Jump to content

Addition of 2 Memory Floats


Recommended Posts

Hi There

 

I need help please. I am using a V130-T38 software version 9.8.96

 I would like to add 2 memory float numbers whenever a pulse input occurs.

Each pulse represents 0.1KWh.

I am having trouble as the ADD F function block doesn't seem to add each time the pulse input occurs. Only when I go online and change the MF value, it add once then stops.

I would then like to convert the MF to integer so I can show then on the display.

Any tips on the best way of doing this. is appreciated

Thank you all

 

 

Pulse input is 0.1.png

Link to comment
Share on other sites

  • MVP 2023

The best way is to use the high-speed counter built into the PLC (I0 or I2) and assign it a to large integer number (ML or DW) in Hardware Config - High speed counter  to accumulate an energy value with  0.1 kW increments. Further, this number can simply be displayed on the screen by moving the comma one unit to the left in the display.

Then no floating point calculations are needed.

  • Like 1
Link to comment
Share on other sites

Thanks Kratmel I appreciate the help so far very good

Just another quick question, where would I enter a value of 0.1 as the increment

I'm not sure how to increment by 0.1 per pulse. As I can't enter 0.1 as a preset as it only takes dec

Attached is hardware config and logic

 

Hardware Config.png

Counter.png

Link to comment
Share on other sites

  • MVP 2023

You don't need logic.  When you configure the input as a HSC it will start incrementing on it's own in ML 0.  Download your program and try it out!

The HSC value is not retained through a power cycle.  If it's something you want long term you'll need to continually copy the value off to another ML and copy that value back to your HSC with the start-up bit SB 2.

You

18 minutes ago, Razim said:

I'm not sure how to increment by 0.1 per pulse. As I can't enter 0.1 as a preset as it only takes dec

You're not.  Each pulse is 0.1 kW, so the value in ML 0 represents kW with an implied decimal at xxx.x.  For example, when the value in ML 0 = 1234 the actual power is 123.4 kW.  You can set the display format to match this.

 

Joe T.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...