4-20mA flow meter/totalizer

jeramiah

Member
Join Date
Mar 2009
Location
Texas
Posts
53
Hello

I need some assistance in building the code to take a 4-20mA reading from a flow meter and having it read out on a HMI screen showing both flow and GPM rate total with ability to reset total

I am using Siemens TIA Step 7 v12, WinCC on a TP1500 HMI
315 CPU
A 4-20mA flow meter with a 0-180gpm range
I am imputing the 4-20mA into the AI card and did the 4-20mA scale

The current flow rate I have done, but the count showing how much has flowed and a reset is where I need help

Thank you
 
Hi I would use a mass flow meter and set a pulsed digital output to "Litres" and use a high speed counter to collect the count. Trying to count a analog value every xx seconds is prone to error imho

I wait to be corrected lol
 
I would buy a flowmeter that does all of the accumulation for you. Im not a big fan of doing that kind of stuff in a plc when there are flowmeters made and approved to handle those tasks.

thats just my opinion though. I know you can do it in a plc, but in my experience it ends up being a big mess for everyone involved.
 
Don't be scared off by the other posters, totalization isn't that difficult off an analog signal. You can get very accurate results, but as the total grows very large you start to have troubles. So if you want to totalize a high flowrate over a 7 days...do as the others say. If you just need to totalize over a shorter period of time, by all means use your analog signal. I've used the analog signals on batching systems and have gotten additions +/- .5% of the totalizer on the flowmeter ~ 500 - 5000lb additions.

Totalization is simply the addition of the instantaneous flowrate over a period of time. Setup a timer, you need to decide the time units you want to use for best accuracy. Minutes are better than hours, seconds are better than minutes....are milliseconds better than seconds? Is that resolution needed?

Lets say you want to use a 1 second resolution. Each second accumulate your instantaneous flow rate. Be sure to convert your flowrate to the proper time unit. If you are running at 60 gpm, you need to convert that to gallons-per-second to match the 1 second timer for totalization. Each second interval you add 1 gps to your total. After 60 seconds, you have a total of 60 gallons, which aligns with the 60 gpm flowrate.

As for resetting, well just clear it down when the process that requires it is complete. That should be pretty simple.
 
Thank you for your reply.

I already have the flow meter and went with the 4-20mA in part because it wouldn't require a HSC on the PLC if I had went with a pulse output.

The flow meter is being used on a pumping system to watch the flow when actuating valves from open to close. not a lot of flow, but if its allowed to get to 9999 it would automatically reset to zero. I need to show total gallons used in real time and GPM of flow along with a reset to zero function button all on a Siemens HMI panel.

I know basic ladder logic, but this is a little out of my knowledge base.
 
OK. Assume you have a flow of 0..180 GPM.
You have analog signal, assume you read the input every 100 ms.

So the value you read per cycle of 100 ms will be 0..3 Gallon. And you just keep adding this value to you accumulator. Add a button to your HMI that will overwrite the accumulator with 0.

As mentioned, this is usually pretty accurate.
 
OK. Assume you have a flow of 0..180 GPM.
You have analog signal, assume you read the input every 100 ms.

So the value you read per cycle of 100 ms will be 0..3 Gallon. And you just keep adding this value to you accumulator. Add a button to your HMI that will overwrite the accumulator with 0.

As mentioned, this is usually pretty accurate.

I think typo 0..3 should be 0.3 What accuracy do you get ? I always use the pulse method with mass flow meters but always interested in better methods
 
0..180 GPM = 0..0.3 GPM, ofcourse..

it is what you deem more important. pulse is more accurate for accumulated, analogue is more accurate for momentary. as he states, he already has the measurement in place.
 
To be honest, you don't need a HSC to accumulate pulses. Most meters let you set the pulse width upwards of 1s, plenty of time for detecting a 0 to 1 transition using a normal input.

I do this all the time with magflows, works great.

But i do have sites where these were not originally wired in so the analog is used. Still works OK as long as you have clean analogs. Scale the analog to a gallons per second reading, then Just add the value of the analog to a totalizer once a second. Be mindful of overflow - copy to a second register and scale to a larger unit if required.
 
To be honest, you don't need a HSC to accumulate pulses. Most meters let you set the pulse width upwards of 1s, plenty of time for detecting a 0 to 1 transition using a normal input.

Depends on the application. If I am batching I want immediate actions to minimise errors so use the pulse method into a HSC . The frequency of the input will be governed by the real flow ( I use litres and get a 1 litre max error)

Cheers
 
Totalizing in the PLC should be just fine.
RSLogix has a Totalize and Integrator function in FBD. I don't know much about Siemens, but I can't imagine that Siemens doesn't have some sort of Totalizer or Ingetrator FBD, that can be started and reset.

If it really doesn't you should be able to make your own. I played around with making my own integrator one time. Take (rate*change in time + previous_rate*change_in_time)/2 --> and you get a "totalizer" or integrator based on the parallelogram approximation method. It's pretty accurate. A deterministic scan time is desirable, but even without it, its pretty good.
 

Similar Topics

Hello I am new to setting up a flow meter totalizer in ladder logic.I know using pulse to configure gallons total would be best, but currently...
Replies
45
Views
13,074
have done some chemical batching systems that was basically just a paddle wheel positive type displacement flow meter and counted pulses from the...
Replies
6
Views
4,403
i am newbie for omron plc cpm2a. how writing flow totalizer for ai 4-20ma ? and how calculation ? please help me.....thks....
Replies
0
Views
1,610
Hi all, I'm connecting several 4-20mA sensors together in parallel (only one shown below) The enclosure is ABS plastic with metal backplate DAQ...
Replies
5
Views
273
Problem: Our PLC can only output 4-20mA, but the actuators it needs to control, modulate based on a 0-135Ohm signal. Buying 4 or 8 individual...
Replies
7
Views
275
Back
Top Bottom