Process Tank Strapping Table (PTST)

This information applies to the CompactLogix 5380P and ControlLogix 5580P controllers.
The Process Tank Strapping Table (PTST) instruction calculates the volume of product in an upright cylindrical tank, given the level of the product and the tank calibration table. The instruction can compensate for:
  • Free water at the bottom of the tank, given a product/water interface level.
  • Thermal expansion of the tank shell, given the coefficient of linear expansion of the shell material and product and ambient temperatures.
  • A floating tank roof, given the product density is provided.
The Process Tank Strapping Table (PTST) instruction is a calculation function, between blocks.
Available Languages
Ladder Diagram
PTST_avail_LD
Function Block Diagram
PTST_avail_FBD
Structured Text
PTST(PTST_tag, Cfg_CalTbl);
Operands
IMPORTANT:
Unexpected operation may occur if:
  • Output tag operands are overwritten.
  • Members of a structure operand are overwritten.
  • Except when specified, structure operands are shared by multiple instructions.
There are data conversion rules for mixing numeric data types within an instruction. See Data conversions.
Configuration Operands
Operand
Type
Format
Description
PlantPAx Control
P_TANK_STRAPPING_TABLE
tag
Data structure required for proper operation of instruction.
Cfg_CalTbl
P_STRAPPING_TABLE_ROW
tag
Tank calibration table, level to volume.
P_TANK_STRAPPING_TABLE Structure
Public members are standard, visible tag members that are programmatically accessible. Private, hidden members are used in HMI faceplates and are not programmatically accessible. Private members are listed in separate tables after public members.
Public Input Members
Data Type
Description
EnableIn
BOOL
Enable input. Ladder Diagram: Corresponds to the rung-condition-in.
Default is true.
Inp_InitializeReq
BOOL
1 = Request to initialize the instruction. The instruction is normally initialized in instruction first run. Use this request when reinitialization is needed. The instruction clears this operand automatically.
Default is true.
Inp_Level
REAL
Tank innage level, in feet or meters. Valid = any float.
Default is 0.0.
Inp_FreeWaterLevel
REAL
Tank innage free water interface level, in major level units (feet or meters). Valid = any float.
Default is 0.0.
Inp_ObsAPI
REAL
Observed density, or degrees API, at product temperature. This is used for floating roof compensation to calculate displacement based on weight of roof. Valid = any float.
Default is 30.5.
Inp_AvgProdTemp
REAL
Average product temperature input in degrees Fahrenheit or Celsius. Valid = any float.
Default is 60.0.
Inp_AmbTemp
REAL
Ambient temperature input in degrees Fahrenheit or Celsius. Valid = any float.
Default is 60.0.
Cfg_MinorPerMajor
REAL
Table minor units, in inches, centimeters, millimeters, per major unit, in feet or meters. Type 0.0 if minor units not used. Valid = any float.
Default is 12.0.
Cfg_HasCorrTempShell
BOOL
0 = No correction for temperature of tank shell. 1 = Include correction for temperature of tank shell.
Default is false.
Cfg_HasFloatRoofAdj
BOOL
0 = Do not use floating roof adjustment. 1 = Include floating roof adjustment to account for displacement of fluid level.
Default is false.
Cfg_HasMoreObj
BOOL
1 = Tells HMI an object with more info is available.
Default is false.
Cfg_CalTemp
REAL
Temperature of tank calibration (typically 60 °F or 15 °C). Valid = any float.
Default is 60.0.
Cfg_ShellCoefOfExp
REAL
Tank shell linear coefficient of thermal expansion (1 per degree Fahrenheit or 1 per Celsius). Valid = any float.
Default is 0.0000062.
Cfg_K
REAL
Temperature weighting (type 0.0 for insulated tank). See API MPMS 2.2A Appendix D. Valid = any float.
Default is 7.0.
Cfg_FloatRoofLevel
REAL
Lowest level at which to add or subtract floating roof compensation (feet). Valid = any float.
Default is 0.0.
Cfg_FloatRoofCalAPI
REAL
Degrees API for which table includes floating roof data. Valid = any float.
Default is 30.5.
Cfg_FloatRoofVolPerAPI
REAL
Adjustment to table values for product density not equal to calibration density (in volume units per degree API, typically a negative number). Valid = any float.
Default is -2.5.
Public Output Members
Data Type
Description
EnableOut
BOOL
Enable Output. This output state always reflects EnableIn input state.
Val_TotObsVol
REAL
Raw total observed volume from Calibration Table (barrels, gallons, liters).
Val_FreeWater
REAL
Free water volume (barrels, gallons, liters).
Val_TempShell
REAL
Calculated tank shell temperature in degrees Fahrenheit or Celsius.
Val_CorrTempShell
REAL
Correction for temperature of tank shell (multiplier).
Val_FloatRoofAdj
REAL
Floating roof adjustment volume (barrels, gallons, liters).
Val_GrossObsVol
REAL
Primary value: Gross observed volume (see API MPMS 12.1.1).
Sts_Initialized
BOOL
1 = Instruction is initialized. Use Inp_InitializeReq to reinitialize.
Sts_UnderMin
BOOL
Inp_Level is below lowest level in strapping table.
Sts_OverMax
BOOL
Inp_Level is above highest level in strapping table.
Public InOut Members
Data Type
Description
Cfg_CalTbl
P_STRAPPING_TABLE_ROW[2]
Tank calibration table (level to volume).
P_STRAPPING_TABLE_ROW Structure
Members
Data Type
Description
Major
REAL
Number of major units (feet, meters). Valid = 0.0 to maximum positive float.
Minor
REAL
Number of minor units (inches, centimeters, or millimeters). Valid = 0.0 to maximum positive float.
Volume
REAL
Tank volume (oil barrels, gallons, liters) at given level (feet, inches). Valid = 0.0 to maximum positive float.
Operation
Configuration of Strings for HMI
Configure strings for HMI faceplates (FT View) and for the Logix Designer configuration dialog box. The strings are set to extended properties of tag items. Configure the strings in Logix Designer only.
  • Description
  • Label for graphic symbol
  • Display Library for HMI Faceplate call-up
  • Instruction name
  • Area name
  • URL link
  • More Information
  • Gross volume units
  • Free water volume units
  • Raw volume units
  • Calculated tank temperature units
  • Correction for tank temperature units
  • Floating roof adjustments volume units
  • Temperature for tank calibration units
  • Temperature for API units
  • Level units
  • Volume units
  • Temperature for tank shell linear coefficient units
