Volume af cylindrical tanks lying down

JERA

Member
Join Date
Feb 2006
Location
Copenhagen
Posts
320
I have to calculate the volume in cylindrical tanks lying down.
PLC = Siemens S7-300
Software = Step7 vers. 5.5 software (not TIA portal)

I have analog signal for liquid level height in the tank.

Does anyone have program for this calculation in a Siemens PLC, or the formula for the calculation?
 
Hi Andy

Thanks for your reply.

I can see that formula for calculation is difficult to make in a PLC.

Lookup table will probably be the solution, but it depends on the accuracy that I will find out with the customer
 
Depending on the sensor used, you may be able to have the sensor do the scaling for you. We have this situation with an oil tank, and we put an Endrauss+Hauser ultrasonic sensor on it, that was smart enough to handle the scaling for us.
 
In many cases like this I plot the function in an Excel chart and get the trend function to give me an equation. This is an example.
 
SCL or STL implementations:

Code:
FUNCTION FC898:REAL
VAR_INPUT
R:REAL;    
h:REAL;
L:REAL;
END_VAR

VAR_TEMP
Term1: REAL;    
Term2:REAL;
END_VAR
Term1:=(R-h)*SQRT(2*R*h - h*h);
Term2:=R*R*ACOS((R-h)/R);
FC898:=L*(Term2 - Term1);
END_FUNCTION
Code:
FUNCTION FC 899 : REAL
TITLE =
VERSION : 0.1


VAR_INPUT
  R : REAL ;    
  h : REAL ;    
  L : REAL ;    
END_VAR
VAR_TEMP
  Term1 : REAL ;    
  Term2 : REAL ;    
  hsquared : REAL ;    
  tworh : REAL ;    
  rminush : REAL ;    
END_VAR
BEGIN
NETWORK
TITLE =

      L     #R; 
      L     #h; 
      -R    ; 
      T     #rminush; 
      L     #h; 
      L     #h; 
      *R    ; 
      T     #hsquared; 
      L     2.000000e+000; 
      L     #R; 
      *R    ; 
      L     #h; 
      *R    ; 
      L     #hsquared; 
      -R    ; 
      SQRT  ; 
      L     #rminush; 
      *R    ; 

      T     #Term1; 
//..
      L     #R; 
      L     #h; 
      -R    ; 
      L     #R; 
      /R    ; 
      ACOS  ; 
      L     #R; 
      *R    ; 
      L     #R; 
      *R    ; 
      T     #Term2; 
//..
      L     #Term1; 
      -R    ; 
      L     #L; 
      *R    ; 
      T     #RET_VAL; 

END_FUNCTION
 
Thank you to everyone for answers that have been of great help. (y)

JRW - I know Oscat and have used their blocks a couple of times

Thanks to Tom Jenkins for the Excel sheets, that I will use to check for calculations.

L D [AR2, P # 0.0] Thank you for the code and if you come to Copenhagen one day, send me a PM and there will be some Danish beer 🍻
 

Similar Topics

Looking over the technical data for a PowerFlex 755 & noticed they specify a minimum enclosure volume for their drives: (1)When using a circuit...
Replies
1
Views
542
Hello, all. I’ve worked with totalizers based on a flow meter. However, I am trying to use ladder logic on totalizing a tank based on volume. I...
Replies
1
Views
1,126
Hi Everyone, Got a new project where I am going to read the level of a tank via Modbus and I need to use the tank strapping chart to convert it to...
Replies
8
Views
2,510
As cyber security concern and compliance requirement increases in my world. We are being pressed to at least do periodic patching review but not...
Replies
2
Views
1,421
Is this reasonable to do? I am using a SLC 5/05 so there's no totalizing instruction, I think I have to make my own. Anybody done this, any...
Replies
14
Views
4,283
Back
Top Bottom