# Volume Calculation

## Recommended Posts

Hello,

I am currently checking an installation of a Flow meter model: Hoffer HIT-2A.

I would like to calculate in my PLC the Volume flowing at real time. This kind of valve has 2 outputs, 4-20 mA for the Flow Meter and a Pulse with 62.5 msec signal.

Should I create a High speed input or can I use the next structure for the Volume Calculation in real time.

Any suggestion?

##### Share on other sites

Hello,

If I understood correctly, using the analog output you are turning on and off  the valve? and using the digital input you are measuring the flow? is that correct?

Can you share the Flow Meter SPEC?

##### Share on other sites

Hi,

Sorry I mean analog input, one is a pulse and the other one is a normal 4-20mA. Yes I would like to check each 0.1s the volume so is refreshing each 100 ms.

KR,

##### Share on other sites

Hi, So both analog and digital are inputs to the PLC from the Flow Meter, If this is correct and the digital input does'nt have to be used, you can use only the Linearization block without the ADD block, and you will get the input from the Flow Meter every scan How to create a linearization (example is attached): The Linearization setting (also in the attached image): 1.First you have to check the resolution of the specific PLC(in the SPEC), for example the V350-35-R34 is 10-bit and it will be, 0-1024, so X(1)=0, X(2)=1024. 2.Y(1) and Y(2) will be the units from the device itself, for example 0-100. 3.In X you will set the register that getting the inputs from the device. 4.In Y you will set the output of the from the ‘Linearization’ block. *If it is still not clear, you can share the device SPEC,

##### Share on other sites

What value is stored at the output of your linearization block? It should be value according to device specs (ex cubic meters per minute).

I'm not sure you'll get correct value by adding every 0.1 second. You could try adding every second and then dividing MI46 (or ML46 if numbers go too high)  by 60 to get cubic meters.

I just had a glance at data sheet and saw it has e a totalizer. You can easily compare your calculation with real value.

##### Share on other sites

Hi,

This actually what I finally thought about how to convert from m3/h to m3 in a refreshing range of 100ms. So basically if it works like I think the sb7 works.

1. Linearization 4-20mA to 0-1181m3/h
2. Scan each 100ms if the proccess botton is close do the next routine each 100ms:
1. Flow rate in m3/h to m3/100ms
2. Summation the current value+the previous value
3. Volume requiered-Summation=Volume Remaining
3. When Volume remaining <= 0 then activate routine finish delivery and open the process botton

I am not actually sure about how this sb7 works. I will be wonder for anysuggestion, thanks for your help.

Regards,

##### Share on other sites

Use SB15 instead of SB7 to get calculation only once per 100 ms

SB15 keeps ON during one single scan, SB7 keeps ON during 100 ms.

##### Share on other sites

Thanks Gabriel,

Gracias desde Medellin

##### Share on other sites

• MVP 2023

Hi all,

I've just had a squiz at this and I might have missed something, but why are you doing so much work?  If you have a device that outputs 4-20 as an amount per hour, simply divide the Linearised result by 36000 to get flow per .1 seconds.   edit:  And don't forget you can often do this by adjusting numbers within the Linz itself.

And looking at the HIT specs, it only updates 4-20 every 2 seconds anyway.  You might have to go the pulse method.

Analog (4-20mA) Output Option
Scale: 4 – 20 mA follows rate.
Accuracy: 0.02% of Full Scale @ 20ºC.
Temperature drift: 40 ppm/°C
Update Time: 2.0 seconds.
Connection: Two wire.

cheers,

Aus

##### Share on other sites

• MVP 2023

And now that I've read that info a bit more, the HIT-2A looks like a device that reads info from the sensors in the stream, and interprets/displays/converts it.  You could read directly from the sensors if needed, thus avoiding all the HIT-2A "interference".

cheers,

Aus

##### Share on other sites

Hi,

Cheers for your answer and the detail of 2 sec, the problem for the signal configuration it is because by default if you have a shut down the flow meter read, (Flow and Pulse).

Then my question is there how to introduce the pulse in my programming, like a high speed input? or a normal input?

KR

##### Share on other sites

Hi,

I finally solved my problem with these ladder logic. I will test tomorrow the performance.

I know I can delete some elements but I prefer add all the blocks and check the process one by one.

Now my question is how to convert a Memory Float in seconds to hours, minutes, seconds.

KR,

##### Share on other sites

• MVP 2023
On 19/02/2017 at 8:55 AM, tonymony said:

I am currently checking an installation of a Flow meter model: Hoffer HIT-2A.

OK, I am a bit confused now.  The above statement implies that you are wanting to check the installation.  How?  Are you wanting to check whether the actual flow matches what is on the Hoffer Meter?  Because if you are, and you use the meter's outputs to do the checking, you are in a wrong thought loop.  You will be checking what the thing you are checking is outputting.  You need to check direct from the turbine's pulse output.

cheers,

Aus

##### Share on other sites

Hi Ausman,

Basically I am checking and improving. I working with a input which is refreshed each 2 seconds by a pulse.

KR,

##### Share on other sites

• 1 month later...

Dear guys,

I know this is a little bit old thread but I cannot resist: Every dividing in the PLC world is very risky operation, regardless if you are dividing integers or float. For totalizers (in my case, to count generator power to kWh) I use another solution:
1. Add the value (power in kW, MI0) every second to the MI, let's say to MI100 (energy in kilowattseconds)
2. Make a test if this MI100 >= 3600 (because 3600 kWs == 1 kHh).
3. If it is not greater, do nothing.
4. If MI100 >= 3600, increment kWh counter (for example MI101) and MI100 = MI100 - 3600.
5. Go to back to step 1

.

## Create an account

Register a new account

×