Totalizer ladder program from Modicon Compact


Thread Starter

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.


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)

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
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.
You can cascade another ADD block after the second ADD to keep ontotalizing.

This is a simple way of doing this. If you want to preserve decimal point resolution, then you will have to perform a similar operation using the
floating point blocks. I assume you are familiar with the joys of Modicons floating point math blocks.

E-mail me separately at [email protected] for more information.