Joined on 04-05-2007
How can I get the totalizer value from analog input?
I am the newcommer with OPTO22.
I use SNAP-PAC-R1.
I want to get the totalizer value from analog input (flowrates) from a flow meter. How to do it?
I want to get the totalizer value from Digital input from Pulse of flow meter. And I want to calculate the flowrates from this Pulse input. How to do it?
Could any one help me please?
Above 02 question can be solved in SNAP-PAC-R1?
Thanks & Best regards,
Nguyen Vinh Loc
04-04-2008, 8:19 AM
Joined on 04-04-2008
Re: How can I get the totalizer value from analog input?
You will need a time delay in your routine so this will be more accurate. A delay of about a second should do the trick. I recommend using a timer vs. just using the Delay command. Set an UpTimer with a target of 1 second. When that value has been reached, use the equation UpTimer / 60 x Analog = Totalizer. Add this Totalizer to a running total. Then reset your UpTimer.
For this you will need a delay as well. Using an UpTimer as well, use a delay of a couple seconds. The accuracy of this will depend on the pulse rate and the time delay you have chosen. Higher pulse rates may exceed the digital input scan rate. Get & Clear Counter. I then like to Start Counter just in case it stops for any reason. Then multiply your pulses (Counter) times your rate. Add it to a Totalizer. For the rate, Multiply the Counter value you just got by the Uptimer divided by 60 (Rate = Counter * Uptimer / 60).
Both responses assumes flow rates of per minute. The Uptimer itself is used in the equation to make the result more accurate. Using a DownTimer or the UpTimer Target in the equation won’t account for the time elapsed since the UpTimer Target was reached.