Author Topic: Vessel fill rate  (Read 2682 times)

Cowboy1

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Vessel fill rate
« on: August 02, 2015, 10:27:20 PM »
Does anybody know how I can use a analog level transmitter to get vessel fill rate? I have asked this question on a PLC forum and had no luck so far. If this possible I would like to get as much detail as possible in creating the logic to accomplish this.

Thanks,

David

Cowboy1

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Vessel fill rate
« Reply #1 on: August 03, 2015, 10:27:27 AM »
This is the equation I need to solve or how to solve using either Advanced HMI or PLC program:

Amount register D19 increases per M1013 pulse * 60

D19 = Analog in volume scaled in Quarts
M1013 = Built in 1 sec pulse PLC register
60 = Multiplier to get final value to minutes.

Any help would be greatly appreciated. If it is not able to be done please let me know that also. I will seek a alternative method like buying a flow meter.


Thanks,

David

pal

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Vessel fill rate
« Reply #2 on: August 03, 2015, 05:20:23 PM »
With  the information you have given , it is not possible to supply an answer . If the vessel  you are measuring the depth of has a flat bottom and vertical sides , then it is fairly straight forward to work out the volume . If it is a horizontal cylinder , then it is a lot more difficult , because the change in volume with change in depth is not linear relationship .

Paul

pal

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Vessel fill rate
« Reply #3 on: August 03, 2015, 05:56:50 PM »
Just come across more detail on another website . If you scale your analog input to give 0 when the tun is empty and 6200 when it is full ( = to 15.5 gal or 62 quarts ) then an increase of 50 in depth in 1 minute is the rate you are looking for . If you set a latch from a start button and use a 1 shot to store the level reading and start a 60 sec timer , then use the time done bit to un-latch and at the smae time subtract the start level from the current level then the result is the flow over 1min. Adjust your manual valve to give a reading of 50 or as close to as you need .
This just 1 way to do it - with PLCs , there are always several ways to cut a cookie !

Paul

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Vessel fill rate
« Reply #4 on: August 03, 2015, 06:09:03 PM »
This might work for you:

1) Place a label on the form and set its ValuePrefix to "Vessel Fill Rate: " and ValueSuffix to " Quarts/min"
2) Place a timer on the form, enable it and set its interval to 1000 (which is 1 second)
3) Double click the timer to get to its tick event and enter the following code:

Code: [Select]
    Private lastValue As Single
    Private currentValue As Single
    Private vesselFillRate As Single
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Me.currentValue = Me.ModbusTCPCom1.Read("D19") '<---- This line will depend on your driver and tag for D19 register
        vesselFillRate = (Me.currentValue - Me.lastValue) * 60
        Me.BasicLabel1.Value = vesselFillRate 'This you could change to CInt(vesselFillRate) to get round value
        Me.lastValue = Me.currentValue
    End Sub

I am not familiar with what driver you are using and what value is received from D19 register or what value you are receiving from the analog level transmitter itself. Whichever value you might use then you might need to correct the code.

The above code could be read like this, with some random numbers:

"My last level was 23 Quarts and my current level is 25 Quarts. These values were sampled in a time period of 1 second so my level increased for 2 Quarts in 1 second meaning that current vessel fill rate is 120 Quarts / minute".

The code will produce negative result if the level is dropping.
« Last Edit: August 03, 2015, 06:15:02 PM by Godra »

Cowboy1

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Vessel fill rate
« Reply #5 on: August 03, 2015, 06:48:01 PM »
Just come across more detail on another website . If you scale your analog input to give 0 when the tun is empty and 6200 when it is full ( = to 15.5 gal or 62 quarts ) then an increase of 50 in depth in 1 minute is the rate you are looking for . If you set a latch from a start button and use a 1 shot to store the level reading and start a 60 sec timer , then use the time done bit to un-latch and at the smae time subtract the start level from the current level then the result is the flow over 1min. Adjust your manual valve to give a reading of 50 or as close to as you need .
This just 1 way to do it - with PLCs , there are always several ways to cut a cookie !

Paul


Paul,

Thanks for the reply I kind of understand your logic but not exactly sure how to program it being very new to PLC programming.

Thanks,

David

Cowboy1

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Vessel fill rate
« Reply #6 on: August 03, 2015, 07:15:43 PM »
This might work for you:

1) Place a label on the form and set its ValuePrefix to "Vessel Fill Rate: " and ValueSuffix to " Quarts/min"
2) Place a timer on the form, enable it and set its interval to 1000 (which is 1 second)
3) Double click the timer to get to its tick event and enter the following code:

Code: [Select]
    Private lastValue As Single
    Private currentValue As Single
    Private vesselFillRate As Single
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Me.currentValue = Me.ModbusTCPCom1.Read("D19") '<---- This line will depend on your driver and tag for D19 register
        vesselFillRate = (Me.currentValue - Me.lastValue) * 60
        Me.BasicLabel1.Value = vesselFillRate 'This you could change to CInt(vesselFillRate) to get round value
        Me.lastValue = Me.currentValue
    End Sub

I am not familiar with what driver you are using and what value is received from D19 register or what value you are receiving from the analog level transmitter itself. Whichever value you might use then you might need to correct the code.

The above code could be read like this, with some random numbers:

"My last level was 23 Quarts and my current level is 25 Quarts. These values were sampled in a time period of 1 second so my level increased for 2 Quarts in 1 second meaning that current vessel fill rate is 120 Quarts / minute".

The code will produce negative result if the level is dropping.
 


Godra,

Thank so much for the help it is exactly what I'm looking for and I understand it too that makes it even better. The only glitch and not that big of a deal is every other pulse gives a zero reading on a steady flow up. Like I said no big deal but do you think it can be cured by messing with sample time? I'm very new to all this so everyday is a learning day for me.



Thanks,

David
« Last Edit: August 03, 2015, 07:17:23 PM by Cowboy1 »

Cowboy1

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Vessel fill rate
« Reply #7 on: August 03, 2015, 07:18:16 PM »
Oh here was the code only thing added was Modbus RTU:

Code: [Select]
[/ Private lastValue As Single
    Private currentValue As Single
    Private vesselFillRate As Single
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        Me.currentValue = Me.ModbusRTUCom1.Read("404116") '<---- This line will depend on your driver and tag for D19 register
        vesselFillRate = (Me.currentValue - Me.lastValue) * 60
        Me.BasicLabel4.Value = vesselFillRate 'This you could change to CInt(vesselFillRate) to get round value
        Me.lastValue = Me.currentValue
    End Subcode]

Cowboy1

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Vessel fill rate
« Reply #8 on: August 03, 2015, 07:42:26 PM »
Godra,


Disregard previous reply, I had the timer set to 100 not 1000 as you described once I changed it to 1000 it works great.

Thanks for your help,

David

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Vessel fill rate
« Reply #9 on: August 03, 2015, 08:38:55 PM »
You are welcome.

I tried using the same code with BasicDataLogger and it just wasn't showing the correct rate (used 2 different simulators OpcDaCom and ModbusTCPCom).

If you need data logged then you could try using BasicDataLogger separately for logging only.

Cowboy1

  • Jr. Member
  • **
  • Posts: 65
    • View Profile
Re: Vessel fill rate
« Reply #10 on: August 03, 2015, 10:48:24 PM »
You are welcome.

I tried using the same code with BasicDataLogger and it just wasn't showing the correct rate (used 2 different simulators OpcDaCom and ModbusTCPCom).

If you need data logged then you could try using BasicDataLogger separately for logging only.


This is actually perfect for my needs. I need it for a reference to manually throttle a valve to keep my sparge  running for 1 hour.