# Totalizer ladder program from Modicon Compact

S

#### Sheari Rice

Can anyone help me understand how to build a totalizing configuration in a Modicon PLC (A984-131).

The analog input range is read into the PLC as 4096 - 8096 corresponding to a 13 Bit A/D conversion (I think) for a measurement in Million Gallons per Day. I am not sure how to scale the raw value and totalize it every minute.

Thanks.

B

#### Brian Kukulski

I would use the following:

1) What is the flow meter calibrated to - say 4-20 ma = 4096-8096 = 0-10000 gal/min.
2) That is 0-2.777 gal/sec. - or as an integer 0-2777 - put this number in register 40200
3) Using a 1 second timer only - not the 0.1 or the 0.01 timer(these are not accurate) - program a coil to turn on every 1 second.
4 Using a One-shot from the above coil drive an ADD block. (top node 40100, middle node 40200, bottom node 40100).
5) To the right of the above ADD block put in another ADD block (Top node 40101, Middle node 0001, bottom node, 40101)

Explanation:
If the flow rate is 5000 gal/hour this is 1.388 gal/sec.
Initially start out with 0000 in registers 40100 & 40101.
The first 1 second one-shot pulse will add 0000 + 1388 = 1388.
The second 1 sec one-shot pulse adds 1388 +1388 = 2766
The third 1 sec one-shot pulse adds 2766 + 1388 =4164
Etc.
When after a number of pulses 9716 + 1388 = 11104.
In Mod Math this will be seen in Reg 40100 as 1104 and the 1st Add block node will turn on causing the second add block to execute.
Then you have in reg 40101 = 0001, reg 40100 = 1104.