Monitor the PTST Instruction
Monitor from within Logix Designer. The PTST does not have an associated operator faceplate.
Affects Math Status Flags
No.
Major/Minor Faults
None specific to this instruction. See Index Through Arrays for array-indexing faults.
Execution
Ladder Diagram
Condition/State
Action Taken
Prescan
Rung-condition-out is cleared to false.
Instruction first run
All internal statuses and calculations are reset.
The instruction executes normally.
Rung-condition-in is false
Rung-condition-out is cleared to false.
Calculation values is not updated (holds last value).
Rung-condition-in is true
Set rung-condition-out to rung-condition-in.
The instruction executes.
Postscan
Rung-condition-out is cleared to false.
Function Block Diagram
Condition/State
Action Taken
Prescan
EnableOut is cleared to false.
Instruction first run
All internal statuses and calculations are reset.
The instruction executes normally.
Instruction first scan
See Instruction first run in the Function Block Diagram table.
EnableIn is false
EnableOut is cleared to false.
Calculation values is not updated (holds last value).
EnableIn is true
EnableOut is set to true.
The instruction executes.
Postscan
EnableIn and EnableOut bits are cleared to false.
Structured Text
In Structured Text, EnableIn is always true during normal scan. The instruction executes when it is in the control path activated by the logic.
Condition/State
Action Taken
Prescan
See Prescan in the Function Block Diagram table.
Instruction first run
See Instruction first run in the Function Block Diagram table.
EnableIn is true
See EnableIn is true in the Function Block Diagram table.
Postscan
See Postscan in the Function Block Diagram table.
Example
In this example, the PTST instruction calculates the volume of product in a storage tank based on the measured storage tank level and storage tank strapping table information. There is no floating roof and no compensation for displacement. There are no adjustments based on temperature to account for thermal expansion of the tank.
Ladder Diagram
PTST_example_LD
Function Block Diagram
PTST_example_FBD
The measured storage tank level connects to the PTST instruction by using the input Inp_Level. The level is in units of feet. The storage tank is four feet tall. In this example, data is in six-inch increments. The strapping table has nine rows:
Level (ft-in.)
Volume (barrels)
0-00
3.1
0-06
136.6
1-00
264.2
1-06
402.7
2-00
541.4
2-06
692.7
3-00
844.1
3-06
990.8
4-00
1137.5
To store the strapping table information in the controller, the tag MyP_StrapTbl_CalTable is created as type P_STRAPPING_TABLE_ROW [9], a nine-element array.
.Major
.Minor
.Volume
MyP_StrapTbl_CalTable[0]
0
0
3.1
MyP_StrapTbl_CalTable[1]
0
6
136.6
MyP_StrapTbl_CalTable[2]
1
0
264.2
MyP_StrapTbl_CalTable[3]
1
6
402.7
MyP_StrapTbl_CalTable[4]
2
0
541.4
MyP_StrapTbl_CalTable[5]
2
6
692.7
MyP_StrapTbl_CalTable[6]
3
0
844.1
MyP_StrapTbl_CalTable[7]
3
6
990.8
MyP_StrapTbl_CalTable[8]
4
0
1137.5
The InOut tag Cfg_CalTbl of the PTST instruction is modified to point to the new array MyP_StrapTbl_CalTable to provide the instruction with the strapping table information. The output of PTST is then connected to another PAI instruction. The output is the calculated volume of the storage tank.
Structured Text
MyPTST.Inp_Level := MyLevel.Val;
MyVolume.Inp_PVUncertain := MyLevel.Sts_PVUncertain;
MyVolume.Inp_PVData := MyPTST.Val_TotObsVol;
PAI(MyLevel);
PTST(MyPTST,MyP_StrapTbl_CalTable);
PAI(MyVolume);
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.