Flow Totalizing

R

Thread Starter

rvargas

I have totalized in AB PLC5 & SLC with no problems, however using a Direct Logic PLC is different. I need to totalize a GPM flow. Initially, I scale the raw analog value, then divide it by 60, load it to a register and add the value to itself every second. When I do this the flow total resets to zero after 65536. Do I need to use 2 words for this function? Is there a easier way to do this function. Any help will be appreciated.
 
We use the two word method. We write some code so that when the register resets to 0 you will add 1 to the next register. Then write the code to multiply the second register by 65536 and add it to the first register.
You also could consider resetting the value to zero at a certain time (midnight) and reporting the totalized flow for the previous day.
 
If you are using a 250 PLC, I would convert the flow to a real number type for the totalization.

If you are using a 230/240 or if you prefer, convert the flow to a BCD and use the double BCD add instruction.

John
 
You could just set another register up that has 1 added every time your total reaches 1000 then reset to zero, this way you will have a record for over 64 million.
 
S

Steve Myres, PE

Surely you must have had to use a float register in the PLC or SLC because their integers only go to 32767 and would have rolled over sooner than the DL205. So use a floating point value in the DL205, and yes, they do require two V-Memory registers. You will also need to use floating point arithmetic instructions. Alternately, you could use two registers, and only let the less significant one increment to 10,000 before zeroing and incrementing the more significant register. Then you would get 655,350,000 units before rollover.
 
M
You're on the right track, the first value you should take and move to a another register, which you add to each time the first one resets, this way you know there was X thousands of gallons + the value of the current running totalizer. Sounds like you need another holding register as well to keep the total in as you do your calculations. look at your AB SLC code, I am sure you will find the answer there, doing this should be similar for either PLC. You know, you may have to take the value of the first register and at every 1000 or 10K gallons that you calculated flow for, is move that total to the second register, reset the first one, so you have a preset roll over of the total.

matt
 
2 possible solutions:

Use a floating point (real) number for your totals.

If you don't need a high resolution result, use 10, 100, or 1000 gpm units
 
Top