Totalize an analog input

B

Thread Starter

Bill Adams

I am using a NIO4I analog card and Scale(SCL) the input to 0-300 GPM. How do I totalize the input on an SLC 500 and send the result, 1 sec update, to display on an HMI.
 
A

amora fibrianto

That will also depend on your HMI refresh rate/update time.....I don't think PanelView can handle update rate/time less than 1 sec. Rgrds amora fibrianto Bill Adams wrote: > I am using a NIO4I analog card and Scale(SCL) the input to 0-300 GPM. How do I totalize the input on an SLC 500 and send the result, 1 sec update, to display on an HMI.
 
> I am using a NIO4I analog card and Scale(SCL) the input to 0-300 GPM. How do I totalize the input on an SLC 500 and send the result, 1 sec update, to display on an HMI. ____________________________ This question might sound simple to many readers. But it is not at all. " Totalize " here means Integration. Few steps are required. 1. The flow signal is noisy: Therefore you must smooth it, first. 2. Then,you must create an accumulator large enough to suit the Romberg Integrate. This will output the Integrated Total of the data set captured. 3. For cumulative total, step 2. must be repeated And so on. Romberg Integrate is an improved Simpson Integrate. I'm willing to help on the matter. Just let me know: jmg[email protected] Check first your system. Your 1 sec up date has no meaning as you need several readings to validate the measurment and the Integration. And whereas 1 sec between reading is fast enough for flow, then integrating every 1 sec makes no sense. May be a moving average is what you are looking for. Is it ?
 
A

Alan Rimmington

Convert your GPM to Gallons per second, then use a one second pulse to add the current GPs to a totalised amount, eg add instruction - N7:1(total) + GPs = N7:1 If you want an example email me [email protected]
 
W
It is much easier, and much more accurate, to take the frequency output from the flow meter directly into a frequency input on the PLC rather than to try to write an integrator subroutine. Even if you are working with a very slow frequency output, such as from a turbine or paddlewheel meter, you can still take it to a contact closure input on the PLC. Then all you have to do is implement a counter and report the register contents to the HMI at whatever interval floats your boat. This ought to be tattooed on the faceplate of any PLC used with a flowmeter input. Walt Boyes Contributing Editor Flow Control Magazine
 
D

David Bergeron, P.E.

T = F*t/(60*1000) + T where T = Total F = Flow in GPM t = scan time of your logic in ms As far as displaying the result in an HMI, that depends on the HMI and the SLC 500 driver. But it would be no different than displaying any other variable. David Bergeron, P.E. Thompson Equipment Co. ----- Original Message ----- From: "List Manager" <[email protected]> To: <[email protected]-CONTROL.COM> Sent: Tuesday, May 08, 2001 4:25 PM Subject: APPS: Totalize an analog input > ------------Forwarded message--------- > From: Bill Adams <[email protected]> > To: [email protected] > Subject: APPS: Totalize an analog input > > I am using a NIO4I analog card and Scale(SCL) the input to 0-300 GPM. How > do I totalize the input on an SLC 500 and send the result, 1 sec update, > to display on an HMI. > > ***************************************************************** > YES! You can get digests, or limit messages by topic. See > http://www.control.com/control_com/alist/ for details. > Before posting, please read http://www.control.com/control_com/alist/faq_html. > The Automation List is managed by Control.com Inc. ***************************************************************** Before posting, please read http://www.control.com/control_com/alist/faq_html. Got code? Add it to the PLCArchive at http://www.control.com/control_com/PLCArchive/ The Automation List is managed by Control.com Inc.
 
F

Frank Powell

> T = F*t/(60*1000) + T > > where > T = Total > F = Flow in GPM > t = scan time of your logic in ms How do you know what the scan time is? I experimented with that sort of equation, but it was never very consistent. Even with nothing else running in the PLC, there seemed to be enough difference in scan times that it could not count accurately. Frank Powell
 
R

Runfactory Maillists

Frank, Scan time in an Allen-Bradley SLC-500 is stored in address S:35 (in ms). The value is updated once per scan, immediately before execution of file 2, rung 0. Keep in mind that this register is affected by the REF command (I/O Refresh) which will reset the value. Typically most SLC-500 programs don't use the REF command. Sincerely, Mark Wells President Runfactory Systems Inc. http://www.runfactory.com 1235 Bay Street, Suite 400 Toronto, Ontario, Canada M5R 3K4 Cell Ph. 416-984-0774 Fax. 416-352-5206
 
J
Walt writes ... >It is much easier, and much more accurate, to take the frequency output >from the flow meter directly into a frequency input on the PLC rather >than to try to write an integrator subroutine. I have heard this before. Why ? A propeller type meter is accurate to only 2%. A PLC will not detract much to this low accuracy. Other types of meters measure flow directly and do not usually come with pulse outputs. The reason for the inaccuracy in some of the PLC totalizer algorithms I have seen is the use of a timer instruction to trigger the totalization or the use a floating point register to hold the totalizer. If possible, use the PLC's clock to generate the totalizer pulse. That is, turn the pulse on for one scan when the second changes. This will make the error in the timing of the pulse random, but averaging on the second. A timer will usually give a pulse at 1 second + some extra time, leaving your totalizer low. The totalizer should be kept in an integer. The SLC, does not have a long integer, so two integers will be required. Continually adding to a small number to a floating point register will fail to effect the totalizer when the number in the totalizer gets too large. To totalize flow in 1000's of gallons define two F registers, one for the flow and one for an accumulator. Also define one ( or two ) N register(s) for the totalizer: 1) scale flow in gallons per second 2) once per second add current flow to flow accumulator 3) when accumulator is >= 1000.0, add 1 to the totalizer and subtract 1000.0 from the accumulator Jay Kirsch
 
Begging your pardon, Jay, but I must respectfully disagree. A propeller meter is quite accurate (AWWA spec is +/- 2% _of rate_). Turbine meters are quite accurate (more so than propellers, to lower flows). Both have native frequency outputs. Vortex meters do also, as do Coanda-effect meters, and Swirlmeters. Most magnetic flow meters have frequency outputs. It isn't difficult to get a frequency output to totalize directly, thus removing one of the components of error. You can do it my way, or you can do it your way, but my way requires virtually no code, and saves a step. Sometimes the hardware is even cheaper. Walt Boyes Contributing Editor Flow Control magazine
 
J

johan bengtsson

Actually, for integrating it does not serve any purpose to smooth the signal before integrating (the end result will be the same anyway). That doesn't mean it would be wrong, just unnecesary. /Johan Bengtsson ---------------------------------------- P&L, Innovation in training Box 252, S-281 23 H{ssleholm SWEDEN Tel: +46 451 49 460, Fax: +46 451 89 833 E-mail: [email protected] Internet: http://www.pol.se/ ----------------------------------------
 
In the case where a flow meter is used for billing, I agree with you Walt. By counting the pulses with the PLC, the total indicator on the flow meter and the number in the PLC will match, giving the owner a way to double check his readings. In other cases, however, the PLC needs to read the flow anyway. Using the pulse method, you then need both the AI module and the counter module in the PLC, making it more expensive. (Or you can calculate the flow with relay logic from just the counter, YECCH!) In this case it's simpler to totalize in the PLC. It only takes 4 rungs to totalize an AI. Jay Kirsch
 
Top