Analog Input Value Totalizer

jmcnabbcmi

Member
Join Date
Oct 2018
Location
St Augustine, FL
Posts
7
On a Click PLC...How do I write the logic to totalize an analog input (water flow meter in GPM)? I need to totalize the gallons per minute input so that I can turn off the pump and close the inlet valve when the daily max process gallons value is reached.
 
Hi and welcome to the forum,

Is your flow rate in GPM? If so I would set a 6 second timer and move the flow rate every 6 seconds into a register. Then take that rate in GPM and divide by 10 (6 sec is 1/10th of a minute) that is the number of gallons that passed in the last 6 seconds. Then add that volume to a total register.

You can then monitor the total register to shut down when you meet your max.
 
Yes the 4-20mA input is in GPM. My problem is getting the value to accumulate in a register based on the per minute time period so I can compare the accumulated total value to a discrete value to trigger the control function(s) I need. Not sure how to write the logic to take the incoming analog input to do this function.

Click PLC programming documentation/help is very limited.
 
Unfortunately, this flow meter only has the 1 analog output which is the flow rate in GPM. If it had a totalizer pulse output I would be able to just utilize that and quantify the volume. I will need to figure out a way to move the GPM value into a register and accumulate the value each minute to get a total volume value I can compare to and trigger the control functions I need to accomplish.
 
The click analog can be scaled in the IO configuration of the analog. This would represent the GPM that the analog is seeing.
If we want the update rate to be 1 minute then use the leading edge of the one minute pulse bit (SC8) and add the Analog GPM to the total using the math instruction.
Compare the total to the maximum value and turn off the flow.
If you want the refresh period to be quicker then use the method that Bullzi has indicated above.

click running total.png
 
Thanks, I have the analog input scaled for the flow in GPM for the existing system setup.

This is what I needed to totalize that value. Using SC8 to get the value each minute will be enough resolution/refresh for this application.

Looking at this...I was way over complicating this when I was attempting to write the math function using the "SUM" for multiple register entries.

Thanks for the assistance.
 
Thanks for the help. That is done and running on the test bench now.

One last question...to reset DF100 to zero after midnight each day, would it be best to use the PLC clock to look at when the hour:minute is 00:00? or how is the best way to accomplish that?
 
The click analog can be scaled in the IO configuration of the analog. This would represent the GPM that the analog is seeing.
If we want the update rate to be 1 minute then use the leading edge of the one minute pulse bit (SC8) and add the Analog GPM to the total using the math instruction.
Compare the total to the maximum value and turn off the flow.
If you want the refresh period to be quicker then use the method that Bullzi has indicated above.


That SC8 with the 2 lines and the arrow pointing up what does that mean.I mean what does the 2 lines and the arrow represent.
 
To reset at midnight, you are correct. Compare using the equal flag to 00 for the hours. This would then be AND with the compare of the equal flag to 00 for the minutes.
Note: The MOVE instruction is on a one shot.

Regards,

click running total.png
 
+1 jmcnabbcmi
The arrow up indicates a transition from off to on. (leading edge) The bit will turn on for one scan of the PLC when this happens. (one shot)
 
Here is how I went about it. Sampling every minute may end up being to slow, especially if your flow rates change during that minute. You could end up with a lot of error. Sampling 10 times a minute picks up more changes and will give you a more accurate number. If you flow is changing a lot you may need to do 20 or more samples per minute.

click flow rate.PNG
 

Similar Topics

I ran into a strange issue the other day. System has been up and running for many months. An analog input channel suddenly reported 0mA. I...
Replies
21
Views
3,189
We have L72 controller of Rockwell make with 4 nos. analog inputs from pressure transmitters. Due to break in cable connection OR transmitter...
Replies
7
Views
2,026
Hi everybody, I inherited a redundant 1756-L71 ControlLogix system with 2 racks with some DI, DO, and AI redundant modules (1715 series). The...
Replies
6
Views
2,360
I want to force an analog input value in a Modicon M340 PLC. I work with Unity Pro XL. The problem is that the Unity Pro doesn't let me set a...
Replies
4
Views
3,919
I am currently working on a project Motor test bench for PLC Control.. I am trying to measure current using Hall effect sensor. As I want to store...
Replies
18
Views
5,463
Back
Top Bottom