0% found this document useful (0 votes)
23 views352 pages

ControlEdge RTU Electronic Flow Measurement Users Guide RTDOC X547 en 172A

Uploaded by

dungnguyenvo2606
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views352 pages

ControlEdge RTU Electronic Flow Measurement Users Guide RTDOC X547 en 172A

Uploaded by

dungnguyenvo2606
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 352

ControlEdge RTU

Release 172.1

Electronic Flow Measurement User's Guide


RTDOC-X547-en-172A
February 2022
DISCLAIMER
This document contains Honeywell proprietary information. Information
contained herein is to be used solely for the purpose submitted, and no part
of this document or its contents shall be reproduced, published, or
disclosed to a third party without the express permission of Honeywell
International Sàrl.
While this information is presented in good faith and believed to be
accurate, Honeywell disclaims the implied warranties of merchantability
and fitness for a purpose and makes no express warranties except as may
be stated in its written agreement with and for its customer.
In no event is Honeywell liable to anyone for any direct, special, or
consequential damages. The information and specifications in this
document are subject to change without notice.
Copyright 2022 - Honeywell International Sàrl

2
Contents

CONTENTS
Contents 3
Chapter 1 - About this guide 5
Chapter 2 - Overview 9
Chapter 3 - Compatibility 11
Chapter 4 - Configuring gas meter runs 13
Creating a new meter run 13
Meter Information properties for a gas meter run 14
Variable Selection properties for a gas meter run 18
Contract Settings properties for a gas meter run 25
Composition properties for a gas meter run 27
Record properties for a gas meter run 30

Chapter 5 - Configuring liquid meter runs 33


ST103A Data Acquisition Module 33
ST103A Specification 36
Installing ST103A 42
Wiring ST103A 45
Checking LED Indicators of a ST103A 48
Creating a new meter run 48
Information properties for a Liquid meter run 49
Liquid type properties for a Liquid meter run 50
Densitometer properties for a Liquid meter run 52
Meter Information properties for a Liquid meter run 58
Contract Settings properties for a Liquid meter run 64
Natural Gas Liquefied properties for a Liquid meter run 67
Station Totalizer properties for a Liquid meter run 67
Records properties for a Liquid meter run 69

3
Contents

Chapter 6 - Editing a meter run 71


Chapter 7 - Changing meter run types 73
Chapter 8 - Quickly configuring meter runs using sample projects 75
Chapter 9 - Configuring Function Blocks 77
Configurable Function Blocks 77
AGA 80
API 11.1 134
APINGLLIB 155
ISO5167DualLIB 163
ISO5167DualJTLib 172
ISO6976lib 184
HWPI_Freq 195
Non-configurable Function Blocks 196
API 21.1 197
API 21.2 297

Chapter 10 - EFM meter run registers 331


Integration with SCADA 332
Meter run register range 332
Meter run register offset 333
QTR rollover details 334
System events 334
Meter run register description 335
Alarm and event operator Bit definition 347
Notices 350

4
CHAPTER

1 ABOUT THIS GUIDE

This document outlines how to build and manage Electronic Gas/Liquid


Flow Measurement components using ControlEdge Builder.

Revision history
Revision Date Description
A February 2022 Initial release of this document

Intended audience
This documentation is intended for the following audience: Users who plan,
install, configure, operate, or maintain ControlEdge™ 2020 controllers
running the eCLR (IEC 61131-3) execution environment.

Prerequisite skills
Knowledge of SCADA systems and experience of working in a Microsoft
Windows environment are required.

Introduction to ControlEdge Technology


Item Description
ControlEdge PLC ControlEdge 900 controllers running the eCLR (IEC 61131-3)
execution environment with PLC software options configured with
ControlEdge Builder.
ControlEdge RTU ControlEdge 2020 controllers running the eCLR (IEC 61131-3)
execution environment with RTU software options configured
with ControlEdge Builder.
ControlEdge UOC ControlEdge 900 controllers running the Honeywell control
execution environment (CEE) configured with Experion Control
Builder.

5
Chapter 1 - About this guide

Special terms
The following table describes some commonly used industry-wide and
Honeywell-specific terminology:

Terminology Description
AI Analog Input
AO Analog Output
ControlEdge A integrated configuration tool to design, configure, program and maintain
Builder ControlEdge controllers.
CPM Control Processor Module
DI Digital Input
DNP3 Distributed Network Protocol V3.0
DO Digital Output
EFM Electronic Flow Measurement
Enron An extension of standard Modbus supports for 32-bit Integer and Floating
Modbus Point variables, and historical and flow data.
Experion® Experion® Process Knowledge System
PKS
Meter run Meter run in a flow measurement system represents a physical system
comprising primary flow measurement element supported by devices
measuring secondary parameters like density, pressure, temperature and
composition etc., to determine the quantifiable flow through the
measurement system.

In ControlEdge RTU, meter run is used to calculate quantifiable flow


according to different standards mandated by AGA, API and other
international standards.
Modbus A communication protocol supports communication between Modbus slave
devices and Modbus master devices via serial port or Ethernet port.
PI Pulse Input
POU Programming Organization Unit
QTR Quantity Transaction Record
RTU Remote Terminal Unit
SCADA Supervisory Control and Data Acquisition

6
Chapter 1 - About this guide

Related documents
The following list identifies publications that may contain information
relevant to the information in this document.
n ControlEdge Builder Software Installation User’s Guide

n ControlEdge Builder Software Change Notice

n ControlEdge PLC and ControlEdge RTU Getting started

n ControlEdge Builder User’s Guide

n ControlEdge 2020 Platform Hardware Planning and Installation Guide

n ControlEdge Builder Function and Function Block Configuration


Reference Guide

n ControlEdge Builder Protocol Configuration Reference Guide

n ControlEdge PLC and ControlEdge RTU Network and Security


Planning Guide

n ControlEdge RTU and PLC DNP3 Device Profile

n ControlEdge Bulk Configuration User's Guide

n Firmware Manager User Guide

7
Chapter 1 - About this guide

8
CHAPTER

2 OVERVIEW

Electronic flow measurement systems are used for the measurement and
recording of flow parameters of gaseous phase hydrocarbon and other
related fluids for custody transfer applications utilizing industry recognized
primary measurement devices.
For the non-redundant controller, up to four meter runs, including gas and
liquid meter runs, can be created.
For the redundant controller, up to twelve meter runs, including gas and
liquid meter runs, can be created.
If a project upgraded from earlier to R161.2 or above releases is running in
the controller, before downloading a new project created using ControlEdge
Builder R161.2 or above releases with API21_1_V2 & API21_2_V2 function
blocks (new meter runs added) along with/without older meter runs,
perform the following steps:

1. Back up the current upgraded project before adding new meter runs.
2. Collect and back up all audit trail data by connecting with SCADA.
3. Remove all meter runs in the upgraded project, and download the
project to the controller. It is required to reset or free up the memory
resources of the controller, occupied by the meter runs.
4. Add new meter runs accordingly, either in a new project or the existing
upgraded project.
5. Compile and download the project.

9
Chapter 2 - Overview

10
CHAPTER

3 COMPATIBILITY

From ControlEdge Builder R171.1, the following project upgrades are


supported for project with EFM configuration.

V1
ControlEdg
Project FW version Controller function V2 function block
e Builder
version selection type block (add/edit)
version
(add/edit)
R151.1 R151.1 or lower SC-UCMX01 R171.1 Supported Not supported
or
lower
R151.1 R151.1 or lower SC-UCNN11 R171.1 Supported Not supported
or
lower
R160.2 R160 SC- R171.1 Supported Not supported
UCNN11/S
C-UCMX02
R160.2 R161/R170/R17 SC- R171.1 Only Supported
1 UCNN11/S support
C-UCMX02 edit It is required to
upgrade controller to
R161.2/R170.1/R171.
1 first.
R161.1 R161/R170/R17 SC- R171.1 Only Supported
1 UCNN11/S support
C-UCMX02 edit It is required to
upgrade controller to
R161.2/R170.1/R171.
1 first.
R161.2 R170/R171 SC- R171.1 Not Supported
UCNN11/S applicable
C-UCMX02 It is required to
upgrade controller to
R170.1/R171.1 first.

11
Chapter 3 - Compatibility

12
CHAPTER

4 CONFIGURING GAS METER RUNS

For register range, offset, system event and description, see EFM meter
run registers for more information.

Creating a new meter run


1. In Applications tab, click Electronic Flow Measurement > Configure Gas
Meter Runs.

2. Click Add and select a type of meter run. There are four meter run types
can be selected and see the following table for information of the four
meter types.

Parameter Description
Orifice Orifice meter run calculates the volumetric flow-rate for
an orifice meter using flange or pipe tap based on the
differential pressure, temperature and pressure input
parameters.
Turbine Turbine meter run corrects measured volume at flowing
conditions read by turbine meter to volume at base
conditions. The main input parameter of the Turbine
meter is pulse.
Ultrasonic Ultrasonic meter run also corrects measured volume at
flowing conditions read by Ultrasonic meter to volume at
base conditions. The main input parameter of the
Ultrasonic meter is pulse. Technically both Turbine and
Ultrasonic meters are same.
Coriolis Coriolis meter run converts gas mass to volume. Gas
mass is directly measured from Coriolis Meter.

3. Configure parameters of the added meter according to the navigation


tab, and click Finish to add the meter to the list at left of the page.
4. Click the arrow besides each meter to unfold tabs, including Meter
Information, Variable Selection, Contract Settings, Composition and
Record. You can check and modify parameters in corresponding tabs if
applicable.
5. Click Save. It will take 3~5 minutes to save the configuration.

13
Chapter 4 - Configuring gas meter runs

You can also copy a existing meter run by clicking to create a new meter
run.

Meter Information properties for a gas meter run


The Meter Information tab defines the basic information and advance
information of a meter.
n See the following table for basic information parameter descriptions.

Parameter Description
Meter name The name of the meter

In most cases, the meter number is also used as the


tag name.
Meter ID The unique identifier of the meter

Third-party flow analysis applications use the meter ID


to uniquely identify the meter.
Meter type There are four meter types: Orifice, Turbine, Ultrasonic
and Coriolis.
Input units Input unit system : US Unit or Metric Unit
Contract Contract unit system : US Unit or Metric Unit

14
Chapter 4 - Configuring gas meter runs

Parameter Description
units
Description (Optional) A description of the meter

Up to 132 alphanumeric characters including spaces


can be added.

n Advanced information is different according to selected meter run type.


l If meter run type is Orifice, see the following table for parameter
descriptions.

Parameter Description
Flow Starting from R161.2, different AGA3 standard can
calculation be selected:
type
l AGA 3(1992)

l AGA 3(2012)
Orifice If Flow calculation type is selected as AGA 3
Material (1992), Stainless Steel, Monel, CarbonSteel are
available.

15
Chapter 4 - Configuring gas meter runs

Parameter Description
If Flow calculation type is selected as AGA 3
(2012), Stainless Steel, Monel, CarbonSteel,
Stainless_S_304, Stainless_S_316 are available.

Tap type Flange, PIPE


Tap location UpStream, DownStream
Pipe material If Flow calculation type is selected as AGA 3
(1992), Stainless Steel, Monel, CarbonSteel are
available.

If Flow calculation type is selected as AGA 3


(2012), Stainless Steel, Monel, CarbonSteel,
Stainless_S_304, Stainless_S_316 are available.

Orifice Orifice diameter in inches for US units or in


diameter millimeter for Metric units
Pipe Pipe diameter in inches for US units or in millimeter
Diameter for Metric units
Viscosity Viscosity in CENTIPOISES for any unit system
Orifice Unit: F° (Fahrenheit in US units)
reference
temperature Unit: C° (Celcius in Metric Units)

Pipe Unit: F° (Fahrenheit in US units)


reference
temperature Unit: C° (Celcius in Metric Units)

Beta radio Beta ratio is the ratio of Orifice diameter to Pipe


diameter.
Isentropic It is a constant number.
exponent
Fluid type Compressible, Non-Compressible

l If meter run type is Turbine, Ultrasonic or Coriolis, see the following


table for parameter descriptions.

16
Chapter 4 - Configuring gas meter runs

Parameter Description
Meter K (Turbine/Ultrasonic meter run) Meter K factor
factor converts pulse from flow meter into volume. The
value should be in pulses/m3 or pulses/ft3. When the
flow type is analog, this is the correction factor to
apply for volume calculation and the default value
should be 1.0.

(Coriolis meter run) Meter K factor converts pulse


from flow meter into mass. The value should be in
pulses/kg (Metric) or pulses/lb (US). When the flow
type is analog, this is the correction factor to apply
for mass calculation and the default value should be
1.0.

17
Chapter 4 - Configuring gas meter runs

Variable Selection properties for a gas meter run


The Variable Selection tab defines the static pressure, differential pressure,
pulse, gas mass and temperature for a meter.
See the following table for Static Pressure parameter descriptions.

Parameter Description
Variable Name of variable
name
LOLO This parameter is extreme low value for static pressure. If static pressure
goes below this value then an alarm is logged. This value should be in the
same units chosen by user for static pressure.
LO This parameter is low value for static pressure. If static pressure goes below
this value then an alarm is logged. This value should be in the same units
chosen by user for static pressure.
HI This parameter is extreme high value for static pressure. If static pressure
goes beyond this value then an alarm is logged. This value should be in the
same units chosen by user for static pressure.
HIHI This parameter is high value for static pressure. If static pressure goes

18
Chapter 4 - Configuring gas meter runs

Parameter Description
beyond this value then an alarm is logged. This value should be in the same
units chosen by user for static pressure.
Status Status for Static Pressure. The value should be {0} for good status, or any
positive integer for bad status.
Override Keypad value for Static Pressure. This value is used when the Static
Value Pressure status is bad.
I/O Selection I/O selection for Static Pressure. The value should be 1 for Live or 2 for
Keypad value.
Atmospheric Absolute Pressure, Gauge Pressure
pressure
Local If Atmospheric Pressure option is Gauge Pressure then local atmospheric
atmospheric pressure must be entered by the user.
pressure
Unit: This value should be in the same units chosen by the user for static
pressure.

There are different configurable parameters according to different meter


run types.
n If meter run type is Orifice, configure Differential Pressure parameters.
See the following table for parameter descriptions.

19
Chapter 4 - Configuring gas meter runs

Parameter Description
Variable Name of variable
name
LOLO This parameter is extreme low value for differential
pressure. If differential pressure goes below this value
then an alarm is logged. This value should be in the
same units chosen by user for differential pressure.
LO This parameter is low value for differential pressure. If
differential pressure goes below this value then an
alarm is logged. This value should be in the same units
chosen by user for differential pressure.
HI This parameter is extreme high value for differential
pressure. If differential pressure goes beyond this value
then an alarm is logged. This value should be in the
same units chosen by user for differential pressure.
HIHI This parameter is high value for differential pressure. If
differential pressure goes beyond this value then an
alarm is logged. This value should be in the same units
chosen by user for differential pressure.
Low DP Low DP cutoff value checks the no flow condition in the
cutoff calculations. The value should be in the same units
chosen by user for differential pressure.

n If meter run type is Turbine or Ultrasonic, configure Pulse parameters.


See the following table for parameter descriptions.

20
Chapter 4 - Configuring gas meter runs

Parameter Description
Variable Name of variable
name
Input Pulse: If the input is pulse.

Analog: if the input is uncorrected analog value.


LOLO It appears when Input is Analog.

This is the LoLo limit for analog input. The value should
be in ft3/hr for US unit or m^3/hr for Metric unit.
LO It appears when Input is Analog.

This is the Lo limit for analog input. The value should be


in ft3/hr for US unit or m^3/hr for Metric unit.
HI It appears when Input is Analog.

This is the Hi limit for analog input. The value should be


in ft3/hr for US unit or m^3/hr for Metric unit.
HIHI It appears when Input is Analog.

This is the HiHi limit for analog input. The value should

21
Chapter 4 - Configuring gas meter runs

Parameter Description
be in ft3/hr for US unit or m^3/hr for Metric unit.
Low pulse It appears when Input is Pulse.
cutoff
Low pulse cutoff value checks the no flow condition in
the calculations. If the Pulse increment is less than this
number, it will be considered as no flow condition.
Low flow It appears when Input is Analog.
cutoff
Low flow cutoff value checks the no flow condition in the
calculations. If the flow is s less than this number, it will
be considered as no flow condition. Unit is m3/hr for
Metric unit, ft3/hr for US unit.

n If meter run type is Coriolis, configure Gas Mass parameters. See the
following table for parameter descriptions.

Parameter Description
Variable Name of variable
name
Input Pulse: If the input is pulse.

22
Chapter 4 - Configuring gas meter runs

Parameter Description
Analog: If the input is uncorrected analog value.

LOLO It appears when Input is Analog.

This is the LoLo limit for analog input. The value should
be in lb/hr for US unit or kg/hr for Metric unit.
LO It appears when Input is Analog.

This is the Lo limit for analog input. The value should be


in lb/hr for US unit or kg/hr for Metric unit.
HI It appears when Input is Analog.

This is the Hi limit for analog input. The value should be


in lb/hr for US unit or kg/hr for Metric unit.
HIHI It appears when Input is Analog.

This is the HiHi limit for analog input. The value should
be in lb/hr for US unit or kg/hr for Metric unit.
Low pulse It appears when Input is Pulse.
cutoff
Low pulse cutoff value checks the no flow condition in
the calculations. If the Pulse increment is less than this
number, it will be considered as no flow condition.
Low flow It appears when Input is Analog.
cutoff
Low flow cutoff value checks the no flow condition in the
calculations. If the flow is s less than this number, it will
be considered as no flow condition. Unit is kg/hr for
Metric unit, lb/hr for US unit.

See the following table for Temperature parameter descriptions.

23
Chapter 4 - Configuring gas meter runs

Parameter Description
Variable Name of variable
name
LOLO This parameter is extreme low value for temperature. If
temperature goes below this value then an alarm is logged.
This value should be in the same units chosen by user for
temperature.
LO This parameter is low value for temperature. If temperature
goes below this value then an alarm is logged. This value
should be in the same units chosen by user for
temperature.
HI This parameter is extreme high value for temperature. If
temperature goes beyond this value then an alarm is
logged. This value should be in the same units chosen by
user for temperature.
HIHI This parameter is high value for temperature. If temperature
goes beyond this value then an alarm is logged. This value
should be in the same units chosen by user for
temperature.

24
Chapter 4 - Configuring gas meter runs

Parameter Description
Status Status for Temperature. The value should be {0} for good
status, or any positive integer for bad status.
Override Keypad value for Temperature. This value is used when the
Value Temperature status is bad.
I/O I/O selection for Temperature. The value should be 1 for
Selection Live or 2 for Keypad value.

Contract Settings properties for a gas meter run


See the following table for Contract Settings parameter descriptions.

Parameter Description
Compressibility calculation Starting from R161.2, compressibility
calculation can be selected from different
AGA 8 versions:

l AGA 8(1994)
l AGA 8(2017)

25
Chapter 4 - Configuring gas meter runs

Parameter Description
Calculation type l Detailed: Gas densities calculation with
all gas composition parameters
l GrossMethod1: Gas densities
calculation with fewer number of
parameters (CO2, Hydrogen and CO)
l GrossMethod2: Gas densities
calculation with fewer number of
parameters (CO2, Hydrogen, CO and
Nitrogen)
l GERG: Compressibility calculation
using GERG method based on AGA 8
(2017) with all gas composition details
are available.

NOTE: With AGA 8 (1994) method,


GERG method can’t be selected.

Averaging Method TimeWeighted: Parameter to choose the


Averaging method. By default in AP21.1, the
averaging method is time weighted average.
Contract Hour It is the hour when day QTR is closed and
new one starts.
Base Temperature Base temperature is input parameter for any
compressibility method to calculate density at
base condition¹.
Base Pressure Base pressure is input parameter for any
compressibility method to calculate density at
base condition.
Maintenance Mode Flag Parameter to Start or Stop the Maintenance
Mode. The value should be either {0}
Maintenance End or {1} for Maintenance
Start.
Note 1: Base conditions, are in general equal to standard conditions, however they are
allowed to be configured by users and they will be different from standard conditions.
Standard conditions are fixed conditions and they are not allowed to configure by users.

For US units, Standard temperature is 60 F°, and standard pressure is 14.73 psi.

26
Chapter 4 - Configuring gas meter runs

Parameter Description
For SI/Metric units, Standard temperature is 15 C°, and standard pressure is 101.325 Kpa.

Composition properties for a gas meter run


Composition tab defines Gas Composition of a meter and you can configure
percentage of each composition.
The configurable composition is different by selecting the different
Compressibility Method in Contract Settings tab.

n If Compressibility Method is Detailed, see the following table for


parameter descriptions.

Parameter Description
Source Constant, Live
Format Percentage, Mole Fraction
Configurable Methane, CO2, Propane, H2S, CO, Argon, I_Butane,
Composition I_Pentane, Hexane, Octane, Decane, Nitrogen,
Ethane, Water, Hydrogen, Oxygen, Helium, N_
Butane, N_Pentane, Heptane, and Nonane.
Normalize To normalize the gas composition values if their sum

27
Chapter 4 - Configuring gas meter runs

Parameter Description
is not 100.

n If Compressibility Method is GrossMethod1 or GrossMethod2, see the


following table for parameter descriptions.

Parameter Description
Source Constant, Live
Format Percentage, Mole Fraction
Composition l CO2
Parameter
l Hydrogen
l CO
l Nitrogen(Only for GrossMethod2)
Gas relative density Gas relative density measured at reference
condition, input parameter for Gross Method
1 & 2.
Reference Reference temperature for calorimeter
Temperature For density required parameter for Gross Method

28
Chapter 4 - Configuring gas meter runs

Parameter Description
Calorimeter Density 1 & 2.
Gas heating value Heating value for the gas mixture.
Reference Pressure Reference pressure for calorimeter density
For Calorimeter required parameter for Gross Method 1 & 2.
Density
Reference Reference temperature for combustion
Temperature For required parameter for Gross Method 1 & 2.
Combustion

29
Chapter 4 - Configuring gas meter runs

Record properties for a gas meter run


Record tab defines Daily/Hourly Record Parameters of a meter. See the
following table for parameter descriptions.

Parameter Description
Start Date Start date of the logged hourly/ daily QTR (Quantity Transaction Record)
Start Time Start time of the logged hourly/ daily QTR.
End Date End date of the logged hourly/ daily QTR.
End Time End time of the logged hourly/ daily QTR
Flow Time Flow time in seconds for hourly/ daily QTR
Volume at Accumulated volume at base condition for hourly/ daily QTR
Base
Mass Accumulated gas mass for hourly/ daily QTR
Energy Accumulated energy for hourly/ daily QTR
Temperature Averaged temperature for hourly/ daily QTR
Pressure Averaged pressure for hourly/ daily QTR
Differential Only apply to Orifice Meter.

30
Chapter 4 - Configuring gas meter runs

Parameter Description
Pressure Averaged differential pressure for hourly/ daily QTR
Analog Only applicable to Turbine, Ultrasonic and Coriolis meter when flow type is
selected as Analog.

This parameter provides average value of analog input for daily/hourly


QTR.
Density Averaged density for hourly/ daily QTR
Flow Extension Only apply to Orifice Meter.

Flow extension value for hourly/ daily QTR.


Uncorrected Only apply to Turbine and Ultrasonic Meter.
flow
It provides uncorrected flow average value for daily/hourly QTR.
None Only apply to Coriolis Meter.

This record is empty and generally filled with zero.


Relative Averaged relative density for hourly/ daily QTR
Density
Non- Non-Resettable or Cumulative total for volume at Base
Resettable
Volume at
Base
Non- Non-Resettable or Cumulative total for Mass
Resettable
Mass
Non- Non-Resettable or Cumulative total for Energy
Resettable
Energy
Maintenance Non-Resettable or Cumulative total Volume at Base (Turbine Ultrasonic
Volume at and Orifice Meter) or Mass (Coriolis) in Maintenance mode
Base

or,

Maintenance
Mass
Pulse Start This is applicable for Turbine, Ultrasonic and Coriolis meter when flow type
is selected as Pulse. This is snapshot value when transaction time starts

31
Chapter 4 - Configuring gas meter runs

Parameter Description
(hour/day).
Pulse End This is applicable for Turbine, Ultrasonic and Coriolis meter when flow type
is selected as Pulse. This is snapshot value when transaction time ends
(hour/day).
UserDefined1 Average value of user defined parameter for hourly and daily QTR
UserDefined2 Average value of user defined parameter for hourly and daily QTR
UserDefined3 Average value of user defined parameter for hourly and daily QTR
UserDefined4 Average value of user defined parameter for hourly and daily QTR

32
CHAPTER

5 CONFIGURING LIQUID METER


RUNS
For register range, offset, system event and description, see EFM meter
run registers for more information.

ST103A Data Acquisition Module


The ST103A is an ultra-reliable data acquisition module that provides I/O
capabilities to controllers requiring high accuracy, or to fiscal or custody
transfer metering interfaces (e.g. Dual pulse fidelity checking). The ST103A
reads and updates its I/Os within 500 ms, and provides external data
access through a Modbus serial port.
See the following solution diagram for Liquid Electronic Flow Measurement
system:

Figure 5-1: Liquid Electronic Flow Measurement system

See the following table for the recommended configurations of liquid meter
runs:

33
Chapter 5 - Configuring liquid meter runs

n For a non-redundant system, up to 4 liquid meter runs are supported:

No. of No. of ST103A


Set task time
meter connected to serial Task execution time
automatically?
run port
1~3 3 ST103A devices STTask: 250ms Yes
connect to one serial
port. AITask: 500ms

4 3 ST103A devices LiqTask: 1000ms


connect to one serial
port, and the fouth
device connects to
the other serial port.

n For a redundant system, up to 12 liquid meter runs are supported.

No. of No. of ST103A


Task execution Set task time
meter connected to serial
time automatically?
run port
1~3 3 ST103A devices STTask: 250ms Yes
connect to 1 serial
port. AITask: 500ms

1~6 3 ST103A devices LiqTask: 1000ms


connect to one serial
port, and the rest
devices connect to
the other serial port.
7 ~ 12 6 ST103A devices STTask: 750ms No. You should
connect to one serial set it manually.1
port, and the rest AITask: 1500ms
devices connect to LiqTask: 3000ms
the other serial port.
Note1: The slowest execution time for the LiqTask is <= 5000ms. The
execution time of the STTask is 25% of LiqTask's, and AITask is 50%
of LiqTask's.

34
Chapter 5 - Configuring liquid meter runs

TIP: If there are other Modbus serial devices needing to be


connected with ST103A in the same daisy chain, it will impact
the number or execution time of meter runs in the current
configuration. You should reduce the number of meter runs
based on the previous execution time. Alternatively, you should
slow the execution time and keep the previous number of meter
runs.

When a project requires flow calculation based on single pulse stream from
primary flow meter and secondary measurements as analog input, onboard
I/O or expansion I/O can be used.
See the following solution diagram for Liquid Electronic Flow Measurement
system with the onboard I/O or expansion I/O:

Figure 5-2: Liquid Electronic Flow Measurement system with the onboard
or expansion I/O

Prerequisites

Make sure BatchTotalizer_DataTypes exists in the Data Types list. If not,


you should insert it manually.

1. From the IEC Programming Workspace, right-click Data Types, and


select Insert > Datatypes.
2. Enter the name BatchTotalizer_DataTypes, and click OK.

35
Chapter 5 - Configuring liquid meter runs

ST103A Specification

Table 5-1: General Description of ST103A

Item Description Number


Analogue Inputs 18 bits minimum, 1-5V or 4-20mA 5
PRT Inputs 4 wire, 1mA sense current 1
Frequency Inputs High sensitivity, AC Coupled 2
Pulse Inputs 2 Single or 1 Dual (Level A, B or E) 2
Digital Inputs D.I. 9 Can also be used as Sphere Switch inputs 9
Digital Outputs Open collector, 100mA Max 8
Analogue Outputs 12 bit minimum, each fully isolated 2
Alarm Relay Volt Free, Normally Closed Contact 1
Raw Pulse (Input or Output) Differential Bus, enable & direction configurable 1

Table 5-2: Analogue Inputs Specification

Item Description
Type of Inputs 0 to 5 Volt or 4-20 mA nominal i/p type
Isolation All channels individually isolated to 50 V RMS
Conversion Method Integrating charge - balance
Effective resolution More than 18 bits, auto zero, auto calibrate
Conversion time Less than 100 mSec per channel
Scan Rate All channels can be acquired in under 1 second
Series mode rejection >100 dB at 50 Hz and 60 Hz
Voltage Common mode range ±50 V relative to computer ground or other input
Calibration Period 2 Years to 0.005% of Voltage. 5 Years to 0.01 % of
Voltage

36
Chapter 5 - Configuring liquid meter runs

Table 5-3: ADC Inputs Voltage Mode

Item Description
Type of Inputs Differential voltage inputs
Input Range 0 to +5.5 V
Accuracy +/- 0.005% of FSD at 23 °C
Ambient Temperature +/- 7 ppm/°C from 23°C in the range 0 to 45°C. 0.05% -40°C to
effect +85°C

Table 5-4: ADC Inputs Current Mode

Item Description
Type of Inputs Isolated current inputs
Input Range 0 to 22mA.
Accuracy +/- 0.02% of FSD at 23 °C
Ambient Temperature +/-10 ppm/°C from 23°C in range 0°C to 45°C. .0.1% -40°C to
effect +85°C

Table 5-5: PRT Inputs

Item Description
Type of Inputs 4 wire using Pt 100 RTD
Temperature measuring range -100°C to +300°C.
Resolution 0.01°C
Accuracy 0.05°C
PRT cables Loop resistance up to 600 Ohms
Barriers 9 V, 100 Ohms are satisfactory.
Security Continuous cable/PRT integrity tests
3 Wire Mode Not recommended, but possible

37
Chapter 5 - Configuring liquid meter runs

Table 5-6: Analogue Outputs

Item Description
Type Each channel is an individually isolated current
controlled 0 to 21 mA output, that can be used to sink
or source cubicle power
Effective resolution 12 bit minimum.
Accuracy +/- 0.1% at 23°C.
Temperature Coefficient 20ppm / °C
Minimum Load Loop resistance Safe down to zero ohms from +32V external supply.
Maximum Load Loop resistance 1000 Ohms when powered from +24V external
Maximum External Supply 32 Volts
Output Form Isolated active current controller
Number of field connections 2 terminals per channel
Update time 500mSec to within 1%

Table 5-7: Digital Status Inputs

Item Description
Configuration Individually Opto-isolated inputs
Max Input Voltage 30V
Min Input on Voltagee 12V
Max Input off voltage 3.0V
Input Impedance 2-2.5K Ohm typical
Protection Surge and reverse voltage protection
Additional Features Filtering and fleeting input detection provided

38
Chapter 5 - Configuring liquid meter runs

Table 5-8: Digital Status Outputs

Item Description
Configuration Individually galvanically isolated
Max Output Current 100mA
Min Output Saturation Voltage 2.1V @ 100mA
Max Output Standoff Voltage 32V, limited by input protection
When off|Reset/Power on State All digital outputs OFF

Table 5-9: Frequency/Density Meter

Item Description
Configuration AC Coupled, Galvanically Isolated, with active limiting
Sensitivity 3.0 V peak to peak minimum
Maximum Input Voltage 24V peak to peak
Input current Internally limited to 3mA
Frequency Range 50Hz to 5 kHz.
Accuracy of frequency 10 ppm
measurement
Resolution 25 nanoseconds
Note Info from Solartron – a 220R resistor inline will give approx 3.5V
peak to peak signal.

Table 5-10: Flow Meter Pulses

Item Description
Input Type Can use "best in class" differential mode or single ended.
Configuration Opto-coupled inputs.
Input signal levels +/- 3.5 V to +/- 24 V.
Input current minimum 5 mA
Frequency range DC to 10 kHz.
Line Integrity Dual back-to-back optos, allowing full quiescent line and

39
Chapter 5 - Configuring liquid meter runs

Item Description
electronic integrity testing, when used with differential
pre-amps and VS300 pulser
Dual Pulse compliance IP 252/76 or API Ch 5.5 level A or B, or E

Table 5-11: Raw Pulse Bus

Item Description
Configuration Digital Ground referenced Differential transceiver
Gating & Direction Software controlled
Use To bus together several streams to a common prover
Signalling RS422 Compatible drive & receive levels
Max output frequency 10 KHz

Table 5-12: Pulse Outputs

Item Description
Configuration Individually Isolated
Max Output Current 100 mA
Max Output Saturation Voltage 2.1 V @ 100 mA
Max Output Standoff Voltage 32V, limited by Transorb
Frequency range DC to 100Hz

Table 5-13: Alarm Relay

Item Description
Contact Form Form B (Normally Closed)
Max current 1A
Max Voltage 32 V, limited by input protection
Maximum Power 30 VA
Control Released on de-power or watchdog restart or software command

40
Chapter 5 - Configuring liquid meter runs

The ST103A is equipped with two Modbus serial ports to give dual
redundant links to DCS or PLCs.

Table 5-14: Modbus Comms Interface – Serial Ports

Item Description
Port Type Dual RS485, two wire half Duplex
Isolation None
Protection Highly ruggedised ports with Full EMC protection, including
transient and surge protection
Biasing/Determination Very light biasing to maintain receivers in an off state when
disconnected
Baud Rate Fixed at 19,200 Baud

Above technical specification may change, the latest data should refer to
the module specification published on the website.
ST103A needs to be procured from Swinton Technology, UK.
Please contact this email id for procurement -
[email protected]
Swinton Technology's contact details :
Swinton House, Hertford Way
York Road Business Park
Malton - YO17 6YG
United Kingdom
Telephone: +44 (0)1653 698844
Fax: +44 (0)1653 605679

41
Chapter 5 - Configuring liquid meter runs

Installing ST103A
Installation Dimension for a ST103A
See the following table for ST103A installation dimension:

Table 5-15: ST103A installation dimension

Item Description
Length on Rail 168mm
Height 56mm
Width across Rail 128mm
Weight 650 grams
Structure: PVC extrusion with passivated steel lid

Mounting a ST103A
ST103A acting as a slave communicates with the controller which acts as a
master through any one of two RS485 ports over Modbus.
ST103A can be remotely mounted (>1km) to the controller.
To mount ST103A

1. It is recommended to mount ST103A on a 35 mm symmetrical Top Hat


rail to EN50022 or on an asymmetric G-type rail.
2. Connect RS485 ports between ST103A and the controller using a solid
wire.
To understand the location of serial ports of ST103A, see ST103A
Wiring and configuration details for more information.
3. If multiple ST103A modules are connected to the controller, they need
to be connected in a daisy chain with a termination resistor (120 Ohms)
at the termination end.
4. Configure a slave ID for the ST103A module. See "Configuring a Slave
ID for the ST103A" below for more information.

Configuring a Slave ID for the ST103A


The ST103A needs to be enabled to configure the Slave ID. 4 bit switches
allow the Modbus slave address to be set in the range of 1 to 15.

42
Chapter 5 - Configuring liquid meter runs

See the following table for the Switch Setting:

Table 5-16: Switch Setting of ST103A

Switch'1' Switch'2' Switch'3' Switch'4' Slave ID


ON (Down) ON (Down) ON (Down) ON (Down) Not valid
OFF (Up) ON (Down) ON (Down) ON (Down) 1
ON (Down) OFF (Up) ON (Down) ON (Down) 2
OFF (Up) OFF (Up) ON (Down) ON (Down) 3
ON (Down) ON (Down) OFF (Up) ON (Down) 4
OFF (Up) ON (Down) OFF (Up) ON (Down) 5
ON (Down) OFF (Up) OFF (Up) ON (Down) 6
OFF (Up) OFF (Up) OFF (Up) ON (Down) 7
ON (Down) ON (Down) ON (Down) OFF (Up) 8
OFF (Up) ON (Down) ON (Down) OFF (Up) 9
ON (Down) OFF (Up) ON (Down) OFF (Up) 10
OFF (Up) OFF (Up) ON (Down) OFF (Up) 11
ON (Down) ON (Down) OFF (Up) OFF (Up) 12
OFF (Up) ON (Down) OFF (Up) OFF (Up) 13
ON (Down) OFF (Up) OFF (Up) OFF (Up) 14
OFF (Up) OFF (Up) OFF (Up) OFF (Up) 15

43
Chapter 5 - Configuring liquid meter runs

Configuring an Analog input channel for voltage (1 -5V) or current


mode (4-20mA)
The factory setting for all analog inputs is voltage mode. This means that an
external 250R 0.01% (minimum 0.2W) is required, and the signal monitored
by the ST103A is 1~5V.
If the analog input is required to be in current mode (4~20mA), then an
internal bit link should be fitted and the ADC configuration modified to
match via the Modbus interface (Register #50 and #51).

Figure 5-3: Analog Board

Analog Input P1 P2 P3 P4 P5 P6 P7 P8
1 (1-5V)-factory setting OFF
1 (4-20mA) ON
2 (1-5V)-factory setting OFF
2 (4-20mA) ON
3 (1-5V)-factory setting OFF
3 (4-20mA) ON
4 (1-5V)-factory setting OFF
4 (4-20mA) ON
5 (1-5V)-factory setting OFF ON
5 (4-20mA) ON ON
5 (RTD2) OFF OFF

44
Chapter 5 - Configuring liquid meter runs

Analog Input P1 P2 P3 P4 P5 P6 P7 P8
6 (1-5V)-factory setting OFF ON
6 (4-20mA) ON ON
6 (RTD1) OFF OFF

NOTE: Access to bit links cover from the unit should only be attempted
by an engineer with suitable training.

If the bit links on the analog board need to be changed you need to first
remove the unit's cover .
To remove the cover of the unit:

1. Remove the Earth stand-off which secures the cover earth tag using a
9/32" or 7mm socket driver.
2. Remove the M3x6mm pozidrive pan head screw which is next to the
Status LED and above the ETH2 connector.
3. Remove the remaining four M3x20mm pozidrive pan head screws.
4. Remove the cover by lifting it vertically away from the base.
To re-fit the cover:

1. Slid the cover back into position, taking care that the earth tag slips over
the earth stud.
2. Refit the screws to secure the cover.
3. Screw the stand-off back into the Earth Stud.

Wiring ST103A
Power Cabling

Table 5-17: Power Supplies- Inputs

Item Description
Input Voltage & Current 20-32V D.C 2W nominal, 4 W Max
No of DC Inputs 2 off, allowing direct connection to redundant supplies
Galvanic isolation 50V RMS to Instrument Earth

45
Chapter 5 - Configuring liquid meter runs

Item Description
Maximum Input Ripple 2V pp
DC Input Power fail flag 19V +/- 0.5v
Hold up period after powerfail flag 4ms
Input protection Non-replaceable 1A Input Fuse

Table 5-18: Power Supplies—Outputs

Item Description
Output Nominal 12V supply for turbine pre-amplifiers
Isolation Isolated from incoming power and computer 0 V
Regulation Fully regulated
Voltage level 12V, 500mV p-p ripple
Output Current 75 mA
Output protection Electronic current limit and thermal shutdown

46
Chapter 5 - Configuring liquid meter runs

ST103A Wiring and configuration details


See the following diagram for connection details for ST103A wiring:

Figure 5-4: ST103A Wiring Diagram

47
Chapter 5 - Configuring liquid meter runs

Checking LED Indicators of a ST103A


To assist debugging, LEDs are provided on both the transmit and receive
lines of all three communications ports.

Creating a new meter run


1. In Applications tab, click Electronic Flow Measurement > Configure Liquid
Meter Runs.

2. Click Add and select a type of meter run. There are five meter run types
can be selected and see the following table for information of the five
meter types.

Parameter Description
Turbine, Positive Different primary meter types measuring
Displacement, liquid flow in a meter run.
Ultrasonic, Coriolis
Station Totalizer Station Totalizer is used when multiple
streams are connected to a station and the
totals should be calculated from multiple
streams.

3. Configure parameters of the added meter according the navigation tab,


and click Finish to add the meter to the list at left of the page.

48
Chapter 5 - Configuring liquid meter runs

4. Click the arrow besides each meter to unfold tabs, including Information,
Liquid Type, Densitometer, Meter Information, Contract Settings, Natural
Gas Liquefied and Records. You can configure each tab with required
parameters.
5. Click Save. It will take 3~5 minutes to save the configuration.

Information properties for a Liquid meter run


The Basic Information tab defines the basic information of a meter.
n See the following table for basic information parameter descriptions.

Parameter Description
Meter name The name of the meter

In most cases, the meter number is also used as the


tag name.
Meter ID The unique identifier of the meter

Third-party flow analysis applications use the meter ID


to uniquely identify the meter.
Meter bank Meter Bank identifier.
name
Meter type There are five meter types: Orifice, Turbine, Ultrasonic,
Coriolis and Station Totalizer.
Input units Input unit system : US Unit or Metric Unit
Contract Contract unit system : US Unit or Metric Unit

49
Chapter 5 - Configuring liquid meter runs

Parameter Description
units
Description (Optional) A description of the meter

Up to 132 alphanumeric characters including spaces


can be added.

Liquid type properties for a Liquid meter run


The Liquid Type tab provides the options to select the liquid type to be
measured.
n See the following table for Liquid Type parameter descriptions.

Parameter Description
Liquid to be measured You can measure the following liquid:

l Crude oil
l Refined Products
l Special products
l Lubricating Oil
l Natural Gas Liquefied
Thermal expansion It is ONLY applicable for the Special products
factor at 60F liquid type.

Thermal expansion coefficient at 60°F.

50
Chapter 5 - Configuring liquid meter runs

n See the following table for I/O Selection parameter descriptions.

Parameter Description
I/O Type for the Meter l ST103A
Run
l Others
Select it if onboard I/O or expansion I/O or
any other device is used as an I/O.
I/O Identifier It is available when you select ST103A for I/O
Type for the Meter Run.

Identifier of the connected ST103A I/O.

Select the target ST103A you have added.


MessageID It is available when you select ST103A for I/O
Type for the Meter Run.

Message ID from the connected ST103A


device. It is used as a heartbeat to know
whether ST103A is alive and able to
communicate with ControlEdge 2020
controller. Message ID will increment 2 in 1
second.

The global variable created automatically


after you add a ST103A device.
Watch Dog Time It is available when you select ST103A for I/O
Type for the Meter Run.

51
Chapter 5 - Configuring liquid meter runs

Parameter Description
Maixmum wait time in seconds for ST103A
to restore the connection after the
connection failure with ControlEdge 2020
controller. Beyond this limit, pulse increment
will not be utilized in volume calculations.
The status for hourly/daily/Batch totals will
be set to 1, i.e. the totals are unreliable.
Pulse Max Increment It is available when you select ST103A for I/O
Type for the Meter Run.

Maximum pulse increment limit for an


execution cycle. If the pulse increment is
beyond the limit, pulse increment will not be
utilized in volume calculations and an alarm
will be generated.

Densitometer properties for a Liquid meter run


The Densitometer tab provides the configuration required for meter run
calculations from densitometers.
n See the following table for Densitometer parameter descriptions.

Parameter Description
Densitometer is available Option to set whether the
Densitometer is available or not. The
value should be either 1 for Yes or 0
for No.

52
Chapter 5 - Configuring liquid meter runs

Parameter Description

l Yes
l No
Coriolis meter to provide It is available when the meter run
density measurement type is Coriolis.

If the Coriolis meter is measuring


both flow and density measurement,
select the appropriate option.
No. of Densitometer It is available when you select Yes
for Densitometer is available.

The number of Densitometers


available. The value should be either
1 for Single or 2 for Dual
densitometer.

l 1 (A)
l 2 (A, B)
Base density It is available when you select No for
Densitometer is available.

Density at Base conditions. The


value should be in lb/ft^3 for US unit
and kg/m^3 for Metric unit.

If the measurement system does not


have on-line densitometer and takes
input from offline density
measurement, this option should be
selected.

n If you select Yes for Densitometer is available, configure the Temperature


parameters. See the following table for parameter descriptions.

53
Chapter 5 - Configuring liquid meter runs

Parameter Description
Variable name Parameter to set the Densitometer
temperature. The value should be in
Fahrenheit for US unit and in Celcius
for Metric unit.
Status Status for Densitometer
Temperature. The value should be
{0} for good status, or any positive
integer for bad status.
LOLO This is the LoLo limit for
Densitometer temperature. The
value should be in Fahrenheit for US
unit and in Celcius for Metric unit.
Override Value Keypad value for Densitometer
temperature. This value is used
when the densitometer temperature
status is bad.
LO This is the Lo limit for Densitometer
temperature. The value should be in
Fahrenheit for US unit and in Celcius
for Metric unit.
I/O Selection I/O selection for Densitometer
Temperature. The value should be 1
for Live or 2 for Keypad value.
HI This is the Hi limit for Densitometer

54
Chapter 5 - Configuring liquid meter runs

Parameter Description
temperature. The value should be in
Fahrenheit for US unit and in Celcius
for Metric unit.
HIHI This is the HiHi limit for
Densitometer temperature. The
value should be in Fahrenheit for US
unit and in Celcius for Metric unit.

n If you select Yes for Densitometer is available, configure the Gauge


Pressure parameters. See the following table for parameter
descriptions.

Parameter Description
Variable name Parameter to set the Densitometer
pressure. The value should be in
Psig for US unit and in Kpag for
Metric unit.
Status Status for Densitometer Pressure.
The value should be {0} for good
status, or any positive integer for bad
status.
LOLO This is the LoLo limit for
Densitometer pressure. The value
should be in Psig for US unit and in
Kpag for Metric unit.

55
Chapter 5 - Configuring liquid meter runs

Parameter Description
Override Value Keypad value for Densitometer
pressure. This value is used when
the densitometer pressure status is
bad.
LO This is the Lo limit for Densitometer
pressure. The value should be in
Psig for US unit and in Kpag for
Metric unit.
I/O Selection I/O selection for Densitometer
pressure. The value should be {1} for
Live or {2) for Keypad value.
HI This is the Hi limit for Densitometer
pressure. The value should be in
Psig for US unit and in Kpag for
Metric unit.
HIHI This is the HiHi limit for
Densitometer pressure.The value
should be in Psig for US unit and in
Kpag for Metric unit.

n If you select Yes for Densitometer is available, configure the Density


parameters. See the following table for parameter descriptions.

56
Chapter 5 - Configuring liquid meter runs

Parameter Description
Measured density Density value of the Densitometer.
The value should be in lb/ft^3 for US
unit and kg/m^3 for Metric unit.

If you select 2 (A, B) for No. of


Densitometer, there will be two
options Measured density A and
Measured density B to be configured.

Status Status of Densitometer. The value


should be {0} for good status, or any
positive integer for bad status.

If you select 2 (A, B) for No. of


Densitometer, there will be two
options Status A and Status B to be
configured.
Preferred Densitometer It is available when you select 2 (A,
B) for No. of Densitometer.

l A

l B
Override Value Keypad value for Densitometer
measured density. This value is used
when the densitometer status is bad.
The value should be in lb/ft^3 for US
unit and kb/m^3 for Metric unit.

When the number of densitometer is


2 and the status of preferred
densitometer is bad, the function
block automatically switches to the
other densitometer if its status is
good. If both densitometer status is
bad, then an override (keypad) value
will be used. In case of measured
density, the keypad value needs to
be a base density.
I/O Selection I/O selection for Density. The value
should be {1} for Live or {2} for
Keypad value.

57
Chapter 5 - Configuring liquid meter runs

Meter Information properties for a Liquid meter run


The Meter Information tab defines the basic information related to primary
measurement element and associated secondary measurement devices.
n See the following table for the Advanced information parameter
descriptions.

Parameter Description
Meter K Meter K factor converts pulse from flow meter into
factor volume. The value should be in pulses/m3 or pulses/ft3.
When the flow type is analog, this is the correction
factor to apply for volume calculation and the default
value should be 1.0.

n See the following table for Temperature parameter descriptions.

58
Chapter 5 - Configuring liquid meter runs

Parameter Description
Variable name Parameter to set the meter
temperature. The value should be in
Fahrenheit for US unit and in Celcius
for Metric unit.
Status Analog input channel status for meter
temperature. The value should be {0}
for good status, or any positive
integer for bad status.
LOLO This is the LoLo limit for meter
temperature. The value should be in
Fahrenheit for US unit and in Celcius
for Metric unit.
Override Value Keypad value for meter temperature.
The value is used when the
densitometer temperature status is
not good.
LO This is the Lo limit for meter
temperature. The value should be in
Fahrenheit for US unit and in Celcius
for Metric unit.
I/O Selection I/O selection for meter temperature.
The value should be {1} for Live or {2)

59
Chapter 5 - Configuring liquid meter runs

Parameter Description
for Keypad value.
HI This is the Hi limit for meter
temperature. The value should be in
Fahrenheit for US unit and in Celcius
for Metric unit.
HIHI This is the HiHi limit for meter
temperature. The value should be in
Fahrenheit for US unit and in Celcius
for Metric unit.

n If the meter run type is Coriolis, configure the Density parameters. See
the following table for parameter descriptions.

Parameter Description
Measured density Density value from the
Densitometer. The value should be
in lb/ft^3 for US unit and kg/m^3 for
Metric unit.
Status Status of Densitometer. The value
should be {0} for good status, or any
positive integer for bad status.
Override Value Keypad value is used when
measured density status is bad.

60
Chapter 5 - Configuring liquid meter runs

Parameter Description
Generally this will be base density.
The value should be in lb/ft^3 for US
unit and kg/m^3 for Metric unit.
I/O Selection I/O selection for Density. The value
should be {1} for Live or {2} for
Keypad value.

n See the following table for Gauge pressure parameter descriptions.

Parameter Description
Variable name Parameter to set the meter pressure.
The value should be in Psig for US
unit and in Kpag for Metric unit.
Status Analog input channel status for meter
pressure. The value should be {0} for
good status, or any positive integer
for bad status.
LOLO This is the LoLo limit for meter
pressure. The value should be in Psig
for US unit and in Kpag for Metric
unit.
Override Value Keypad value for meter pressure.

61
Chapter 5 - Configuring liquid meter runs

Parameter Description
The value is used when the meter
pressure status is bad.
LO This is the Lo limit for meter pressure.
The value should be in Psig for US
unit and in Kpag for Metric unit.
I/O Selection I/O selection for meter pressure. The
value should be {1} for Live or {2) for
Keypad value.
HI This is the Hi limit for meter
pressure.The value should be in Psig
for US unit and in Kpag for Metric
unit.
HIHI This is the HiHi limit for meter
pressure. The value should be in Psig
for US unit and in Kpag for Metric
unit.

n See the following table for Pulse parameter descriptions.

Parameter Description
Variable name The parameter to set pulse/analog
input for flow.

62
Chapter 5 - Configuring liquid meter runs

Parameter Description
Input Parameter to set the flow type. The
value should be {0} for Pulse and {1}
for Analog.

l Select Pulse if the flow meter


provides pulse stream as an
output.
l Select Analog if the flow meter
provides flow rate as an output,
and the value should be in
lb^3/hr. for US unit or m^3/hr.
for Metric unit.

TIP: For applications related to


control a flow rate, it is
recommended to select Analog
and use flow meters which
supports analog output.

NOTE: When Analog is


selected, you cannot select
Batch for Operation Type in the
Contract Settings tab.

Low pulse cutoff Low pulse cut off limit determines no


flow conditions.
LOLO It is available when you select Analog
for Input.

This is the LoLo limit for analog input.


The value should be in lb^3/hr for US
unit or m^3/hr for Metric unit.
LO It is available when you select Analog
for Input.

This is the Lo limit for analog input.


The value should be in lb^3/hr for US
unit or m^3/hr for Metric unit.
HI It is available when you select Analog

63
Chapter 5 - Configuring liquid meter runs

Parameter Description
for Input.

This is the Hi limit for analog input.


The value should be in lb^3/hr for US
unit or m^3/hr for Metric unit.
HIHI It is available when you select Analog
for Input.

This is the HiHi limit for analog input.


The value should be in lb^3/hr for US
unit or m^3/hr for Metric unit.

Contract Settings properties for a Liquid meter run


The Contract Settings tab defines the additional settings required for
Quantity Transaction Record (QTR) computation.
n See the following table for Contract Settings parameter descriptions.

Parameter Description
Averaging FlowWeighted: Parameter to choose the Averaging
Method method. By default in AP21.2, the averaging method
is flow weighted average.
Averaging Parameter to set the variable used for averaging.
Variable The value should be {0} for Gross Volume or {1} for
Mass.
Contract Hour Parameter represents the time of daily QTR

64
Chapter 5 - Configuring liquid meter runs

Parameter Description
generation. Its value should be from 0 to 23.
Base Temperature at Base conditions. The value should
Temperature be in Fahrenheit for US units and in Celcius for
Metric units. The contract unit setting on the Basic
Information is used for QTR calculation. The default
value for US unit is 60 Deg F and ranges from 15 to
20 Deg C for Metric units.
API Rounding Option to enable or disable the API rounding. This
option will round-off the input and output float values
according to API standards.

l Enable
l Disable
Sediments & Parameter to set whether the Water and Sediments
water is available in the Crude Oil or not. The value should
measurement be {1} if it is available, otherwise it should be {0}.
is available
l Yes
l No
Sediments & Parameter to set the percentage of Water and
water Sediments present in the Crude Oil.
Status Analog input channel status for Water and
Sediments. The value should be {0} for Good or any
positive integer for Bad status.
Override Value Keypad value in percentage for Water and
Sediments. The value that should be used when the
Water and Sediments status is not good.
I/O Selection I/O selection for Water and Sediments value. The
value should be {1} for Live or {2} for Keypad value.

n See the following table for Operation parameter descriptions.

65
Chapter 5 - Configuring liquid meter runs

Parameter Description
Maintenance Mode Flag Parameter to Start or Stop the
Maintenance Mode. The value should
be either {0} Maintenance End or {1}
for Maintenance Start.
Operation Type Parameter to set the type of
Operation. The value should be {1}
for Continuous or {2} for Batch.

NOTE: If Analog is selected for


Input in the Variable Selection
tab, you cannot select Batch
here.

Batch Identifier It is available when you select Batch


for Operation Type.

Identifier for a Batch operation. This


number will be incremented for every
batch run.
Retrospective K-factor It is available when you select Batch
Correction for Operation Type.

Option to enable or disable the


retrospective K-factor handling in
Batch totolization.

66
Chapter 5 - Configuring liquid meter runs

Natural Gas Liquefied properties for a Liquid meter run


The Natural Gas Liquefied tab defines the inputs parameters required for
Natural Gas Liquefied liquid type.
See the following table for the corresponding parameter descriptions.

Parameter Description
CPL calculation type CPL Calculation Type. The value should be {1} for None or {2} for
API21.2 or {3} for API21.2M.
Convergence criteria IP2 Convergence limit. Default value is 0.001.
Maximum iterations IP2 Max loop limit. Default value is 50.
Iteration method Main calculation method. The value should be either {1} for ASTM or
{2} for IP2.
Vapor pressure input Parameter to set the Vapour Pressure Input.
Vapor pressure Vapour Pressure calculation options. The value should be {1} for
calculation method None, {2} for User Observed or {3} for API 11.2.5

Station Totalizer properties for a Liquid meter run


When you create a Station Totalizer meter run, the Station Totalizer tab
appears.

67
Chapter 5 - Configuring liquid meter runs

The LiquidStationTotalizer function block calculates the meter station totals


for the multiple streams connected to the station. The station totals are
calculated by adding relevant individual totals from each stream and
totalizing them to create Station totals. Station totalizer by default totalize
Gross standard Volume, Net Standard Volume, Mass and water and
sediments volume. The station totalizer by default generate hourly and daily
QTR similar to any other meter runs.
Station totalizer can be configured for totalizing 2 ~ 4 meter runs. The
maximum meter runs that can be added to station totalizer is 4 and
minimum is 2.
While configuring station totalizer, meter runs should have same liquid type,
operation type (period/batch) and same contract hour. The function block
will not do any error handling if the above conditions are not met.
See the following table for the corresponding parameter descriptions.

Parameter Description
Meter ID The unique identifier of the meter.

Third-party flow analysis applications use the meter ID to uniquely identify the
meter.
Liquid Type Liquid to be measured:

l Crude oil

l Refined Products

l Special products

68
Chapter 5 - Configuring liquid meter runs

Parameter Description

l Lubricating Oil

l Natural Gas Liquefied


Contract Contract unit system: US Unit or Metric Unit.
units
Operation Parameter to set the type of Operation. The value should be {1} for
Type Continuous or {2} for Batch.

Records properties for a Liquid meter run


Records tab defines Daily/Hourly Record Parameters of a meter. See the
following table for parameter descriptions.

Parameter Description
Start Date Start date of the Quantity Transaction Record (QTR).
Start Time Start time of the QTR.
End Date End date of the QTR.
End Time End time of the QTR.
Pulse Start Pulse value at the start of the QTR.
Pulse End Pulse value at the end of the QTR.
Meter K- Meter K factor converts pulse from flow meter into volume. The value should

69
Chapter 5 - Configuring liquid meter runs

Parameter Description
Factor be in pulses/m3 or pulses/ft3. When the flow type is analog, this is the
correction factor to apply for volume calculation and the default value should
be 1.0.
CTL Flow weighted average temperature correction factor.
CPL Flow weighted average pressure correction factor.
Observed Flow weighted Average of Observed Density for the hour / day.
Density
Observed Flow weighted Average of Observed Temperature for the hour / day.
Temperature
Observed Flow weighted Average of Observed Pressure for the hour / day.
Pressure
Base Density Flow weighted Average of Base Density for the hour / day.
Temperature Flow weighted Average of Temperature for the hour / day.
Pressure Flow weighted Average of Pressure for the hour / day.
Gross Volume Gross Standard volume total for this hour/day.
SW Volume Sediments and Water volume total for this hour/day.
Mass Mass total for this hour/day.
Non Apply to Turbine, Positive Displacement, Ultrasonic and Station Totalizer
Resettable meters.
Gross Std Vol
Non-Resettable or Cumulative total for Gross Standard volume.
Non Only apply to Coriolis meter.
Resettable
Mass Non-Resettable or Cumulative total for Mass.

Status Status of the flow calculation for the current hour/day.


Batch ID Identifier for a Batch operation.
Maint Gross Non-resettable or cumulative total for Gross Standard volume/mass in
Std Vol or Maintenance mode. For a Coriolis meter, this parameter represents mass,
Maint Mass and for other meter types, it represents volume.
Analog Only apply to when flow type is selected as analog. This parameter provides
average value of analog input for daily/hourly QTR.

For station totalizer, the same description in the above table are applicable.

70
CHAPTER

6 EDITING A METER RUN

1. Select EFM meters from the Navigation pane. A list of meters appears
with the first meter selected.
2. Select the target meter you want to edit. The properties tabs enable you
to edit the configuration of the meter.
3. Click Save. It will take 3~5 minutes to save the configuration.

71
Chapter 6 - Editing a meter run

72
CHAPTER

7 CHANGING METER RUN TYPES

This section introduces how to change meter run types from Gas to Liquid
or vice versa in a project.
You must reinitialize memory resources for the required meter run in the
controller. Perform the following steps:

1. Obtain QTR data from ControlEdge 2020 controller via SCADA for the
meter run that needs to be deleted.
2. Delete the meter run from the project.
3. Compile the project, and download it to the controller.
4. Add and configure the required meter run with required type
(Gas/Liquid).
5. Compile the project, and download it to the controller.

NOTE: It is recommended not to change Input Unit and Contract Unit


when the function block is running.

73
Chapter 7 - Changing meter run types

74
CHAPTER

8 QUICKLY CONFIGURING METER


RUNS USING SAMPLE PROJECTS
Sample ControlEdge Builder projects are provided which can be used to
quickly configure meter runs. They are stored in
"C:\ProgramData\Honeywell\ControlEdge Builder\SampleProjects\EFM".
To use sample projects:

1. Navigate to "C:\ProgramData\Honeywell\ControlEdge
Builder\SampleProjects\EFM", copy a sample project to a folder.

2. Open the sample project in ControlEdge Builder.


3. Videos describing how to use the sample projects are available in
"Videos" folder of ControlEdge Builder Media Kit.

75
Chapter 8 - Quickly configuring meter runs using sample projects

76
CHAPTER

9 CONFIGURING FUNCTION BLOCKS

The following IEC61131–3 libraries are provided with ControlEdge Builder.


For more information about how to use libraries in ControlEdge Builder
projects, see the embedded online help.

Configurable Function Blocks


Library Name Short Description
AGALib and Calculates Gas Super compressibility, Density and Compressibility at
AGALib_V2 and standard and flowing conditions using heating value/ without heating
AGALib_V3 value/ all 21 gas elements; calculates Gas energy using gas heating
value/ all 21 gas elements; calculates corrected flow rates for Orifice
meter; calculates corrected flow rates for Turbine meter; calculates
corrected flow rates for Ultrasonic meter; calculates corrected flow
rate for Coriolis meter.
API 11.1 Lib API 11.1 calculates for Crude Oil, Lubricating Oil, Refined Products,
Special Products with Alternate conditions and or Observed
conditions in both US units and Metric Units.
apingl lib The basic function of API NGL block when set for line to base
operation is to calculate standard density and associated volume
correction factor from an observed density, temperature and pressure
with an option to either calculate a vapor pressure or use an operator
entered value. The basic function of API NGL block when set for base
to line operation is to calculate meter density and associated volume
correction factor from an observed density, temperature and pressure
with an option to either calculate a vapor pressure or use an operator
entered value.
ISO5167DualLib ISO 5167 is an international standard covering the measurement of
fluid flow by means of pressure differential devices such as orifice
plates and venturis. When some parameters are known, ISO 5167
allows other variables to be calculated. The most common usage is to
calculate mass flow rate from differential pressure, static pressure
and density. ISO 5167 is widely used in most areas of the world
except North America. The basic function of the ISO 5167 block is to
calculate mass flow rate from primary element DP and other required
inputs.

77
Chapter 9 - Configuring Function Blocks

Library Name Short Description


ISO5167DualJTLib ISO 5167JT is an international standard covering the measurement of
fluid flow by means of pressure differential devices such as orifice
plates and venturis. When some parameters are known, ISO 5167
allows other variables to be calculated. The most common usage is to
calculate mass flow rate from differential pressure, static pressure
and density. ISO 5167 is widely used in most areas of the world
except North America. The basic function of the ISO 5167 block is to
calculate mass flow rate from primary element DP and other required
inputs.
ISO6976lib ISO 6976 block calculates for Calorific value on a molar, mass and
volumetric basis; Calorific value on a superior and inferior basis;
Calculation of values on an ideal and a real basis; Standard density
and compressibility at the 15 deg C and 1.01325 bara conditions
regardless of the chosen combustion/ metering.

78
Chapter 9 - Configuring Function Blocks

AGA/API standard library version supported:

Library Specification
Metering Gas
Calculation Library
AGA 3 (1992) Orifice Meter
AGA 3 (2012) Orifice Meter
AGA 5 (2009) Volume to Energy Calculation
AGA 7 (1996) Turbine Meter
AGA 8 (1994) Gas Compressibility
AGA 8 (2017) Gas Compressibility
AGA 9 (1996) Ultrasonic Meter
AGA 11 (2013) Coriolis Meter
ISO 6976 (1995) Natural gas: calorific value density, relative
density and Wobbe Index
Liquid

API 11.1 (2004) Volume Correction Factor


API 11.2.2/M Compressibility Factors
(1986)
API 11.2.4 (2007) Temperature Correction
API 11.2.5 (2007) Correction Factor for pressure
Gas & Liquid

ISO 5167 (1991, Pressure differential devices such as orifice


1997, 2003) plates and Venturis
AGA 3 (2012) Orifice Meter

79
Chapter 9 - Configuring Function Blocks

AGA
The following libraries of AGA Function Blocks are supported:

Library Description
AGALib Basic version of AGA function block library. It supports AGA 3 (1992), AGA5
(1996), AGA8 (1994), AGA 7(1996), AGA 11 (2013) and AGA 9 (1996)

Do not support clarity between Super-compressibility factor at base condition


and standard conditions.
AGALib_ It is supported from R151 release.
V2
Added clarity between Super-compressibility factor at base condition and
standard conditions.
AGALib_ It is supported from R161.2 release.
V3
This upgrade supports AGA3(2012), AGA8(2017) including GERG method and
AGA5 (2009) and AGA3 orifice method (2013) supporting Liquid measurement.

Function block with structure input is not supported and will not be available in
this library.

NOTE: When the outcode for any of the function block in AGALib_V3 is
error, other corresponding output parameters from the same function
block are invalid. Hence caution must be taken in project engineering
when processing of the output parameters in conjunction with the
outcode.

The following AGA function blocks are available:

Function Block Apply to Description


AGA8_ AGALib, AGALib_V2 They calculate:
GrossMethod1 and AGALib_V3
l Gas Compressibility at base, standard
and flowing conditions (temp & pressure)

AGA8_ AGALib and AGALib_


l Density of gas at base, standard and
GrossMethod1_st V2 flowing conditions (temp & pressure)

l Gas Super-compressibility at standard


temp & pressure
AGA8_ AGALib, AGALib_V2 They calculate:
GrossMethod2 and AGALib_V3
l Gas Compressibility at base, standard

80
Chapter 9 - Configuring Function Blocks

Function Block Apply to Description

and flowing conditions (temp & pressure)

l Density of gas at base, standard and


AGA8_ AGALib and AGALib_ flowing conditions (temp & pressure)
GrossMethod2_st V2
l Gas Super-compressibility at standard
temp & pressure
AGA8_DetailMethod AGALib, AGALib_V2 They calculate:
and AGALib_V3
l Gas Compressibility at base, standard
and flowing conditions (temp & pressure)

AGA8_ AGALib and AGALib_


l Density of gas at base, standard and
DetailMethod_st V2 flowing conditions (temp & pressure)

l Gas Super-compressibility at standard


temp & pressure
AGA8_GERGMethod AGALib_V3 This function block is based on AGA 8
(2017) upgrade and available only from
R161.2 release.

It calculates Gas Compressibility, Density


and Gas Super-compressibility at base,
standard and flowing condition that is
flowing temperature and pressure based on
the input parameters defined below. Apart
from this, it also calculating speed of sound
in gas that can be used in health monitoring
of Ultrasonic meters. It is used when all 21
gas composition elements are available to
get more accurate densities.
AGA3_Orifice AGALib, AGALib_V2 They calculate the volumetric flow rate for
and AGALib_V3 an orifice meter using either flange or pipe
tap.
AGA3_Orifice_st AGALib and AGALib_
V2
AGA3_Orifice_LIQ AGALib_V3 This standard is based on AGA 3 (2012)
update and this block is available from
R161.2 release.

81
Chapter 9 - Configuring Function Blocks

Function Block Apply to Description


It calculates the volumetric flow-rate of
Liquid for an orifice meter using flange or
pipe tap based on the input parameters
defined below. It is used along with any one
of the API 11.1 function blocks since it
requires densities @flowing, standard and
base conditions.
AGA7_Turbine & AGALib, AGALib_V2 l AGA7_Turbine and AGA_Turbine_st
AGA9_Ultrasonic and AGALib_V3 correct measured volume at flowing
conditions read by turbine to volume at
base conditions
AGA7_Turbine_st & AGALib and AGALib_ l AGA9_Ultrasonic and AGA9_
AGA9_Ultrasonic_st V2 Ultrasonic_st correct measured volume
at flowing conditions read by ultrasonic
to volume at base conditions
AGA11_Coriolis AGALib, AGALib_V2 AGA11_Coriolis converts gas mass to
and AGALib_V3 volume. Gas mass is directly measured
from Coriolis Meter.
AGA5_HV_ AGALib, AGALib_V2 AGA5_HV_CONSTANT calculates the gas
CONSTANT and AGALib_V3 flow energy.
AGA5_DETAIL AGALib, AGALib_V2 They calculate the gas flow energy and
and AGALib_V3 Heating value.
AGA5_DETAIL_st AGALib and AGALib_
V2

AGA8_GrossMethod1

Description
AGA8_GrossMethod1 and AGA8_GrossMethod1_st calculate Gas
Compressibility, Density and Gas Super-compressibility at base, standard
and flowing condition that is flowing temperature and pressure based on the
input parameters defined below.

82
Chapter 9 - Configuring Function Blocks

n AGA8_GrossMethod1

n AGA8_GrossMethod1_st (This function block is with input parameters


in the form of structures to make function block organized and
compact.)

TIP: AGA8_GrossMethod1 expects the input parameters either to


be in US unit system or Metric unit system.

Input
Data
Input Parameter Description
types
UnitSystem INT {1} for US unit system and {2} for Metric unit

83
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
system
GasCompFormat INT Gas Composition Format:

l {1} for Mole Fraction


l {2} for Percentage

NOTE: It is recommended to use 2


percentage as a default option.

GasHeatingValue LREAL It's US unit is BTU/FT^3 and Metric unit is


MJ/M^3.
GasRelDensity LREAL It is unitless number.
CO2_Fraction LREAL It can be in Mole Fraction or Percentage.
Hydrogen_Fraction LREAL It can be in Mole Fraction or Percentage.
CO_Fraction LREAL It can be in Mole Fraction or Percentage.
FlowingTemp LREAL It is in FAHRENHEIT for US unit and Celcius
for Metric unit.
FlowingPressure LREAL It is in PSIA for US unit and Kpa for Metric
unit.
DifferentialPressure LREAL It is in INH2O for US unit and in Kpa for Metric
unit.

It is used to adjust flowing pressure when the


tap location is DOWNSTREAM.
AtmosphericPressure LREAL It is in PSIA for US unit and Kpa for Metric
unit.

Atmospheric pressure is used to make


Flowing Pressure absolute when flowing
pressure is measured by a pressure gauge. If
flowing pressure is already absolute then it
can be left zero.
BaseTemp LREAL It is in FAHRENHEIT for US unit and Celcius
for Metric unit. The recommended default is
60 ° Fahrenheit.

84
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
BasePressure LREAL It is in PSIA for US unit and Kpa for Metric
unit.

The recommended default is 14.73 PSIA.


RefTempForRelDensity LREAL It is in FAHRENHEIT for US unit and Celcius
for Metric unit. The recommended default is
60 ° Fahrenheit for reference temperature.
RefPressureForRelDensity LREAL It is in PSIA for US unit and Kpa for Metric
unit.

The recommended default is 14.73 PSIA for


reference pressure.
RefTempForCalorimeterDensity LREAL It is the reference temperature for Calorimeter
Density. It is in FAHRENHEIT for US unit and
Celcius for Metric unit. Recommended default
value is 60 ° Fahrenheit.
RefPressForCalorimeterDensity LREAL It is the reference pressure for Calorimeter
Density. It is in PSIA for US unit and Kpa for
Metric unit.

Recommended default value is 14.73 PSIA.


RefTempForCombustion LREAL It is reference temperature for combustion. It
is in FAHRENHEIT for US unit and Celcius for
Metric unit. Recommended default value is 60
° Fahrenheit.
TapsLocation INT It is unitless number. 1 is for UPSTREAM
location and 2 is for DOWNSTREAM location.

Output
Data
Output Parameter Description
types
GasDensityAtFlowCond LREAL It is Gas Density at flowing temperature and
pressure. It will be in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System). It is an input to AGA3
Function Block.
GasDensityAtBaseCond LREAL It is Gas Density at base temperature and pressure.

85
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description
types
It will be in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System).

It is an input to AGA3 Function Block.


GasDensityAtStdCond LREAL It is Gas Density at standard temperature and
pressure. It will be in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System). It is an input to AGA3
Function Block.
GasSuperComp LREAL It is gas super-compressibility factor. It is an input
to AGA3 Function Block. It is unitless. The output is
applicable only for AGALib.
GasSuperCompStdCond LREAL It is gas super-compressiblity factor at standard
conditions. It is an input to AGA 7/9 function block
and it is unitless. The output is applicable only for
AGALib_V2 and AGALib_V3.
GasSuperCompBaseCond LREAL It is gas super-compressiblity factor at standard
conditions. It is an input to AGA 3 function block
and it is unitless. The output is applicable only for
AGALib_V2 and AGALib_V3.
GasRelDenAtStdCond LREAL It is Gas Relative Density at standard temperature
and pressure. It is an input to AGA3 Function
Block. It is unitless.
Zb LREAL It is gas compressibility factor at base condition.
Zf LREAL It is gas compressibility factor at flowing condition.
Out_Code INT This out parameter returns success or fail code.

TIP: The output parameters must be in the same unit as of inputs.

For AGA8_GrossMethod1_st function block input structure is user defined


data type. This is defined in Aga_Data Types under Data Types in IEC
Programming Workspace.

Input Parameter Data types


GrossMtd1_Inputs_Struct AGA8_GrossMtd1_Inputs_STRUCT

86
Chapter 9 - Configuring Function Blocks

Following is the table that describes different out code for both AGA8_
GrossMethod1 and AGA8_GrossMethod2 function blocks:

Out
Description Apply to
Code
0 SUCCESS All
5 ERROR: THE ROOT WAS NOT BOUNDED IN DGROSS All
6 ERROR: NO CONVERGENCE IN DGROSS All
7 ERROR: VIRGS SQURE ROOT NEGATIVE All
8 ERROR: COMBINED VALUES OF GRGR, X[2] AND HV All
NOT CONSISTENT
9 ERROR: INVALID TERM IN VIRGS All
11 ERROR: METHOD WAS NOT 1 OR 2 All
12 ERROR: FLOWING PRESSURE (PF) <= 0.0 OR > 1740.0 All
PSIA
13 ERROR: FLOWING TEMPERATURE (TF) < 14.0 OR > All
149.0 DEG F
14 ERROR: HEATING VALUE (HV) < 477.0 OR > 1211.0 AGA8_
BTU/FT^3 GrossMethod1

AGA8_
GrossMethod1_V2

AGA8_
GrossMethod1_V3

87
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
15 ERROR: GAS RELATIVE DENSITY (GRGR) < 0.55 OR > All
0.870
16 ERROR: MOLE FRACTION FOR N2 < 0.0 OR > 0.50 All
OR FOR CO2 < 0.0 OR > 0.30
OR FOR H2 < 0.0 OR > 0.10
OR FOR CO < 0.0 OR > 0.03
17 ERROR: REFERENCE TEMPERATURE < 32.0 OR > 77.0 All
DEG F
18 ERROR: REFERENCE PRESSURE < 13.0 OR > 16.0 PSIA All
22 WARNING: FLOWING PRESSURE (PF) <= 0.0 OR > AGA8_
1200.0 PSIA GrossMethod1&2

AGA8_
GrossMethod1&2_
V2
23 WARNING: FLOWING TEMPERATURE (TF) < 32.0 OR > AGA8_
130.0 DEG F GrossMethod1&2

AGA8_
GrossMethod1&2_
V2
24 WARNING: HEATING VALUE (HV) < 805.0 OR > 1208.0 AGA8_
BTU/FT^3 GrossMethod1

AGA8_
GrossMethod1_V2
25 WARNING: GAS RELATIVE DENSITY (GRGR) < 0.55 OR AGA8_
> 0.800 GrossMethod1&2

AGA8_
GrossMethod1&2_
V2
26 WARNING: MOLE FRACTION FOR N2 < 0.0 OR > 0.20 AGA8_
OR FOR CO2 < 0.0 OR > 0.20 GrossMethod1&2
OR FOR H2 < 0.0 OR > 0.0
OR FOR CO < 0.0 OR >0.0 AGA8_
GrossMethod1&2_
V2

88
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
81 WARNING: FLOWING PRESSURE (PF) > 1500.0 PSIA AGA8_
AGA8 2017 RANGE 1 GrossMethod1&2_
V3
82 WARNING: FLOWING TEMPERATURE (TF) < 17.01 OR > AGA8_
143.0 DEG F AGA8 2017 RANGE 2 OR (TF) < 25.0 OR > GrossMethod1&2_
143.0 DEG F AGA8 2017 RANGE 1 V3
83 WARNING: HEATING VALUE (HV) < 665.0 OR > 1100.0 AGA8_
BTU/FT^3 AGA8 2017 RANGE 2 OR (HV) < 930.0 OR > GrossMethod1_V3
1040.0 BTU/FT^3 AGA8 2017 RANGE 1
84 WARNING: GAS RELATIVE DENSITY (GRGR) < 0.554 OR AGA8_
> 0.801 AGA8 2017 RANGE 2 OR (GRGR) < 0.554 OR > GrossMethod1&2_
0.630 AGA8 RANGE 1 V3
85 WARNING: MOLE FRACTION FOR N2 > 0.20 AGA8 2017 AGA8_
RANGE 2 OR N2 > 0.07 AGA8 2017 RANGE 1 GrossMethod1&2_
V3
OR FOR CO2 > 0.25 AGA8 2017 RANGE 2 OR CO2 > 0.03
AGA8 2017 RANGE 1

OR FOR H2 < 0.0 OR > 0.0 AGA8 2017 RANGE 1 AND 2

OR FOR CO < 0.0 OR > 0.0 AGA8 2017 RANGE 1 AND 2

AGA8_GrossMethod2

Description
This AGA8_GrossMethod2 function block calculates Gas Compressibility,
Density and Gas Super-compressibility at base, standard and flowing
condition that is flowing temperature and pressure based on the input
parameters defined below. It takes Nitrogen fraction as input but does not
take gas heating value. This description is applicable to following function
blocks

89
Chapter 9 - Configuring Function Blocks

n AGA8_GrossMethod2

n AGA8_GrossMethod2_st (This function block is having input


parameters in the form of structures to make function block organized
and compact)

This function block has input parameters in the form of structures to make
the function block organized and compact.

Input
Data
Input Parameter Description
types
UnitSystem INT {1} for US unit system and {2} for Metric unit system
GasCompFormat INT Gas Composition Format - {1} for Mole Fraction
and {2} for Percentage

90
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types

NOTE: It is recommended to use 2


percentage as a default option.

GasRelDensity LREAL It is unit less number


N2_Fraction LREAL It can be in Mole Fraction or Percentage
CO2_Fraction LREAL It can be in Mole Fraction or Percentage
Hydrogen_Fraction LREAL It can be in Mole Fraction or Percentage
CO_Fraction LREAL It can be in Mole Fraction or Percentage
FlowingTemp LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit.
FlowingPressure LREAL It is in PSIA for US unit and Kpa for Metric unit.
DifferentialPressure LREAL It is in INH2O for US unit and in Kpa for Metric unit.

It is used to adjust flowing pressure when the tap


location is DOWNSTREAM.
AtmosphericPressure LREAL It is in PSIA for US unit and Kpa for Metric unit.

Atmospheric pressure is used to make Flowing


Pressure absolute when flowing pressure is
measured by a pressure gauge. If flowing pressure
is already absolute then it can be left zero.
BaseTemp LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit. The recommended default is 60 Deg F.
BasePressure LREAL It is in PSIA for US unit and Kpa for Metric unit.

The recommended default is 14.73 PSIA


RefTempForRelDensity LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit. The recommended default is 60 Deg F
for reference temperature.
RefPressureForRelDensity LREAL It is in PSIA for US unit and Kpa for Metric unit.

The recommended default is 14.73 PSIA for


reference pressure.
TapsLocation INT It is unit less number. It is 1 for UPSTREAM

91
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
location and 2 for DOWNSTREAM location

Ouput
Data
Output Parameter Description
types
GasDensityAtFlowCond LREAL It is Gas Density at flowing temperature and
pressure. It will be in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System).It is an input to AGA3
Function Block
GasDensityAtBaseCond LREAL It is Gas Density at base temperature and pressure.
It will be in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System).

It is an input to AGA3 Function Block


GasDensityAtStdCond LREAL It is Gas Density at standard temperature and
pressure. It will be in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System). It is an input to AGA3
Function Block
GasSuperComp LREAL It is gas super compressibility factor. It is an input to
AGA3 Function Block. It is unit less. The output is
applicable only for AGALib.
GasRelDenAtStdCond LREAL It is Gas Relative Density at standard temperature
and pressure. It is an input to AGA3 Function
Block. It is unit less.
GasSuperCompStdCond LREAL It is gas supercompressiblity factor at standard
conditions. It is an input to AGA 7/9 function block
and it is unitless. The output is applicable only for
AGALib_V2 and AGALib_V3.
GasSuperCompBaseCond LREAL It is gas supercompressiblity factor at standard
conditions. It is an input to AGA 3 function block
and it is unitless. The output is applicable only for
AGALib_V2 and AGALib_V3.
Zb LREAL It is gas compressibility factor at base condition.
Zf LREAL It is gas compressibility factor at flowing condition.
Out_Code INT This out parameter returns success or fail code.

92
Chapter 9 - Configuring Function Blocks

TIP: AGA8_GrossMethod2 expects the input parameters to be in


either US unit system or Metric unit system. The output parameters
would be in the same unit as of inputs.

For AGA8_GrossMethod2_st function block input structure is user defined


data type. This is defined in Aga_Data Types under Data Types in IEC
Programming Workspace.

Input Parameter Data types


GrossMtd2_Inputs_Struct AGA8_GrossMtd2_Inputs_STRUCT

Following is the table that describes different out code for both AGA8_
GrossMethod1 and AGA8_GrossMethod2 function blocks:

Out
Description Apply to
Code
0 SUCCESS All
5 ERROR: THE ROOT WAS NOT BOUNDED IN DGROSS All
6 ERROR: NO CONVERGENCE IN DGROSS All
7 ERROR: VIRGS SQURE ROOT NEGATIVE All
8 ERROR: COMBINED VALUES OF GRGR, X[2] AND HV All
NOT CONSISTENT

93
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
9 ERROR: INVALID TERM IN VIRGS All
11 ERROR: METHOD WAS NOT 1 OR 2 All
12 ERROR: FLOWING PRESSURE (PF) <= 0.0 OR > 1740.0 All
PSIA
13 ERROR: FLOWING TEMPERATURE (TF) < 14.0 OR > All
149.0 DEG F
14 ERROR: HEATING VALUE (HV) < 477.0 OR > 1211.0 AGA8_
BTU/FT^3 GrossMethod1

AGA8_
GrossMethod1_V2

AGA8_
GrossMethod1_V3
15 ERROR: GAS RELATIVE DENSITY (GRGR) < 0.55 OR > All
0.870
16 ERROR: MOLE FRACTION FOR N2 < 0.0 OR > 0.50 All
OR FOR CO2 < 0.0 OR > 0.30
OR FOR H2 < 0.0 OR > 0.10
OR FOR CO < 0.0 OR > 0.03
17 ERROR: REFERENCE TEMPERATURE < 32.0 OR > 77.0 All
DEG F
18 ERROR: REFERENCE PRESSURE < 13.0 OR > 16.0 PSIA All
22 WARNING: FLOWING PRESSURE (PF) <= 0.0 OR > AGA8_
1200.0 PSIA GrossMethod1&2

AGA8_
GrossMethod1&2_
V2
23 WARNING: FLOWING TEMPERATURE (TF) < 32.0 OR > AGA8_
130.0 DEG F GrossMethod1&2

AGA8_
GrossMethod1&2_
V2
24 WARNING: HEATING VALUE (HV) < 805.0 OR > 1208.0 AGA8_
BTU/FT^3 GrossMethod1

94
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
AGA8_
GrossMethod1_V2
25 WARNING: GAS RELATIVE DENSITY (GRGR) < 0.55 OR AGA8_
> 0.800 GrossMethod1&2

AGA8_
GrossMethod1&2_
V2
26 WARNING: MOLE FRACTION FOR N2 < 0.0 OR > 0.20 AGA8_
OR FOR CO2 < 0.0 OR > 0.20 GrossMethod1&2
OR FOR H2 < 0.0 OR > 0.0
OR FOR CO < 0.0 OR >0.0 AGA8_
GrossMethod1&2_
V2
81 WARNING: FLOWING PRESSURE (PF) > 1500.0 PSIA AGA8_
AGA8 2017 RANGE 1 GrossMethod1&2_
V3
82 WARNING: FLOWING TEMPERATURE (TF) < 17.01 OR > AGA8_
143.0 DEG F AGA8 2017 RANGE 2 OR (TF) < 25.0 OR > GrossMethod1&2_
143.0 DEG F AGA8 2017 RANGE 1 V3
83 WARNING: HEATING VALUE (HV) < 665.0 OR > 1100.0 AGA8_
BTU/FT^3 AGA8 2017 RANGE 2 OR (HV) < 930.0 OR > GrossMethod1_V3
1040.0 BTU/FT^3 AGA8 2017 RANGE 1
84 WARNING: GAS RELATIVE DENSITY (GRGR) < 0.554 OR AGA8_
> 0.801 AGA8 2017 RANGE 2 OR (GRGR) < 0.554 OR > GrossMethod1&2_
0.630 AGA8 RANGE 1 V3
85 WARNING: MOLE FRACTION FOR N2 > 0.20 AGA8 2017 AGA8_
RANGE 2 OR N2 > 0.07 AGA8 2017 RANGE 1 GrossMethod1&2_
V3
OR FOR CO2 > 0.25 AGA8 2017 RANGE 2 OR CO2 > 0.03
AGA8 2017 RANGE 1

OR FOR H2 < 0.0 OR > 0.0 AGA8 2017 RANGE 1 AND 2

OR FOR CO < 0.0 OR > 0.0 AGA8 2017 RANGE 1 AND 2

95
Chapter 9 - Configuring Function Blocks

AGA8_DetailMethod

Description
This AGA8_DetailMethod function block calculates Gas Compressibility,
Density and Gas Super-compressibility at base, standard and flowing
condition that is flowing temperature and pressure based on the input
parameters defined below. It is used when all 21 gas composition elements
are available to get more accurate densities. This description is applicable
to following function blocks
n AGA8_DetailMethod

n AGA8_DetailMethod_st (This function block is having input parameters

96
Chapter 9 - Configuring Function Blocks

in the form of structures to make function block organized and compact)

Input
Data
Input Parameter Description
types
UnitSystem INT {1} for US unit system and {2} for Metric unit system
GasCompFormat INT Gas Composition Format: {1} for Mole Fraction and
{2} for Percentage

NOTE: It is recommended to use 2


percentage as a default option.

Methane LREAL It can be in Mole Fraction or Percentage


Nitrogen LREAL It can be in Mole Fraction or Percentage
CO2 LREAL It can be in Mole Fraction or Percentage
Ethane LREAL It can be in Mole Fraction or Percentage
Propane LREAL It can be in Mole Fraction or Percentage
Water LREAL It can be in Mole Fraction or Percentage
H2S LREAL It can be in Mole Fraction or Percentage
Hydrogen LREAL It can be in Mole Fraction or Percentage
CO LREAL It can be in Mole Fraction or Percentage
Oxygen LREAL It can be in Mole Fraction or Percentage
I_Butane LREAL It can be in Mole Fraction or Percentage

97
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
N_Butane LREAL It can be in Mole Fraction or Percentage
I_Pentane LREAL It can be in Mole Fraction or Percentage
N_Pentane LREAL It can be in Mole Fraction or Percentage
Hexane LREAL It can be in Mole Fraction or Percentage
Heptane LREAL It can be in Mole Fraction or Percentage
Octane LREAL It can be in Mole Fraction or Percentage
Nonane LREAL It can be in Mole Fraction or Percentage
Decane LREAL It can be in Mole Fraction or Percentage
Helium LREAL It can be in Mole Fraction or Percentage
Argon LREAL It can be in Mole Fraction or Percentage
FlowingTemp LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit.
FlowingPressure LREAL It is in PSIA for US unit and Kpa for Metric unit.
DifferentialPressure LREAL It is in INH2O for US unit and in Kpa for Metric unit.

It is used to adjust flowing pressure when the tap


location is DOWNSTREAM.
AtmosphericPressure LREAL It is in PSIA for US unit and Kpa for Metric unit.

Atmospheric pressure is used to make Flowing


Pressure absolute when flowing pressure is
measured by a pressure gauge. If flowing pressure
is already absolute then it can be left zero.
BaseTemp LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit. The recommended default is 60 Deg F.
BasePressure LREAL It is in PSIA for US unit and Kpa for Metric unit.

The recommended default is 14.73 PSIA


RefTempForRelDensity LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit. The recommended default is 60 Deg F
for reference temperature.
RefPressureForRelDensity LREAL It is in PSIA for US unit and Kpa for Metric unit.

98
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
The recommended default is 14.73 PSIA for
reference pressure.
TapsLocation INT It is unit less number. It is 1 for UPSTREAM
location and 2 for DOWNSTREAM location.

Ouput
Data
Output Parameter Description
types
GasDensityAtFlowCond LREAL It is Gas Density at flowing temperature and
pressure. It will be in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System).It is an input to AGA3
Function Block
GasDensityAtBaseCond LREAL It is Gas Density at base temperature and pressure.
It will be in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System).

It is an input to AGA3 Function Block


GasDensityAtStdCond LREAL It is Gas Density at standard temperature and
pressure. It will be in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System). It is an input to AGA3
Function Block
GasSuperComp LREAL It is gas super compressibility factor. It is an input to
AGA3 Function Block. It is unit less. The output is
applicable only for AGALib.
GasSuperCompStdCond LREAL It is gas supercompressiblity factor at standard
conditions. It is an input to AGA 7/9 function block
and it is unitless. The output is applicable only for
AGALib_V2 and AGALib_V3.
GasSuperCompBaseCond LREAL It is gas supercompressiblity factor at standard
conditions. It is an input to AGA 3 function block
and it is unitless. The output is applicable only for
AGALib_V2 and AGALib_V3.
GasRelDenAtStdCond LREAL It is Gas Relative Density at standard temperature
and pressure. It is an input to AGA3 Function
Block. It is unit less.

99
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description
types
Zb LREAL It is gas compressibility factor at base condition. It
is an input to AGA5_DETAIL function block.
Zf LREAL It is gas compressibility factor at flowing condition.
Out_Code INT This out parameter returns success or fail code.

TIP: AGA8_Detail Method expects the input parameters to be either


in US unit system or Metric unit system. It expects all the 21
elements of Gas composition coming out from Gas Analyzer or
Chromatograph/ Flow Computer. Gas parameter should be either in
mole fraction or in percentage.

The output parameters would be in the same unit as of inputs.


AGA8_DetailMethod_st function block input structures are user defined
data type. They are defined in Aga_Data Types under Data Types in IEC
Programming Workspace.

Input Parameter Data types


GasComponents_Struct DtlMtd_GasComps_STRUCT
FieldInputs_Struct AGA8_DtlMtd_FldInputs_STRUCT

100
Chapter 9 - Configuring Function Blocks

Following is the table that describes different out code for AGA8_
DetailMethod function blocks.

Out
Description Apply to
Code
0 SUCCESS All
1 ERROR: PRESSURE HAS A NEGATIVE DERIVATIVE All
DEFAULT GAS DENSITY USED
2 WARNING: DENSITY IN BRAKET EXCEEDS MAXIMUM All

101
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
DEFAULT PROCEEDURE USED
3 ERROR: MAXIMUM ITERATIONS EXCEEDED IN BRAKET All
DEFAULT DENSITY USED
4 ERROR: MAXIMUM ITERATIONS IN DDETAIL EXCEEDED All
LAST DENSITY USED
32 ERROR: FLOWING PRESSURE (PF) <= 0.0 OR > 40,000. PSIA All
33 ERROR: FLOWING TEMPERATURE (TF) < -200 OR > 760 DEG All
F
35 ERROR: ANY COMPONENT MOLE FRACTION < 0.0 OR > 1.0 AGA8_
DetailMethod_
V3
36 ERROR: MOLE FRACTION FOR METHANE < 0.0 OR > 1.0 AGA8_
FOR NITROGEN < 0.0 OR > 1.0 DetailMethod &
FOR CARBON DIOXIDE < 0.0 OR > 1.0 AGA8_
FOR ETHANE < 0.0 OR > 1.0 DetailMethod_
FOR PROPANE < 0.0 OR > 0.12 V2
FOR WATER < 0.0 OR > 0.10
FOR H2S < 0.0 OR > 1.0
FOR HYDROGEN < 0.0 OR > 1.0
FOR CARBON MONOXIDE < 0.0 OR > 0.03
FOR OXYGEN < 0.0 OR > 0.21
FOR BUTANES < 0.0 OR > 0.06
FOR PENTANES < 0.0 OR > 0.04
FOR HEXANES + < 0.0 OR > 0.10
FOR HELIUM < 0.0 OR > 0.03
FOR ARGON < 0.0 OR > 1.0
37 ERROR: REFERENCE TEMPERATURE < 32.0 OR > 77.0 DEG All
F
38 ERROR: REFERENCE PRESSURE < 13.0 OR > 16.0 PSIA All
39 ERROR: SUM OF MOLE FRACTIONS < 0.98 OR > 1.020 All
42 WARNING: FLOWING PRESSURE (PF) < 0.0 OR > 1750. PSIA All
43 WARNING: FLOWING TEMPERATURE (TF) < 17 OR > 143 All
DEG F
45 WARNING: ANY COMPONENT MOLE FRACTION OUTSIDE AGA8_
OF AGA REPORT NO. 8 RECOMMENDED RANGE DetailMethod_

102
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
V3
46 WARNING: MOLE FRACTION FOR METHANE < 0.45 OR > 1.0 AGA8_
FOR NITROGEN < 0.0 OR > 0.5 DetailMethod &
FOR CARBON DIOXIDE < 0.0 OR > 0.3 AGA8_
FOR ETHANE < 0.0 OR > 0.1 DetailMethod_
FOR PROPANE < 0.0 OR > 0.04 V2
FOR WATER < 0.0 OR >= 0.0005
FOR H2S < 0.0 OR > 0.0002
FOR HYDROGEN < 0.0 OR > 0.1
FOR CARBON MONOXIDE < 0.0 OR > 0.03
FOR OXYGEN < 0.0 OR > 0.0
FOR BUTANES < 0.0 OR > 0.01
FOR PENTANES < 0.0 OR >= 0.003
FOR HEXANES + < 0.0 OR >= 0.002
FOR HELIUM < 0.0 OR >= 0.002
FOR ARGON < 0.0 OR > 0.0
49 WARNING: SUM OF MOLE FRACTIONS < 0.9999 OR > 1.0001 All

AGA8_GERGMethod

Description
This AGA8_GERGMethod function block calculates Gas Compressibility,
Density and Gas Super-compressibility at base, standard and flowing
condition that is flowing temperature and pressure based on the input
parameters defined below. Apart from this, it also calculating speed of
sound in gas that can be used in health monitoring of Ultrasonic meters. It is
used when all 21 gas composition elements are available to get more
accurate densities. This description is applicable to following function
blocks. This function block is based on AGA 8 (2017) upgrade and available
only from R161.2 release.

103
Chapter 9 - Configuring Function Blocks

Figure 9-1: AGA8_GERGMethod function block

Input
Data
Input Parameter Description
types
UnitSystem INT {1} for US unit system and {2} for Metric unit system
GasCompFormat INT Gas Composition Format:

l {1} for Mole Fraction


l {2} for Percentage

104
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types

NOTE: It is recommended to use 2


percentage as a default option.

Methane LREAL It can be in Mole Fraction or Percentage


Nitrogen LREAL It can be in Mole Fraction or Percentage
CO2 LREAL It can be in Mole Fraction or Percentage
Ethane LREAL It can be in Mole Fraction or Percentage
Propane LREAL It can be in Mole Fraction or Percentage
Water LREAL It can be in Mole Fraction or Percentage
H2S LREAL It can be in Mole Fraction or Percentage
Hydrogen LREAL It can be in Mole Fraction or Percentage
CO LREAL It can be in Mole Fraction or Percentage
Oxygen LREAL It can be in Mole Fraction or Percentage
I_Butane LREAL It can be in Mole Fraction or Percentage
N_Butane LREAL It can be in Mole Fraction or Percentage
I_Pentane LREAL It can be in Mole Fraction or Percentage
N_Pentane LREAL It can be in Mole Fraction or Percentage
Hexane LREAL It can be in Mole Fraction or Percentage
Heptane LREAL It can be in Mole Fraction or Percentage
Octane LREAL It can be in Mole Fraction or Percentage
Nonane LREAL It can be in Mole Fraction or Percentage
Decane LREAL It can be in Mole Fraction or Percentage
Helium LREAL It can be in Mole Fraction or Percentage
Argon LREAL It can be in Mole Fraction or Percentage
FlowingTemp LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit.
FlowingPressure LREAL It is in PSIA for US unit and Kpa for Metric unit.

105
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
DifferentialPressure LREAL It is in INH2O for US unit and in Kpa for Metric unit.

It is used to adjust flowing pressure when the tap


location is DOWNSTREAM.
AtmosphericPressure LREAL It is in PSIA for US unit and Kpa for Metric unit.

Atmospheric pressure is used to make Flowing


Pressure absolute when flowing pressure is
measured by a pressure gauge. If flowing pressure
is already absolute then it can be left zero.
BaseTemp LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit. The recommended default is 60 °
Fahrenheit.
BasePressure LREAL It is in PSIA for US unit and Kpa for Metric unit.

The recommended default is 14.73 PSIA.


RefTempForRelDensity LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit. The recommended default is 60 °
Fahrenheit for reference temperature.
RefPressureForRelDensity LREAL It is in PSIA for US unit and Kpa for Metric unit.

The recommended default is 14.73 PSIA for


reference pressure.
TapsLocation INT It is unit less number. 1 is for UPSTREAM location
and 2 is for DOWNSTREAM location.

Output
Data
Output Parameter Description
types
GasDensityAtFlowCond LREAL It is Gas Density at flowing temperature and
pressure. It will be in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System). It is an input to AGA3
Function Block.
GasDensityAtBaseCond LREAL It is Gas Density at base temperature and pressure.
It will be in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System).

106
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description
types
It is an input to AGA3 Function Block.
GasDensityAtStdCond LREAL It is Gas Density at standard temperature and
pressure. It will be in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System). It is an input to AGA3
Function Block.
GasSuperCompStdCond LREAL It is gas super-compressiblity factor at standard
conditions. It is an input to AGA 7/9 function block
and it is unitless.
GasSuperCompBaseCond LREAL It is gas super-compressiblity factor at standard
conditions. It is an input to AGA 3 function block
and it is unitless.
GasRelDenAtStdCond LREAL It is Gas Relative Density at standard temperature
and pressure. It is an input to AGA3 Function
Block. It is unitless.
Zb LREAL It is gas compressibility factor at base condition.
Zf LREAL It is gas compressibility factor at flowing condition.
GERG2008Cp LREAL Heat Capacity at Constant Pressure (J/mol K).
GERG2008Cv LREAL Heat Capacity at Constant Volume (J/mol K).
GERG2008W LREAL Speed of sound in gas being measured. Unit -
ft/sec for US, meter/sec for Metric.
Out_Code INT This out parameter returns success or fail code.

Following are the error codes for AGA8_GERGMethod function block.

Out Code Description


0 NO WARNING OR ERROR
1 ERROR: PRESSURE HAS A NEGATIVE DERIVATIVE DEFAULT GAS
DENSITY USED
32 ERROR: FLOWING PRESSURE (PF) <= 0.0 OR > 40,000. PSIA
35 ERROR: ANY COMPONENT MOLE FRACTION < 0.0 OR > 1.0
86 WARNING: Flowing Pressure greater than 2017 AGA8 GERG-2008 Full
Quality Range (10,150 PSIA)
87 WARNING: Flowing Pressure greater than 2017 AGA8 GERG-2008 Range

107
Chapter 9 - Configuring Function Blocks

Out Code Description


(5075 PSIA)
88 WARNING: Flowing Temperature outside 2017 AGA8 GERG-2008 Full Quality
Range (-352 F < TF < 800 F)
89 WARNING: Flowing Temperature outside 2017 AGA8 GERG-2008 Range (-
298 F < TF < 350 F)
90 WARNING: A Component Mole % outside 2017 AGA8 GERG-2008
Intermediate Quality Range
91 WARNING: A Component Mole % outside 2017 AGA8 GERG-2008 Pipeline
Quality Range

AGA3_Orifice

Description
This AGA3_Orifice function block calculates the volumetric flow-rate for an
orifice meter using flange or pipe tap based on the input parameters defined
below. It is used along with any one of the AGA8 function blocks since it
requires densities @flowing, standard and base conditions as well as gas
super compressibility and gas relative density @ standard condition coming
out of AGA8 function block. This description is applicable to following
function blocks

108
Chapter 9 - Configuring Function Blocks

n AGA3_Orifice

n AGA3_Orifice_st (This function block is having input parameters in the


form of structures to make function block organized and compact)

109
Chapter 9 - Configuring Function Blocks

Input
Data
Input Parameter Description
types
UnitSystem INT {1} for US unit system and {2} for Metric unit system
FlowingTemp LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit.
FlowingPressure LREAL It is in PSIA for US unit and Kpa for Metric unit.
DifferentialPressure LREAL It is in INH2O for US unit and in Kpa for Metric unit.
GasDensityAtFlowCond LREAL It is Gas Density at flowing temperature and pressure.
It is in KG/M^3 for (Metric System) & LBM/FT^3 for
(US System). It is an output of AGA8.
GasDensityAtStdCond LREAL It is Gas Density at standard temperature and
pressure. It is in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System).It is an output of AGA8.
GasDensityAtBaseCond LREAL It is Gas Density at base temperature and pressure. It
is in KG/M^3 for (Metric System) & LBM/FT^3 for (US
System).It is an output of AGA8.
GasSuperComp LREAL It is unit less number. It is an output of AGA8
GasRelDenAtStdCond LREAL It is unit less number. It is an output of AGA8
TapsType INT FLANGE=1 and PIPE=2
OrificeMaterial INT STAINLESS STEEL=1, MONEL=2, CARBON
STEEL=3, STAINLESS_S_304=4 and STAINLESS_
S_316=5

110
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
PipeMaterial INT STAINLESS STEEL=1, MONEL=2, CARBON
STEEL=3, STAINLESS_S_304=4 and STAINLESS_
S_316=5
FluidType INT COMPRESSIBLE FLUID =1 and NON-
COMPRESSIBLE FLUID=2
TapsLocation INT UPSTREAM=1 and DOWNSTREAM=2
OrificeDiameter LREAL It is in inches for US unit system & in milimeter for
Metric unit system.
OrfDiaMsrdTemp LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit.
PipeDiameter LREAL It is in inches for US unit system & in milimeter for
Metric unit system.
PipeDiaMsrdTemp LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit.
AbsViscosity LREAL AGA3 Orifice method expects absolute viscosity in
CENTIPOISE unit only for both US & Metric unit
system.

ABSOLUTE VISCOSITY OF FLUID FLOWING.

(RECOMMENDED DEFAULT=0.010268 cP - PG 34
PART 4)
IsenExponent LREAL ISENTROPIC EXPONENT is unit less number.
(RECOMMENDED DEFAULT=1.3 - PG 34 PART 4)
CalibFactor LREAL It is unit less number. Default value is 1.0
AirCompFactAtStdCond LREAL It is unit less number. COMPRESSIBILITY FACTOR
OF AIR AT standard temperature and pressure. It is
used for Pipe tap only.
AtmosphericPressure LREAL It is in PSIA for US unit and Kpa for Metric unit.

If flowing pressure is already absolute, it can be left


zero.

111
Chapter 9 - Configuring Function Blocks

Output
Output Data
Description
Parameter types
Aga3_QV LREAL This is volume flow rate at standard (TS & PS) conditions. It is in
Scf/Hr for US unit system and in cubic meter per hour in Metric unit
system.
Aga3_QM LREAL This is mass flow rate. It is in Lbm/Hr for US unit system and Kg/Hr
for Metric unit system.
Aga3_QB LREAL This is volumetric flow rate at base (TB & PB) conditions. It is in
Scf/Hr for US unit system and in cubic meter per hour in Metric unit
system.
CD LREAL It is Orifice plate coefficient of discharge (flange).
Y LREAL It is Expansion factor (flange and pipe).
EV LREAL It is Velocity of approach factor (flange).
Out_Code INT This out parameter returns success or fail code.

n AGA3_Orifice expects the input parameters to be either in US unit


system or Metric unit system. Output parameters of the AGA8 function
blocks become input parameters for this function block.
n The output parameters would be in the same unit as of inputs.
For AGA3_Orifice_st function block input structures are user defined data
type. They are defined in Aga_Data Types under Data Types in IEC
Programming Workspace.

Input Parameter Data types


FieldInputs_Struct AGA3_Orifice_FldInputs_STRUCT
ConfigInputs_Struct AGA3_Config_Inputs_STRUCT

112
Chapter 9 - Configuring Function Blocks

Following is the table that describes different out code for AGA3_Orifice
function blocks.

Out
Description Apply to
Code
0 SUCCESS, NO WARNING OR ERROR All
51 ERROR: NTAPS WAS NOT 0, 1 OR 2 All
52 ERROR: FLOWING PRESSURE WAS <= 0.0 OR > 40000. PSIA All
53 ERROR: FLOWING TEMPERATURE < -200. OR > 760. DEG F All
54 ERROR: MATORF OR MATPIPE WAS NOT 0, 1, 2 OR 3 All
55 ERROR: ORIFICE DIAMETER WAS <= 0 OR => 100.0 INCHES All
56 ERROR: PIPE DIAMETER WAS <= 0 OR => 100.0 INCHES All
57 ERROR: FLOWING OR STANDARD DENSITY WAS <= 0.0 LBM/FT^3 All
58 ERROR: DIFFERENTIAL PRESSURE WAS <= 0.0 INCHES H2O All
59 ERROR: GAS VISCOSITY WAS <= 0.005 OR > 0.5 CENTIPOISES All
60 ERROR: ISENTROPIC EXPONENT <= 1.0 OR => 2.0 All

113
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
61 ERROR: IFLUID WAS NOT 0, 1 OR 2 All
62 ERROR: STANDARD TEMPERATURE WAS NOT = 60.0 DEG F All
63 ERROR: STANDARD PRESSURE WAS NOT = 14.73 PSIA All
64 ERROR: TAP LOCATION WAS NOT 0, 1 OR 2 FOR NTAPS=2 (PIPE) All
OR TAP LOCATION WAS NOT 1 FOR NTAPS=1 (FLANGE)
65 ERROR: SUPERCOMPRESSIBILITY FACTOR WAS <= 0.0 All
66 ERROR: RELATIVE DENSITY AT STANDARD CONDITIONS WAS < All
0.07 OR > 1.52
67 ERROR: CALIBRATION FACTOR WAS <= 0.0 All
68 ERROR: COMPRESSIBILITY FACTOR AT STANDARD CONDITIONS All
<= 0.0
69 ERROR: BETA RATIO (DO/DM) <= 0.0 OR => 1.0 All
70 ERROR: IF NTAPS = 1, GOF2015_OPTION NOT = 1 OR = 0 AGA3_
Orifice_
V3
71 ERROR: IF NTAPS = 2, GOF2015_OPTION NOT = 0 AGA3_
Orifice_
V3
72 ERROR: DIFFERENTIAL PRESSURE WAS GREATER THAN AGA3_
UPSTREAM STATIC PRESSURE Orifice_
V3
75 WARNING: ORIFICE DIAMETER WAS <= 0.45 INCHES All
76 WARNING: PIPE DIAMETER WAS <= 2.0 INCHES All
79 WARNING: BETA RATIO (DO/DM) WAS <= 0.1 OR >= 0.75 All
80 WARNING: IF GOF2015_OPTION = 1, (HW)/(27.7072*(PF)) = OR > AGA3_
0.25; Orifice_
V3
IF GOF2015_OPTION = 0, (HW)/(27.707*(PF)) > 0.2

114
Chapter 9 - Configuring Function Blocks

AGA3_Orifice_LIQ

Description
This AGA3_Liquid Orifice function block calculates the volumetric flow-rate
of Liquid for an orifice meter using flange or pipe tap based on the input
parameters defined below. It is used along with any one of the API 11.1
function blocks since it requires densities @flowing, standard and base
conditions. This standard is based on AGA 3 (2012) update and this block is
available from R161.2 release.

Figure 9-2: AGA3_Orifice_LIQ function block

115
Chapter 9 - Configuring Function Blocks

Input
Data
Input Parameter Description
types
UnitSystem INT {1} for US unit system and {2} for Metric unit system
FlowingTemp LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit.
FlowingPressure LREAL It is in PSIA for US unit and Kpa for Metric unit.
DifferentialPressure LREAL It is in INH2O for US unit and in Kpa for Metric unit.
GasDensityAtFlowCond LREAL It is Gas Density at flowing temperature and pressure.
It is in KG/M^3 for (Metric System) & LBM/FT^3 for
(US System). It is an output of AGA8.
GasDensityAtStdCond LREAL It is Gas Density at standard temperature and
pressure. It is in KG/M^3 for (Metric System) &
LBM/FT^3 for (US System).It is an output of AGA8.
GasDensityAtBaseCond LREAL It is Gas Density at base temperature and pressure. It
is in KG/M^3 for (Metric System) & LBM/FT^3 for (US
System).It is an output of AGA8.
GasSuperComp LREAL It is unit less number. It is an output of AGA8
GasRelDenAtStdCond LREAL It is unit less number. It is an output of AGA8
TapsType INT FLANGE=1 and PIPE=2
OrificeMaterial INT STAINLESS STEEL=1, MONEL=2, CARBON
STEEL=3, STAINLESS_S_304=4 and STAINLESS_
S_316=5
PipeMaterial INT STAINLESS STEEL=1, MONEL=2, CARBON
STEEL=3, STAINLESS_S_304=4 and STAINLESS_
S_316=5
FluidType INT COMPRESSIBLE FLUID =1 and NON-
COMPRESSIBLE FLUID=2
TapsLocation INT UPSTREAM=1 and DOWNSTREAM=2
OrificeDiameter LREAL It is in inches for US unit system & in milimeter for
Metric unit system.
OrfDiaMsrdTemp LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit.
PipeDiameter LREAL It is in inches for US unit system & in milimeter for

116
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
Metric unit system.
PipeDiaMsrdTemp LREAL It is in FAHRENHEIT for US unit and Celcius for
Metric unit.
AbsViscosity LREAL AGA3 Orifice method expects absolute viscosity in
CENTIPOISE unit only for both US & Metric unit
system.

ABSOLUTE VISCOSITY OF FLUID FLOWING.

(RECOMMENDED DEFAULT=0.010268 cP - PG 34
PART 4)
IsenExponent LREAL ISENTROPIC EXPONENT is unit less number.
(RECOMMENDED DEFAULT=1.3 - PG 34 PART 4)
CalibFactor LREAL It is unit less number. Default value is 1.0
AirCompFactAtStdCond LREAL It is unit less number. COMPRESSIBILITY FACTOR
OF AIR AT standard temperature and pressure. It is
used for Pipe tap only.
AtmosphericPressure LREAL It is in PSIA for US unit and Kpa for Metric unit.

If flowing pressure is already absolute, it can be left


zero.

Output
Output Data
Description
Parameter types
Aga3_QV LREAL This is volume flow rate at standard (TS & PS) conditions. It is in
Scf/Hr for US unit system and in cubic meter per hour in Metric unit
system.
Aga3_QM LREAL This is mass flow rate. It is in Lbm/Hr for US unit system and Kg/Hr
for Metric unit system.
Aga3_QB LREAL This is volumetric flow rate at base (TB & PB) conditions. It is in
Scf/Hr for US unit system and in cubic meter per hour in Metric unit
system.
CD LREAL It is Orifice plate coefficient of discharge (flange).

117
Chapter 9 - Configuring Function Blocks

Output Data
Description
Parameter types
Y LREAL It is Expansion factor (flange and pipe).
EV LREAL It is Velocity of approach factor (flange).
Out_Code INT This out parameter returns success or fail code.

n AGA3_Orifice_LIQ expects the input parameters to be either in US unit


system or Metric unit system. Output parameters from API 11.1 function
blocks become input parameters for this function block.
n The output parameters would be in the same unit as of inputs.
Following is the table that describes different out code for AGA3_Orifice_
LIQ function blocks.

Out
Description
Code
51 ERROR: NTAPS WAS NOT 0, 1 OR 2
52 ERROR: FLOWING PRESSURE WAS <= 0.0 OR > 40000. PSIA
53 ERROR: FLOWING TEMPERATURE < -200. OR > 760. DEG F
54 ERROR: MATORF OR MATPIPE WAS NOT 0, 1, 2 OR 3
55 ERROR: ORIFICE DIAMETER WAS <= 0 OR => 100.0 INCHES
56 ERROR: PIPE DIAMETER WAS <= 0 OR => 100.0 INCHES
57 ERROR: FLOWING OR STANDARD DENSITY WAS <= 0.0 LBM/FT^3
58 ERROR: DIFFERENTIAL PRESSURE WAS <= 0.0 INCHES H2O
60 ERROR: ISENTROPIC EXPONENT <= 1.0 OR => 2.0
61 ERROR: IFLUID WAS NOT 0, 1 OR 2
62 ERROR: STANDARD TEMPERATURE WAS NOT = 60.0 DEG F
63 ERROR: STANDARD PRESSURE WAS NOT = 14.73 PSIA
64 ERROR: TAP LOCATION WAS NOT 0, 1 OR 2 FOR NTAPS=2 (PIPE) OR TAP
LOCATION WAS NOT 1 FOR NTAPS=1 (FLANGE)
65 ERROR: SUPERCOMPRESSIBILITY FACTOR WAS <= 0.0
66 ERROR: RELATIVE DENSITY AT STANDARD CONDITIONS WAS < 0.07 OR >
1.52

118
Chapter 9 - Configuring Function Blocks

Out
Description
Code
67 ERROR: CALIBRATION FACTOR WAS <= 0.0
68 ERROR: COMPRESSIBILITY FACTOR AT STANDARD CONDITIONS <= 0.0
69 ERROR: BETA RATIO (DO/DM) <= 0.0 OR => 1.0
70 ERROR: IF NTAPS = 1, GOF2015_OPTION NOT = 1 OR = 0
71 ERROR: IF NTAPS = 2, GOF2015_OPTION NOT = 0
72 ERROR: DIFFERENTIAL PRESSURE WAS GREATER THAN UPSTREAM
STATIC PRESSURE
80 WARNING: IF GOF2015_OPTION = 1, (HW)/(27.7072*(PF)) = OR > 0.25;

IF GOF2015_OPTION = 0, (HW)/(27.707*(PF)) > 0.2

AGA7_Turbine and AGA9_Ultrasonic

Description
AGA7_Turbine or AGA9_Ultrasonic function block corrects measured
volume at flowing conditions read by either turbine or ultrasonic meter to
volume at base conditions; based on the input parameters defined below.
This description is applicable to following function blocks.
n AGA7_Turbine

119
Chapter 9 - Configuring Function Blocks

n AGA7_Turbine_st (This function block is having input parameters in the


form of structures to make function block organized and compact)

n AGA7_Turbine_V3

n AGA9_Ultrasonic

120
Chapter 9 - Configuring Function Blocks

n AGA9_Ultrasonic_st (This function block is having input parameters in


the form of structures to make function block organized and compact)

n AGA9_Ultrasonic_V3

121
Chapter 9 - Configuring Function Blocks

TIP: AGA7_Turbine and AGA9_Ultrasonic both take unit system as


one of their input parameters. The unit systems supported by these
function blocks are US and Metric. These two function blocks are
similar in all respect.

Input
Data
Input Parameter Description Apply to
types
UnitSystem INT {1} US unit system and {2} Metric unit All
system
FlowType INT {1} Pulse Accumulated or {2} Analog All
Flow Rate
FlowingTemp LREAL If the unit system is US then it should All
be in FAHRENHEIT and if the unit
system is Metric then it should be in
Celsius
FlowingPressure LREAL If the unit system is US then it should All
be in PSIA and if the unit system is
Metric then it should be in KPA.
AtmosphericPressure LREAL If the unit system is US then it should All
be in PSIA and if the unit system is
Metric then it should be in KAR

It is added in Flowing pressure to make

122
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
it absolute pressure. If flowing
pressure is already absolute then it can
be left zero.
GasDensityAtBaseCond LREAL Gas density @ base condition should All
be in LBM/FT^3 (for US Unit System).
For Metric unit system it should be in
KG/M^3.

It is an output parameter of
AGA8function block.
GasSuperComp LREAL It is unit less number. It is gas super All
compressibility calculated by AGA8
function block.

It is an output parameter of AGA8


function block.
HeatingValue LREAL For US unit system it should be in All
Btu/ft^3 and for Metric unit system it
should be in MJ/m^3.

Gas Heating value (usually from Gas


Chromatograph or simply set as a
constant). It is required when delta
energy AGA7_Qe or AGA9_Qe needs
to be determined as one of the outputs
by the Function Block else it can be
left/ set zero
PulseAccumCount_ LREAL For Pulse Accumulated flow type AGA7_
AnalogInput meter, it would be a high speed input Turbine &
pulse counter. And for Analog flow type AGA9_
meter, it would be an analog input Ultrasonic
value.
AGA7_
Turbine_V2
& AGA9_
Ultrasonic_
V2
AnalogInput LREAL Value of analog input if flow type is AGA7_
Analog. The value should be in lb^3/hr Turbine_V3

123
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
for US unit or m^3/hr for Metric unit. & AGA9_
Ultrasonic_
V3
Pulse UDINT Pulse counter value AGA7_
Turbine_V3
& AGA9_
Ultrasonic_
V3
MeterCalFactor LREAL This input parameter is a Meter All
Calibration factor which is a unit less
value.
BaseTemp LREAL If the unit system is US then it must be All
in Deg Fahrenheit. If the unit system is
Metric then it must be in Deg Celsius.

The recommended default is 60 Deg F.


BasePressure LREAL If the unit system is US then it must be All
in PSIA. If the unit system is Metric
then it must be in KPA.

The recommended default is 14.73


PSIA.

Output
Following table describes output parameters for AGA7_Turbine function
block.

Output Data
Description
Parameter types
AGA7_Qv LREAL This is uncorrected volume @ Flowing conditions TF and PF. It’s
US unit is SCF/HR and Metric unit is M^3 /HR
AGA7_Qb LREAL This is Corrected volume at base conditions using compressibility
from AGA8. It’s US unit is SCF/HR and Metric unit is M^3 /HR
AGA7_Qm LREAL This is mass using base density (RHOB) from AGA8. Its US unit is
LBM/HR and Metric unit is KG/HR.
AGA7_Qe LREAL This is energy flow using heating value. It’s US unit is BTU/Hr
(British thermal units) and Metric unit is GJ/hr (gigajoules per hour)

124
Chapter 9 - Configuring Function Blocks

Following table describes output parameters for AGA9_Ultrasonic function


block.

Output Data
Description
Parameter types
AGA9_Qv LREAL This is uncorrected volume @ Flowing conditions TF and PF. It’s
US unit is SCF/HR and Metric unit is M^3 /HR
AGA9_Qb LREAL This is Corrected volume at base conditions using compressibility
from AGA8. It’s US unit is SCF/HR and Metric unit is M^3 /HR
AGA9_Qm LREAL This is mass using base density (RHOB) from AGA8. Its US unit is
LBM/HR and Metric unit is KG/HR.
AGA9_Qe LREAL This is energy flow using heating value. Its US unit is BTU/hr (British
thermal units).

For AGA7_Turbine_st function block input structure is user defined data


type. This is defined in Task_Info under Data Types in IEC Programming
Workspace.

Input Parameter Data types


FieldInputs_Struct AGA7_9_Inputs_STRUCT

For AGA9_Ultrasonic_st function block input structure is user defined data


type. This is defined in Aga_Data Types under Data Types in the IEC
Programming Workspace.

Input Parameter Data types


FieldInputs_Struct AGA7_9_Inputs_STRUCT

125
Chapter 9 - Configuring Function Blocks

AGA11_Coriolis

Description
AGA11_Coriolis function block converts gas mass (absolute) to volume at
base condition; based on the input parameters defined below. This
description is applicable to following function block:
n AGA11_Coriolis

TIP: AGA11_Coriolis function block takes absolute gas mass


measured by Coriolis meter and gas density at base conditions
generally come out of AGA8 function block. If the gas mass is in US
unit then base density from AGA8 should be in US unit. If gas mass
is in Metric then base density should be in Metric unit system. Output
volume at base condition would be in same unit as of inputs. For US
unit output would be in SCF/Hr and for Metric it would be in M^3/Hr.

Input
Input Parameter Data types Description
Gas_Mass LREAL Gas mass should be in US unit or Metric
unit.

Gas Mass directly comes from Coriolis


Meter.
GasDensityAtBaseCond LREAL Gas density @ base condition should be
in LBM/FT^3 (for US Unit System). For
Metric unit system it should be in KG/M^3.

126
Chapter 9 - Configuring Function Blocks

Output
Output Data
Description
Parameter types
AGA11_Qb LREAL This is volume @ base conditions. It’s US unit is SCF/HR and
Metric unit is M^3 /HR

AGA5_HV_CONSTANT

Description
AGA5_HV_CONSTANT function block calculates gas flow energy when we
have gas heating value and volume at base condition. This function block
can be used when gas heating value is directly available.

Input
Data
Input Parameter Description
types
Unit System INT It is unit less number. For US unit it is 1 and for
Metric it is 2
Heating Value LREAL If using US {1} unit then heating value should
be in US unit. If using Metric {2} unit then its
value should be in Metric unit. Its US unit is
BTU/FT^3.

127
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
It's Metric unit is MJ/m^3
BaseTemp LREAL If the unit system is US then it must be in Deg
Fahrenheit. If the unit system is Metric then it
must be in Deg Celsius.

The recommended default is 60 Deg F


BasePressure LREAL If the unit system is US then it must be in
PSIA. If the unit system is Metric then it must
be in KPA.

The recommended default is 14.73 PSIA


RefTempForCalorimeterDensity LREAL It is the reference temperature for Calorimeter
Density; If the unit system is US then it must
be in Deg Fahrenheit. If the unit system is
Metric then it must be in Deg Celsius.

Recommended default value is 60.0 DEG F.


RefPressForCalorimeterDensity LREAL It is the reference pressure for Calorimeter
Density; If the unit system is US then it must
be in PSIA. If the unit system is Metric then it
must be in BAR.

Recommended default value is 14.73 PSIA.


Flow Rate @ Base Condition LREAL If using US {1} unit then Flow Rate value
should be in US unit. If using Metric {2} unit
then its value should be in Metric unit.

It's US unit is FT^3/Hr. It's Metric unit is


M^3/Hr.

Output

Output Data types


Description
Parameter
Aga5_hv LREAL This is gas flow energy at base condition. It’s US unit is
BTU/Hr.

128
Chapter 9 - Configuring Function Blocks

AGA5_DETAIL

Description
AGA5_DETAIL function block calculates gas flow energy when all 21 gas
elements are available. This description is applicable to following function
block:
n AGA5_DETAIL

n AGA5_DETAIL_st

129
Chapter 9 - Configuring Function Blocks

n AGA5_DETAIL_V3

This function block can be used to calculate gas energy flow or gas heating
value when all 21 gas composition elements are available.

Input
Data
Input Parameter Description Apply to
types
Unit System INT For US unit it is 1 and for Metric it is All
2
GasCompFormat INT Gas Composition Format - {1} for All
Mole Fraction and {2} for
Percentage

NOTE: It is recommended to
use 2 percentage as a
default option.

130
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
Methane LREAL It can be in Mole Fraction or All
Percentage
Nitrogen LREAL It can be in Mole Fraction or All
Percentage
CO2 LREAL It can be in Mole Fraction or All
Percentage
Ethane LREAL It can be in Mole Fraction or All
Percentage
Propane LREAL It can be in Mole Fraction or All
Percentage
Water LREAL It can be in Mole Fraction or All
Percentage
H2S LREAL It can be in Mole Fraction or All
Percentage
Hydrogen LREAL It can be in Mole Fraction or All
Percentage
CO LREAL It can be in Mole Fraction or All
Percentage
Oxygen LREAL It can be in Mole Fraction or All
Percentage
I_Butane LREAL It can be in Mole Fraction or All
Percentage
N_Butane LREAL It can be in Mole Fraction or All
Percentage
I_Pentane LREAL It can be in Mole Fraction or All
Percentage
N_Pentane LREAL It can be in Mole Fraction or All
Percentage
Hexane LREAL It can be in Mole Fraction or All
Percentage
Heptane LREAL It can be in Mole Fraction or All
Percentage

131
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
Octane LREAL It can be in Mole Fraction or All
Percentage
Nonane LREAL It can be in Mole Fraction or All
Percentage
Decane LREAL It can be in Mole Fraction or All
Percentage
Helium LREAL It can be in Mole Fraction or All
Percentage
Argon LREAL It can be in Mole Fraction or All
Percentage
BaseTemp LREAL If the unit system is US then it must All
be in Deg Fahrenheit. If the unit
system is Metric then it must be in
Deg Celsius.

The recommended default is 60


Deg F.
BasePressure LREAL If the unit system is US then it must All
be in PSIA. If the unit system is
Metric then it must be in KPA.

The recommended default is 14.73


PSIA.
GCF_AtBaseTempPressure LREAL It is unit less number. It is the output AGA5_
from AGA8 function block. Detail &
AGA5_
Detail_
V2
FlowRateAtBaseTempPressure LREAL If using US {1} unit then Flow Rate All
value should be in US unit. If using
Metric {2} unit then it's value should
be in Metric unit. It's US unit is
FT^3/Hr

It's Metric unit is M^3/Hr.

132
Chapter 9 - Configuring Function Blocks

Output
Data
Output Parameter Description Apply to
types
HeatingValue LREAL This is gas heating value in BTU/FT^3 AGA5_Detail &
for US unit. AGA5_Detail_V2
GrossHeatingValue LREAL This is gross heating value in AGA5_Detail_V3
BTU/FT^3 for US unit. MJ/M3 for
Metric.
NetHeatingValue LREAL This is net heating value in BTU/FT^3 AGA5_Detail_V3
for US unit. MJ/M3 for Metric.
Aga5_hv LREAL This is gas flow energy at base All
condition. It’s US unit is BTU/Hr.
Aga5_qd LREAL This is dry gas flow energy at base All
condition. It’s US unit is BTU/Hr.
Outcode INT This out parameter returns success or AGA5_Detail_V3
fail code.

For AGA5_DETAIL_st function block input structures are user defined data
type. They are defined in Aga_Data Types under Data Types in IEC
Programming Workspace.

Input Parameter Data types


GasComponents_Struct DtlMtd_GasComps_STRUCT
FieldInputs_Struct AGA5_DtlMtd_FldInputs_STRUCT

133
Chapter 9 - Configuring Function Blocks

Following are the error codes for AGA5_Detail_V3 function block:

Out
Description Apply to
Code
1 ERROR: A COMPONENT MOLE FRACTION < 0.0 OR > 1.0 AGA5_DETAIL_
V3
2 WARNING: SUM OF MOLE FRACTIONS < 0.9999 OR > AGA5_DETAIL_
1.0001 V3
3 WARNING: PRESSURE BASE (PB) <= 0.0 OR >= 16 PSIA AGA5_DETAIL_
V3
4 WARNING: TEMPERATURE BASE (TB) <= 32.0 OR >= 77.0 AGA5_DETAIL_
DEG F V3

API 11.1
The following API 11.1 function blocks are available:

Function Block Description


CRUDE_OIL_ALT_US Calculation for Crude Oil with Alternet conditions- US Units
REFINED_PRODUCTS_ Calculation for Refined Products with Alternet conditions- US
ALT_US Units

134
Chapter 9 - Configuring Function Blocks

Function Block Description


SPECIAL_PRODUCTS_ Calculation for Special Products with Alternet conditions- US
ALT_US Units
LUBRICATING_OIL_ALT_ Calculation for Lubricating Oil with Alternet conditions- US Units
US
CRUDE_OIL_OBS_US Calculation for Crude Oil with Observed conditions- US Units
REFINED_PRODUCTS_ Calculation for Refined Products with Observed conditions- US
OBS_US Units
SPECIAL_PRODUCTS_ Calculation for Special Products with Observed conditions- US
OBS_US Units
LUBRICATING_OIL_ Calculation for Lubricating Oil with Observed conditions- US
OBS_US Units
CRUDE_OIL_AO_US Calculation for Crude Oil with Alternet & Observed conditions-
US Units
REFINED_PRODUCTS_ Calculation for Refined Products with Alternet & Observed
AO_US conditions- US Units
SPECIAL_PRODUCTS_ Calculation for Special Products with Alternet & Observed
AO_US conditions- US Units
LUBRICATING_OIL_AO_ Calculation for Lubricating Oil with Alternet & Observed
US conditions- US Units
CRUDE_OIL_ALT_ME Calculation for Crude Oil with Alternet conditions- Metric Units
REFINED_PRODUCTS_ Calculation for Refined Products with Alternet conditions-
ALT_ME Metric Units
SPECIAL_PRODUCTS_ Calculation for Special Products with Alternet conditions- Metric
ALT_ME Units
LUBRICATING_OIL_ALT_ Calculation for Lubricating Oil with Alternet conditions- Metric
ME Units
CRUDE_OIL_OBS_ME Calculation for Crude Oil with Observed conditions- Metric
Units
REFINED_PRODUCTS_ Calculation for Refined Products with Observed conditions-
OBS_ME Metric Units
SPECIAL_PRODUCTS_ Calculation for Special Products with Observed conditions-
OBS_ME Metric Units

135
Chapter 9 - Configuring Function Blocks

Function Block Description


LUBRICATING_OIL_ Calculation for Lubricating Oil with Observed conditions- Metric
OBS_ME Units
CRUDE_OIL_AO_ME Calculation for Crude Oil with Alternet & Observed conditions-
Metric Units
REFINED_PRODUCTS_ Calculation for Refined Products with Alternet & Observed
AO_ME conditions-Metric Units
SPECIAL_PRODUCTS_ Calculation for Special Products with Alternet & Observed
AO_ME conditions-Metric Units
LUBRICATING_OIL_AO_ Calculation for Lubricating Oil with Alternet & Observed
ME conditions-Metric Units

Supported commodities
n Crude oil
n Refined products
n Special products
n Lubricating oil

Supported Unit systems


n US
n Metric

Supported calculations
n API TYPE1- US unit system
n API TYPE2- US unit system
n API TYPE3- US unit system
n API TYPE4- Metric unit system
n API TYPE5- Metric unit system
n API TYPE6- Metric unit system

136
Chapter 9 - Configuring Function Blocks

Output Error Codes


The following is table that describes different output error code generated
by API function blocks.

Parameter Description
0 No error, Calculations Successful
1 Error - Illegal arguments
2 Error - Memory allocation
3 Error - VCF out of range
4 Error - Non convergence
5 Error - Temperature out of range
6 Error - Density out of range
7 Error - Pressure out of range
8 Error - Alpha60 out of range
9 Error - Supercritical fluid
10 Error - No reference fluids
11 Error - No Solution

API TYPE1 Function Blocks

Description
These function blocks calculates the Volume Correction Factor (VCF) for
correcting from the density at the base conditions (60°F and 0 psig) to
alternate temperature and pressure conditions for crude-oil, refined
products, special products and lubricating oil.
These function blocks are specific to US unit system.
API TYPE1 Function Blocks include the following function blocks:

137
Chapter 9 - Configuring Function Blocks

n CRUDE_OIL_ALT_US

n REFINED_PRODUCTS_ALT_US

n SPECIAL_PRODUCTS_ALT_US

n LUBRICATING_OIL_ALT_US

These Function block expects the input values in the proper units (°F, psig,
and kg/m³). If they are not in the proper units then appropriate unit
conversion block should be used. The density values calculated by these
function block are in the units of kg/m³. If these units do not match the
original input units, then the output densities should be converted to that of
the original input value’s units appropriate unit conversion block.

138
Chapter 9 - Configuring Function Blocks

Input
Data
Input Parameter Description
types
AlternateTemperature LREAL Value of alternate temperature in °F
AlternatePressure LREAL Value of alternate Pressure in kpa
BaseDensity LREAL Value of base density (kg/m3). If input density
type is relative density or API Gravity then it
must be converted into Density(kg/m3) using
provided unit conversion blocks
VolumeatAlternetTempPressure LREAL No Conversion needed, Most of the time it is
optional input

Output
Data
Output Parameter Description
types
VCFTemerature LREAL Volume correction factor due to temperature
VCFPressure LREAL Volume correction factor due to pressure
ScaledCompressibilityFactor LREAL Scaled compressibility factor
CombineVCF LREAL Combined volume correction factor due to
temperature and pressure
AlternetDensity LREAL Density at alternate conditions
VolumeatBase LREAL Volume at base conditions
Out_Code INT This out parameter returns success or fail code.

API TYPE2 Function Blocks

Description
These function blocks calculates the density at the base conditions (60°F
and 0 psig) that is consistent with an observed density at its temperature
and pressure condition. It has the flexibility of accepting a pre-calculated
60°F thermal expansion factor as per the commodity type of the liquid that
is crude-oil, refined products, special products and lubricating oil. These
function blocks are specific to US unit system.

139
Chapter 9 - Configuring Function Blocks

This description is applicable to following function blocks:


n CRUDE_OIL_OBS_US

n REFINED_PRODUCTS_OBS_US

n SPECIAL_PRODUCTS_OBS_US

n LUBRICATING_OIL_OBS_US

140
Chapter 9 - Configuring Function Blocks

These Function block expects the input values in the proper units (°F, Kpa,
and kg/m³). If they are not in the proper units then appropriate unit
conversion block should be used. The density values calculated by these
function block are in the units of kg/m³. If these units do not match the
original input units, then the output densities should be converted to that of
the original input value’s units appropriate unit conversion block.

Input
Data
Input Parameter Description
types
ObservedTemperature LREAL Value of observed temperature in °F
ObservedPressure LREAL Value of observed Pressure in kpa
ObservedDensity LREAL Value of observed density (kg/m3). If input
density type is relative density or API
Gravity then it must be converted into
Density(kg/m3) using provided unit
conversion blocks
AlphaAt60F LREAL Pre-calculated 60°F thermal expansion
factor. This input parameter is only
applicable for special products. For other
commodity types this parameter is not
present
VolumeatObservedTempPressure LREAL No Conversion needed, Most of the time it
is optional input

Ouput
Data
Output Parameter Description
types
VCFTemerature LREAL Volume correction factor due to temperature
VCFPressure LREAL Volume correction factor due to pressure
ScaledCompressibilityFactor LREAL Scaled compressibility factor
CombineVCF LREAL Combined volume correction factor due to
temperature and pressure
BaseDensity LREAL Density at Base conditions

141
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description
types
VolumeatBase LREAL Volume at base conditions
Out_Code INT This out parameter returns success or fail code.

API TYPE3 Function Blocks

Description
These function blocks combines those in TYPE1 and TYPE2. First, the
density at the base conditions (60°F and 0 psig) consistent with an
observed density is calculated. This base density is then corrected to the
alternate temperature and pressure conditions as per commodity type of
the liquid that is crude-oil, refined products, special products and lubricating
oil. These function blocks are specific to US unit system.
This description is applicable to following function blocks:
n CRUDE_OIL_AO_US

142
Chapter 9 - Configuring Function Blocks

n REFINED_PRODUCTS_AO_US

n SPECIAL_PRODUCTS_AO_US

143
Chapter 9 - Configuring Function Blocks

n LUBRICATING_OIL_AO_US

These Function block expects the input values in the proper units (°F, Kpa,
and kg/m³). If they are not in the proper units then appropriate unit
conversion block should be used. The density values calculated by these
function block are in the units of kg/m³. If these units do not match the
original input units, then the output densities should be converted to that of
the original input value’s units appropriate unit conversion block.

Input
Data
Input Parameter Description
types
AlternetTemperature LREAL Value of alternate temperature in °F
AlternetPressure LREAL Value of alternate Pressure in kpa
ObservedTemperature LREAL Value of observed temperature in °F
ObservedPressure LREAL Value of observed Pressure in kpa
ObservedDensity LREAL Value of observed density (kg/m3). If input
density type is relative density or API
Gravity then it must be converted into
Density(kg/m3) using provided unit
conversion blocks
AlphaAt60F LREAL Pre-calculated 60°F thermal expansion
factor. This input parameter is only

144
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
applicable for special products. For other
commodity types this parameter is not
present
VolumeatObservedTempPressure LREAL No Conversion needed, Most of the time it
is optional input

Output
Data
Output Parameter Description
types
VCFBaseAndObservedTemerature LREAL Volume correction factor due to
temperature between the base and
observed temperatures
VCFBaseAndObservedPressure LREAL Volume correction factor due to pressure
between the base and observed pressures
at the observed

temperature
SCFObserved LREAL Scaled compressibility factor at the
observed temperature
CombineVCFBaseAndObserved LREAL Combined volume correction factor due to
temperature and pressure between the
base and observed

conditions
BaseDensity LREAL Density at Base conditions
VolumeatBase LREAL Volume at base conditions
VCFBaseAndAlternetTemerature LREAL Volume correction factor due to
temperature between the base and
alternate temperatures
VCFBaseAndAlternetPressure LREAL Volume correction factor due to pressure
between the base and alternate pressures
at the alternate

temperature
SCFAlternet LREAL Scaled compressibility factor at the

145
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description
types
alternate temperature
CombineVCFBaseAndAlternet LREAL Combined volume correction factor due to
temperature and pressure between the
base and alternate

conditions
AlternetDensity LREAL Density at alternate conditions
VolumeatAlternet LREAL Volume at alternate conditions
Out_Code INT This out parameter returns success or fail
code.

API TYPE4 Function Blocks

Description
This procedure calculates the Volume Correction Factor (VCF) given the
density at the metric base conditions (15°C or 20°C and 0 kPa (gauge)).
The parameters used in these function blocks depends upon the
commodity group to which the liquid belongs that is crude-oil, refined
products, special products and lubricating oil. These function blocks are
specific to Metric unit system.
This description is applicable to following function blocks:
n CRUDE_OIL_ALT_ME

146
Chapter 9 - Configuring Function Blocks

n REFINED_PRODUCTS_ALT_ME

n SPECIAL_PRODUCTS_ALT_ME

n LUBRICATING_OIL_ALT_ME

147
Chapter 9 - Configuring Function Blocks

These Function block expects the input values in the proper units (°C, kPa).
If they are not in the proper units then appropriate unit conversion block
should be used. The density values calculated by these function block are
in the units of kg/m³. If these units do not match the original input units, then
the output densities should be converted to that of the original input value’s
units appropriate unit conversion block.

Input
Data
Input Parameter Description
types
BaseTemperature LREAL Value of Base temperature °C
AlternateTemperature LREAL Value of alternate temperature in °C
AlternatePressure LREAL Value of alternate Pressure in kpa
BaseDensity LREAL Value of base density (kg/m3). If input density
type is relative density or API Gravity then it
must be converted into Density(kg/m3) using
provided unit conversion blocks
AlphaAt60F LREAL Pre-calculated 60°F thermal expansion factor.
This input parameter is only applicable for
special products. For other commodity types
this parameter is not present
VolumeatAlternetTempPressure LREAL No Conversion needed, Most of the time it is
optional input

Output
Data
Output Parameter Description
types
VCFTemerature LREAL Volume correction factor due to temperature
VCFPressure LREAL Volume correction factor due to pressure
ScaledCompressibilityFactor LREAL Scaled compressibility factor
CombineVCF LREAL Combined volume correction factor due to
temperature and pressure
AlternetDensity LREAL Density at alternate conditions
VolumeatBase LREAL Volume at base conditions

148
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description
types
Out_Code INT This out parameter returns success or fail code.

API TYPE5 Function Blocks

Description
These function blocks calculates the density at the metric base conditions
(15°C or 20°C and 0 kPa (gauge)) that is consistent with an observed
density measured at the observed temperature and pressure conditions for
crude-oil, refined products, special products and lubricating oil. These
function blocks are specific to Metric unit system.
This description is applicable to following function blocks
n CRUDE_OIL_OBS_ME

n REFINED_PRODUCTS_OBS_ME

149
Chapter 9 - Configuring Function Blocks

n SPECIAL_PRODUCTS_OBS_ME

n LUBRICATING_OIL_OBS_ME

These Function block expects the input values in the proper units (°C, Kpa,
and kg/m³). If they are not in the proper units then appropriate unit
conversion block should be used. The density values calculated by these
function block are in the units of kg/m³. If these units do not match the
original input units, then the output densities should be converted to that of
the original input value’s units appropriate unit conversion block.

Input
Data
Input Parameter Description
types
BaseTemperature LREAL Value of Base temperature °C
ObservedTemperature LREAL Value of observed temperature in °C
ObservedPressure LREAL Value of observed Pressure in kpa
ObservedDensity LREAL Value of observed density (kg/m3). If input
density type is relative density or API

150
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
Gravity then it must be converted into
Density(kg/m3) using provided unit
conversion blocks
AlphaAt60F LREAL Pre-calculated 60°F thermal expansion
factor. This input parameter is only
applicable for special products. For other
commodity types this parameter is not
present
VolumeatObservedTempPressure LREAL No Conversion needed, Most of the time it
is optional input

Output
Data
Output Parameter Description
types
VCFTemerature LREAL Volume correction factor due to temperature
VCFPressure LREAL Volume correction factor due to pressure
ScaledCompressibilityFactor LREAL Scaled compressibility factor
CombineVCF LREAL Combined volume correction factor due to
temperature and pressure
BaseDensity LREAL Density at Base conditions
VolumeatBase LREAL Volume at base conditions
Out_Code INT This out parameter returns success or fail code.

API TYPE6 Function Blocks

Description
These function blocks combines those in TYPE4 and TYPE5. The density
at conditions of 60°F and 0 psig that is consistent with the observed density
is first calculated. This density is then corrected to the alternate
temperature and pressure conditions.
The corresponding density at the metric base temperature (15°C or 20°C) is
also

151
Chapter 9 - Configuring Function Blocks

Calculated as per the commodity type of the liquid that is crude-oil, refined
products, special products and lubricating oil. These function blocks are
specific to Metric unit system.
This description is applicable to following function blocks
n CRUDE_OIL_AO_ME

n REFINED_PRODUCTS_AO_ME

n SPECIAL_PRODUCTS_AO_ME

152
Chapter 9 - Configuring Function Blocks

n LUBRICATING_OIL_AO_ME

These Function block expects the input values in the proper units (°C, Kpa,
and kg/m³). If they are not in the proper units then appropriate unit
conversion block should be used. The density values calculated by these
function block are in the units of kg/m³. If these units do not match the
original input units, then the output densities should be converted to that of
the original input value’s units appropriate unit conversion block.

Input
Data
Input Parameter Description
types
BaseTemperature LREAL Value of Base temperature °C
AlternetTemperature LREAL Value of alternate temperature in °F
AlternetPressure LREAL Value of alternate Pressure in kpa
ObservedTemperature LREAL Value of observed temperature in °F
ObservedPressure LREAL Value of observed Pressure in kpa
ObservedDensity LREAL Value of observed density (kg/m3). If input
density type is relative density or API
Gravity then it must be converted into
Density(kg/m3) using provided unit
conversion blocks
AlphaAt60F LREAL Pre-calculated 60°F thermal expansion
factor. This input parameter is only
applicable for special products. For other
commodity types this parameter is not
present

153
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
VolumeatObservedTempPressure LREAL No Conversion needed, Most of the time it
is optional input

Output
Data
Output Parameter Description
types
VCFBaseAndObservedTemerature LREAL Volume correction factor due to
temperature between the base and
observed temperatures
VCFBaseAndObservedPressure LREAL Volume correction factor due to pressure
between the base and observed pressures
at the observed

temperature
SCFObserved LREAL Scaled compressibility factor at the
observed temperature
CombineVCFBaseAndObserved LREAL Combined volume correction factor due to
temperature and pressure between the
base and observed

conditions
BaseDensity LREAL Density at Base conditions
VolumeatBase LREAL Volume at base conditions
VCFBaseAndAlternetTemerature LREAL Volume correction factor due to
temperature between the base and
alternate temperatures
VCFBaseAndAlternetPressure LREAL Volume correction factor due to pressure
between the base and alternate pressures
at the alternate

temperature
SCFAlternet LREAL Scaled compressibility factor at the
alternate temperature
CombineVCFBaseAndAlternet LREAL Combined volume correction factor due to
temperature and pressure between the

154
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description
types
base and alternate

conditions
AlternetDensity LREAL Density at alternate conditions
VolumeatAlternet LREAL Volume at alternate conditions
Out_Code INT This out parameter returns success or fail
code.

APINGLLIB

The following API NGL function block is available:

Function
Short description
block
API NGL API NGL Block calculates:
Block
Base density using API Chapter 11, Section 2, Part 4 in conjunction with either
API Chapter 11.2.2 or Chapter 11.2.2M.

Calculates standard density using API Chapter 11, Section 2, Part 4 in


conjunction with either API Chapter 11.2.2 or Chapter 11.2.2M.

Calculation of vapor pressure using API Chapter 11, Section 2, Part 5.

API NGL Function Block


This function block does calculations using following standards.
n API Manual of Petroleum Measurement Standards, Chapter 11, Section
2, Part 4 is an international standard covering temperature volume
correction for NGLs and LPGs.
n API Manual of Petroleum Measurement Standards, Chapter 11, Section
2, Part 5 is an international standard covering vapor pressure
correlation for commercial NGLs.
n API Manual of Petroleum Measurement Standards, Chapter 11.2.2 is
an international standard covering compressibility factors for
Hydrocarbons from relative density and temperature (Fahrenheit).

155
Chapter 9 - Configuring Function Blocks

n API Manual of Petroleum Measurement Standards, Chapter 11.2.2M is


an international standard covering compressibility factors for
Hydrocarbons from density (Kg/m3) and temperature (Centigrade).
Information:

The basic function of API NGL block when set for line to base operation is
to calculate standard density and associated volume correction factor from
an observed density, temperature and pressure with an option to either
calculate a vapor pressure or use an operator entered value.
The basic function of API NGL block when set for base to line operation is
to calculate meter density and associated volume correction factor from an
observed density, temperature and pressure with an option to either
calculate a vapor pressure or use an operator entered value.
API NGL block solves either a line to base or base to line correction but not
both.
It is possible, however, to connect the resulting standard density from a line
to base block to the input of a base to line block.

Input
Data
Input Parameter Description
types
APITables INT This can be from one of the following standards:

0 - T23E (line to base (60 'F) from observed

relative density)

1 - T24E (base to line from standard relative

density (60 'F))

2 - T53E (line to base (15 'C) from observed Kg/m3)

3 - T54E (base to line to from standard Kg/m3(15 'C))

4 - T59E (line to base (20 'C) from observed Kg/m3)

5 - T60E (base to line to from Kg/m3 (20 'C))


CPLCalcType INT CPL Calculation Type.

This can be from one of the following options:

0 – None (No CPL calculation is performed)

156
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
2 - API1122 (CPL calculated from standard)

relative density (60 'F) and observed temperature)

4 - API1122M
ConverCriteria LREAL IP2 Convergence limit. Reserved for future use.

Set to 0.001
MaxIterations INT IP2 Max loop limit. Reserved for future use. Preset to
Set to 50.
DensityInput LREAL Density Input
DensityUnits INT This can be from one of the following options:

0 - Kg/m3

1 - RD

2 - Degrees API
IterationMethod INT Main calculation method such as ASTM and IP2

0 - ASTM

1 - IP2
PressureInput LREAL Pressure Input.
PressureUnits INT 0 - PSIA

1 - PSIG

2 - Kpa

3 - Bar

4 - BarG
EquilibPressureInput LREAL Operator Entered or Observed Vapor Pressure Input
PECalcType INT Vapor Pressure Options.

The vapor pressure option can be from one of the

following values:

0 - None (Vapor pressure assumed to be zero.)

157
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
1 - Use Observed (The operator entered value is used)

2 - API1125 (Vapor pressure calculated from

standard relative density at 60 'F and observed

Temperature.)
ReferanceTemperature LREAL Reference Temperature. This is only used by T59E
and T60E. The usual value is 20. 0 degC.
Rounding INT 0 – Rounding Disabled

2 – Rounding Enabled

When enabled, the function block follows the rounding


standards specified by the calculations. The API
11.2.4 temperature correction calculation only
specifies rounding for the inputs and final results i.e. no
interim variables require rounding.
TemperatureInput LREAL Observed Temperature Input
TemperatureUnits INT 0 – Deg F

1 – Deg C

Output
Data
Output Parameter Description
types
CPL LREAL Correction factor for effects of pressure on the liquid
CTL LREAL Correction factor for effects of temperature on the
liquid
CTPL LREAL Correction factor for effects of temperature and
pressure on the liquid
AFactor LREAL CPL calculation interim result
BFactor LREAL CPL calculation interim result
EquilibriumPressureOut LREAL Calculated (or used) Vapor Pressure

158
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description
types
Relative Density LREAL Relative Density Corrected
CorrectedDensity LREAL Calculated Density in kg/m3 units
CorrectedDensityAPI LREAL Calculated Density in degrees API
ErrorCode INT Critical error code
WarningCode INT Warning code

Operating Limits:
The API 11 Chapter 11 methods are derived from correlations of density
versus physical conditions of liquids. As such they are only valid over
certain operating ranges. To allow flexibility, especially with the IP2 iteration
method where compressibility and temperature correction calculation
results interact, the limits are set as follows:

T23E RD from 0.21 to 0.74.

Temperature from -50.8 'F to 199.4 'F


T24E RD from 0.35 to 0.688.

Temperature from -50.8 'F to 199.4 'F


T53E Density from 210 to 739 kg/m3.

Temperature from -46 'C to 93 'C


T54E Density from 351.7 to 687.8 kg/m3.

Temperature from -46 'C to 93 'C


T59E Density from 351.7 to 687.8 kg/m3.

Temperature from -46 'C to 93 'C


T60E Density from 331.7 to 683.6 kg/m3.

Temperature from -46 'C to 93 'C


API1122 RD from 0.2 to 0.75.

Temperature from -50.8 'F to 140 'F.

Pressure from 0 to 2200 psi


API1122M Density from 200 to 750 kg/m3.

159
Chapter 9 - Configuring Function Blocks

Temperature from -50.8 'F to 140 'F.

Pressure from 0 to 2200 psi.


API1125 RD from 0.2 to 0.75.

Temperature from -50 'F to 140 'F

Critical Error Codes


Code Description
1 Density value is invalid
2 Temperature value is invalid
3 Pressure value is invalid
4 Vapor Pressure value is invalid

160
Chapter 9 - Configuring Function Blocks

Warning codes
Code Description
1 Density input is out of range (all calculations)
2 Temperature input is out of range (all calculations)
3 Pressure input is out of range (all calculations)
4 Calculation combination is invalid (all calculations)
5 Reserved
6 Reserved
7 Reserved
8 Reserved
9 Reserved
10 Reserved
11 Reserved
12 Reserved
13 Reserved
14 API.11.2.4: Alpha error
15 API.11.2.4: Interpolation variable error
16 API.11.2.4: TC error
17 API.11.2.4: TRX error
18 API.11.2.4: H2 error
19 API.11.2.4: Saturated density error
20 API.11.2.4: Interpolation factor error
21 API.11.2.4: Step 4-5 error
22 API.11.2.4: Fluid 2 relative density low error
23 API.11.2.4: Step 6 TC2_TC1 error
24 API.11.2.4: RD X < Lower Limit
25 API.11.2.4: RD 60 Mid error
26 API.11.2.4: Step 9 Phi error

161
Chapter 9 - Configuring Function Blocks

Code Description
27 API.11.2.4: Step 9 A error
28 API.11.2.4: Step 9 B error
29 API.11.2.4: Step 9 RD 60 Trial error
30 API.11.2.4: Iteration Fail error
31 API.11.2.4: CTL range error
32 API.11.2.4: T60 Step 6 density error
101 API.11.2.4: Density conversion error
102 API.11.2.4: Rounding error
103 API.11.2.4: Reserved
104 API.11.2.4: CTL range error
105 API.11.2.4: CPL range error
106 API.11.2.4: Reserved
107 API.11.2.4: Reserved
108 API.11.2.4: Calculated density range error
109 API.11.2.4: Density units conversion error
110 API.11.2.4: Pressure units conversion error
111 API.11.2.4: CTPL range error
211 API 1122 and API1122M: TR > Max error
212 API 1122 and API1122M: Factor error
301 Ch.11.2.5: relative density out of range
302 Ch.11.2.5: Temperature out of range

Invalid generally means one of the following:


n The input block pin is not connected.
n The input value is NaN.
n The input value is out of range.
If critical errors occur, all key output parameters are forced to NaN.

162
Chapter 9 - Configuring Function Blocks

ISO5167DualLIB

The following ISO 5167 Dual function block is available:

Function Block Short Description


See ISO ISO 5167 Dual function block calculates:
5167Dual for
more Mass flow to the 1991, 1997 and 2003 versions of ISO 5167.Calorific value
information. on a superior and inferior basis

Gross volume flow, standard volume flow and energy flow.

Fully-recovered downstream pressure.

Calculation of upstream density from a downstream measurement (see


section 11.2). Each density measurement input can be configured
upstream or downstream independently.

Calculation of upstream temperature from a downstream measurement


(see section 11.1)

ISO 5167Dual
ISO 5167 is an international standard covering the measurement of fluid
flow by means of pressure differential devices such as orifice plates and
venturis. When some parameters are known, ISO 5167 allows other
variables to be calculated. The most common usage is to calculate mass
flow rate from differential pressure, static pressure and density. ISO 5167 is
widely used in most areas of the world except North America.
The basic function of the ISO 5167 block is to calculate mass flow rate from
primary element DP and other required inputs. This block supports the
1991, 1997 and 2003 versions of the ISO 5167 standard. These versions
differ in small but significant ways.
n The basic functions supported are listed below
n Calculation of mass flow to the 1991, 1997 and 2003 versions of ISO
5167.
n Calculation of gross volume flow, standard volume flow and energy
flow.
n Calculation of fully-recovered downstream pressure (see section 9).
n Dual density inputs with automatic fail-over and deviation checking (see
section 5.4).

163
Chapter 9 - Configuring Function Blocks

n Calculation of upstream density from a downstream measurement (see


section 11.2). Each density measurement input can be configured
upstream or downstream independently.
n Calculation of upstream temperature from a downstream measurement
(see section 11.1).
n Temperature compensation of primary element and pipe.
n Gauge or absolute static pressure transmitters located upstream or
downstream.
n Automatic selection of DP from up to three DP transmitters (see section
0).
n Orifice plates with all three tapping types (corner, D and D/2 and
flange).
n Classical ventures of all three construction types: as-cast, machined
and rough-welded.
n Externally calculated viscosity and isentropic exponent or constant
values.
n Incompressible fluids (liquids) or compressible ones (gases).
n UK DTI limits on beta and Reynolds No for fiscal purposes.

Input
Data
Input Parameter Description
types
CalorificValue LREAL Calorific value in MJ/Sm3
ISO5167Version INT ISO5167Version:

0 = version 1991;

1 = version 1997;

2 = version 2003
FluidType INT 0 = Compressible;

1 = Uncompressible
DensityFromBlockPin BOOL 1: RHOTP from block pin;

0: constant value
ConstantDensity LREAL Const Density

164
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
DensityInput1 LREAL Density Input 1
DensityInput2 LREAL Density Input 1
ViscosityFromBlockPin BOOL 1: VISC from block pin;

0: constant value
ViscosityOfFluid LREAL DP transmitter input - range 1 (in selected DP
units)
ISEN_EXPFromBlockPin BOOL true: ISEN_EXP from block pin;

false: constant value


IsentropicExponent LREAL Isentropic Exponent
MassFlowUnit INT 0 = kg/sec;

1 = kg/min;

2 = kg/hour;

3 = tonne/min;

4 = tonne/hour
MassFlowScaling LREAL mass flow scaling factor
QVComputation BOOL true = computation for Volume Flow
VolumeFlowUnit INT 0 = m3/sec;

1 = m3/min;

2 = m3/hour;

4 = km3/hour
VolumeFlowScaling LREAL Volume flow scaling factor
QSComputation BOOL true = Standard Volume Flow Computation

StdVolumeFlowUnit INT 0 = Sm3/sec;

1 = Sm3/min;

165
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
2 = Sm3/hour;

4 = kSm3/hour
StdVolumeFlowScaling LREAL Standard volume flow scaling factor
QHComputation BOOL true = Energy Flow
EnergyFlowUnit INT 0 = KJ/sec;

1 = MJ/sec;

2 = MJ/min;

3 = MJ/hour;

4 = GJ/hour
EnergyFlowScaling LREAL Energy flow scaling factor
InitialCValue LREAL initial C value
MaxItrations INT max number of iterations
PrecisionLimit LREAL Precision Limits
FiscalMetering BOOL Fiscal Metering 1 = YES , 0 =NO
PrmiaryElementType INT 0 = Orifice Plate;

1 = Classical Venturi
OrificeTapType INT 0 = Corner;

1 = Flange;

2 = D&D/2
VenturiType INT 0 = As-Cast;

1 = Machined;

2 = Roughwelded
AllowanceForExp BOOL true = allowance for expansion
PipeRefTemperature LREAL pipe reference temperature (deg C)
PipeCoefficient LREAL pipe coefficient of expansion (mm/mm/deg C)
ElementRefTemperature LREAL primary element reference temperature (deg
C)

166
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
ElementCoefficient LREAL primary element coefficient of expansion
(mm/mm/deg C)
PipeReferenceBore LREAL pipe reference bore (mm)
ElementReferenceBore LREAL primary element reference bore (mm)
PermLossA LREAL venturi permanent pressure loss(%DP) for
coefficients A
PermLossB LREAL venturi permanent pressure loss(%DP) for
coefficients B
StaticPressMeasurementPos INT static pressure measurement position

(0 = Upstream, 1 = Downstream)
StaticPressUnit INT 0 = KPa;

1 = MPa;

2 = bar
StaticPressBasis INT 0 = Gauge;

1 = Absolute
AtmosphericPress LREAL Atmospheric Pressure
AtmosphericPressUnit INT atmospheric pressure measurement unit, 0 =
KPa abs, 1 = MPa abs, 2 = bara
DiffPressUnit INT diffrential pressure measurement unit, 0 =
KPa, 1 = MPa, 2 = bar, 3 = mbar
TempMeasurePosition INT temperature measurement position at 0 =
Upstream, 1= Downstream
DiffPressureTxNumber INT 1 = 1 transmitter;

2 = 2 transmitter;

3 = 3 transmitter
HiLimDP1 LREAL hight limit value of transition 1-2
HiLimDP2 LREAL hight limit value of transition 2-3
DeadbandValueDP1 LREAL deadband value of transition 1-2

167
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
DeadbandValueDP2 LREAL deadband value of transition 2-3
NoOfDensityInputs INT Number of density inputs
DensityInputSelection INT Density input selection
DensityMeasurPosition1 INT density measurement position for input1

(0 = Upstream, 1 = Downstream)
DensityMeasurPosition2 INT density measurement position for input2

(0 = Upstream, 1 = Downstream)
DensityInputComparDB LREAL Density inputs 1 and 2 comparison deadband
DensityInputComparTimeDelay INT Density inputs 1 and 2 comparison time delay
CalorificValue LREAL Calorific Value
DiffPressInputRange1 LREAL Diff Pressure Transmitter input range1
DiffPressInputRange2 LREAL Diff Pressure Transmitter input range2
DiffPressInputRange3 LREAL Diff Pressure Transmitter input range3
DiffPressureStatus1 BOOL Diff Pressure Transmitter 1 status; 0=OK,
1=fault
DiffPressureStatus2 BOOL Diff Pressure Transmitter 2 status; 0=OK,
1=fault
DiffPressureStatus3 BOOL Diff Pressure Transmitter 3 status; 0=OK,
1=fault
DPPVEUHI1 LREAL DP transmitter x EUHI
DPPVEUHI2 LREAL DP transmitter x EUHI
RhoInputSelStatus1 BOOL RhoInputSel Input Status 1
RhoInputSelStatus2 BOOL RhoInputSel Input Status 2
StaticPressure LREAL Static Pressure
StandardDensity LREAL Standard density
Temperature LREAL Temperature

Output

168
Chapter 9 - Configuring Function Blocks

Output Parameter Data types Description


BetaRatio LREAL Beta ratio (d/D) at flowing conditions
ElementActualBore LREAL Corrected bore/throat size
CValue LREAL Coefficient of discharge
SelectedDiffPressure LREAL Selected differential pressure
DiffTxInuse INT In-use DP transmitter
ExpFactor LREAL Expansibility factor
Pressure1Abs LREAL Upstream absolute pressure in Pa
Pressure1Guage LREAL Upstream gauge pressure
Pressure3Abs LREAL Fully recovered downstream absolute press
Pressure3Guage LREAL Fully recovered downstream gauge press
PipeActBore LREAL Corrected pipe size
Qh LREAL Energy flow
Qm LREAL Mass flow
Qs LREAL Standard volume flow
Qv LREAL Volume flow
Red LREAL Reynolds Number
RHO1 LREAL In-use Upstream density
RHO1_1 LREAL Upstream density derived from RHOTP1
RHO1_2 LREAL Upstream density derived from RHOTP2
Temperature1 LREAL Upstream temperature
VelApproachFactor LREAL Velocity of Approach factor
NumberIterations LREAL Number of Iterations for the last scan
ErrorCode INT Critital Error Code
WarningCode INT Warning Code

In ISO 5167 block, there is DP, static pressure, temperature and density
exposed as input pin (or constant density from the configuration form) and
measured form field. There are other additional inputs as well. Based on
these inputs, the mass flow, volume flow, standard volume flow and energy
flow of the fluid can be figured out via ISO5167_DUAL function block.

169
Chapter 9 - Configuring Function Blocks

Input parameters range:


Input Parameter Min Value Max Value
PipeReferenceBore 16.67 1200
ElementReferenceBore 12.5 1000
DensityInputComparTimeDelay 0 300
HiLimDP1 50.0 95.0
HiLimDP2 50.0 95.0
PipeRefTemperature 0 50
ElementRefTemperature 0 50
MaxItrations 6 12
DeadbandValueDP1 0 10.0
DeadbandValueDP2 0 10.0
DensityInputComparDB 0 10
IsentropicExponent 1.0 5.0
InitialCValue 0.58 0.62
PermLossA 0 5.0
PermLossB 0 5.0
PipeCoefficient 0.000005 0.00005
ElementCoefficient 0.000005 0.00005
PrecisionLimit 0.000000001 0.000001

Error and Warning list

Critical Error Codes


Code Description
1 Static pressure value is invalid (if a compressible fluid is selected).
2 Differential pressure value is invalid.
3 If Temp Comp is enabled, temperature value is invalid.
4 Density value is invalid.

170
Chapter 9 - Configuring Function Blocks

Code Description
5 Viscosity value is invalid.
6 Isentropic exponent value is invalid (if a compressible fluid is selected).
7 Iteration failed to converge.
8 Multiple DP transmitter configuration is invalid.
9 Pipe bore is invalid.
10 Beta is invalid.
11 P2 is invalid (if a compressible fluid is selected).
20 If standard volume is enabled, standard density is invalid.
21 If energy flow is enabled, CV by volume is invalid.
30 Configuration parameter invalid.

Invalid generally means one of the following:


n The input block pin is not connected.
n The input value is NaN.
n The input value is out of range.
If critical errors 1 to 11 occur, Qm and all derived values are set to NaN. If
critical error 20 occurs, QS and QH are set to NaN. If critical error 21
occurs, QH is set to NaN.

Warning codes
Code Description
1 For a compressible fluid, P2/P1 ratio is too low.
2 Element bore is too small.
3 Pipe size is out of range for an orifice plate.
4 Pipe size is out of range for a venturi.
5 Orifice beta ratio is outside fiscal limits.
6 Orifice beta ratio is outside limits.
7 Venturi beta ratio is outside limits.

171
Chapter 9 - Configuring Function Blocks

Code Description
8 Orifice plate is outside Reynolds No limits.
9 Orifice plate is above fiscal Reynolds No limit.
10 Venturi is outside Reynolds No limits.
11 For dual density inputs, input 1 is invalid.
12 For dual density inputs, input 2 is invalid.
13 For dual density inputs, the deviation between the inputs is greater than the
deadband.

ISO5167DualJTLib

The following ISO 5167 Dual JT function block is available:

Function
Short description
block
ISO 5167 ISO 5167 Dual JT Block calculates
DUAL JT
1. Mass flow to the 1991, 1997 and 2003 versions of ISO 5167.Calorific value
on a superior and inferior basis

2. Gross volume flow, standard volume flow and energy flow.

3. Fully-recovered downstream pressure.

4. Calculation of upstream density from a downstream measurement (see


section 11.2). Each density measurement input can be configured upstream or
downstream independently.

5. Calculation of upstream temperature from a downstream measurement (see


section 11.1)

ISO 5167 DUAL JT


ISO 5167 DUAL JT is an international standard covering the measurement
of fluid flow by means of pressure differential devices such as orifice plates
and venturis. When some parameters are known, ISO 5167 allows other
variables to be calculated. The most common usage is to calculate mass
flow rate from differential pressure, static pressure and density. ISO 5167 is
widely used in most areas of the world except North America.
Information:

172
Chapter 9 - Configuring Function Blocks

The basic function of the ISO 5167 block is to calculate mass flow rate from
primary element DP and other required inputs. This block supports the
1991, 1997 and 2003 versions of the ISO 5167 standard. These versions
differ in small but significant ways.
The basic functions supported are listed below
n Calculation of mass flow to the 1991, 1997 and 2003 versions of ISO
5167.
n Calculation of gross volume flow, standard volume flow and energy
flow.
n Calculation of fully-recovered downstream pressure (see section 9).
n Dual density inputs with automatic fail-over and deviation checking (see
section 5.4).
n Calculation of upstream density from a downstream measurement (see
section 11.2). Each density measurement input can be configured
upstream or downstream independently.
n Calculation of upstream temperature from a downstream measurement
(see section 11.1).
n Temperature compensation of primary element and pipe.
n Gauge or absolute static pressure transmitters located upstream or
downstream.
n Automatic selection of DP from up to three DP transmitters (see section
0).
n Orifice plates with all three tapping types (corner, D and D/2 and
flange).
n Classical ventures of all three construction types: as-cast, machined
and rough-welded.
n Externally calculated viscosity and isentropic exponent or constant
values.
n Incompressible fluids (liquids) or compressible ones (gases).
n UK DTI limits on beta and Reynolds No for fiscal purposes.

Input
Data
Parameter Description
type

173
Chapter 9 - Configuring Function Blocks

Data
Parameter Description
type
CalorificValue LREAL Calorific value in MJ/Sm3
ISO5167Version INT ISO5167Version:

0 = 1991;

1 = 1997;

2 = 2003
FluidType INT 0 = Compressible;

1 = Uncompressible
DensityFromBlockPin BOOL 1: RHOTP from block pin;

0: constant value
ConstantDensity LREAL Const Density
DensityInput1 LREAL Density Input 1
DensityInput2 LREAL Density Input 1
ViscosityFromBlockPin BOOL 1: VISC from block pin;

0: constant value
ViscosityOfFluid LREAL DP transmitter input - range 1 (in selected
DP units)
ISEN_EXPFromBlockPin BOOL 1 : ISEN_EXP from block pin;

0: constant value
IsentropicExponent LREAL Isentropic Exponent
MassFlowUnit INT 0 = kg/sec;

1 = kg/min;

2 = kg/hour;

3 = tonne/min;

4 = tonne/hour
MassFlowScaling LREAL mass flow scaling factor
QVComputation BOOL true = computation for Volume Flow

174
Chapter 9 - Configuring Function Blocks

Data
Parameter Description
type
VolumeFlowUnit INT 0 = m3/sec;

1 = m3/min;

2 = m3/hour;

4 = km3/hour
VolumeFlowScaling LREAL Volume flow scaling factor
QSComputation BOOL true = Standard Volume Flow Computation
StdVolumeFlowUnit INT 0 = Sm3/sec;

1 = Sm3/min;

2 = Sm3/hour;

4 = kSm3/hour
StdVolumeFlowScaling LREAL Standard volume flow scaling factor
QHComputation BOOL Energy Flow computation

1 = enable;

0 = disable
EnergyFlowUnit INt 0 = KJ/sec;

1 = MJ/sec;

2 = MJ/min;

3 = MJ/hour;

4 = GJ/hour
EnergyFlowScaling LREAL Energy flow scaling factor
InitialCValue LREAL initial C value
MaxItrations INT max number of iterations
PrecisionLimit LREAL Precision Limits
FiscalMetering BOOL Fiscal Metering:

1= Yes;

175
Chapter 9 - Configuring Function Blocks

Data
Parameter Description
type
0 =No
PrmiaryElementType INT 0 = Orifice Plate;

1 = Classical Venturi
OrificeTapType INT 0 = Corner;

1 = Flange;

2 = D&D/2
VenturiType INT 0 = As-Cast;

1 = Machined;

2 = Roughwelded
AllowanceForExp BOOL allowance for expansion:

1 = Yes;

0 = No
PipeRefTemperature LREAL pipe reference temperature (deg C)
PipeCoefficient LREAL pipe coefficient of expansion (mm/mm/deg
C)
ElementRefTemperature LREAL primary element reference temperature (deg
C)
ElementCoefficient LREAL primary element coefficient of expansion
(mm/mm/deg C)
PipeReferenceBore LREAL pipe reference bore (mm)
ElementReferenceBore LREAL primary element reference bore (mm)
PermLossA LREAL venturi permanent pressure loss(%DP) for
coefficients A
PermLossB LREAL venturi permanent pressure loss(%DP) for
coefficients B
StaticPressMeasurementPos INT static pressure measurement position at

(0 = Upstream, 1 = Downstream)
StaticPressUnit INT 0 = KPa;

176
Chapter 9 - Configuring Function Blocks

Data
Parameter Description
type
1 = MPa;

2 = bar
StaticPressBasis INT 0 = Gauge;

1 = Absolute
AtmosphericPress LREAL Atmospheric Pressure
AtmosphericPressUnit INT atmospheric pressure measurement unit:

0 = KPa abs;

1 = MPa abs;

2 = bara
DiffPressUnit INT diffrential pressure measurement unit:

0 = KPa;

1 = MPa;

2 = bar;

3 = mbar
TempMeasurePosition INT temperature measurement position at

(0 = Upstream, 1 = Downstream)
DiffPressureTxNumber INT 1 = 1 transmitter;

2 = 2 transmitter;

3 = 3 transmitter
HiLimDP1 LREAL hight limit value of transition 1-2
HiLimDP2 LREAL hight limit value of transition 2-3
DeadbandValueDP1 LREAL deadband value of transition 1-2
DeadbandValueDP2 LREAL deadband value of transition 2-3
NoOfDensityInputs INT Number of density inputs
DensityInputSelection INT Density input selection
DensityMeasurPosition1 INT density measurement position for input1

177
Chapter 9 - Configuring Function Blocks

Data
Parameter Description
type
(0 = Upstream, 1 = Downstream)
DensityMeasurPosition2 INT density measurement position for input2

(0 = Upstream, 1 = Downstream)
DensityInputComparDB LREAL Density inputs 1 and 2 comparison
deadband
DensityInputComparTimeDelay INT Density inputs 1 and 2 comparison time
delay
CalorificValue LREAL Calorific Value
DiffPressInputRange1 LREAL Diff Pressure Transmitter input range1
DiffPressInputRange2 LREAL Diff Pressure Transmitter input range2
DiffPressInputRange3 LREAL Diff Pressure Transmitter input range3
DiffPressureStatus1 BOOL Diff Pressure Transmitter 1 status; 0=OK,
1=fault
DiffPressureStatus2 BOOL Diff Pressure Transmitter 2 status; 0=OK,
1=fault
DiffPressureStatus3 BOOL Diff Pressure Transmitter 3 status; 0=OK,
1=fault
DPPVEUHI1 LREAL DP transmitter x EUHI
DPPVEUHI2 LREAL DP transmitter x EUHI
RhoInputSelStatus1 BOOL RhoInputSel Input Status 1
RhoInputSelStatus2 BOOL RhoInputSel Input Status 2
StaticPressure LREAL Static Pressure
StandardDensity LREAL Standard density
Temperature LREAL Temperature
ZP1T1 LREAL Compressibility at P1, T1 line conditions.
ZP2T3 LREAL Compressibility at P2, T3 line conditions.

178
Chapter 9 - Configuring Function Blocks

Output
Data
Output Parameter Description
types
BetaRatio LREAL Beta ratio (d/D) at flowing conditions
ElementActualBore LREAL Corrected bore/throat size
CValue LREAL Coefficient of discharge
SelectedDiffPressure LREAL Selected differential pressure
DiffTxInuse INT In-use DP transmitter
ExpFactor LREAL Expansibility factor
Pressure1Abs LREAL Upstream absolute pressure in Pa
Pressure1Guage LREAL Upstream gauge pressure
Pressure3Abs LREAL Fully recovered downstream absolute press
Pressure3Guage LREAL Fully recovered downstream gauge press
PipeActBore LREAL Corrected pipe size
Qh LREAL Energy flow
Qm LREAL Mass flow
Qs LREAL Standard volume flow
Qv LREAL Volume flow
Red LREAL Reynolds Number
RHO1 LREAL In-use Upstream density
RHO1_1 LREAL Upstream density derived from RHOTP1
RHO1_2 LREAL Upstream density derived from RHOTP2
Temperature1 LREAL Upstream temperature
VelApproachFactor LREAL Velocity of Approach factor
NumberIterations LREAL Number of Iterations for the last scan
ErrorCode INT Critital Error Code
WarningCode INT Warning Code
JT_COEFF LREAL Joule-Thomson coefficient in K/bar. If Version < 2003
Or Fluid is incompressible, value = NaN.

179
Chapter 9 - Configuring Function Blocks

Information:
Compared with ISO5167_DUAL, ISO5167_DUAL_JT function block have
another two extra pin inputs, ZP1T1 and ZP2T3, based on these two inputs,
ISO5167_DUAL_JT adopts different algorithm to calculate RHO1_1 and
RHO1_2.
In addition, ISO5167_DUAL_JT calculate T1 based on Joule-Thomson
coefficient, finally flow rate can be figured out via ISO5167_DUAL_JT
Function Block.

Input parameters range:


Input Parameter Min Value Max Value
PipeRefBore? 16.67 1200
PipeActBore? 12.5 1000
DensityInputComparTimeDelay 0 300
HiLimDP1 50.0 95.0
HiLimDP2 50.0 95.0

180
Chapter 9 - Configuring Function Blocks

Input Parameter Min Value Max Value


PipeRefTemperature 0 50
ElementRefTemperature 0 50
MaxItrations 6 12
DeadbandValueDP1 0 10.0
DeadbandValueDP2 0 10.0
DensityInputComparDB 0 10
IsentropicExponent 1.0 5.0
InitialCValue 0.58 0.62
PermLossA 0 5.0
PermLossB 0 5.0
PipeCoefficient 0.000005 0.00005
ElementCoefficient 0.000005 0.00005
PrecisionLimit 0.000000001 0.000001

Critical Error Codes


Error Code Description
1 Static pressure value is invalid (if a compressible fluid is selected
2 Differential pressure value is invalid
3 If Temp Comp is enabled, temperature value is invalid
4 Density value is invalid
5 Viscosity value is invalid
6 Isentropic exponent value is invalid (if a compressible fluid is selected)
7 Iteration failed to converge
8 Multiple DP transmitter configuration is invalid.
9 Pipe bore is invalid
10 Beta is invalid
11 P2 is invalid (if a compressible fluid is selected)

181
Chapter 9 - Configuring Function Blocks

Error Code Description


12 ZP1T1 is invalid **
13 ZP2T3 is invalid **
20 If standard volume is enabled, standard density is invalid
21 If energy flow is enabled, CV by volume is invalid
30 Configuration parameter invalid

Invalid generally means one of the following:


n The input block pin is not connected.
n The input value is NaN.
n The input value is out of range.
If critical errors 1 to 11 occur, Qm and all derived values are set to NaN. If
critical error 20 occurs, QS and QH are set to NaN. If critical error 21
occurs, QH is set to NaN.
** ZP1T1 errors and ZP2T3 errors are only relevant when ISO 5167:2003 is
used.
That is when the ISO5167_DUAL_JT function block is used, the fluid is
compressible, the density position is downstream and the 2003 version of
ISO5167 is used.

Warning codes
Code Description
1 For a compressible fluid, P2/P1 ratio is too low.
2 Element bore is too small.
3 Pipe size is out of range for an orifice plate.
4 Pipe size is out of range for a venturi.
5 Orifice beta ratio is outside fiscal limits.
6 Orifice beta ratio is outside limits.
7 Venturi beta ratio is outside limits.
8 Orifice plate is outside Reynolds No limits.
9 Orifice plate is above fiscal Reynolds No limit.

182
Chapter 9 - Configuring Function Blocks

Code Description
10 Venturi is outside Reynolds No limits.
11 For dual density inputs, input 1 is invalid.
12 For dual density inputs, input 2 is invalid.
13 For dual density inputs, the deviation between the inputs is greater than the
deadband.

Error and Warning list

Critical Error Codes


Code Description
1 Static pressure value is invalid (if a compressible fluid is selected.
2 Differential pressure value is invalid.
3 If Temp Comp is enabled, temperature value is invalid.
4 Density value is invalid.
5 Viscosity value is invalid.
6 Isentropic exponent value is invalid (if a compressible fluid is selected).
7 Iteration failed to converge.
8 Multiple DP transmitter configuration is invalid.
9 Pipe bore is invalid.
10 Beta is invalid.
11 P2 is invalid (if a compressible fluid is selected).
12 ZP1T1 is invalid**.
13 ZP2T3 is invalid**.
20 If standard volume is enabled, standard density is invalid.
21 If energy flow is enabled, CV by volume is invalid.
30 Configuration parameter invalid.

Invalid generally means one of the following:

183
Chapter 9 - Configuring Function Blocks

n The input block pin is not connected.


n The input value is NaN.
n The input value is out of range.
If critical errors 1 to 11 occur, Qm and all derived values are set to NaN. If
critical error 20 occurs, QS and QH are set to NaN. If critical error 21
occurs, QH is set to NaN.
** ZP1T1 errors and ZP2T3 errors are only relevant when ISO 5167:2003 is
used.
That is when the ISO5167_DUAL_JT function block is used, the fluid is
compressible, the density position is downstream and the 2003 version of
ISO5167 is used.

Warning codes
Code Description
1 For a compressible fluid, P2/P1 ratio is too low.
2 Element bore is too small.
3 Pipe size is out of range for an orifice plate.
4 Pipe size is out of range for a venturi.
5 Orifice beta ratio is outside fiscal limits.
6 Orifice beta ratio is outside limits.
7 Venturi beta ratio is outside limits.
8 Orifice plate is outside Reynolds No limits.
9 Orifice plate is above fiscal Reynolds No limit.
10 Venturi is outside Reynolds No limits.
11 For dual density inputs, input 1 is invalid.
12 For dual density inputs, input 2 is invalid.
13 For dual density inputs, the deviation between the inputs is greater than the
deadband.

ISO6976lib

The following ISO 6976 function block is available:

184
Chapter 9 - Configuring Function Blocks

Function block Short description


See ISO 6976 for ISO 6976 Block calculates
more information.
Calorific value on a molar, mass and volumetric basis.

Calorific value on a superior and inferior basis

Calculation of values on an ideal and a real basis.

Standard density and compressibility at the 15 deg C and 1.01325 bara


conditions regardless of the chosen combustion/metering

ISO 6976
ISO 6976:1995 is an international standard covering the calculation for
natural gas of calorific value, density, relative density and Wobbe Index
from its composition. ISO 6976 is widely used in most areas of the world
except North America.

Description
The basic function of this block is to calculate the following values using gas
composition and the ISO 6976 definitive methods:
n Molar mass
n Ideal relative density
n Real relative density at 1.01325 bara and selected metering
temperature.
n Ideal density at 1.01325 bara and selected metering temperature.
n Ideal density at 1.01325 bara and 15 deg C.
n Real density at 1.01325 bara and selected metering temperature.
n Real density at 1.01325 bara and 15 deg C.
n Compressibility at 1.01325 bara and 15 deg C.
n Compressibility at 1.01325 bara and metering temperature.
n CV on a molar basis – superior
n CV on a molar basis – inferior
n CV on a mass basis – superior
n CV on a mass basis – inferior
n Ideal CV on a volumetric basis – superior

185
Chapter 9 - Configuring Function Blocks

n Ideal CV on a volumetric basis – inferior


n Real CV on a volumetric basis – superior
n Real CV on a volumetric basis – inferior
n Ideal Wobbe Index
n Real Wobbe Index
This function block does not support:
n Versions of ISO 6976 earlier than 1995.
n Alternative calculation methods as defined in ISO 6976.
n Normalization of gas composition.
n Calculation of line density. This is not supported by ISO 6976. If this
value is required, AGA 8 Detailed must be used.
Explanation of Calorific Value (CV) Basis
CV can be calculated on a molar basis, a mass basis or a volumetric basis.
In order to calculate CV on a mass basis or a volumetric basis, it is first
necessary to calculate it on a molar basis. Also, in order to calculate Wobbe
Index, it is necessary to calculate CV on a volumetric, superior basis.
Thus, it is always necessary to calculate CV on a molar, superior basis, CV
on a volumetric, ideal, superior basis and CV on a volumetric, real, superior
basis. Calculation of CV on a mass basis or on any form of inferior basis is
optional and will only be done when those values are required.
CV on all 6 bases are exposed as outputs. Where the CV is not calculated,
the value will be set to NaN. In most cases, only the CV on a volumetric,
real, superior basis will be exposed and connected.
For CV on a molar basis or a mass basis, the ideal and real values are the
same.

TIP: Generally gas composition will be normalized prior to


connecting it to the ISO 6976 Function block. This means that
fractions are adjusted such that they sum to 1.0. Depending on how
the gas analysis is done and to what extent on- line gas
chromatographs are used, the normalization methods vary.
Normalization is not provided by the function block and is beyond the
scope of this document.

186
Chapter 9 - Configuring Function Blocks

ISO6976 Components
ISO 6976 defines 58 components and provides complete or partial constant
data for them. This function block input shows the name of the real
components as seen in the below table. The mol fractions of the non-
exposed components and indexes should be forced to 0.0.

Input
Data
Input Parameter Description
types
Methane LREAL Input mol fractions or mol percentage
Ethane LREAL Input mol fractions or mol percentage
Propane LREAL Input mol fractions or mol percentage
n_Butane LREAL Input mol fractions or mol percentage
i_Butane LREAL Input mol fractions or mol percentage
n_Pentane LREAL Input mol fractions or mol percentage
i_Pentane LREAL Input mol fractions or mol percentage
neo_Pentane LREAL Input mol fractions or mol percentage
n_Hexane LREAL Input mol fractions or mol percentage
Methylpentane_2 LREAL Input mol fractions or mol percentage
Methylpentane_3 LREAL Input mol fractions or mol percentage
Dimethylbutane_2_2 LREAL Input mol fractions or mol percentage
Dimethylbutane_2_3 LREAL Input mol fractions or mol percentage
n_Heptane LREAL Input mol fractions or mol percentage
n_Octane LREAL Input mol fractions or mol percentage
n_Nonane LREAL Input mol fractions or mol percentage
n_Decane LREAL Input mol fractions or mol percentage
Ethylene LREAL Input mol fractions or mol percentage
Propylene LREAL Input mol fractions or mol percentage
Butene1 LREAL Input mol fractions or mol percentage

187
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
cis_2_Butene LREAL Input mol fractions or mol percentage
trans_2_Butene LREAL Input mol fractions or mol percentage
2-Methylpropene LREAL Input mol fractions or mol percentage
Pentene_1 LREAL Input mol fractions or mol percentage
Propadiene LREAL Input mol fractions or mol percentage
Butadiene_1_2 LREAL Input mol fractions or mol percentage
Butadiene_1_3 LREAL Input mol fractions or mol percentage
Acetylene LREAL Input mol fractions or mol percentage
Cyclopentane LREAL Input mol fractions or mol percentage
Methylcyclopentane LREAL Input mol fractions or mol percentage
Ethylcyclopentane LREAL Input mol fractions or mol percentage
Cyclohexane LREAL Input mol fractions or mol percentage
Methylcyclohexane LREAL Input mol fractions or mol percentage
Ethylcyclohexane LREAL Input mol fractions or mol percentage
Benzene LREAL Input mol fractions or mol percentage
Toluene LREAL Input mol fractions or mol percentage
Ethylbenzene LREAL Input mol fractions or mol percentage
o_Xylene LREAL Input mol fractions or mol percentage
Methano LREAL Input mol fractions or mol percentage
Methanethiol LREAL Input mol fractions or mol percentage
Hydrogen LREAL Input mol fractions or mol percentage
Water LREAL Input mol fractions or mol percentage
Hydrogensulphide LREAL Input mol fractions or mol percentage
Ammonia LREAL Input mol fractions or mol percentage
Hydrogencyanide LREAL Input mol fractions or mol percentage
Carbonmonoxide LREAL Input mol fractions or mol percentage
Carbonyldisulphide LREAL Input mol fractions or mol percentage

188
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
Carbondisulphide LREAL Input mol fractions or mol percentage
Helium LREAL Input mol fractions or mol percentage
Neon LREAL Input mol fractions or mol percentage
Argon LREAL Input mol fractions or mol percentage
Nitrogen LREAL Input mol fractions or mol percentage
Oxygen LREAL Input mol fractions or mol percentage
Carbondioxide LREAL Input mol fractions or mol percentage
Sulphurdioxide LREAL Input mol fractions or mol percentage
Dinitrogenmonoxide LREAL Input mol fractions or mol percentage
Krypton LREAL Input mol fractions or mol percentage
Xenon LREAL Input mol fractions or mol percentage
MeteringTemperature INT The possible combinations are:

0 = 0/0, 1 = 15/0 ,2 = 25/0 ,3 = 15/15,4 = 20/22

25 = 25/20
InferiorCV_Values INT If inferior values are required, this needs to be set to 1
DensityScalingFactor LREAL The function block only calculates density in units of
kg/Sm3. However, it is possible to use it for alternative
metric units or non- metric units by scaling the output
using the scale factor. For instance from, say, kg/Sm3 to
lbs/Scuf.

The scale factor must be set to 1.0 for no scaling but


must be numeric and greater than zero.
CV_ LREAL The function block only calculates CV on a molar basis
MolarScalingFactor in units of KJ/mol. However, it is possible to use it for
alternative metric units or non- metric units by scaling
the output using the scale factor. For instance from, say,
KJ/mol to BTU/mol.

The scale factor must be set to 1.0 for no scaling but


must be numeric and greater than zero.
Input Basis INT Input compositions can either be in mol fraction terms or

189
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
types
mol percentage terms. Mol fractions must sum to 1.0
and mol percentages must sum to 100.0.

0 = fraction , 1 = percent.
CV_ INT If mass based CV is required, this must be set to 1.
onMassBasisMode
CV_ LREAL The function block only calculates CV on a mass basis in
MassScalingFactor units of MJ/kg. However, it is possible to use it for
alternative metric units or non- metric units by scaling
the output using the scale factor. For instance from, say,
MJ/kg to BTU/lb.

The scale factor must be set to 1.0 for no scaling but


must be numeric and greater than zero.
CV_ LREAL The function block only calculates CV on a volumetric
VolumeScalingFactor basis in units of MJ/Sm3. However, it is possible to use it
for alternative metric units or non- metric units by scaling
the output using the scale factor. For instance from, say,
MJ/Sm3 to BTU/scuf.

The scale factor must be set to 1.0 for no scaling but


must be numeric and greater than zero.

Output
Data
Output Parameter Description
types
ErrorCode INT Critical error code
CV_MolarBasisSuperior LREAL Calorific value on a molar basis, superior (KJ/mol)
CV_MolarBasisInferior LREAL Calorific value on a molar basis, inferior (KJ/mol)
CV_MassBasisSuperior LREAL Calorific value on a mass basis,superior (MJ/kg)
CV_MassBasisInferior LREAL Calorific value on a mass basis,inferior (MJ/kg)
CVIdeal_ LREAL Ideal calorific value on a volumetric basis, superior
VolBasisSuperior (MJ/Sm3)
CVReal_ LREAL Real calorific value on a volumetric basis, superior
VolBasisSuperior (MJ/Sm3)

190
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description
types
CVIdeal_VolBasisInferior LREAL Ideal calorific value on a volumetric basis, inferior
(MJ/Sm3)
CVReal_VolBasisInferior LREAL Real calorific value on a volumetric basis, inferior
(MJ/Sm3)
MolarMass LREAL Molar mass
ComponentCount INT Number of components
RelativeDensityIdeal LREAL Relative density - ideal
RelativeDensityReal LREAL Relative density - real
ReferenceDensityIdeal LREAL Density at metering conditions – ideal (kg/Sm3)
ReferenceDensityReal LREAL Density at metering conditions – real (kg/Sm3)
StandardDensityIdeal LREAL Standard density - ideal (kg/Sm3)
StandardDensityReal LREAL Standard density - real (kg/Sm3)
SumOfComponentFracs LREAL Sum of component fractions
WobbeIdxIdeal LREAL Wobbe Index - ideal
WobbeIdxReal LREAL Wobbe Index - real
WarningCode INT Warning code
CompressAtRefCond LREAL Compressibility at metering conditions
CompressAtStdCond LREAL Compressibility at standard conditions

Information
ISO 6976 defines 58 components and provides complete or partial constant
data for them.
This data is used in the calculation of molar mass, CV etc. Each component
has an index number (1- 58) and this index will be used to refer to the
particular component. These same index numbers are also used to point at
elements in data arrays. The relationship of indexes and component names
is as follows:

Index Component Name


1 Methane

191
Chapter 9 - Configuring Function Blocks

Index Component Name


2 Ethane
3 Propane
4 n-Butane
5 i-Butane
6 n-Pentane
7 i-Pentane
8 neo-Pentane
9 n-Hexane
10 2-Methylpentane
11 3-Methylpentane
12 2,2-Dimethylbutane
13 2,3 Dimethylbutane
14 n-Heptane
15 n-Octane
16 n-Nonane
17 n-Decane
18 Ethylene
19 Propylene
20 1-Butene
21 cis-2-Butene
22 trans-2-Butene
23 2-Methylpropene
24 1-Pentene
25 Propadiene
26 1,2 Butadiene
27 1,3 Butadiene
28 Acetylene

192
Chapter 9 - Configuring Function Blocks

Index Component Name


29 Cyclopentane
30 Methylcyclopentane
31 Ethylcyclopentane
32 Cyclohexane
33 Methylcyclohexane
34 Ethylcyclohexane
35 Benzene
36 Toluene
37 Ethylbenzene
38 o-Xylene
39 Methano
40 Methanethiol
41 Hydrogen
42 Water
43 Hydrogen sulphide
44 Ammonia
45 Hydrogen cyanide
46 Carbon monoxide
47 Carbonyl disulphide
48 Carbon disulphide
49 Helium
50 Neon
51 Argon
52 Nitrogen
53 Oxygen
54 Carbon dioxide
55 Sulphur dioxide

193
Chapter 9 - Configuring Function Blocks

Index Component Name


56 Dinitrogen monoxide
57 Krypton
58 Xenon

Error and Warning list

Critical Error Codes


Code Description
1 An input component is invalid.
2 Inputs do not sum to 1.0 +/- 0.001.
3 Input configuration is invalid.
4 Absolute temperature is zero.
5 Molar mass is zero.
6 Reference compressibility factor is zero.
7 Standard compressibility factor is zero.
8 Relative gas density real is zero.
9 Relative gas density ideal is zero.

Invalid generally means one of the following:


n The input value is NaN.
n The input value is out of range.

194
Chapter 9 - Configuring Function Blocks

Warning codes
Code Description
1 Inputs do not sum to 1.0 +/- 0.0001.
2 Ethane mol fraction is > 0.15.
3 Water mol fraction is > 0.00005.
4 Nitrogen mol fraction is > 0.3.
5 Carbon dioxide mol fraction is > 0.15.
6 General component mol fraction is > 0.05.
7 Methane mol fraction is < 0.5.

HWPI_Freq

Description
This function block is connected to a pulse input channel’s counter and
outputs frequency and pulse delta count (at 1 sec interval). The first order
filter is used to filter variations and help to calculate frequency.

NOTE: The POU containing this block must be configured at the 50mS
cycle task. The FREQ can be used to calculate the instantaneous flow
rate of the meter.

195
Chapter 9 - Configuring Function Blocks

Input
Input Data
Description
Parameter types
PI UDINT Counter of a pulse input channel.
FILT REAL First order filter time constant in minutes for smoothing calculated
frequency output FREQ. Recommended value is 0.05 to 0.1.

Output
Output Parameter Data types Description
DELTA LREAL Delta counts in last 1 sec
FREQ REAL Calculated pulse frequency in Hz.
PISTS STRING Pulse input channel status message.

Non-configurable Function Blocks


Function blocks in the following libraries need to be only configured with
ControlEdge Builder's meter run wizard, which can be accessed in as
below.

Library
Short Description
Name
API This library provides function blocks to support API21.1 for electronic gas
21.1 Lib measurement systems. These function blocks provide flow measurement,
and API reporting and change management logs required for accurate and auditable gas
21.1 measurement.
Lib_V2

196
Chapter 9 - Configuring Function Blocks

Library
Short Description
Name
API This library provides function blocks to support API 21.2 measures the liquid flow
21.2 Lib for the configured meter type. The function block calculates meter density, Gross
and API and Net standard volume, Sediments and Water volume, mass flow rate,
21.2 averaging and Totalization based on the input parameters. It generates events,
Lib_V2 alarms, hourly and daily QTR's which can be read from SCADA using MODBUS
or DNP3 protocol.

API 21.1
The following libraries of API21.1 Function Blocks are supported:

Library Description
API21_1Lib The function block library provides support for creating flow measurement
calculations for gas based on API 21.1 standard for Orifice, Turbine,
Corolis and ultrasonic meters.
API21_1_V2 It is supported from R161.2 release.

The function block library provides support for creating flow measurement
calculations for gas based on API 21.1 standard for Orifice, Turbine,
Corolis and ultrasonic meters with upgraded recent standards AGA3
(2012), AGA8 (2017) including GERG method and AGA5 (2009). This
version also supports using override values in case of communication/out
of range errors and also supports extended Quantity Transactions and
Alarm and Events for effective audit trail.

The following API 21.1 meter run function blocks are available.

Function
Description
Block
Orifice_Dtl_ Orifice_Dtl_MeterRun calculates
MeterRun
1. Gas compressibility factor, density, relative density and molecular weight
from AGA8 detailed method.

2. Volume flow rate at standard condition, mass flow rate and volume flow
rate at base condition from AGA3.

3. Gas energy per hour

4. Hourly and daily Averages and Totals

5. Generates hourly & daily QTRs

197
Chapter 9 - Configuring Function Blocks

Function
Description
Block
Orifice_GM_ Orifice_GM_MeterRun calculates
MeterRun
1. Gas compressibility factor, density, relative density and molecular weight
from AGA8 gross method.

2. Volume flow rate at standard condition, mass flow rate and volume flow
rate at base condition from AGA3.

3. Gas energy per hour

4. Hourly and daily Averages and Totals

5. Generates hourly & daily QTRs


Turbine_Dtl_ Turbine_Dtl_MeterRun calculates
MeterRun
1. Gas compressibility factor, density, relative density and molecular weight
from AGA8 detailed method.

2. Uncorrected volume flow rate at standard condition, mass flow rate and
volume flow rate at base condition from AGA7.

3. Gas energy per hour

4. Hourly and daily Averages and Totals

5. Generates hourly & daily QTRs


Turbine_GM_ Turbine_GM_MeterRun calculates
MeterRun
1. Gas compressibility factor, density, relative density and molecular weight
from AGA8 gross method.

2. Uncorrected volume flow rate at standard condition, mass flow rate and
volume flow rate at base condition from AGA7.

3. Gas energy per hour

4. Hourly and daily Averages and Totals

5. Generates hourly & daily QTRs


Coriolis_Dtl_ Coriolis_Dtl_MeterRun calculates
MeterRun
1. Gas compressibility factor, density, relative density and molecular weight
from AGA8 detailed method.

2. Volume flow rate at base condition from AGA11.

198
Chapter 9 - Configuring Function Blocks

Function
Description
Block
3. Gas energy per hour

4. Hourly and daily Averages and Totals

5. Generates hourly & daily QTRs


Coriolis_GM_ Coriolis_GM_MeterRun calculates
MeterRun
1. Gas compressibility factor, density, relative density and molecular weight
from AGA8 gross method.

2. Volume flow rate at base condition from AGA11.

3. Gas energy per hour

4. Hourly and daily Averages and Totals

5. Generates hourly & daily QTRs

Orifice_Dtl_MeterRun Function Block


Here is an example for Orifice_Dtl_MeterRun:

199
Chapter 9 - Configuring Function Blocks

Description
This Orifice_Dtl_MeterRun function block calculates gas compressibility
factor, density, relative density and molecular weight from AGA8 detailed
method, volume flow rate at standard condition, mass flow rate and volume
flow rate at base condition from AGA3 and gas energy per hour from AGA5.
It also calculates hourly and daily averages and totals. It generates hourly &
daily QTRs and sends them to EFM application which logs them on the
contoller’s MRAM and flash memory. It also generates alarms when any of
the process value crosses specified alarm limit. Orifice_Dtl_MeterRun
expects the input parameters to be in US or Metric unit system. The
exception is absolute viscosity of the gas that should be in centipoise in
either unit system.

Input
Data
Input Parameter Description Apply to
types
Methane REAL It could be in mole fraction or All
percentage.
Nitrogen REAL It could be in mole fraction or All
percentage.
CO2 REAL It could be in mole fraction or All
percentage.
Ethane REAL It could be in mole fraction or All

200
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
percentage.
Propane REAL It could be in mole fraction or All
percentage.
Water REAL It could be in mole fraction or All
percentage.
H2S REAL It could be in mole fraction or All
percentage.
Hydrogen REAL It could be in mole fraction or All
percentage.
CO REAL It could be in mole fraction or All
percentage.
Oxygen REAL It could be in mole fraction or All
percentage.
IButane REAL It could be in mole fraction or All
percentage.
NButane REAL It could be in mole fraction or All
percentage.
IPentane REAL It could be in mole fraction or All
percentage.
NPentane REAL It could be in mole fraction or All
percentage.
Hexane REAL It could be in mole fraction or All
percentage.
Heptane REAL It could be in mole fraction or All
percentage.
Octane REAL It could be in mole fraction or All
percentage.
Nonane REAL It could be in mole fraction or All
percentage.
Decane REAL It could be in mole fraction or All
percentage.
Helium REAL It could be in mole fraction or All

201
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
percentage.
Argon REAL It could be in mole fraction or All
percentage.
DetailMethod INT Selection for Detail method: Orifice_Dtl_
MeterRun_
1- Detail Method V2
2- GERG Method. GERG Method is
only applicable for V2 function block.
BaseTemp REAL Base temperature should be in All
Fahrenheit for US unit system and in
Celcius for Metric unit system. The
recommended default is 60 Deg F.
BasePressure REAL Base pressure should be in Psia for US All
unit system and in Kpa for Metric unit
system. The recommended default is
14.73 Psia.
FlowingTemp REAL Flowing temperature should be in All
Fahrenheit for US unit system and in
Celcius for Metric unit system.
TempHiHi REAL This is the HiHi limit for flowing All
temperature. It should be either in
Fahrenheit or Celcius.
TempHi REAL This is the Hi limit for flowing All
temperature. It should be either in
Fahrenheit or Celcius.
TempLoLo REAL This is the LoLo limit for flowing All
temperature. It should be either in
Fahrenheit or Celcius.
TempLo REAL This is the Lo limit for flowing All
temperature. It should be either in
Fahrenheit or Celcius.
FlowTempIOSelection INT IO selection for meter temperature. The Orifice_Dtl_
value should be {1} for Live or {2) for MeterRun_
Keypad value. V2
FlowTempStsStatus USINT Analog input channel status for meter Orifice_Dtl_

202
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
temperature. The value should be {0} MeterRun_
for Good or any positive integer for bad V2
status.
FlowTempKeypadVal REAL Keypad value for meter temperature. Orifice_Dtl_
The value that should be used when the MeterRun_
meter temperature status is bad. V2
FlowingPressure REAL Flowing pressure should be in Psia for All
US unit system and in Kpa for Metric
unit system.
PressureHiHi REAL This is the HiHi limit for flowing All
pressure. It should be either in Psia or
Kpa.
PressureHi REAL This is the Hi limit for flowing pressure. All
It should be either in Psia or Kpa.
PressureLoLo REAL This is the LoLo limit for flowing All
pressure. It should be either in Psia or
Kpa.
PressureLo REAL This is the Lo limit for flowing pressure. All
It should be either in Psia or Kpa.
FlowPresIOSelection INT IO selection for meter pressure. The Orifice_Dtl_
value should be {1} for Live or {2) for MeterRun_
Keypad value. V2
FlowPresStsStatus USINT Analog input channel status for meter Orifice_Dtl_
pressure. The value should be {0} for MeterRun_
Good or any positive integer for Bad V2
status.
FlowPresKeypadVal REAL Analog input channel status for meter Orifice_Dtl_
pressure. The value should be {0} for MeterRun_
Good or any positive integer for Bad V2
status.
DifferentialPressure REAL Differential Pressure should be in All
Inches of H2O for US unit system and in
Kpa for Metric unit system.
DPHiHi REAL This is the HiHi limit for differential All
pressure. It should be either in Inches of

203
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
H2O or Kpa.
DPHi REAL This is the Hi limit for differential All
pressure. It should be either in Inches of
H2O or Kpa.
DPLoLo REAL This is the LoLo limit for differential All
pressure. It should be either in Inches of
H2O or Kpa.
DPLo REAL This is the Lo limit for differential All
pressure. It should be either in Inches of
H2O or Kpa.
LowDPCutOff REAL This is the low differential pressure cut All
off limit. It should be either in Inches of
H2O or Kpa. This limit decides no flow
condition.
MeterRunId INT This is an integer number that All
represents a configured meter run
identifier.
GasCompFormat INT This parameter is for the gas All
composition format. It should be either
mole fraction {1} or percentage {2}.

NOTE: It is recommended to use


2 percentage as a default option.

InputUnit INT This parameter is for all the inputs of All


meter run function block. It should be
either US {1} or Metric {2}.
ContractUnit INT This parameter is for all the outputs of All
meter run function block. It should be
either US {1} or Metric {2}.
ContractStartday INT This parameter represents the start of All
gas QTR day. Its value should be from
0 to 23.
AvgMethod INT This parameter is for averaging method All
to be used for averaging. As of now, it
only supports value {1} that is for time

204
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
weighted linear average.
MaintMode INT Parameter to Start or Stop the Orifice_Dtl_
Maintenance Mode. The value should MeterRun_
be either {0} Maintenance End or {1} for V2
Maintenance Start. When Maintenance
mode is started, an independent
totalizer will be started and accumulate
all the flow until the maintenance mode
is stopped. During this period, non-
resettable totals, hourly/daily/batch
totals will be not incremented.
AGA8Version INT Selection for AGA 8 algorithm selection: Orifice_Dtl_
MeterRun_
1- AGA 8 (1994) V2
2 - AGA 8 (2017)
TapsType INT Flange=1 and Pipe=2 All
OrificeMaterial INT STAINLESS STEEL=1, MONEL=2, All
CARBON STEEL=3, STAINLESS_S_
304=4 and STAINLESS_S_316=5
PipeMaterial INT STAINLESS STEEL=1, MONEL=2, All
CARBON STEEL=3, STAINLESS_S_
304=4 and STAINLESS_S_316=5
FluidType INT Compressible Fluid =1 and Non- All
Compressible Fluid=2
TapsLocation INT Upstream=1 and Downstream=2 All
OrificeDiameter REAL This parameter is the for orifice plate All
diameter. It should be either in inches
for US unit system or in millimeter for
Metric unit system.
OrfDiaMsrdTemp REAL This parameter represents the All
temperature at which orifice plate
diameter is measured. It should be
either in Fahrenheit for US unit system
and in Celcius for Metric unit system.
PipeDiameter REAL This parameter is the for pipe diameter. All

205
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
It should be either in inches for US unit
system or in millimeter for Metric unit
system.
PipeDiaMsrdTemp REAL This parameter represents the All
temperature at which pipe diameter is
measured. It should be either in
Fahrenheit for US unit system and in
Celcius for Metric unit system.
AbsViscosity REAL This parameter represents the absolute All
viscosity of the gas in Centipoise. In
either unit system, it must be in
centipoise only.

(Recommended default=0.010268 cP -
pg 34 part 4)
IsenExponent REAL This parameter isentropic exponent is a All
unit less number. (Recommended
default=1.3 - pg 34 part 4)
AGA3Version INT Selection for AGA 3 algorithm selection: Orifice_Dtl_
MeterRun_
1- AGA 3 (1992) V2
2- AGA 3 (2012)
AtmosphericPressure REAL Atmospheric pressure should be in Psia All
for US unit system and in Kpa for Metric
unit system.

Atmospheric pressure is used to make


Flowing pressure absolute when
flowing pressure is measured by a
pressure gauge. If flowing pressure is
already absolute then it can be left zero.

UserDefined1 REAL This parameter is an optional one, if All


user wants to average some parameter
then user can use it, it will be averaged
and logged in the QTR.
UserDefined2 REAL This parameter is an optional one, if All
user wants to average some parameter

206
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
then user can use it, it will be averaged
and logged in the QTR.
UserDefined3 REAL This parameter is an optional one, if All
user wants to average some parameter
then user can use it, it will be averaged
and logged in the QTR.
UserDefined4 REAL This parameter is an optional one, if All
user wants to average some parameter
then user can use it, it will be averaged
and logged in the QTR.

Output
Data
Output Parameter Description Apply to
types
Out_Code INT This out parameter returns success All
or fail code.
GasCompAtBaseCond LREAL This parameter is gas All
compressibility factor at base
condition. It is calculated in AGA8
Detailed method. It is unit less.
GasDensityAtBaseCond LREAL This parameter is gas density at All
base condition. It is calculated
through AGA8 Detailed method. It is
in lbm/ft^3 for US unit system and in
kg/m^3 for Metric unit system.
GasRelDenAtBaseCond LREAL This parameter is gas relative All
density at base condition. It is
calculated through AGA8 Detailed
method. It is unit less.
GasMolecularWeight LREAL This parameter is gas molecular All
weight at base condition. It is
calculated through AGA8 Detailed
method. It is in lbm for US unit
system and in kg for Metric unit
system.

207
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
Aga3QV LREAL This parameter is volume flow rate All
at flowing condition. It is calculated
through AGA3 method. It is in ft^3/hr
for US unit system and in m^3/hr for
Metric unit system.
Aga3QM LREAL This parameter is gas mass flow All
rate. It is calculated through AGA3
method. It is in lbm/hr for US unit
system and in kg/hr for Metric unit
system.
Aga3QB LREAL This parameter is volume flow rate All
at base condition. It is calculated
through AGA3 method. It is in ft^3/hr
for US unit system and in m^3/hr for
Metric unit system.
Energy LREAL This parameter is gas energy per All
hour. It is calculated through AGA5
method. It is in Btu/hr for US unit
system and in MJ/hr for Metric unit
system.
PrevHrAvgTemp LREAL This parameter is previous hour All
average for temperature.
PreDayAvgTemp LREAL This parameter is previous day All
average for temperature.
PrevHrAvgPressure LREAL This parameter is previous hour All
average for pressure.
PreDayAvgPressure LREAL This parameter is previous day All
average for pressure.
PrevHrAvgDP LREAL This parameter is previous hour All
average for differential pressure.
PreDayAvgDP LREAL This parameter is previous day All
average for differential pressure.
PrevHrAvgDenAtBase LREAL This parameter is previous hour All
average for density at base
condition.

208
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
PreDayAvgDenAtBase LREAL This parameter is previous day All
average for density at base
condition.
PrevHrAvgRelDenAtBase LREAL This parameter is previous hour All
average for relative density at base
condition.
PreDayAvgRelDenAtBase LREAL This parameter is previous day All
average for relative density at base
condition.
PrevHrAvgFlowExt LREAL This parameter is previous hour All
average for flow extension.
PreDayAvgFlowExt LREAL This parameter is previous day All
average for flow extension.
PrevHrAvgUserDefined1 LREAL This parameter is previous hour All
average for user defined
parameter1.
PreDayAvgUserDefined1 LREAL This parameter is previous day All
average for user defined
parameter1.
PrevHrAvgUserDefined2 LREAL This parameter is previous hour All
average for user defined
parameter2.
PreDayAvgUserDefined2 LREAL This parameter is previous day All
average for user defined
parameter2.
PrevHrAvgUserDefined3 LREAL This parameter is previous hour All
average for user defined
parameter3.
PreDayAvgUserDefined3 LREAL This parameter is previous day All
average for user defined
parameter3.
PrevHrAvgUserDefined4 LREAL This parameter is previous hour All
average for user defined
parameter4.

209
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
PreDayAvgUserDefined4 LREAL This parameter is previous day All
average for user defined
parameter4.
QbTH LREAL This parameter is volume flow rate All
at base condition total for this hour.
QbLH LREAL This parameter is volume flow rate All
at base condition total for last hour.
QbTD LREAL This parameter is volume flow rate All
at base condition total for this day.
QbLD LREAL This parameter is volume flow rate All
at base condition total for last day.
MTH LREAL This parameter is mass flow rate All
total for this hour.
MLH LREAL This parameter is mass flow rate All
total for last hour.
MTD LREAL This parameter is mass flow rate All
total for this day.
MLD LREAL This parameter is mass flow rate All
total for last day.
ETH LREAL This parameter is energy total for All
this hour.
ELH LREAL This parameter is energy total for All
last hour.
ETD LREAL This parameter is energy total for All
this day.
ELD LREAL This parameter is energy total for All
last day.
QbNR LREAL Non-Resettable or Cumulative total Orifice_Dtl_
for volume at Base. Unit - ft3/hr for MeterRun_
US, m3/hr for Metric. V2
MNR LREAL Non-Resettable or Cumulative total Orifice_Dtl_
for Mass. Unit - lbm/hr for US, kg/hr MeterRun_
for Metric. V2

210
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
ENR LREAL Non-Resettable or Cumulative total Orifice_Dtl_
for Energy. Unit -Btu/hr for US, MeterRun_
MJ/hr for Metric. V2
QbRollover INT Rollover flag for volume at base Orifice_Dtl_
condition non-resettable total. The MeterRun_
value {1} indicates Rollover V2
otherwise {0}. The value for roll-over
is 999,999,999. The rollover flag will
be on 5 times interval time.
MRollover INT Rollover flag for Non-Resettable Orifice_Dtl_
Mass total. The value {1} indicates MeterRun_
Rollover otherwise {0}. The value for V2
roll-over is 999,999,999. The
rollover flag will be on 5 times
interval time.
ERollover INT Rollover flag for Non-Resettable Orifice_Dtl_
Energy total. The value {1} indicates MeterRun_
Rollover otherwise {0}. The value for V2
roll-over is 999,999,999. The
rollover flag will be on 5 times
interval time.
QbMaint LREAL Volume at Base in Maintenance Orifice_Dtl_
mode. MeterRun_
V2
MMaint LREAL Mass in Maintenance mode. Orifice_Dtl_
MeterRun_
V2
EMaint LREAL Energy at Base in Maintenance Orifice_Dtl_
mode. MeterRun_
V2
GERG2008CV LREAL Heat Capacity at Constant Volume Orifice_Dtl_
(J/mol K). MeterRun_
V2
GERG2008CP LREAL Heat Capacity at Constant Pressure Orifice_Dtl_
(J/mol K). MeterRun_
V2

211
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
GERG2008W LREAL Speed of sound in gas being Orifice_Dtl_
measured. Unit - ft/sec for US, MeterRun_
meter/sec for Metric. V2

NOTE: The above outputs including averages and totals would be in


the contract unit. The QTR generated by this function block contains
following fields. Datetime; Mass flow rate (total) Flowtime; Volume flow
rate at base condition (total); Energy per hour (total); Average
Temperature; Average Pressure; Average Differential pressure;
Average Density at base condition; Average Relative Density at base
condition; Average Flow Extension; Average User Defined 1
(optional); Average User Defined 2 (optional); Average User Defined 3
(optional); Average User Defined 4 (optional).

Following are the error codes for the above meter run function block.

Out
Description Apply to
Code
0 SUCCESS All
1¹ ERROR: PRESSURE HAS A NEGATIVE DERIVATIVE DEFAULT All
GAS DENSITY USED
ERROR: A COMPONENT MOLE FRACTION < 0.0 OR > 1.0 Orifice_Dtl_
MeterRun_
V2
2¹ WARNING: DENSITY IN BRAKET EXCEEDS MAXIMUM DEFAULT All
PROCEEDURE USED
WARNING: SUM OF MOLE FRACTIONS < 0.9999 OR > 1.0001 Orifice_Dtl_
MeterRun_
V2
3¹ ERROR: MAXIMUM ITERATIONS EXCEEDED IN BRAKET All
DEFAULT DENSITY USED
WARNING: PRESSURE BASE (PB) <= 0.0 OR >= 16 PSIA Orifice_Dtl_
MeterRun_
V2
4¹ ERROR: MAXIMUM ITERATIONS IN DDETAIL EXCEEDED LAST All
DENSITY USED

212
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
WARNING: TEMPERATURE BASE (TB) <= 32.0 OR >= 77.0 DEG F Orifice_Dtl_
MeterRun_
V2
32 ERROR: FLOWING PRESSURE (PF) <= 0.0 OR > 40,000. PSIA All
33 ERROR: FLOWING TEMPERATURE (TF) < -200 OR > 760 DEG F All
36 ERROR: MOLE FRACTION FOR METHANE < 0.0 OR > 1.0 Orifice_Dtl_
FOR NITROGEN < 0.0 OR > 1.0 MeterRun
FOR CARBON DIOXIDE < 0.0 OR > 1.0
FOR ETHANE < 0.0 OR > 1.0
FOR PROPANE < 0.0 OR > 0.12
FOR WATER < 0.0 OR > 0.10
FOR H2S < 0.0 OR > 1.0
FOR HYDROGEN < 0.0 OR > 1.0
FOR CARBON MONOXIDE < 0.0 OR > 0.03
FOR OXYGEN < 0.0 OR > 0.21
FOR BUTANES < 0.0 OR > 0.06
FOR PENTANES < 0.0 OR > 0.04
FOR HEXANES + < 0.0 OR > 0.10
FOR HELIUM < 0.0 OR > 0.03
FOR ARGON < 0.0 OR > 1.0
37 ERROR: REFERENCE TEMPERATURE < 32.0 OR > 77.0 DEG F All
38 ERROR: REFERENCE PRESSURE < 12.9 OR > 16.01 PSIA All
39 ERROR: SUM OF MOLE FRACTIONS < 0.98 OR > 1.020 All
42 WARNING: FLOWING PRESSURE (PF) < 0.0 OR > 1750. PSIA All
43 WARNING: FLOWING TEMPERATURE (TF) < 17 OR > 143 DEG F All
45 WARNING: ANY COMPONENT MOLE FRACTION OUTSIDE OF Orifice_Dtl_
AGA REPORT NO. 8 RECOMMENDED RANGE MeterRun_
V2
46 WARNING: MOLE FRACTION FOR METHANE < 0.45 OR > 1.0 Orifice_Dtl_
FOR NITROGEN < 0.0 OR > 0.5 MeterRun
FOR CARBON DIOXIDE < 0.0 OR > 0.3
FOR ETHANE < 0.0 OR > 0.1
FOR PROPANE < 0.0 OR > 0.04
FOR WATER < 0.0 OR >= 0.0005
FOR H2S < 0.0 OR > 0.0002

213
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
FOR HYDROGEN < 0.0 OR > 0.1
FOR CARBON MONOXIDE < 0.0 OR > 0.03
FOR OXYGEN < 0.0 OR > 0.0
FOR BUTANES < 0.0 OR > 0.01
FOR PENTANES < 0.0 OR >= 0.003
FOR HEXANES + < 0.0 OR >= 0.002
FOR HELIUM < 0.0 OR >= 0.002
FOR ARGON < 0.0 OR > 0.0
49 WARNING: SUM OF MOLE FRACTIONS < 0.9999 OR > 1.0001 All
51 ERROR: NTAPS WAS NOT 0, 1 OR 2 All
52 ERROR: FLOWING PRESSURE WAS <= 0.0 OR > 40000. PSIA All
53 ERROR: FLOWING TEMPERATURE < -200. OR > 760. DEG F All
54 ERROR: MATORF OR MATPIPE WAS NOT 0, 1, 2 OR 3 All
55 ERROR: ORIFICE DIAMETER WAS <= 0 OR => 100.0 INCHES All
56 ERROR: PIPE DIAMETER WAS <= 0 OR => 100.0 INCHES All
57 ERROR: FLOWING OR STANDARD DENSITY WAS <= 0.0 All
LBM/FT^3
58 ERROR: DIFFERENTIAL PRESSURE WAS <= 0.0 INCHES H2O All
59 ERROR: GAS VISCOSITY WAS <= 0.005 OR > 0.5 CENTIPOISES All
60 ERROR: ISENTROPIC EXPONENT <= 1.0 OR => 2.0 All
61 ERROR: IFLUID WAS NOT 0, 1 OR 2 All
62 ERROR: STANDARD TEMPERATURE WAS NOT = 60.0 DEG F All
63 ERROR: STANDARD PRESSURE WAS NOT = 14.73 PSIA All
64 ERROR: TAP LOCATION WAS NOT 0, 1 OR 2 FOR NTAPS=2 All
(PIPE) OR TAP LOCATION WAS NOT 1 FOR NTAPS=1 (FLANGE)
65 ERROR: SUPERCOMPRESSIBILITY FACTOR WAS <= 0.0 All
66 ERROR: RELATIVE DENSITY AT STANDARD CONDITIONS WAS All
< 0.07 OR > 1.52
67 ERROR: CALIBRATION FACTOR WAS <= 0.0 All
68 ERROR: COMPRESSIBILITY FACTOR AT STANDARD All
CONDITIONS <= 0.0

214
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
69 ERROR: BETA RATIO (DO/DM) <= 0.0 OR => 1.0 All
70 ERROR: IF NTAPS = 1, GOF2015_OPTION NOT = 1 OR = 0 Orifice_Dtl_
MeterRun_
V2
71 ERROR: IF NTAPS = 2, GOF2015_OPTION NOT = 0 Orifice_Dtl_
MeterRun_
V2
72 ERROR: DIFFERENTIAL PRESSURE WAS GREATER THAN Orifice_Dtl_
UPSTREAM STATIC PRESSURE MeterRun_
V2
75 WARNING: ORIFICE DIAMETER WAS <= 0.45 INCHES All
76 WARNING: PIPE DIAMETER WAS <= 2.0 INCHES All
79 WARNING: BETA RATIO (DO/DM) WAS <= 0.1 OR >= 0.75 All
80 WARNING: IF GOF2015_OPTION = 1, (HW)/(27.7072*(PF)) = OR > Orifice_Dtl_
0.25; MeterRun_
V2
IF GOF2015_OPTION = 0, (HW)/(27.707*(PF)) > 0.2
86 WARNING: Flowing Pressure greater than 2017 AGA8 GERG-2008 Orifice_Dtl_
Full Quality Range (10,150 PSIA) MeterRun_
V2
87 WARNING: Flowing Pressure greater than 2017 AGA8 GERG-2008 Orifice_Dtl_
Range (5075 PSIA) MeterRun_
V2
88 WARNING: Flowing Temperature outside 2017 AGA8 GERG-2008 Orifice_Dtl_
Full Quality Range (-352 F < TF < 800 F) MeterRun_
V2
89 WARNING: Flowing Temperature outside 2017 AGA8 GERG-2008 Orifice_Dtl_
Range (-298 F < TF < 350 F) MeterRun_
V2
90 WARNING: A Component Mole % outside 2017 AGA8 GERG-2008 Orifice_Dtl_
Intermediate Quality Range MeterRun_
V2
91 WARNING: A Component Mole % outside 2017 AGA8 GERG-2008 Orifice_Dtl_
Pipeline Quality Range MeterRun_

215
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
V2
NOTE 1: Error codes 1~4 are common between AGA 8 and AGA 5. You must take caution
and analyze when these specific out codes appear to determine the source.

216
Chapter 9 - Configuring Function Blocks

Orifice_GM_MeterRun Function Block


Here is an example for Orifice_GM_MeterRun:

Description
This Orifice_GM_MeterRun function block calculates gas compressibility
factor, density, relative density and molecular weight from AGA8 gross
method, volume flow rate at standard condition, mass flow rate and volume
flow rate at base condition from AGA3 and gas energy per hour from AGA5.
It also calculates hourly and daily averages and totals. It generates hourly &
daily QTRs and sends them to EFM application which logs them on the

217
Chapter 9 - Configuring Function Blocks

contoller’s MRAM and flash memory. It also generates alarms when any of
the process value crosses specified alarm limit. Orifice_GM_MeterRun
expects the input parameters to be in US or Metric unit system. The
exception is absolute viscosity of the gas that should be in centipoise in
either unit system.

Input
Data
Input Parameter Description Apply to
types
GrossMethod INT This parameter represents All
gross method number. It
should be either {1} for gross
method 1 and {2} for gross
method 2.
GasRelDensity REAL This parameter is gas relative All
density at reference condition.
It is unit less.
CO2 REAL It could be in mole fraction or All
percentage.
Hydrogen REAL It could be in mole fraction or All
percentage.
CO REAL It could be in mole fraction or All
percentage.
Nitrogen REAL It could be in mole fraction or All
percentage. This parameter is
only required for gross method
2, for gross method 1, it can be
zero.
GasHeatingValue REAL This parameter is gas heating All
value. It is only required for
gross method 1, for gross
method 2, it can be zero. It is in
Btu/ft^3 for US unit system and
in MJ/m^3 for Metric unit
system.
RefTempForCalorimeterDensity REAL This parameter is reference All
temperature for calorimeter
density. It should be in
Fahrenheit for US unit system

218
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
and in Celcius for Metric unit
system. The recommended
default is 60 Deg F.
RefPressForCalorimeterDensity REAL This parameter is reference All
pressure for calorimeter
density. It should be in Psia for
US unit system and in Kpa for
Metric unit system. The
recommended default is 14.73
Psia.
RefTempForCombustion REAL This parameter is reference All
temperature for combustion. It
should be in Fahrenheit for US
unit system and in Celcius for
Metric unit system. The
recommended default is 60
Deg F.
BaseTemp REAL Base temperature should be in All
Fahrenheit for US unit system
and in Celcius for Metric unit
system. The recommended
default is 60 Deg F.
BasePressure REAL Base pressure should be in All
Psia for US unit system and in
Kpa for Metric unit system. The
recommended default is 14.73
Psia.
FlowingTemp REAL Flowing temperature should be All
in Fahrenheit for US unit
system and in Celcius for
Metric unit system.
TempHiHi REAL This is the HiHi limit for flowing All
temperature. It should be either
in Fahrenheit or Celcius.
TempHi REAL This is the Hi limit for flowing All
temperature. It should be either
in Fahrenheit or Celcius.

219
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
TempLoLo REAL This is the LoLo limit for flowing All
temperature. It should be either
in Fahrenheit or Celcius.
TempLo REAL This is the Lo limit for flowing All
temperature. It should be either
in Fahrenheit or Celcius.
FlowTempIOSelection INT IO selection for meter Orifice_GM_
temperature. The value should MeterRun_
be {1} for Live or {2) for Keypad V2
value.
FlowTempStsStatus USINT Analog input channel status for Orifice_GM_
meter temperature. The value MeterRun_
should be {0} for Good or any V2
positive integer for bad status.
FlowTempKeypadVal REAL Keypad value for meter Orifice_GM_
temperature. The value that MeterRun_
should be used when the meter V2
temperature status is bad.
FlowingPressure REAL Flowing pressure should be in All
Psia for US unit system and in
Kpa for Metric unit system.
PressureHiHi REAL This is the HiHi limit for flowing All
pressure. It should be either in
Psia or Kpa.
PressureHi REAL This is the Hi limit for flowing All
pressure. It should be either in
Psia or Kpa.
PressureLoLo REAL This is the LoLo limit for flowing All
pressure. It should be either in
Psia or Kpa.
PressureLo REAL This is the Lo limit for flowing All
pressure. It should be either in
Psia or Kpa.
FlowPresIOSelection INT IO selection for meter pressure. Orifice_GM_
The value should be {1} for Live MeterRun_
or {2) for Keypad value. V2

220
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
FlowPresStsStatus USINT Analog input channel status for Orifice_GM_
meter pressure. The value MeterRun_
should be {0} for Good or any V2
positive integer for Bad status.
FlowPresKeypadVal REAL Analog input channel status for Orifice_GM_
meter pressure. The value MeterRun_
should be {0} for Good or any V2
positive integer for Bad status.
DifferentialPressure REAL Differential Pressure should be All
in Inches of H2O for US unit
system and in Kpa for Metric
unit system.
DPHiHi REAL This is the HiHi limit for All
differential pressure. It should
be either in Inches of H2O or
Kpa.
DPHi REAL This is the Hi limit for All
differential pressure. It should
be either in Inches of H2O or
Kpa.
DPLoLo REAL This is the LoLo limit for All
differential pressure. It should
be either in Inches of H2O or
Kpa.
DPLo REAL This is the Lo limit for All
differential pressure. It should
be either in Inches of H2O or
Kpa.
LowDPCutOff REAL This is the low differential All
pressure cut off limit. It should
be either in Inches of H2O or
Kpa. This limit decides no flow
condition.
MeterRunId INT This is an integer number that All
represents a configured meter
run identifier.

221
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
GasCompFormat INT This parameter is for the gas All
composition format. It should
be either mole fraction {1} or
percentage {2}.

NOTE: It is
recommended to use 2
percentage as a default
option.

InputUnit INT This parameter is for all the All


inputs of meter run function
block. It should be either US {1}
or Metric {2}.
ContractUnit INT This parameter is for all the All
outputs of meter run function
block. It should be either US {1}
or Metric {2}.
ContractStartday INT This parameter represents the All
start of gas QTR day. Its value
should be from 0 to 23.
AvgMethod INT This parameter is for averaging All
method to be used for
averaging. As of now, it only
supports value {1} that is for
time weighted linear average.
MaintMode INT Parameter to Start or Stop the Orifice_GM_
Maintenance Mode. The value MeterRun_
should be either {0} V2
Maintenance End or {1} for
Maintenance Start. When
Maintenance mode is started,
an independent totalizer will be
started and accumulate all the
flow until the maintenance
mode is stopped. During this
period, non-resettable totals,
hourly/daily/batch totals will be
not incremented.

222
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
AGA8Version INT Selection for AGA 8 algorithm Orifice_GM_
selection: MeterRun_
V2
1- AGA 8 (1994)

2 - AGA 8 (2017)
TapsType INT Flange=1 and Pipe=2 All
OrificeMaterial INT STAINLESS STEEL=1, All
MONEL=2, CARBON
STEEL=3, STAINLESS_S_
304=4 and STAINLESS_S_
316=5
PipeMaterial INT STAINLESS STEEL=1, All
MONEL=2, CARBON
STEEL=3, STAINLESS_S_
304=4 and STAINLESS_S_
316=5
FluidType INT Compressible Fluid =1 All
and Non-Compressible
Fluid=2
TapsLocation INT Upstream=1 and All
Downstream=2
OrificeDiameter REAL This parameter is the for orifice All
plate diameter. It should be
either in inches for US unit
system or in millimeter for
Metric unit system.
OrfDiaMsrdTemp REAL This parameter represents the All
temperature at which orifice
plate diameter is measured. It
should be either in Fahrenheit
for US unit system and in
Celcius for Metric unit system.
PipeDiameter REAL This parameter is the for pipe All
diameter. It should be either in
inches for US unit system or in
millimeter for Metric unit

223
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
system.
PipeDiaMsrdTemp REAL This parameter represents the All
temperature at which pipe
diameter is measured. It should
be either in Fahrenheit for US
unit system and in Celcius for
Metric unit system.
AbsViscosity REAL This parameter represents the All
absolute viscosity of the gas in
Centipoise. In either unit
system, it must be in centipoise
only.

(Recommended
default=0.010268 cP - pg 34
part 4)
IsenExponent REAL This parameter isentropic All
exponent is a unit less number.
(Recommended default=1.3 -
pg 34 part 4)
AGA3Version INT Selection for AGA 3 algorithm Orifice_GM_
selection: MeterRun_
V2
1- AGA 3 (1992)

2- AGA 3 (2012)
AtmosphericPressure REAL Atmospheric pressure should All
be in Psia for US unit system
and in Kpa for Metric unit
system.

Atmospheric pressure is used


to make Flowing pressure
absolute when flowing
pressure is measured by a
pressure gauge. If flowing
pressure is already absolute
then it can be left zero.
UserDefined1 REAL This parameter is an optional All

224
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
one, if user wants to average
some parameter then user can
use it, it will be averaged and
logged in the QTR.
UserDefined2 REAL This parameter is an optional All
one, if user wants to average
some parameter then user can
use it, it will be averaged and
logged in the QTR.
UserDefined3 REAL This parameter is an optional All
one, if user wants to average
some parameter then user can
use it, it will be averaged and
logged in the QTR.
UserDefined4 REAL This parameter is an optional All
one, if user wants to average
some parameter then user can
use it, it will be averaged and
logged in the QTR.

Output
Data
Output Parameter Description Apply to
types
Out_Code INT This out parameter returns success All
or fail code.
GasCompAtBaseCond LREAL This parameter is gas All
compressibility factor at base
condition. It is calculated in AGA8
Detailed method. It is unit less.
GasDensityAtBaseCond LREAL This parameter is gas density at All
base condition. It is calculated
through AGA8 Detailed method. It
is in lbm/ft^3 for US unit system and
in kg/m^3 for Metric unit system.
GasRelDenAtBaseCond LREAL This parameter is gas relative All

225
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
density at base condition. It is
calculated through AGA8 Detailed
method. It is unit less.
GasMolecularWeight LREAL This parameter is gas molecular All
weight at base condition. It is
calculated through AGA8 Detailed
method. It is in lbm for US unit
system and in kg for Metric unit
system.
Aga3QV LREAL This parameter is volume flow rate All
at flowing condition. It is calculated
through AGA3 method. It is in
ft^3/hr for US unit system and in
m^3/hr for Metric unit system.
Aga3QM LREAL This parameter is gas mass flow All
rate. It is calculated through AGA3
method. It is in lbm/hr for US unit
system and in kg/hr for Metric unit
system.
Aga3QB LREAL This parameter is volume flow rate All
at base condition. It is calculated
through AGA3 method. It is in
ft^3/hr for US unit system and in
m^3/hr for Metric unit system.
Energy LREAL This parameter is gas energy per All
hour. It is calculated through AGA5
method. It is in Btu/hr for US unit
system and in MJ/hr for Metric unit
system.
PrevHrAvgTemp LREAL This parameter is previous hour All
average for temperature.
PreDayAvgTemp LREAL This parameter is previous day All
average for temperature.
PrevHrAvgPressure LREAL This parameter is previous hour All
average for pressure.
PreDayAvgPressure LREAL This parameter is previous day All
average for pressure.

226
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
PrevHrAvgDP LREAL This parameter is previous hour All
average for differential pressure.
PreDayAvgDP LREAL This parameter is previous day All
average for differential pressure.
PrevHrAvgDenAtBase LREAL This parameter is previous hour All
average for density at base
condition.
PreDayAvgDenAtBase LREAL This parameter is previous day All
average for density at base
condition.
PrevHrAvgRelDenAtBase LREAL This parameter is previous hour All
average for relative density at base
condition.
PreDayAvgRelDenAtBase LREAL This parameter is previous day All
average for relative density at base
condition.
PrevHrAvgFlowExt LREAL This parameter is previous hour All
average for flow extension.
PreDayAvgFlowExt LREAL This parameter is previous day All
average for flow extension.
PrevHrAvgUserDefined1 LREAL This parameter is previous hour All
average for user defined
parameter1.
PreDayAvgUserDefined1 LREAL This parameter is previous day All
average for user defined
parameter1.
PrevHrAvgUserDefined2 LREAL This parameter is previous hour All
average for user defined
parameter2.
PreDayAvgUserDefined2 LREAL This parameter is previous day All
average for user defined
parameter2.
PrevHrAvgUserDefined3 LREAL This parameter is previous hour All
average for user defined

227
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
parameter3.
PreDayAvgUserDefined3 LREAL This parameter is previous day All
average for user defined
parameter3.
PrevHrAvgUserDefined4 LREAL This parameter is previous hour All
average for user defined
parameter4.
PreDayAvgUserDefined4 LREAL This parameter is previous day All
average for user defined
parameter4.
QbTH LREAL This parameter is volume flow rate All
at base condition total for this hour.
QbLH LREAL This parameter is volume flow rate All
at base condition total for last hour.
QbTD LREAL This parameter is volume flow rate All
at base condition total for this day.
QbLD LREAL This parameter is volume flow rate All
at base condition total for last day.
MTH LREAL This parameter is mass flow rate All
total for this hour.
MLH LREAL This parameter is mass flow rate All
total for last hour.
MTD LREAL This parameter is mass flow rate All
total for this day.
MLD LREAL This parameter is mass flow rate All
total for last day.
ETH LREAL This parameter is energy total for All
this hour.
ELH LREAL This parameter is energy total for All
last hour.
ETD LREAL This parameter is energy total for All
this day.
ELD LREAL This parameter is energy total for All

228
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
last day.
QbNR LREAL Non-Resettable or Cumulative total Orifice_GM_
for volume at Base. Unit - ft3/hr for MeterRun_
US, m3/hr for Metric. V2
MNR LREAL Non-Resettable or Cumulative total Orifice_GM_
for Mass. Unit - lbm/hr for US, kg/hr MeterRun_
for Metric. V2
ENR LREAL Non-Resettable or Cumulative total Orifice_GM_
for Energy. Unit -Btu/hr for US, MeterRun_
MJ/hr for Metric. V2
QbRollover INT Rollover flag for volume at base Orifice_GM_
condition non-resettable total. The MeterRun_
value {1} indicates Rollover V2
otherwise {0}. The value for roll-
over is 999,999,999. The rollover
flag will be on 5 times interval time.
MRollover INT Rollover flag for Non-Resettable Orifice_GM_
Mass total. The value {1} indicates MeterRun_
Rollover otherwise {0}. The value V2
for roll-over is 999,999,999. The
rollover flag will be on 5 times
interval time.
ERollover INT Rollover flag for Non-Resettable Orifice_GM_
Energy total. The value {1} MeterRun_
indicates Rollover otherwise {0}. V2
The value for roll-over is
999,999,999. The rollover flag will
be on 5 times interval time.
QbMaint LREAL Volume at Base in Maintenance Orifice_GM_
mode. MeterRun_
V2
MMaint LREAL Mass in Maintenance mode. Orifice_GM_
MeterRun_
V2
EMaint LREAL Energy at Base in Maintenance Orifice_GM_
mode. MeterRun_

229
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
V2

NOTE: The above outputs including averages and totals would be in


the contract unit. The QTR generated by this function block contains
following fields. Datetime; Mass flow rate (total) Flowtime; Volume flow
rate at base condition (total); Energy per hour (total); Average
Temperature; Average Pressure; Average Differential pressure;
Average Density at base condition; Average Relative Density at base
condition; Average Flow Extension; Average User Defined 1
(optional); Average User Defined 2 (optional); Average User Defined 3
(optional); Average User Defined 4 (optional).

Following are the error codes for the above meter run function block.

Out
Description Apply to
Code
0 SUCCESS All
5 ERROR: THE ROOT WAS NOT BOUNDED IN DGROSS All
6 ERROR: NO CONVERGENCE IN DGROSS All
7 ERROR: VIRGS SQURE ROOT NEGATIVE All
8 ERROR: COMBINED VALUES OF GRGR, X[2] AND HV NOT All
CONSISTENT
9 ERROR: INVALID TERM IN VIRGS All
11 ERROR: METHOD WAS NOT 1 OR 2 All
12 ERROR: FLOWING PRESSURE (PF) <= 0.0 OR > 1740.0 PSIA All
13 ERROR: FLOWING TEMPERATURE (TF) < 14.0 OR > 149.0 DEG F All

14 ERROR: HEATING VALUE (HV) < 477.0 OR > 1211.0 BTU/FT^3 All
15 ERROR: GAS RELATIVE DENSITY (GRGR) < 0.55 OR > 0.870 All
16 ERROR: MOLE FRACTION FOR N2 < 0.0 OR > 0.50 All
OR FOR CO2 < 0.0 OR > 0.30
OR FOR H2 < 0.0 OR > 0.10
OR FOR CO < 0.0 OR > 0.03
17 ERROR: REFERENCE TEMPERATURE < 32.0 OR > 77.0 DEG F All

230
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
18 ERROR: REFERENCE PRESSURE < 13.0 OR > 16.0 PSIA All
22 WARNING: FLOWING PRESSURE (PF) <= 0.0 OR > 1200.0 PSIA Orifice_GM_
MeterRun
23 WARNING: FLOWING TEMPERATURE (TF) < 32.0 OR > 130.0 Orifice_GM_
DEG F MeterRun
24 WARNING: HEATING VALUE (HV) < 805.0 OR > 1208.0 BTU/FT^3 Orifice_GM_
MeterRun
25 WARNING: GAS RELATIVE DENSITY (GRGR) < 0.55 OR > 0.800 Orifice_GM_
MeterRun
26 WARNING: MOLE FRACTION FOR N2 < 0.0 OR > 0.20 Orifice_GM_
OR FOR CO2 < 0.0 OR > 0.20 MeterRun
OR FOR H2 < 0.0 OR > 0.0
OR FOR CO < 0.0 OR >0.0
51 ERROR: NTAPS WAS NOT 0, 1 OR 2 All
54 ERROR: MATORF OR MATPIPE WAS NOT 0, 1, 2 OR 3 All
55 ERROR: ORIFICE DIAMETER WAS <= 0 OR => 100.0 INCHES All
56 ERROR: PIPE DIAMETER WAS <= 0 OR => 100.0 INCHES All
57 ERROR: FLOWING OR STANDARD DENSITY WAS <= 0.0 All
LBM/FT^3
58 ERROR: DIFFERENTIAL PRESSURE WAS <= 0.0 INCHES H2O All
59 ERROR: GAS VISCOSITY WAS <= 0.005 OR > 0.5 CENTIPOISES All
60 ERROR: ISENTROPIC EXPONENT <= 1.0 OR => 2.0 All
61 ERROR: IFLUID WAS NOT 0, 1 OR 2 All
62 ERROR: STANDARD TEMPERATURE WAS NOT = 60.0 DEG F All
63 ERROR: STANDARD PRESSURE WAS NOT = 14.73 PSIA All
64 ERROR: TAP LOCATION WAS NOT 0, 1 OR 2 FOR NTAPS=2 All
(PIPE) OR TAP LOCATION WAS NOT 1 FOR NTAPS=1 (FLANGE)
65 ERROR: SUPERCOMPRESSIBILITY FACTOR WAS <= 0.0 All
66 ERROR: RELATIVE DENSITY AT STANDARD CONDITIONS WAS All
< 0.07 OR > 1.52

231
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
67 ERROR: CALIBRATION FACTOR WAS <= 0.0 All
68 ERROR: COMPRESSIBILITY FACTOR AT STANDARD All
CONDITIONS <= 0.0
69 ERROR: BETA RATIO (DO/DM) <= 0.0 OR => 1.0 All
70 ERROR: IF NTAPS = 1, GOF2015_OPTION NOT = 1 OR = 0 Orifice_GM_
MeterRun_
V2
71 ERROR: IF NTAPS = 2, GOF2015_OPTION NOT = 0 Orifice_GM_
MeterRun_
V2
72 ERROR: DIFFERENTIAL PRESSURE WAS GREATER THAN Orifice_GM_
UPSTREAM STATIC PRESSURE MeterRun_
V2
75 WARNING: ORIFICE DIAMETER WAS <= 0.45 INCHES All
76 WARNING: PIPE DIAMETER WAS <= 2.0 INCHES All
79 WARNING: BETA RATIO (DO/DM) WAS <= 0.1 OR >= 0.75 All
80 WARNING: IF GOF2015_OPTION = 1, (HW)/(27.7072*(PF)) = OR > Orifice_GM_
0.25; MeterRun_
V2
IF GOF2015_OPTION = 0, (HW)/(27.707*(PF)) > 0.2
81 WARNING: FLOWING PRESSURE (PF) > 1500.0 PSIA AGA8 2017 Orifice_GM_
RANGE 1 MeterRun_
V2
82 WARNING: FLOWING TEMPERATURE (TF) < 17.01 OR > 143.0 Orifice_GM_
DEG F AGA8 2017 RANGE 2 OR (TF) < 25.0 OR > 143.0 DEG F MeterRun_
AGA8 2017 RANGE 1 V2
83 WARNING: HEATING VALUE (HV) < 665.0 OR > 1100.0 BTU/FT^3 Orifice_GM_
AGA8 2017 RANGE 2 OR (HV) < 930.0 OR > 1040.0 BTU/FT^3 MeterRun_
AGA8 2017 RANGE 1 V2
84 WARNING: GAS RELATIVE DENSITY (GRGR) < 0.554 OR > 0.801 Orifice_GM_
AGA8 2017 RANGE 2 OR (GRGR) < 0.554 OR > 0.630 AGA8 MeterRun_
RANGE 1 V2
85 WARNING: MOLE FRACTION FOR N2 > 0.20 AGA8 2017 RANGE Orifice_GM_
2 OR N2 > 0.07 AGA8 2017 RANGE 1 MeterRun_

232
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
OR FOR CO2 > 0.25 AGA8 2017 RANGE 2 OR CO2 > 0.03 AGA8 V2
2017 RANGE 1

OR FOR H2 < 0.0 OR > 0.0 AGA8 2017 RANGE 1 AND 2

OR FOR CO < 0.0 OR > 0.0 AGA8 2017 RANGE 1 AND 2

Turbine_Dtl_MeterRun Function Block


Here is an example for Turbine_Dtl_MeterRun:

233
Chapter 9 - Configuring Function Blocks

Description
This Turbine_Dtl_MeterRun function block calculates gas compressibility
factor, density, relative density and molecular weight from AGA8 detailed
method, uncorrected flow, mass flow rate and volume flow rate at base
condition from AGA7 and gas energy per hour from AGA5. It also calculates
hourly and daily averages and totals. It generates hourly & daily QTRs and
sends them to EFM application which logs them on he contoller’s MRAM
and flash memory. It also generates alarms when any of the process value
crosses specified alarm limit.
Turbine_Dtl_MeterRun expects the input parameters to be in US or Metric
unit system.
This description is also applicable to function block Ultrasonic_Dtl_
MeterRun. Both Turbine and Ultrasonic meters are technically same.

Input
Data
Input Parameter Description Apply to
types
Methane REAL It could be in mole fraction or percentage. All

Nitrogen REAL It could be in mole fraction or percentage. All

234
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
CO2 REAL It could be in mole fraction or percentage. All

Ethane REAL It could be in mole fraction or percentage. All

Propane REAL It could be in mole fraction or percentage. All

Water REAL It could be in mole fraction or percentage. All

H2S REAL It could be in mole fraction or percentage. All

Hydrogen REAL It could be in mole fraction or percentage. All

CO REAL It could be in mole fraction or percentage. All

Oxygen REAL It could be in mole fraction or percentage. All

IButane REAL It could be in mole fraction or percentage. All

NButane REAL It could be in mole fraction or percentage. All

IPentane REAL It could be in mole fraction or percentage. All

NPentane REAL It could be in mole fraction or percentage. All

Hexane REAL It could be in mole fraction or percentage. All

Heptane REAL It could be in mole fraction or percentage. All

Octane REAL It could be in mole fraction or percentage. All

Nonane REAL It could be in mole fraction or percentage. All

235
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
Decane REAL It could be in mole fraction or percentage. All

Helium REAL It could be in mole fraction or percentage. All

Argon REAL It could be in mole fraction or percentage. All

DetailMethod INT Selection for Detail method: Turbine_


Dtl_
1- Detail Method MeterRun_
2- GERG Method. GERG Method is only V2
applicable for V2 function block.
BaseTemp REAL Base temperature should be in All
Fahrenheit for US unit system and in
Celcius for Metric unit system. The
recommended default is 60 Deg F.
BasePressure REAL Base pressure should be in Psia for US All
unit system and in Kpa for Metric unit
system. The recommended default is
14.73 Psia.
FlowingTemp REAL Flowing temperature should be in All
Fahrenheit for US unit system and in
Celcius for Metric unit system.
TempHiHi REAL This is the HiHi limit for flowing All
temperature. It should be either in
Fahrenheit or Celcius.
TempHi REAL This is the Hi limit for flowing All
temperature. It should be either in
Fahrenheit or Celcius.
TempLoLo REAL This is the LoLo limit for flowing All
temperature. It should be either in
Fahrenheit or Celcius.
TempLo REAL This is the Lo limit for flowing All
temperature. It should be either in
Fahrenheit or Celcius.
FlowTempIOSelection INT IO selection for meter temperature. The Turbine_

236
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
value should be {1} for Live or {2) for Dtl_
Keypad value. MeterRun_
V2
FlowTempStsStatus USINT Analog input channel status for meter Turbine_
temperature. The value should be {0} for Dtl_
Good or any positive integer for bad MeterRun_
status. V2
FlowTempKeypadVal REAL Keypad value for meter temperature. The Turbine_
value that should be used when the meter Dtl_
temperature status is bad. MeterRun_
V2
FlowingPressure REAL Flowing pressure should be in Psia for All
US unit system and in Kpa for Metric unit
system.
PressureHiHi REAL This is the HiHi limit for flowing pressure. All
It should be either in Psia or Kpa.
PressureHi REAL This is the Hi limit for flowing pressure. It All
should be either in Psia or Kpa.
PressureLoLo REAL This is the LoLo limit for flowing pressure. All
It should be either in Psia or Kpa.
PressureLo REAL This is the Lo limit for flowing pressure. It All
should be either in Psia or Kpa.
PulseOrAnalogCount REAL For pulse input, it would be a number Turbine_
while for analog input, it should be in Dtl_
ft^3/hr for US unit system and in m^3/hr MeterRun
for Metric unit system.
PulseOrAnalogHiHi REAL This is the HiHi limit for pulse or analog Turbine_
input. For pulse input, it would be a Dtl_
number while for analog input, it should MeterRun
be in ft^3/hr for US unit system and in
m^3/hr for Metric unit system.
PulseOrAnalogHi REAL This is the Hi limit for pulse or analog Turbine_
input. For pulse input, it would be a Dtl_
number while for analog input, it should MeterRun
be in ft^3/hr for US unit system and in

237
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
m^3/hr for Metric unit system.
PulseOrAnalogLoLo REAL This is the LoLo limit for pulse or analog Turbine_
input. For pulse input, it would be a Dtl_
number while for analog input, it should MeterRun
be in ft^3/hr for US unit system and in
m^3/hr for Metric unit system.
PulseOrAnalogLo REAL This is the Lo limit for pulse or analog Turbine_
input. For pulse input, it would be a Dtl_
number while for analog input, it should MeterRun
be in ft^3/hr for US unit system and in
m^3/hr for Metric unit system.
LowPulseCutOff REAL This is the low pulse cut off limit. For Turbine_
pulse input, it is a number. For analog Dtl_
input, it should be in ft^3/hr for US unit MeterRun
system and in m^3/hr for Metric unit
system.
FlowPresIOSelection INT IO selection for meter pressure. The Turbine_
value should be {1} for Live or {2) for Dtl_
Keypad value. MeterRun_
V2
FlowPresStsStatus USINT Analog input channel status for meter Turbine_
pressure. The value should be {0} for Dtl_
Good or any positive integer for Bad MeterRun_
status. V2
FlowPresKeypadVal REAL Analog input channel status for meter Turbine_
pressure. The value should be {0} for Dtl_
Good or any positive integer for Bad MeterRun_
status. V2
Analog REAL Value of analog input if flow type = Turbine_
analog. The value should be in ft3/hr for Dtl_
US unit or m^3/hr for Metric unit. MeterRun_
V2
AnalogHiHi REAL This is the HiHi limit for analog input. The Turbine_
value should be in ft3/hr for US unit or Dtl_
m^3/hr for Metric unit. MeterRun_
V2

238
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
AnalogHi REAL This is the Hi limit for analog input. The Turbine_
value should be in ft3/hr for US unit or Dtl_
m^3/hr for Metric unit. MeterRun_
V2
AnalogLoLo REAL This is the LoLo limit for analog input. The Turbine_
value should be in ft3/hr for US unit or Dtl_
m^3/hr for Metric unit. MeterRun_
V2
AnalogLo REAL This is the Lo limit for analog input. The Turbine_
value should be in ft3/hr for US unit or Dtl_
m^3/hr for Metric unit. MeterRun_
V2
LowFlowCutOff REAL Low flow cutoff value checks the no flow Turbine_
condition in the calculations. If the flow is Dtl_
s less than this number, it will be MeterRun_
considered as no flow condition. Unit is V2
m3/hr for Metric unit, ft3/hr for US unit.
Pulse UDINT Pulse counter value Turbine_
Dtl_
MeterRun_
V2
LowPulseCutOff UINT Low pulse cutoff value checks the no flow Turbine_
condition in the calculations. If the Pulse Dtl_
increment is less than this number, it will MeterRun_
be considered as no flow condition. V2
MeterCalFactor REAL It is same as Meter K Factor which All
converts pulse from flow meter into
volume. The value should be in
pulses/m3 or pulses/ft3. When the flow
type is analog, this is the correction factor
to apply for volume calculation and the
default value should be 1.0.
MeterRunId INT This is an integer number that represents All
a configured meter run identifier.
GasCompFormat INT This parameter is for the gas composition All
format. It should be either mole fraction

239
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
{1} or percentage {2}.

NOTE: It is recommended to use 2


percentage as a default option.

FlowType INT This parameter represents the flow type, All


it should be either {1} Pulse Accumulated
or {2} Analog Flow Rate.
InputUnit INT This parameter is for all the inputs of All
meter run function block. It should be
either US {1} or Metric {2}.
ContractUnit INT This parameter is for all the outputs of All
meter run function block. It should be
either US {1} or Metric {2}.
ContractStartday INT This parameter represents the start of All
gas QTR day. Its value should be from 0
to 23.
AvgMethod INT This parameter is for averaging method All
to be used for averaging. As of now, it
only supports value {1} that is for time
weighted linear average.
MaintMode INT Parameter to Start or Stop the Turbine_
Maintenance Mode. The value should be Dtl_
either {0} Maintenance End or {1} for MeterRun_
Maintenance Start. When Maintenance V2
mode is started, an independent totalizer
will be started and accumulate all the flow
until the maintenance mode is stopped.
During this period, non-resettable totals,
hourly/daily/batch totals will be not
incremented.
AGA8Version INT Selection for AGA 8 algorithm selection: Turbine_
Dtl_
1- AGA 8 (1994) MeterRun_
2 - AGA 8 (2017) V2

AtmosphericPressure REAL Atmospheric pressure should be in Psia All


for US unit system and in Kpa for Metric

240
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
unit system.

Atmospheric pressure is used to make


Flowing pressure absolute when flowing
pressure is measured by a pressure
gauge. If flowing pressure is already
absolute then it can be left zero.
UserDefined1 REAL This parameter is an optional one, if user All
wants to average some parameter then
user can use it, it will be averaged and
logged in the QTR.
UserDefined2 REAL This parameter is an optional one, if user All
wants to average some parameter then
user can use it, it will be averaged and
logged in the QTR.
UserDefined3 REAL This parameter is an optional one, if user All
wants to average some parameter then
user can use it, it will be averaged and
logged in the QTR.
UserDefined4 REAL This parameter is an optional one, if user All
wants to average some parameter then
user can use it, it will be averaged and
logged in the QTR.

Output
Data
Output Parameter Description Apply to
types
Out_Code INT This out parameter returns success All
or fail code.
GasCompAtBaseCond LREAL This parameter is gas compressibility All
factor at base condition. It is
calculated in AGA8 Detailed method.
It is unit less.
GasDensityAtBaseCond LREAL This parameter is gas density at base All
condition. It is calculated through
AGA8 Detailed method. It is in

241
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
lbm/ft^3 for US unit system and in
kg/m^3 for Metric unit system.
GasRelDenAtBaseCond LREAL This parameter is gas relative density All
at base condition. It is calculated
through AGA8 Detailed method. It is
unit less.
GasMolecularWeight LREAL This parameter is gas molecular All
weight at base condition. It is
calculated through AGA8 Detailed
method. It is in lbm for US unit
system and in kg for Metric unit
system.
UncorrectedFlow LREAL This parameter is uncorrecetd flow All
rate. It is calculated through AGA7
method. It is in ft^3/hr for US unit
system and in m^3/hr for Metric unit
system.
Aga7QM LREAL This parameter is gas mass flow rate. All
It is calculated through AGA7
method. It is in lbm/hr for US unit
system and in kg/hr for Metric unit
system.
Aga7QB LREAL This parameter is volume flow rate at All
base condition. It is calculated
through AGA7 method. It is in ft^3/hr
for US unit system and in m^3/hr for
Metric unit system.
Energy LREAL This parameter is gas energy per All
hour. It is calculated through AGA5
method. It is in Btu/hr for US unit
system and in MJ/hr for Metric unit
system.
PrevHrAvgTemp LREAL This parameter is previous hour All
average for temperature.
PreDayAvgTemp LREAL This parameter is previous day All
average for temperature.
PrevHrAvgPressure LREAL This parameter is previous hour All

242
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
average for pressure.
PreDayAvgPressure LREAL This parameter is previous day All
average for pressure.
PrevHrAvgPulse LREAL This parameter is previous hour All
average for analog input.
PreDayAvgPulse LREAL This parameter is previous day All
average for analog input.
PrevHrAvgDenAtBase LREAL This parameter is previous hour All
average for density at base
condition.
PreDayAvgDenAtBase LREAL This parameter is previous day All
average for density at base
condition.
PrevHrAvgRelDenAtBase LREAL This parameter is previous hour All
average for relative density at base
condition.
PreDayAvgRelDenAtBase LREAL This parameter is previous day All
average for relative density at base
condition.
PrevHrAvgUncorrFlow LREAL This parameter is previous hour All
average for uncorrected flow.
PreDayAvgUncorrFlow LREAL This parameter is previous day All
average for uncorrected flow.
PrevHrAvgUserDefined1 LREAL This parameter is previous hour All
average for user defined parameter1.
PreDayAvgUserDefined1 LREAL This parameter is previous day All
average for user defined parameter1.
PrevHrAvgUserDefined2 LREAL This parameter is previous hour All
average for user defined parameter2.
PreDayAvgUserDefined2 LREAL This parameter is previous day All
average for user defined parameter2.
PrevHrAvgUserDefined3 LREAL This parameter is previous hour All
average for user defined parameter3.

243
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
PreDayAvgUserDefined3 LREAL This parameter is previous day All
average for user defined parameter3.
PrevHrAvgUserDefined4 LREAL This parameter is previous hour All
average for user defined parameter4.
PreDayAvgUserDefined4 LREAL This parameter is previous day All
average for user defined parameter4.
QbTH LREAL This parameter is volume flow rate at All
base condition total for this hour.
QbLH LREAL This parameter is volume flow rate at All
base condition total for last hour.
QbTD LREAL This parameter is volume flow rate at All
base condition total for this day.
QbLD LREAL This parameter is volume flow rate at All
base condition total for last day.
MTH LREAL This parameter is mass flow rate total All
for this hour.
MLH LREAL This parameter is mass flow rate total All
for last hour.
MTD LREAL This parameter is mass flow rate total All
for this day.
MLD LREAL This parameter is mass flow rate total All
for last day.
ETH LREAL This parameter is energy total for this All
hour.
ELH LREAL This parameter is energy total for last All
hour.
ETD LREAL This parameter is energy total for this All
day.
ELD LREAL This parameter is energy total for last All
day.
QbNR LREAL Non-Resettable or Cumulative total Turbine_
for volume at Base. Unit - ft3/hr for Dtl_
US, m3/hr for Metric. MeterRun_

244
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
V2
MNR LREAL Non-Resettable or Cumulative total Turbine_
for Mass. Unit - lbm/hr for US, kg/hr Dtl_
for Metric. MeterRun_
V2
ENR LREAL Non-Resettable or Cumulative total Turbine_
for Energy. Unit -Btu/hr for US, MJ/hr Dtl_
for Metric. MeterRun_
V2
QbRollover INT Rollover flag for volume at base Turbine_
condition non-resettable total. The Dtl_
value {1} indicates Rollover MeterRun_
otherwise {0}. The value for roll-over V2
is 999,999,999. The rollover flag will
be on 5 times interval time.
MRollover INT Rollover flag for Non-Resettable Turbine_
Mass total. The value {1} indicates Dtl_
Rollover otherwise {0}. The value for MeterRun_
roll-over is 999,999,999. The rollover V2
flag will be on 5 times interval time.
ERollover INT Rollover flag for Non-Resettable Turbine_
Energy total. The value {1} indicates Dtl_
Rollover otherwise {0}. The value for MeterRun_
roll-over is 999,999,999. The rollover V2
flag will be on 5 times interval time.
QbMaint LREAL Volume at Base in Maintenance Turbine_
mode. Dtl_
MeterRun_
V2
MMaint LREAL Mass in Maintenance mode. Turbine_
Dtl_
MeterRun_
V2
EMaint LREAL Energy at Base in Maintenance Turbine_
mode. Dtl_
MeterRun_

245
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
V2
GERG2008CV LREAL Heat Capacity at Constant Volume Turbine_
(J/mol K). Dtl_
MeterRun_
V2
GERG2008CP LREAL Heat Capacity at Constant Pressure Turbine_
(J/mol K). Dtl_
MeterRun_
V2
GERG2008W LREAL Speed of sound in gas being Turbine_
measured. Unit - ft/sec for US, Dtl_
meter/sec for Metric. MeterRun_
V2

NOTE: The above outputs including averages and totals would be in


the contract unit. The QTR generated by this function block contains
following fields. Date; Time; Flow Time; Volume at Base; Mass;
Energy; Temperature; Pressure; Pulse; Density; Uncorrected flow;
Relative Density; Average User Defined 1 (optional); Average User
Defined 2 (optional); Average User Defined 3 (optional); Average User
Defined 4 (optional).

Following are the error codes for the above meter run function block.

Out Code Description Apply to


0 SUCCESS All
1¹ ERROR: PRESSURE HAS A NEGATIVE DERIVATIVE All
DEFAULT GAS DENSITY USED
ERROR: A COMPONENT MOLE FRACTION < 0.0 OR > 1.0 Turbine_
Dtl_
MeterRun_
V2
2¹ WARNING: DENSITY IN BRAKET EXCEEDS MAXIMUM All
DEFAULT PROCEEDURE USED
WARNING: SUM OF MOLE FRACTIONS < 0.9999 OR > 1.0001 Turbine_
Dtl_
MeterRun_

246
Chapter 9 - Configuring Function Blocks

Out Code Description Apply to


V2
3¹ ERROR: MAXIMUM ITERATIONS EXCEEDED IN BRAKET All
DEFAULT DENSITY USED
WARNING: PRESSURE BASE (PB) <= 0.0 OR >= 16 PSIA Turbine_
Dtl_
MeterRun_
V2
4¹ ERROR: MAXIMUM ITERATIONS IN DDETAIL EXCEEDED All
LAST DENSITY USED
WARNING: TEMPERATURE BASE (TB) <= 32.0 OR >= 77.0 Turbine_
DEG F Dtl_
MeterRun_
V2
32 ERROR: FLOWING PRESSURE (PF) <= 0.0 OR > 40,000. All
PSIA
33 ERROR: FLOWING TEMPERATURE (TF) < -200 OR > 760 All
DEG F
36 ERROR: MOLE FRACTION FOR METHANE < 0.0 OR > 1.0 Turbine_
FOR NITROGEN < 0.0 OR > 1.0 Dtl_
FOR CARBON DIOXIDE < 0.0 OR > 1.0 MeterRun
FOR ETHANE < 0.0 OR > 1.0
FOR PROPANE < 0.0 OR > 0.12
FOR WATER < 0.0 OR > 0.10
FOR H2S < 0.0 OR > 1.0
FOR HYDROGEN < 0.0 OR > 1.0
FOR CARBON MONOXIDE < 0.0 OR > 0.03
FOR OXYGEN < 0.0 OR > 0.21
FOR BUTANES < 0.0 OR > 0.06
FOR PENTANES < 0.0 OR > 0.04
FOR HEXANES + < 0.0 OR > 0.10
FOR HELIUM < 0.0 OR > 0.03
FOR ARGON < 0.0 OR > 1.0
37 ERROR: REFERENCE TEMPERATURE < 32.0 OR > 77.0 DEG All
F
38 ERROR: REFERENCE PRESSURE < 12.9 OR > 16.01 PSIA All
39 ERROR: SUM OF MOLE FRACTIONS < 0.98 OR > 1.020 All

247
Chapter 9 - Configuring Function Blocks

Out Code Description Apply to


42 WARNING: FLOWING PRESSURE (PF) < 0.0 OR > 1750. PSIA All

43 WARNING: FLOWING TEMPERATURE (TF) < 17 OR > 143 All


DEG F
45 WARNING: ANY COMPONENT MOLE FRACTION OUTSIDE Turbine_
OF AGA REPORT NO. 8 RECOMMENDED RANGE Dtl_
MeterRun _
V2
46 WARNING: MOLE FRACTION FOR METHANE < 0.45 OR > 1.0 Turbine_
FOR NITROGEN < 0.0 OR > 0.5 Dtl_
FOR CARBON DIOXIDE < 0.0 OR > 0.3 MeterRun
FOR ETHANE < 0.0 OR > 0.1
FOR PROPANE < 0.0 OR > 0.04
FOR WATER < 0.0 OR >= 0.0005
FOR H2S < 0.0 OR > 0.0002
FOR HYDROGEN < 0.0 OR > 0.1
FOR CARBON MONOXIDE < 0.0 OR > 0.03
FOR OXYGEN < 0.0 OR > 0.0
FOR BUTANES < 0.0 OR > 0.01
FOR PENTANES < 0.0 OR >= 0.003
FOR HEXANES + < 0.0 OR >= 0.002
FOR HELIUM < 0.0 OR >= 0.002
FOR ARGON < 0.0 OR > 0.0
49 WARNING: SUM OF MOLE FRACTIONS < 0.9999 OR > 1.0001 All

86 WARNING: Flowing Pressure greater than 2017 AGA8 GERG- Turbine_


2008 Full Quality Range (10,150 PSIA) Dtl_
MeterRun_
V2
87 WARNING: Flowing Pressure greater than 2017 AGA8 GERG- Turbine_
2008 Range (5075 PSIA) Dtl_
MeterRun_
V2
88 WARNING: Flowing Temperature outside 2017 AGA8 GERG- Turbine_
2008 Full Quality Range (-352 F < TF < 800 F) Dtl_
MeterRun_
V2
89 WARNING: Flowing Temperature outside 2017 AGA8 GERG- Turbine_

248
Chapter 9 - Configuring Function Blocks

Out Code Description Apply to


2008 Range (-298 F < TF < 350 F) Dtl_
MeterRun_
V2
90 WARNING: A Component Mole % outside 2017 AGA8 GERG- Turbine_
2008 Intermediate Quality Range Dtl_
MeterRun_
V2
91 WARNING: A Component Mole % outside 2017 AGA8 GERG- Turbine_
2008 Pipeline Quality Range Dtl_
MeterRun_
V2
NOTE 1: Error codes 1~4 are common between AGA 8 and AGA 5. You must take caution
and analyze when these specific out codes appear to determine the source.

Turbine_GM_MeterRun Function Block


Here is an example for Turbine_GM_MeterRun:

249
Chapter 9 - Configuring Function Blocks

Description
This Turbine_GM_MeterRun function block calculates gas compressibility
factor, density, relative density and molecular weight from AGA8 gross
method, uncorrected flow, mass flow rate and volume flow rate at base
condition from AGA7 and gas energy per hour from AGA5. It also calculates
hourly and daily averages and totals. It generates hourly & daily QTRs and
sends them to EFM application which logs them on the controller’s MRAM
and flash memory. It also generates alarms when any of the process value
crosses specified alarm limit.
Turbine_GM_MeterRun expects the input parameters to be in US or Metric
unit system.
This description is also applicable to function block Ultrasonic_GM_
MeterRun. Both Turbine and Ultrasonic meters are technically same.

Input
Data
Input Parameter Description Apply to
types
GrossMethod INT This parameter represents All
gross method number. It should
be either {1} for gross method 1
and {2} for gross method 2.
GasRelDensity REAL This parameter is gas relative All
density at reference condition.
It is unit less.
CO2 REAL It could be in mole fraction or All

250
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
percentage.
Hydrogen REAL It could be in mole fraction or All
percentage.
CO REAL It could be in mole fraction or All
percentage.
Nitrogen REAL It could be in mole fraction or All
percentage. This parameter is
only required for gross method
2, for gross method 1, it can be
zero.
GasHeatingValue REAL This parameter is gas heating All
value. It is only required for
gross method 1, for gross
method 2, it can be zero. It is in
Btu/ft^3 for US unit system and
in MJ/m^3 for Metric unit
system.
RefTempForCalorimeterDensity REAL This parameter is reference All
temperature for calorimeter
density. It should be in
Fahrenheit for US unit system
and in Celcius for Metric unit
system. The recommended
default is 60 Deg F.
RefPressForCalorimeterDensity REAL This parameter is reference All
pressure for calorimeter
density. It should be in Psia for
US unit system and in Kpa for
Metric unit system. The
recommended default is 14.73
Psia.
RefTempForCombustion REAL This parameter is reference All
temperature for combustion. It
should be in Fahrenheit for US
unit system and in Celcius for
Metric unit system. The
recommended default is 60

251
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
Deg F.
BaseTemp REAL Base temperature should be in All
Fahrenheit for US unit system
and in Celcius for Metric unit
system. The recommended
default is 60 Deg F.
BasePressure REAL Base pressure should be in All
Psia for US unit system and in
Kpa for Metric unit system. The
recommended default is 14.73
Psia.
FlowingTemp REAL Flowing temperature should be All
in Fahrenheit for US unit
system and in Celcius for Metric
unit system.
TempHiHi REAL This is the HiHi limit for flowing All
temperature. It should be either
in Fahrenheit or Celcius.
TempHi REAL This is the Hi limit for flowing All
temperature. It should be either
in Fahrenheit or Celcius.
TempLoLo REAL This is the LoLo limit for flowing All
temperature. It should be either
in Fahrenheit or Celcius.
TempLo REAL This is the Lo limit for flowing All
temperature. It should be either
in Fahrenheit or Celcius.
FlowTempIOSelection INT IO selection for meter Turbine_
temperature. The value should GM_
be {1} for Live or {2) for Keypad MeterRun_
value. V2
FlowTempStsStatus USINT Analog input channel status for Turbine_
meter temperature. The value GM_
should be {0} for Good or any MeterRun_
positive integer for bad status. V2
FlowTempKeypadVal REAL Keypad value for meter Turbine_

252
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
temperature. The value that GM_
should be used when the meter MeterRun_
temperature status is bad. V2
FlowingPressure REAL Flowing pressure should be in All
Psia for US unit system and in
Kpa for Metric unit system.
PressureHiHi REAL This is the HiHi limit for flowing All
pressure. It should be either in
Psia or Kpa.
PressureHi REAL This is the Hi limit for flowing All
pressure. It should be either in
Psia or Kpa.
PressureLoLo REAL This is the LoLo limit for flowing All
pressure. It should be either in
Psia or Kpa.
PressureLo REAL This is the Lo limit for flowing All
pressure. It should be either in
Psia or Kpa.
PulseOrAnalogCount REAL For pulse input, it would be a Turbine_
number while for analog input, it GM_
should be in ft^3/hr for US unit MeterRun
system and in m^3/hr for Metric
unit system.
PulseOrAnalogHiHi REAL This is the HiHi limit for pulse or Turbine_
analog input. For pulse input, it GM_
would be a number while for MeterRun
analog input, it should be in
ft^3/hr for US unit system and in
m^3/hr for Metric unit system.
PulseOrAnalogHi REAL This is the Hi limit for pulse or Turbine_
analog input. For pulse input, it GM_
would be a number while for MeterRun
analog input, it should be in
ft^3/hr for US unit system and in
m^3/hr for Metric unit system.
PulseOrAnalogLoLo REAL This is the LoLo limit for pulse Turbine_

253
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
or analog input. For pulse input, GM_
it would be a number while for MeterRun
analog input, it should be in
ft^3/hr for US unit system and in
m^3/hr for Metric unit system.
PulseOrAnalogLo REAL This is the Lo limit for pulse or Turbine_
analog input. For pulse input, it GM_
would be a number while for MeterRun
analog input, it should be in
ft^3/hr for US unit system and in
m^3/hr for Metric unit system.
LowPulseCutOff REAL This is the low pulse cut off Turbine_
limit. For pulse input, it is a GM_
number. For analog input, it MeterRun
should be in ft^3/hr for US unit
system and in m^3/hr for Metric
unit system.
FlowPresIOSelection INT IO selection for meter pressure. Turbine_
The value should be {1} for Live GM_
or {2) for Keypad value. MeterRun_
V2
FlowPresStsStatus USINT Analog input channel status for Turbine_
meter pressure. The value GM_
should be {0} for Good or any MeterRun_
positive integer for Bad status. V2
FlowPresKeypadVal REAL Analog input channel status for Turbine_
meter pressure. The value GM_
should be {0} for Good or any MeterRun_
positive integer for Bad status. V2
Analog REAL Value of analog input if flow Turbine_
type = analog. The value GM_
should be in ft3/hr for US unit or MeterRun_
m^3/hr for Metric unit. V2
AnalogHiHi REAL This is the HiHi limit for analog Turbine_
input. The value should be in GM_
ft3/hr for US unit or m^3/hr for MeterRun_
Metric unit. V2

254
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
AnalogHi REAL This is the Hi limit for analog Turbine_
input. The value should be in GM_
ft3/hr for US unit or m^3/hr for MeterRun_
Metric unit. V2
AnalogLoLo REAL This is the LoLo limit for analog Turbine_
input. The value should be in GM_
ft3/hr for US unit or m^3/hr for MeterRun_
Metric unit. V2
AnalogLo REAL This is the Lo limit for analog Turbine_
input. The value should be in GM_
ft3/hr for US unit or m^3/hr for MeterRun_
Metric unit. V2
LowFlowCutOff REAL Low flow cutoff value checks Turbine_
the no flow condition in the GM_
calculations. If the flow is s less MeterRun_
than this number, it will be V2
considered as no flow
condition. Unit is m3/hr for
Metric unit, ft3/hr for US unit.
Pulse UDINT Pulse counter value Turbine_
GM_
MeterRun_
V2
LowPulseCutOff UINT Low pulse cutoff value checks Turbine_
the no flow condition in the GM_
calculations. If the Pulse MeterRun_
increment is less than this V2
number, it will be considered as
no flow condition.
MeterCalFactor REAL It is same as Meter K Factor All
which converts pulse from flow
meter into volume. The value
should be in pulses/m3 or
pulses/ft3. When the flow type
is analog, this is the correction
factor to apply for volume
calculation and the default
value should be 1.0.

255
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
MeterRunId INT This is an integer number that All
represents a configured meter
run identifier.
GasCompFormat INT This parameter is for the gas All
composition format. It should
be either mole fraction {1} or
percentage {2}.

NOTE: It is
recommended to use 2
percentage as a default
option.

FlowType INT This parameter represents the All


flow type, it should be either {1}
Pulse Accumulated or {2}
Analog Flow Rate.
InputUnit INT This parameter is for all the All
inputs of meter run function
block. It should be either US {1}
or Metric {2}.
ContractUnit INT This parameter is for all the All
outputs of meter run function
block. It should be either US {1}
or Metric {2}.
ContractStartday INT This parameter represents the All
start of gas QTR day. Its value
should be from 0 to 23.
AvgMethod INT This parameter is for averaging All
method to be used for
averaging. As of now, it only
supports value {1} that is for
time weighted linear average.
MaintMode INT Parameter to Start or Stop the Turbine_
Maintenance Mode. The value GM_
should be either {0} MeterRun_
Maintenance End or {1} for V2

256
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
Maintenance Start. When
Maintenance mode is started,
an independent totalizer will be
started and accumulate all the
flow until the maintenance
mode is stopped. During this
period, non-resettable totals,
hourly/daily/batch totals will be
not incremented.
AGA8Version INT Selection for AGA 8 algorithm Turbine_
selection: GM_
MeterRun_
1- AGA 8 (1994) V2
2 - AGA 8 (2017)
AtmosphericPressure REAL Atmospheric pressure should All
be in Psia for US unit system
and in Kpa for Metric unit
system.

Atmospheric pressure is used


to make Flowing pressure
absolute when flowing pressure
is measured by a pressure
gauge. If flowing pressure is
already absolute then it can be
left zero.
UserDefined1 REAL This parameter is an optional All
one, if user wants to average
some parameter then user can
use it, it will be averaged and
logged in the QTR.
UserDefined2 REAL This parameter is an optional All
one, if user wants to average
some parameter then user can
use it, it will be averaged and
logged in the QTR.
UserDefined3 REAL This parameter is an optional All
one, if user wants to average

257
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
some parameter then user can
use it, it will be averaged and
logged in the QTR.
UserDefined4 REAL This parameter is an optional All
one, if user wants to average
some parameter then user can
use it, it will be averaged and
logged in the QTR.

Output
Data
Output Parameter Description All
types
Out_Code INT This out parameter returns All
success or fail code.
GasCompAtBaseCond LREAL This parameter is gas All
compressibility factor at base
condition. It is calculated in AGA8
Detailed method. It is unit less.
GasDensityAtBaseCond LREAL This parameter is gas density at All
base condition. It is calculated
through AGA8 Detailed method. It
is in lbm/ft^3 for US unit system
and in kg/m^3 for Metric unit
system.
GasRelDenAtBaseCond LREAL This parameter is gas relative All
density at base condition. It is
calculated through AGA8
Detailed method. It is unit less.
GasMolecularWeight LREAL This parameter is gas molecular All
weight at base condition. It is
calculated through AGA8
Detailed method. It is in lbm for
US unit system and in kg for
Metric unit system.
UncorrectedFlow LREAL This parameter is uncorrecetd All
flow rate. It is calculated through

258
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description All
types
AGA7 method. It is in ft^3/hr for
US unit system and in m^3/hr for
Metric unit system.
Aga7QM LREAL This parameter is gas mass flow All
rate. It is calculated through
AGA7 method. It is in lbm/hr for
US unit system and in kg/hr for
Metric unit system.
Aga7QB LREAL This parameter is volume flow All
rate at base condition. It is
calculated through AGA7
method. It is in ft^3/hr for US unit
system and in m^3/hr for Metric
unit system.
Energy LREAL This parameter is gas energy per All
hour. It is calculated through
AGA5 method. It is in Btu/hr for
US unit system and in MJ/hr for
Metric unit system.
PrevHrAvgTemp LREAL This parameter is previous hour All
average for temperature.
PreDayAvgTemp LREAL This parameter is previous day All
average for temperature.
PrevHrAvgPressure LREAL This parameter is previous hour All
average for pressure.
PreDayAvgPressure LREAL This parameter is previous day All
average for pressure.
PrevHrAvgPulse LREAL This parameter is previous hour All
average for analog input.
PreDayAvgPulse LREAL This parameter is previous day All
average for analog input.
PrevHrAvgDenAtBase LREAL This parameter is previous hour All
average for density at base
condition.
PreDayAvgDenAtBase LREAL This parameter is previous day All

259
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description All
types
average for density at base
condition.
PrevHrAvgRelDenAtBase LREAL This parameter is previous hour All
average for relative density at
base condition.
PreDayAvgRelDenAtBase LREAL This parameter is previous day All
average for relative density at
base condition.
PrevHrAvgUncorrFlow LREAL This parameter is previous hour All
average for uncorrected flow.
PreDayAvgUncorrFlow LREAL This parameter is previous day All
average for uncorrected flow.
PrevHrAvgUserDefined1 LREAL This parameter is previous hour All
average for user defined
parameter1.
PreDayAvgUserDefined1 LREAL This parameter is previous day All
average for user defined
parameter1.
PrevHrAvgUserDefined2 LREAL This parameter is previous hour All
average for user defined
parameter2.
PreDayAvgUserDefined2 LREAL This parameter is previous day All
average for user defined
parameter2.
PrevHrAvgUserDefined3 LREAL This parameter is previous hour All
average for user defined
parameter3.
PreDayAvgUserDefined3 LREAL This parameter is previous day All
average for user defined
parameter3.
PrevHrAvgUserDefined4 LREAL This parameter is previous hour All
average for user defined
parameter4.
PreDayAvgUserDefined4 LREAL This parameter is previous day All
average for user defined

260
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description All
types
parameter4.
QbTH LREAL This parameter is volume flow All
rate at base condition total for this
hour.
QbLH LREAL This parameter is volume flow All
rate at base condition total for last
hour.
QbTD LREAL This parameter is volume flow All
rate at base condition total for this
day.
QbLD LREAL This parameter is volume flow All
rate at base condition total for last
day.
MTH LREAL This parameter is mass flow rate All
total for this hour.
MLH LREAL This parameter is mass flow rate All
total for last hour.
MTD LREAL This parameter is mass flow rate All
total for this day.
MLD LREAL This parameter is mass flow rate All
total for last day.
ETH LREAL This parameter is energy total for All
this hour.
ELH LREAL This parameter is energy total for All
last hour.
ETD LREAL This parameter is energy total for All
this day.
ELD LREAL This parameter is energy total for All
last day.
QbNR LREAL Non-Resettable or Cumulative Turbine_
total for volume at Base. Unit - GM_
ft3/hr for US, m3/hr for Metric. MeterRun_
V2

261
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description All
types
MNR LREAL Non-Resettable or Cumulative Turbine_
total for Mass. Unit - lbm/hr for GM_
US, kg/hr for Metric. MeterRun_
V2
ENR LREAL Non-Resettable or Cumulative Turbine_
total for Energy. Unit -Btu/hr for GM_
US, MJ/hr for Metric. MeterRun_
V2
QbRollover INT Rollover flag for volume at base Turbine_
condition non-resettable total. GM_
The value {1} indicates Rollover MeterRun_
otherwise {0}. The value for roll- V2
over is 999,999,999. The rollover
flag will be on 5 times interval
time.
MRollover INT Rollover flag for Non-Resettable Turbine_
Mass total. The value {1} GM_
indicates Rollover otherwise {0}. MeterRun_
The value for roll-over is V2
999,999,999. The rollover flag will
be on 5 times interval time.
ERollover INT Rollover flag for Non-Resettable Turbine_
Energy total. The value {1} GM_
indicates Rollover otherwise {0}. MeterRun_
The value for roll-over is V2
999,999,999. The rollover flag will
be on 5 times interval time.
QbMaint LREAL Volume at Base in Maintenance Turbine_
mode. GM_
MeterRun_
V2
MMaint LREAL Mass in Maintenance mode. Turbine_
GM_
MeterRun_
V2
EMaint LREAL Energy at Base in Maintenance Turbine_
mode. GM_
MeterRun_

262
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description All
types
V2

NOTE: The above outputs including averages and totals would be in


the contract unit. The QTR generated by this function block contains
following fields. Date; Time; Flow Time; Volume at Base; Mass;
Energy; Temperature; Pressure; Pulse; Density; Uncorrected flow;
Relative Density; Average User Defined 1 (optional); Average User
Defined 2 (optional); Average User Defined 3 (optional); Average User
Defined 4 (optional).

Following are the error codes for the above meter run function block.

Out
Description Apply to
Code
0 SUCCESS All
5 ERROR: THE ROOT WAS NOT BOUNDED IN DGROSS All
6 ERROR: NO CONVERGENCE IN DGROSS All
7 ERROR: VIRGS SQURE ROOT NEGATIVE All
8 ERROR: COMBINED VALUES OF GRGR, X[2] AND HV NOT All
CONSISTENT
9 ERROR: INVALID TERM IN VIRGS All
11 ERROR: METHOD WAS NOT 1 OR 2 All
12 ERROR: FLOWING PRESSURE (PF) <= 0.0 OR > 1740.0 PSIA All
13 ERROR: FLOWING TEMPERATURE (TF) < 14.0 OR > 149.0 DEG F All

14 ERROR: HEATING VALUE (HV) < 477.0 OR > 1211.0 BTU/FT^3 All
15 ERROR: GAS RELATIVE DENSITY (GRGR) < 0.55 OR > 0.870 All
16 ERROR: MOLE FRACTION FOR N2 < 0.0 OR > 0.50 All
OR FOR CO2 < 0.0 OR > 0.30
OR FOR H2 < 0.0 OR > 0.10
OR FOR CO < 0.0 OR > 0.03
17 ERROR: REFERENCE TEMPERATURE < 32.0 OR > 77.0 DEG F All

263
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
18 ERROR: REFERENCE PRESSURE < 13.0 OR > 16.0 PSIA All
22 WARNING: FLOWING PRESSURE (PF) <= 0.0 OR > 1200.0 PSIA Turbine_
GM_
MeterRun
23 WARNING: FLOWING TEMPERATURE (TF) < 32.0 OR > 130.0 Turbine_
DEG F GM_
MeterRun
24 WARNING: HEATING VALUE (HV) < 805.0 OR > 1208.0 BTU/FT^3 Turbine_
GM_
MeterRun
25 WARNING: GAS RELATIVE DENSITY (GRGR) < 0.55 OR > 0.800 Turbine_
GM_
MeterRun
26 WARNING: MOLE FRACTION FOR N2 < 0.0 OR > 0.20 Turbine_
OR FOR CO2 < 0.0 OR > 0.20 GM_
OR FOR H2 < 0.0 OR > 0.0 MeterRun
OR FOR CO < 0.0 OR >0.0
81 WARNING: FLOWING PRESSURE (PF) > 1500.0 PSIA AGA8 2017 Turbine_
RANGE 1 GM_
MeterRun_
V2
82 WARNING: FLOWING TEMPERATURE (TF) < 17.01 OR > 143.0 Turbine_
DEG F AGA8 2017 RANGE 2 OR (TF) < 25.0 OR > 143.0 DEG F GM_
AGA8 2017 RANGE 1 MeterRun_
V2
83 WARNING: HEATING VALUE (HV) < 665.0 OR > 1100.0 BTU/FT^3 Turbine_
AGA8 2017 RANGE 2 OR (HV) < 930.0 OR > 1040.0 BTU/FT^3 GM_
AGA8 2017 RANGE 1 MeterRun_
V2
84 WARNING: GAS RELATIVE DENSITY (GRGR) < 0.554 OR > 0.801 Turbine_
AGA8 2017 RANGE 2 OR (GRGR) < 0.554 OR > 0.630 AGA8 GM_
RANGE 1 MeterRun_
V2
85 WARNING: MOLE FRACTION FOR N2 > 0.20 AGA8 2017 RANGE Turbine_
2 OR N2 > 0.07 AGA8 2017 RANGE 1 GM_
MeterRun_

264
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
OR FOR CO2 > 0.25 AGA8 2017 RANGE 2 OR CO2 > 0.03 AGA8 V2
2017 RANGE 1

OR FOR H2 < 0.0 OR > 0.0 AGA8 2017 RANGE 1 AND 2

OR FOR CO < 0.0 OR > 0.0 AGA8 2017 RANGE 1 AND 2

265
Chapter 9 - Configuring Function Blocks

Coriolis_Dtl_MeterRun Function Block


Here is an example for Coriolis_Dtl_MeterRun:

266
Chapter 9 - Configuring Function Blocks

Description
This Coriolis_Dtl_MeterRun function block calculates gas compressibility
factor, density, relative density and molecular weight from AGA8 detailed
method, volume flow rate at base condition from AGA11 and gas energy
per hour from AGA5. It also calculates hourly and daily averages and totals.
It generates hourly & daily QTRs and sends them to EFM application which
logs them on he contoller s MRAM and flash memory. It also generates
alarms when any of the process value crosses specified alarm limit.
Coriolis_Dtl_MeterRun expects the input parameters to be in US or Metric
unit system.

Input
Data
Input Parameter Description Apply to
types
Methane REAL It could be in mole fraction or All
percentage.
Nitrogen REAL It could be in mole fraction or All
percentage.
CO2 REAL It could be in mole fraction or All
percentage.
Ethane REAL It could be in mole fraction or All
percentage.
Propane REAL It could be in mole fraction or All
percentage.
Water REAL It could be in mole fraction or All
percentage.
H2S REAL It could be in mole fraction or All
percentage.
Hydrogen REAL It could be in mole fraction or All
percentage.
CO REAL It could be in mole fraction or All
percentage.
Oxygen REAL It could be in mole fraction or All
percentage.
IButane REAL It could be in mole fraction or All

267
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
percentage.
NButane REAL It could be in mole fraction or All
percentage.
IPentane REAL It could be in mole fraction or All
percentage.
NPentane REAL It could be in mole fraction or All
percentage.
Hexane REAL It could be in mole fraction or All
percentage.
Heptane REAL It could be in mole fraction or All
percentage.
Octane REAL It could be in mole fraction or All
percentage.
Nonane REAL It could be in mole fraction or All
percentage.
Decane REAL It could be in mole fraction or All
percentage.
Helium REAL It could be in mole fraction or All
percentage.
Argon REAL It could be in mole fraction or All
percentage.
DetailMethod INT Selection for Detail method: Coriolis_
Dtl_
1- Detail Method MeterRun_
2- GERG Method. GERG Method is only V2
applicable for V2 function block.
BaseTemp REAL Base temperature should be in All
Fahrenheit for US unit system and in
Celcius for Metric unit system. The
recommended default is 60 Deg F.
BasePressure REAL Base pressure should be in Psia for US All
unit system and in Kpa for Metric unit
system. The recommended default is
14.73 Psia.

268
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
FlowingTemp REAL Flowing temperature should be in All
Fahrenheit for US unit system and in
Celcius for Metric unit system.
TempHiHi REAL This is the HiHi limit for flowing All
temperature. It should be either in
Fahrenheit or Celcius.
TempHi REAL This is the Hi limit for flowing All
temperature. It should be either in
Fahrenheit or Celcius.
TempLoLo REAL This is the LoLo limit for flowing All
temperature. It should be either in
Fahrenheit or Celcius.
TempLo REAL This is the Lo limit for flowing All
temperature. It should be either in
Fahrenheit or Celcius.
FlowTempIOSelection INT IO selection for meter temperature. The Coriolis_
value should be {1} for Live or {2) for Dtl_
Keypad value. MeterRun_
V2
FlowTempStsStatus USINT Analog input channel status for meter Coriolis_
temperature. The value should be {0} for Dtl_
Good or any positive integer for bad MeterRun_
status. V2
FlowTempKeypadVal REAL Keypad value for meter temperature. Coriolis_
The value that should be used when the Dtl_
meter temperature status is bad. MeterRun_
V2
FlowingPressure REAL Flowing pressure should be in Psia for All
US unit system and in Kpa for Metric unit
system.
PressureHiHi REAL This is the HiHi limit for flowing pressure. All
It should be either in Psia or Kpa.
PressureHi REAL This is the Hi limit for flowing pressure. It All
should be either in Psia or Kpa.
PressureLoLo REAL This is the LoLo limit for flowing All

269
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
pressure. It should be either in Psia or
Kpa.
PressureLo REAL This is the Lo limit for flowing pressure. It All
should be either in Psia or Kpa.
GasMass REAL This parameter is gas mass that is Coriolis_
directly measured from coriolis meter. It Dtl_
should be in lbm/hr for US unit system MeterRun
and in kg/hr for Metric unit system.
GasMassHiHi REAL This is the HiHi limit for gas mass. It Coriolis_
should be in lbm/hr for US unit system Dtl_
and in kg/hr for Metric unit system. MeterRun
GasMassHi REAL This is the Hi limit for gas mass. It should Coriolis_
be in lbm/hr for US unit system and in Dtl_
kg/hr for Metric unit system. MeterRun
GasMassLoLo REAL This is the LoLo limit for gas mass. It Coriolis_
should be in lbm/hr for US unit system Dtl_
and in kg/hr for Metric unit system. MeterRun
GasMassLo REAL This is the Lo limit for gas mass. It Coriolis_
should be in lbm/hr for US unit system Dtl_
and in kg/hr for Metric unit system. MeterRun
LowGasMassCutOff REAL This is the low gas mass cut off limit. It Coriolis_
should be in lbm/hr for US unit system Dtl_
and in kg/hr for Metric unit system. MeterRun
FlowPresIOSelection INT IO selection for meter pressure. The Coriolis_
value should be {1} for Live or {2) for Dtl_
Keypad value. MeterRun_
V2
FlowPresStsStatus USINT Analog input channel status for meter Coriolis_
pressure. The value should be {0} for Dtl_
Good or any positive integer for Bad MeterRun_
status. V2
FlowPresKeypadVal REAL Analog input channel status for meter Coriolis_
pressure. The value should be {0} for Dtl_
Good or any positive integer for Bad MeterRun_
status. V2

270
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
Analog REAL Value of analog input if flow type = Coriolis_
analog. The value should be in lb/hr for Dtl_
US unit or kg/hr for Metric unit. MeterRun_
V2
AnalogHiHi REAL This is the HiHi limit for analog input. The Coriolis_
value should be in lb/hr for US unit or Dtl_
kg/hr for Metric unit. MeterRun_
V2
AnalogHi REAL This is the Hi limit for analog input. The Coriolis_
value should be in lb/hr for US unit or Dtl_
kg/hr for Metric unit. MeterRun_
V2
AnalogLoLo REAL This is the LoLo limit for analog input. Coriolis_
The value should be in lb/hr for US unit Dtl_
or kg/hr for Metric unit. MeterRun_
V2
AnalogLo REAL This is the Lo limit for analog input. The Coriolis_
value should be in lb/hr for US unit or Dtl_
kg/hr for Metric unit. MeterRun_
V2
LowFlowCutOff REAL Low flow cutoff value checks the no flow Coriolis_
condition in the calculations. If the flow is Dtl_
s less than this number, it will be MeterRun_
considered as no flow condition. Unit is V2
kg/hr for Metric unit, lb/hr for US unit.
FlowType INT This parameter represents the flow type, Coriolis_
it should be either {1} Pulse Dtl_
Accumulated or {2} Analog Flow Rate. MeterRun_
V2
Pulse UDINT Pulse counter value Coriolis_
Dtl_
MeterRun_
V2
LowPulseCutOff UINT Low pulse cutoff value checks the no Coriolis_
flow condition in the calculations. If the Dtl_
Pulse increment is less than this MeterRun_

271
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
number, it will be considered as no flow V2
condition.
MeterCalFactor REAL It is same as Meter K factor which Coriolis_
converts pulse from flow meter into Dtl_
mass. The value should be in pulses/kg MeterRun_
(Metric) or pulses/lb (US). When the flow V2
type is analog, this is the correction
factor to apply for mass calculation and
the default value should be 1.0.
MeterRunId INT This is an integer number that All
represents a configured meter run
identifier.
GasCompFormat INT This parameter is for the gas All
composition format. It should be either
mole fraction {1} or percentage {2}.

NOTE: It is recommended to use


2 percentage as a default option.

InputUnit INT This parameter is for all the inputs of All


meter run function block. It should be
either US {1} or Metric {2}.
ContractUnit INT This parameter is for all the outputs of All
meter run function block. It should be
either US {1} or Metric {2}.
ContractStartday INT This parameter represents the start of All
gas QTR day. Its value should be from 0
to 23.
AvgMethod INT This parameter is for averaging method All
to be used for averaging. As of now, it
only supports value {1} that is for time
weighted linear average.
MaintMode INT Parameter to Start or Stop the Coriolis_
Maintenance Mode. The value should be Dtl_
either {0} Maintenance End or {1} for MeterRun_
Maintenance Start. When Maintenance V2
mode is started, an independent totalizer

272
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
will be started and accumulate all the
flow until the maintenance mode is
stopped. During this period, non-
resettable totals, hourly/daily/batch
totals will be not incremented.
AGA8Version INT Selection for AGA 8 algorithm selection: Coriolis_
Dtl_
1- AGA 8 (1994) MeterRun_
2 - AGA 8 (2017) V2

AtmosphericPressure REAL Atmospheric pressure should be in Psia All


for US unit system and in Kpa for Metric
unit system.

Atmospheric pressure is used to make


Flowing pressure absolute when flowing
pressure is measured by a pressure
gauge. If flowing pressure is already
absolute then it can be left zero.
UserDefined1 REAL This parameter is an optional one, if user All
wants to average some parameter then
user can use it, it will be averaged and
logged in the QTR.
UserDefined2 REAL This parameter is an optional one, if user All
wants to average some parameter then
user can use it, it will be averaged and
logged in the QTR.
UserDefined3 REAL This parameter is an optional one, if user All
wants to average some parameter then
user can use it, it will be averaged and
logged in the QTR.
UserDefined4 REAL This parameter is an optional one, if user All
wants to average some parameter then
user can use it, it will be averaged and
logged in the QTR.

273
Chapter 9 - Configuring Function Blocks

Output
Data
Output Parameter Description Apply to
types
Out_Code INT This out parameter returns success All
or fail code.
GasCompAtBaseCond LREAL This parameter is gas All
compressibility factor at base
condition. It is calculated in AGA8
Detailed method. It is unit less.
GasDensityAtBaseCond LREAL This parameter is gas density at All
base condition. It is calculated
through AGA8 Detailed method. It
is in lbm/ft^3 for US unit system
and in kg/m^3 for Metric unit
system.
GasRelDenAtBaseCond LREAL This parameter is gas relative All
density at base condition. It is
calculated through AGA8 Detailed
method. It is unit less.
GasMolecularWeight LREAL This parameter is gas molecular All
weight at base condition. It is
calculated through AGA8 Detailed
method. It is in lbm for US unit
system and in kg for Metric unit
system.
Aga11QB LREAL This parameter is volume flow rate All
at base condition. It is calculated
through AGA11 method. It is in
ft^3/hr for US unit system and in
m^3/hr for Metric unit system.
Energy LREAL This parameter is gas energy per All
hour. It is calculated through AGA5
method. It is in Btu/hr for US unit
system and in MJ/hr for Metric unit
system.
PrevHrAvgTemp LREAL This parameter is previous hour All
average for temperature.
PreDayAvgTemp LREAL This parameter is previous day All
average for temperature.

274
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
PrevHrAvgPressure LREAL This parameter is previous hour All
average for pressure.
PreDayAvgPressure LREAL This parameter is previous day All
average for pressure.
PrevHrAvgGasMass LREAL This parameter is previous hour All
average for gas mass.
PreDayAvgGasMass LREAL This parameter is previous day All
average for gas mass.
PrevHrAvgDenAtBase LREAL This parameter is previous hour All
average for density at base
condition.
PreDayAvgDenAtBase LREAL This parameter is previous day All
average for density at base
condition.
PrevHrAvgRelDenAtBase LREAL This parameter is previous hour All
average for relative density at base
condition.
PreDayAvgRelDenAtBase LREAL This parameter is previous day All
average for relative density at base
condition.
PrevHrAvgUserDefined1 LREAL This parameter is previous hour All
average for user defined
parameter1.
PreDayAvgUserDefined1 LREAL This parameter is previous day All
average for user defined
parameter1.
PrevHrAvgUserDefined2 LREAL This parameter is previous hour All
average for user defined
parameter2.
PreDayAvgUserDefined2 LREAL This parameter is previous day All
average for user defined
parameter2.
PrevHrAvgUserDefined3 LREAL This parameter is previous hour All
average for user defined

275
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
parameter3.
PreDayAvgUserDefined3 LREAL This parameter is previous day All
average for user defined
parameter3.
PrevHrAvgUserDefined4 LREAL This parameter is previous hour All
average for user defined
parameter4.
PreDayAvgUserDefined4 LREAL This parameter is previous day All
average for user defined
parameter4.
QbTH LREAL This parameter is volume flow rate All
at base condition total for this hour.
QbLH LREAL This parameter is volume flow rate All
at base condition total for last hour.
QbTD LREAL This parameter is volume flow rate All
at base condition total for this day.
QbLD LREAL This parameter is volume flow rate All
at base condition total for last day.
MTH LREAL This parameter is mass flow rate All
total for this hour.
MLH LREAL This parameter is mass flow rate All
total for last hour.
MTD LREAL This parameter is mass flow rate All
total for this day.
MLD LREAL This parameter is mass flow rate All
total for last day.
ETH LREAL This parameter is energy total for All
this hour.
ELH LREAL This parameter is energy total for All
last hour.
ETD LREAL This parameter is energy total for All
this day.
ELD LREAL This parameter is energy total for All

276
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
last day.
QbNR LREAL Non-Resettable or Cumulative total Coriolis_
for volume at Base. Unit - ft3/hr for Dtl_
US, m3/hr for Metric. MeterRun_
V2
MNR LREAL Non-Resettable or Cumulative total Coriolis_
for Mass. Unit - lbm/hr for US, kg/hr Dtl_
for Metric. MeterRun_
V2
ENR LREAL Non-Resettable or Cumulative total Coriolis_
for Energy. Unit -Btu/hr for US, Dtl_
MJ/hr for Metric. MeterRun_
V2
QbRollover INT Rollover flag for volume at base Coriolis_
condition non-resettable total. The Dtl_
value {1} indicates Rollover MeterRun_
otherwise {0}. The value for roll- V2
over is 999,999,999. The rollover
flag will be on 5 times interval time.
MRollover INT Rollover flag for Non-Resettable Coriolis_
Mass total. The value {1} indicates Dtl_
Rollover otherwise {0}. The value MeterRun_
for roll-over is 999,999,999. The V2
rollover flag will be on 5 times
interval time.
ERollover INT Rollover flag for Non-Resettable Coriolis_
Energy total. The value {1} Dtl_
indicates Rollover otherwise {0}. MeterRun_
The value for roll-over is V2
999,999,999. The rollover flag will
be on 5 times interval time.
QbMaint LREAL Volume at Base in Maintenance Coriolis_
mode. Dtl_
MeterRun_
V2
MMaint LREAL Mass in Maintenance mode. Coriolis_

277
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
Dtl_
MeterRun_
V2
EMaint LREAL Energy at Base in Maintenance Coriolis_
mode. Dtl_
MeterRun_
V2
GERG2008CV LREAL Heat Capacity at Constant Volume Coriolis_
(J/mol K). Dtl_
MeterRun_
V2
GERG2008CP LREAL Heat Capacity at Constant Coriolis_
Pressure (J/mol K). Dtl_
MeterRun_
V2
GERG2008W LREAL Speed of sound in gas being Coriolis_
measured. Unit - ft/sec for US, Dtl_
meter/sec for Metric. MeterRun_
V2

NOTE: The above outputs including averages and totals would be in


the contract unit. The QTR generated by this function block contains
following fields. Date; Time; Flow Time; Volume at Base; Mass;
Energy; Temperature; Gas mass; Density; None; Relative Density;
Average User Defined 1 (optional); Average User Defined 2 (optional);
Average User Defined 3 (optional); Average User Defined 4 (optional).

Following are the error codes for the above meter run function block.

Out
Description Apply to
Code
0 SUCCESS All
1¹ ERROR: PRESSURE HAS A NEGATIVE DERIVATIVE DEFAULT All
GAS DENSITY USED
ERROR: A COMPONENT MOLE FRACTION < 0.0 OR > 1.0 Coriolis_
Dtl_
MeterRun _
V2

278
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
2¹ WARNING: DENSITY IN BRAKET EXCEEDS MAXIMUM DEFAULT All
PROCEEDURE USED
WARNING: SUM OF MOLE FRACTIONS < 0.9999 OR > 1.0001 Coriolis_
Dtl_
MeterRun _
V2
3¹ ERROR: MAXIMUM ITERATIONS EXCEEDED IN BRAKET All
DEFAULT DENSITY USED
WARNING: PRESSURE BASE (PB) <= 0.0 OR >= 16 PSIA Coriolis_
Dtl_
MeterRun _
V2
4¹ ERROR: MAXIMUM ITERATIONS IN DDETAIL EXCEEDED LAST All
DENSITY USED
WARNING: TEMPERATURE BASE (TB) <= 32.0 OR >= 77.0 DEG F Coriolis_
Dtl_
MeterRun _
V2
32 ERROR: FLOWING PRESSURE (PF) <= 0.0 OR > 40,000. PSIA All
33 ERROR: FLOWING TEMPERATURE (TF) < -200 OR > 760 DEG F All
36 ERROR: MOLE FRACTION FOR METHANE < 0.0 OR > 1.0 Coriolis_
FOR NITROGEN < 0.0 OR > 1.0 Dtl_
FOR CARBON DIOXIDE < 0.0 OR > 1.0 MeterRun
FOR ETHANE < 0.0 OR > 1.0
FOR PROPANE < 0.0 OR > 0.12
FOR WATER < 0.0 OR > 0.10
FOR H2S < 0.0 OR > 1.0
FOR HYDROGEN < 0.0 OR > 1.0
FOR CARBON MONOXIDE < 0.0 OR > 0.03
FOR OXYGEN < 0.0 OR > 0.21
FOR BUTANES < 0.0 OR > 0.06
FOR PENTANES < 0.0 OR > 0.04
FOR HEXANES + < 0.0 OR > 0.10
FOR HELIUM < 0.0 OR > 0.03
FOR ARGON < 0.0 OR > 1.0

279
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
37 ERROR: REFERENCE TEMPERATURE < 32.0 OR > 77.0 DEG F All
38 ERROR: REFERENCE PRESSURE < 12.9 OR > 16.01 PSIA All
39 ERROR: SUM OF MOLE FRACTIONS < 0.98 OR > 1.020 All
42 WARNING: FLOWING PRESSURE (PF) < 0.0 OR > 1750. PSIA All
43 WARNING: FLOWING TEMPERATURE (TF) < 17 OR > 143 DEG F All
45 WARNING: ANY COMPONENT MOLE FRACTION OUTSIDE OF Coriolis_
AGA REPORT NO. 8 RECOMMENDED RANGE Dtl_
MeterRun _
V2
46 WARNING: MOLE FRACTION FOR METHANE < 0.45 OR > 1.0 Coriolis_
FOR NITROGEN < 0.0 OR > 0.5 Dtl_
FOR CARBON DIOXIDE < 0.0 OR > 0.3 MeterRun
FOR ETHANE < 0.0 OR > 0.1
FOR PROPANE < 0.0 OR > 0.04
FOR WATER < 0.0 OR >= 0.0005
FOR H2S < 0.0 OR > 0.0002
FOR HYDROGEN < 0.0 OR > 0.1
FOR CARBON MONOXIDE < 0.0 OR > 0.03
FOR OXYGEN < 0.0 OR > 0.0
FOR BUTANES < 0.0 OR > 0.01
FOR PENTANES < 0.0 OR >= 0.003
FOR HEXANES + < 0.0 OR >= 0.002
FOR HELIUM < 0.0 OR >= 0.002
FOR ARGON < 0.0 OR > 0.0
49 WARNING: SUM OF MOLE FRACTIONS < 0.9999 OR > 1.0001 All
86 WARNING: Flowing Pressure greater than 2017 AGA8 GERG-2008 Coriolis_
Full Quality Range (10,150 PSIA) Dtl_
MeterRun_
V2
87 WARNING: Flowing Pressure greater than 2017 AGA8 GERG-2008 Coriolis_
Range (5075 PSIA) Dtl_
MeterRun_
V2
88 WARNING: Flowing Temperature outside 2017 AGA8 GERG-2008 Coriolis_
Full Quality Range (-352 F < TF < 800 F) Dtl_
MeterRun_

280
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
V2
89 WARNING: Flowing Temperature outside 2017 AGA8 GERG-2008 Coriolis_
Range (-298 F < TF < 350 F) Dtl_
MeterRun_
V2
90 WARNING: A Component Mole % outside 2017 AGA8 GERG-2008 Coriolis_
Intermediate Quality Range Dtl_
MeterRun_
V2
91 WARNING: A Component Mole % outside 2017 AGA8 GERG-2008 Coriolis_
Pipeline Quality Range Dtl_
MeterRun_
V2
NOTE 1: Error codes 1~4 are common between AGA 8 and AGA 5. You must take caution
and analyze when these specific out codes appear to determine the source.

281
Chapter 9 - Configuring Function Blocks

Coriolis_GM_MeterRun Function Block


Here is an example for Coriolis_GM_MeterRun:

Description
This Coriolis_GM_MeterRun function block calculates gas compressibility
factor, density, relative density and molecular weight from AGA8 gross

282
Chapter 9 - Configuring Function Blocks

method, volume flow rate at base condition from AGA11 and gas energy
per hour from AGA5. It also calculates hourly and daily averages and totals.
It generates hourly & daily QTRs and sends them to EFM application which
logs them on he contoller’s MRAM and flash memory. It also generates
alarms when any of the process value crosses specified alarm limit.
Coriolis_GM_MeterRun expects the input parameters to be in US or Metric
unit system.

Input
Data
Input Parameter Description Apply to
types
GrossMethod INT This parameter represents All
gross method number. It
should be either {1} for gross
method 1 and {2} for gross
method 2.
GasRelDensity REAL This parameter is gas relative All
density at reference condition.
It is unit less.
CO2 REAL It could be in mole fraction or All
percentage.
Hydrogen REAL It could be in mole fraction or All
percentage.
CO REAL It could be in mole fraction or All
percentage.
Nitrogen REAL It could be in mole fraction or All
percentage. This parameter is
only required for gross method
2, for gross method 1, it can
be zero.
GasHeatingValue REAL This parameter is gas heating All
value. It is only required for
gross method 1, for gross
method 2, it can be zero. It is
in Btu/ft^3 for US unit system
and in MJ/m^3 for Metric unit
system.

283
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
RefTempForCalorimeterDensity REAL This parameter is reference All
temperature for calorimeter
density. It should be in
Fahrenheit for US unit system
and in Celcius for Metric unit
system. The recommended
default is 60 Deg F.
RefPressForCalorimeterDensity REAL This parameter is reference All
pressure for calorimeter
density. It should be in Psia for
US unit system and in Kpa for
Metric unit system. The
recommended default is 14.73
Psia.
RefTempForCombustion REAL This parameter is reference All
temperature for combustion. It
should be in Fahrenheit for US
unit system and in Celcius for
Metric unit system. The
recommended default is 60
Deg F.
BaseTemp REAL Base temperature should be in All
Fahrenheit for US unit system
and in Celcius for Metric unit
system. The recommended
default is 60 Deg F.
BasePressure REAL Base pressure should be in All
Psia for US unit system and in
Kpa for Metric unit system.
The recommended default is
14.73 Psia.
FlowingTemp REAL Flowing temperature should All
be in Fahrenheit for US unit
system and in Celcius for
Metric unit system.
TempHiHi REAL This is the HiHi limit for flowing All
temperature. It should be
either in Fahrenheit or

284
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
Celcius.
TempHi REAL This is the Hi limit for flowing All
temperature. It should be
either in Fahrenheit or
Celcius.
TempLoLo REAL This is the LoLo limit for All
flowing temperature. It should
be either in Fahrenheit or
Celcius.
TempLo REAL This is the Lo limit for flowing All
temperature. It should be
either in Fahrenheit or
Celcius.
FlowTempIOSelection INT IO selection for meter Coriolis_
temperature. The value should GM_
be {1} for Live or {2) for MeterRun_
Keypad value. V2
FlowTempStsStatus USINT Analog input channel status Coriolis_
for meter temperature. The GM_
value should be {0} for Good MeterRun_
or any positive integer for bad V2
status.
FlowTempKeypadVal REAL Keypad value for meter Coriolis_
temperature. The value that GM_
should be used when the MeterRun_
meter temperature status is V2
bad.
FlowingPressure REAL Flowing pressure should be in All
Psia for US unit system and in
Kpa for Metric unit system.
PressureHiHi REAL This is the HiHi limit for flowing All
pressure. It should be either in
Psia or Kpa.
PressureHi REAL This is the Hi limit for flowing All
pressure. It should be either in
Psia or Kpa.

285
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
PressureLoLo REAL This is the LoLo limit for All
flowing pressure. It should be
either in Psia or Kpa.
PressureLo REAL This is the Lo limit for flowing All
pressure. It should be either in
Psia or Kpa.
GasMass REAL This parameter is gas mass Coriolis_
that is directly measured from GM_
coriolis meter. It should be in MeterRun
lbm/hr for US unit system and
in kg/hr for Metric unit system.
GasMassHiHi REAL This is the HiHi limit for gas Coriolis_
mass. It should be in lbm/hr for GM_
US unit system and in kg/hr for MeterRun
Metric unit system.
GasMassHi REAL This is the Hi limit for gas Coriolis_
mass. It should be in lbm/hr for GM_
US unit system and in kg/hr for MeterRun
Metric unit system.
GasMassLoLo REAL This is the LoLo limit for gas Coriolis_
mass. It should be in lbm/hr for GM_
US unit system and in kg/hr for MeterRun
Metric unit system.
GasMassLo REAL This is the Lo limit for gas Coriolis_
mass. It should be in lbm/hr for GM_
US unit system and in kg/hr for MeterRun
Metric unit system.
LowGasMassCutOff REAL This is the low gas mass cut Coriolis_
off limit. It should be in lbm/hr GM_
for US unit system and in kg/hr MeterRun
for Metric unit system.
FlowPresIOSelection INT IO selection for meter Coriolis_
pressure. The value should be GM_
{1} for Live or {2) for Keypad MeterRun_
value. V2
FlowPresStsStatus USINT Analog input channel status Coriolis_

286
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
for meter pressure. The value GM_
should be {0} for Good or any MeterRun_
positive integer for Bad status. V2
FlowPresKeypadVal REAL Analog input channel status Coriolis_
for meter pressure. The value GM_
should be {0} for Good or any MeterRun_
positive integer for Bad status. V2
Analog REAL Value of analog input if flow Coriolis_
type = analog. The value GM_
should be in lb/hr for US unit MeterRun_
or kg/hr for Metric unit. V2
AnalogHiHi REAL This is the HiHi limit for analog Coriolis_
input. The value should be in GM_
lb/hr for US unit or kg/hr for MeterRun_
Metric unit. V2
AnalogHi REAL This is the Hi limit for analog Coriolis_
input. The value should be in GM_
lb/hr for US unit or kg/hr for MeterRun_
Metric unit. V2
AnalogLoLo REAL This is the LoLo limit for Coriolis_
analog input. The value GM_
should be in lb/hr for US unit MeterRun_
or kg/hr for Metric unit. V2
AnalogLo REAL This is the Lo limit for analog Coriolis_
input. The value should be in GM_
lb/hr for US unit or kg/hr for MeterRun_
Metric unit. V2
LowFlowCutOff REAL Low flow cutoff value checks Coriolis_
the no flow condition in the GM_
calculations. If the flow is s MeterRun_
less than this number, it will be V2
considered as no flow
condition. Unit is kg/hr for
Metric unit, lb/hr for US unit.
FlowType INT This parameter represents the Coriolis_
flow type, it should be either GM_

287
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
{1} Pulse Accumulated or {2} MeterRun_
Analog Flow Rate. V2
Pulse UDINT Pulse counter value Coriolis_
GM_
MeterRun_
V2
LowPulseCutOff UINT Low pulse cutoff value checks Coriolis_
the no flow condition in the GM_
calculations. If the Pulse MeterRun_
increment is less than this V2
number, it will be considered
as no flow condition.
MeterCalFactor REAL It is same as Meter K factor Coriolis_
which converts pulse from flow GM_
meter into mass. The value MeterRun_
should be in pulses/kg (Metric) V2
or pulses/lb (US). When the
flow type is analog, this is the
correction factor to apply for
mass calculation and the
default value should be 1.0.
MeterRunId INT This is an integer number that All
represents a configured meter
run identifier.
GasCompFormat INT This parameter is for the gas All
composition format. It should
be either mole fraction {1} or
percentage {2}.

NOTE: It is
recommended to use 2
percentage as a default
option.

InputUnit INT This parameter is for all the All


inputs of meter run function
block. It should be either US
{1} or Metric {2}.

288
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
ContractUnit INT This parameter is for all the All
outputs of meter run function
block. It should be either US
{1} or Metric {2}.
ContractStartday INT This parameter represents the All
start of gas QTR day. Its value
should be from 0 to 23.
AvgMethod INT This parameter is for All
averaging method to be used
for averaging. As of now, it
only supports value {1} that is
for time weighted linear
average.
MaintMode INT Parameter to Start or Stop the Coriolis_
Maintenance Mode. The value GM_
should be either {0} MeterRun_
Maintenance End or {1} for V2
Maintenance Start. When
Maintenance mode is started,
an independent totalizer will
be started and accumulate all
the flow until the maintenance
mode is stopped. During this
period, non-resettable totals,
hourly/daily/batch totals will be
not incremented.
AGA8Version INT Selection for AGA 8 algorithm Coriolis_
selection: GM_
MeterRun_
1- AGA 8 (1994) V2
2 - AGA 8 (2017)
AtmosphericPressure REAL Atmospheric pressure should All
be in Psia for US unit system
and in Kpa for Metric unit
system.

Atmospheric pressure is used


to make Flowing pressure

289
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
absolute when flowing
pressure is measured by a
pressure gauge. If flowing
pressure is already absolute
then it can be left zero.
UserDefined1 REAL This parameter is an optional All
one, if user wants to average
some parameter then user can
use it, it will be averaged and
logged in the QTR.
UserDefined2 REAL This parameter is an optional All
one, if user wants to average
some parameter then user can
use it, it will be averaged and
logged in the QTR.
UserDefined3 REAL This parameter is an optional All
one, if user wants to average
some parameter then user can
use it, it will be averaged and
logged in the QTR.
UserDefined4 REAL This parameter is an optional All
one, if user wants to average
some parameter then user can
use it, it will be averaged and
logged in the QTR.

Output
Data
Output Parameter Description Apply to
types
Out_Code INT This out parameter returns success All
or fail code.
GasCompAtBaseCond LREAL This parameter is gas All
compressibility factor at base
condition. It is calculated in AGA8
Detailed method. It is unit less.
GasDensityAtBaseCond LREAL This parameter is gas density at All

290
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
base condition. It is calculated
through AGA8 Detailed method. It
is in lbm/ft^3 for US unit system
and in kg/m^3 for Metric unit
system.
GasRelDenAtBaseCond LREAL This parameter is gas relative All
density at base condition. It is
calculated through AGA8 Detailed
method. It is unit less.
GasMolecularWeight LREAL This parameter is gas molecular All
weight at base condition. It is
calculated through AGA8 Detailed
method. It is in lbm for US unit
system and in kg for Metric unit
system.
Aga11QB LREAL This parameter is volume flow rate All
at base condition. It is calculated
through AGA11 method. It is in
ft^3/hr for US unit system and in
m^3/hr for Metric unit system.
Energy LREAL This parameter is gas energy per All
hour. It is calculated through AGA5
method. It is in Btu/hr for US unit
system and in MJ/hr for Metric unit
system.
PrevHrAvgTemp LREAL This parameter is previous hour All
average for temperature.
PreDayAvgTemp LREAL This parameter is previous day All
average for temperature.
PrevHrAvgPressure LREAL This parameter is previous hour All
average for pressure.
PreDayAvgPressure LREAL This parameter is previous day All
average for pressure.
PrevHrAvgGasMass LREAL This parameter is previous hour All
average for gas mass.

291
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
PreDayAvgGasMass LREAL This parameter is previous day All
average for gas mass.
PrevHrAvgDenAtBase LREAL This parameter is previous hour All
average for density at base
condition.
PreDayAvgDenAtBase LREAL This parameter is previous day All
average for density at base
condition.
PrevHrAvgRelDenAtBase LREAL This parameter is previous hour All
average for relative density at base
condition.
PreDayAvgRelDenAtBase LREAL This parameter is previous day All
average for relative density at base
condition.
PrevHrAvgUserDefined1 LREAL This parameter is previous hour All
average for user defined
parameter1.
PreDayAvgUserDefined1 LREAL This parameter is previous day All
average for user defined
parameter1.
PrevHrAvgUserDefined2 LREAL This parameter is previous hour All
average for user defined
parameter2.
PreDayAvgUserDefined2 LREAL This parameter is previous day All
average for user defined
parameter2.
PrevHrAvgUserDefined3 LREAL This parameter is previous hour All
average for user defined
parameter3.
PreDayAvgUserDefined3 LREAL This parameter is previous day All
average for user defined
parameter3.
PrevHrAvgUserDefined4 LREAL This parameter is previous hour All
average for user defined
parameter4.

292
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
PreDayAvgUserDefined4 LREAL This parameter is previous day All
average for user defined
parameter4.
QbTH LREAL This parameter is volume flow rate All
at base condition total for this hour.
QbLH LREAL This parameter is volume flow rate All
at base condition total for last hour.
QbTD LREAL This parameter is volume flow rate All
at base condition total for this day.
QbLD LREAL This parameter is volume flow rate All
at base condition total for last day.
MTH LREAL This parameter is mass flow rate All
total for this hour.
MLH LREAL This parameter is mass flow rate All
total for last hour.
MTD LREAL This parameter is mass flow rate All
total for this day.
MLD LREAL This parameter is mass flow rate All
total for last day.
ETH LREAL This parameter is energy total for All
this hour.
ELH LREAL This parameter is energy total for All
last hour.
ETD LREAL This parameter is energy total for All
this day.
ELD LREAL This parameter is energy total for All
last day.
QbNR LREAL Non-Resettable or Cumulative total Coriolis_
for volume at Base. Unit - ft3/hr for GM_
US, m3/hr for Metric. MeterRun_
V2
MNR LREAL Non-Resettable or Cumulative total Coriolis_
for Mass. Unit - lbm/hr for US, kg/hr GM_

293
Chapter 9 - Configuring Function Blocks

Data
Output Parameter Description Apply to
types
for Metric. MeterRun_
V2
ENR LREAL Non-Resettable or Cumulative total Coriolis_
for Energy. Unit -Btu/hr for US, GM_
MJ/hr for Metric. MeterRun_
V2
QbRollover INT Rollover flag for volume at base Coriolis_
condition non-resettable total. The GM_
value {1} indicates Rollover MeterRun_
otherwise {0}. The value for roll- V2
over is 999,999,999. The rollover
flag will be on 5 times interval time.
MRollover INT Rollover flag for Non-Resettable Coriolis_
Mass total. The value {1} indicates GM_
Rollover otherwise {0}. The value MeterRun_
for roll-over is 999,999,999. The V2
rollover flag will be on 5 times
interval time.
ERollover INT Rollover flag for Non-Resettable Coriolis_
Energy total. The value {1} GM_
indicates Rollover otherwise {0}. MeterRun_
The value for roll-over is V2
999,999,999. The rollover flag will
be on 5 times interval time.
QbMaint LREAL Volume at Base in Maintenance Coriolis_
mode. GM_
MeterRun_
V2
MMaint LREAL Mass in Maintenance mode. Coriolis_
GM_
MeterRun_
V2
EMaint LREAL Energy at Base in Maintenance Coriolis_
mode. GM_
MeterRun_
V2

294
Chapter 9 - Configuring Function Blocks

NOTE: The above outputs including averages and totals would be in


the contract unit. The QTR generated by this function block contains
following fields. Date; Time; Flow Time; Volume at Base; Mass;
Energy; Temperature; Gas mass; Density; None; Relative Density;
Average User Defined 1 (optional); Average User Defined 2 (optional);
Average User Defined 3 (optional); Average User Defined 4 (optional).

295
Chapter 9 - Configuring Function Blocks

Following are the error codes for the above meter run function block.

Out
Description Apply to
Code
0 SUCCESS All
5 ERROR: THE ROOT WAS NOT BOUNDED IN DGROSS All
6 ERROR: NO CONVERGENCE IN DGROSS All
7 ERROR: VIRGS SQURE ROOT NEGATIVE All
8 ERROR: COMBINED VALUES OF GRGR, X[2] AND HV NOT All
CONSISTENT
9 ERROR: INVALID TERM IN VIRGS All
11 ERROR: METHOD WAS NOT 1 OR 2 All
12 ERROR: FLOWING PRESSURE (PF) <= 0.0 OR > 1740.0 PSIA All
13 ERROR: FLOWING TEMPERATURE (TF) < 14.0 OR > 149.0 DEG F All

14 ERROR: HEATING VALUE (HV) < 477.0 OR > 1211.0 BTU/FT^3 All
15 ERROR: GAS RELATIVE DENSITY (GRGR) < 0.55 OR > 0.870 All
16 ERROR: MOLE FRACTION FOR N2 < 0.0 OR > 0.50 All
OR FOR CO2 < 0.0 OR > 0.30
OR FOR H2 < 0.0 OR > 0.10
OR FOR CO < 0.0 OR > 0.03
17 ERROR: REFERENCE TEMPERATURE < 32.0 OR > 77.0 DEG F All
18 ERROR: REFERENCE PRESSURE < 13.0 OR > 16.0 PSIA All
22 WARNING: FLOWING PRESSURE (PF) <= 0.0 OR > 1200.0 PSIA Coriolis_
GM_
MeterRun
23 WARNING: FLOWING TEMPERATURE (TF) < 32.0 OR > 130.0 Coriolis_
DEG F GM_
MeterRun
24 WARNING: HEATING VALUE (HV) < 805.0 OR > 1208.0 BTU/FT^3 Coriolis_
GM_
MeterRun
25 WARNING: GAS RELATIVE DENSITY (GRGR) < 0.55 OR > 0.800 Coriolis_
GM_
MeterRun

296
Chapter 9 - Configuring Function Blocks

Out
Description Apply to
Code
26 WARNING: MOLE FRACTION FOR N2 < 0.0 OR > 0.20 Coriolis_
OR FOR CO2 < 0.0 OR > 0.20 GM_
OR FOR H2 < 0.0 OR > 0.0 MeterRun
OR FOR CO < 0.0 OR >0.0
81 WARNING: FLOWING PRESSURE (PF) > 1500.0 PSIA AGA8 2017 Coriolis_
RANGE 1 GM_
MeterRun_
V2
82 WARNING: FLOWING TEMPERATURE (TF) < 17.01 OR > 143.0 Coriolis_
DEG F AGA8 2017 RANGE 2 OR (TF) < 25.0 OR > 143.0 DEG F GM_
AGA8 2017 RANGE 1 MeterRun_
V2
83 WARNING: HEATING VALUE (HV) < 665.0 OR > 1100.0 BTU/FT^3 Coriolis_
AGA8 2017 RANGE 2 OR (HV) < 930.0 OR > 1040.0 BTU/FT^3 GM_
AGA8 2017 RANGE 1 MeterRun_
V2
84 WARNING: GAS RELATIVE DENSITY (GRGR) < 0.554 OR > 0.801 Coriolis_
AGA8 2017 RANGE 2 OR (GRGR) < 0.554 OR > 0.630 AGA8 GM_
RANGE 1 MeterRun_
V2
85 WARNING: MOLE FRACTION FOR N2 > 0.20 AGA8 2017 RANGE Coriolis_
2 OR N2 > 0.07 AGA8 2017 RANGE 1 GM_
MeterRun_
OR FOR CO2 > 0.25 AGA8 2017 RANGE 2 OR CO2 > 0.03 AGA8 V2
2017 RANGE 1

OR FOR H2 < 0.0 OR > 0.0 AGA8 2017 RANGE 1 AND 2

OR FOR CO < 0.0 OR > 0.0 AGA8 2017 RANGE 1 AND 2

API 21.2
The following libraries of API21.2 Function Blocks are supported:

Library Description
API21_2 The function block library provides support for creating flow measurement
calculations for various liquids based on API 21.2 standard for Turbine,
Corolis, positive displacement and ultrasonic meters.

297
Chapter 9 - Configuring Function Blocks

Library Description
API21_2_V2 It is supported from R161.2 release.

The function block library provides support for creating flow measurement
calculations for Liquid based on API 21.2 standard for Turbine, Corolis,
positive displacement and ultrasonic meters with upgraded support for
low flow cutoff.

The following API 21.2 meter run function blocks are available:

Function Block Description


Analog_AI_ Function block to preprocess the data from the analog input channel of
Process the ST103A device before the data is used with API21.2 function blocks.
The general preprocessing includes scaling and analog input status
determination.
Flowrate_Calc Function block to compute the flow rate.
Liq_CrudeOil This function block calculates volume correction factors for crude oil
according to API 11.1. It takes input from flow meter in terms of
Pulse/flow rate and calculate Gross Standard Volume, Net Standard
Volume and Sediments and Water Volume and Mass. The function
block supports base density from a offline densitometer, and live
measured density from single/dual densitometer (fast loop). The block
can take inputs either in US or Metric systems. The base temperature
and pressure is 60 Deg F and 0 psig in US units. The base temperature
is 15/20 Deg C and base pressure is 0 KPag in METRIC Unit.

The function block has the capability to use keypad values when the live
values from field devices are out of range or communication with
devices is lost. The function block supports continuous operations and
reporting. The function block also supports maintenance mode totalizer
when the meter run is under maintenance mode.

The function block can be configured to use with external ST103A or the
native I/O of the ControlEdge RTU.
Liq_LubricatingOil This function block calculates volume correction factors for refined
products like gasoline/diesel or lubricating oil according to API 11.1. It
takes input from flow meter in terms of Pulse/flow rate and calculate
Gross Standard Volume, and Mass. The function block supports base
density from a offline densitometer and live measured density from
single/dual densitometer (fast loop). The block can take inputs either in
US or Metric systems. The base temperature and pressure is 60 Deg F
and 0 psig in US units. The base temperature is 15/20 Deg C and base
pressure is 0 KPag in METRIC units.

298
Chapter 9 - Configuring Function Blocks

Function Block Description


The function block has the capability to use keypad values when the live
values from field devices are out of range or communication with
devices is lost. The function block supports continuous operations and
reporting. The function block also supports maintenance mode totalizer
when the meter run is under maintenance.

The function block can be configured to use with external ST103A or the
native I/O of the ControlEdge RTU.
Liq_NaturalGas This function block calculates volume correction factors for Natural gas
liquids (LNG/LPG ) according to API 11.2.4, API 11.2.2/11.2.2M and API
11.2.5. It takes input from the flow meter in terms of Pulse/flow rate and
calculate Gross Standard Volume, and Mass. The function block
supports base density from a offline densitometer and live measured
density from single/dual densitometer (fast loop). The block can take
inputs either in US or Metric systems. The base temperature and
pressure is 60 Deg F and 0 psig in US units. The base temperature is
15/20 Deg C and base pressure is 0 KPag in METRIC units.

The function block has the capability to use keypad values when the live
values from field devices are out of range or communication with
devices is lost. The function block supports continuous operations and
reporting. The function block also supports maintainence mode totalizer
when meter run is under maintenance. In order to get accuracy as
stated in API 11.2.4, the RoundingMethod needs to be set as enabled (1
as part of the configuration).

The function block can be configured to use with external ST103A or the
native I/O of the ControlEdge RTU.
Liq_ This function block calculates volume correction factors for refined
RefinedProducts products like gasoline or lubricating oil according to API 11.1. It takes
input from flow meter in terms of Pulse/flow rate and calculate Gross
Standard Volume, and Mass. The function block supports base density
from a offline densitometer and live measured density from single/dual
densitometer (fast loop). The block can take inputs either in US or Metric
systems. The base temperature and pressure is 60 Deg F and 0 psig in
US units. The base temperature is 15/20 Deg C and base pressure is 0
KPag in METRIC units.

The function block has the capability to use keypad values when the live
values from field devices are out of range or communication with
devices is lost. The function block supports continuous operations and
reporting. The function block also supports maintenance mode totalizer

299
Chapter 9 - Configuring Function Blocks

Function Block Description


when the meter run is under maintenance.

The function block can be configured to use with external ST103A or the
native I/O of the ControlEdge RTU.
Liq_ This function block calculates volume correction factors for special
SpecialProducts products according to API 11.1. It takes input from flow meter in terms of
Pulse/flow rate and calculate Gross Standard Volume, and Mass. The
value of thermal expansion factor at 60 deg F needs to be provided. The
function block supports base density from a offline densitometer and live
measured density from single/dual densitometer (fast loop). The block
can take inputs either in US or Metric systems. The base temperature
and pressure is 60F and 0 psig in US units. The base temperature is
15/20 Deg C and base pressure is 0 KPag.

The function block has the capability to use keypad values when the live
values from field devices are out of range or communication with
devices is lost. The function block supports continuous operations and
reporting. The function block also supports maintenance mode totalizer
when the meter run is under maintenance.

The function block can be configured to use with external ST103A or the
native I/O of the ControlEdge RTU.
Liquid_ The LiquidStationTotalizer function block calculates the meter station
StationTotalizer totals for the multiple streams connected to the Station. The Station
totals are calculated by adding relevant individual totals from each
stream and totalizing them to create Station totals. Station totalizer by
default totalizes gross standard volume, net standard volume, mass and
water and sediments volume. The station totalizer by default generates
hourly and daily QTR similar to any other meter runs.
ST103A_Process Function block to check the connection status of the ST103A device
before the data is used with other API21.2 function blocks.
Volume_ Function block to compute the corrected Volume for the given CTL and
Correction_FB CPL.

300
Chapter 9 - Configuring Function Blocks

Liq_CrudeOil, Liq_LubricatingOil, Liq_NaturalGas, Liq_


RefinedProducts and Liq_SpecialProducts

Description
Function Block Description
Liq_CrudeOil This function block calculates volume correction factors for crude oil
according to API 11.1. It takes input from flow meter in terms of
Pulse/flow rate and calculate Gross Standard Volume, Net Standard
Volume and Sediments and Water Volume and Mass. The function
block supports base density from a offline densitometer, and live
measured density from single/dual densitometer (fast loop). The block
can take inputs either in US or Metric systems. The base temperature
and pressure is 60 Deg F and 0 psig in US units. The base temperature
is 15/20 Deg C and base pressure is 0 KPag in METRIC Unit.

The function block has the capability to use keypad values when the live
values from field devices are out of range or communication with
devices is lost. The function block supports continuous operations and
reporting. The function block also supports maintenance mode totalizer
when the meter run is under maintenance mode.

The function block can be configured to use with external ST103A or the
native I/O of the ControlEdge RTU.
Liq_ This function block calculates volume correction factors for refined
RefinedProducts products like gasoline or lubricating oil according to API 11.1. It takes
input from flow meter in terms of Pulse/flow rate and calculate Gross
Standard Volume, and Mass. The function block supports base density
from a offline densitometer and live measured density from single/dual
densitometer (fast loop). The block can take inputs either in US or Metric
systems. The base temperature and pressure is 60 Deg F and 0 psig in
US units. The base temperature is 15/20 Deg C and base pressure is 0
KPag in METRIC units.

The function block has the capability to use keypad values when the live
values from field devices are out of range or communication with
devices is lost. The function block supports continuous operations and
reporting. The function block also supports maintenance mode totalizer
when the meter run is under maintenance.

The function block can be configured to use with external ST103A or the
native I/O of the ControlEdge RTU.
Liq_LubricatingOil This function block calculates volume correction factors for refined

301
Chapter 9 - Configuring Function Blocks

Function Block Description


products like gasoline/diesel or lubricating oil according to API 11.1. It
takes input from flow meter in terms of Pulse/flow rate and calculate
Gross Standard Volume, and Mass. The function block supports base
density from a offline densitometer and live measured density from
single/dual densitometer (fast loop). The block can take inputs either in
US or Metric systems. The base temperature and pressure is 60 Deg F
and 0 psig in US units. The base temperature is 15/20 Deg C and base
pressure is 0 KPag in METRIC units.

The function block has the capability to use keypad values when the live
values from field devices are out of range or communication with
devices is lost. The function block supports continuous operations and
reporting. The function block also supports maintenance mode totalizer
when the meter run is under maintenance.

The function block can be configured to use with external ST103A or the
native I/O of the ControlEdge RTU.
Liq_ This function block calculates volume correction factors for special
SpecialProducts products according to API 11.1. It takes input from flow meter in terms of
Pulse/flow rate and calculate Gross Standard Volume, and Mass. The
value of thermal expansion factor at 60 deg F needs to be provided. The
function block supports base density from a offline densitometer and live
measured density from single/dual densitometer (fast loop). The block
can take inputs either in US or Metric systems. The base temperature
and pressure is 60F and 0 psig in US units. The base temperature is
15/20 Deg C and base pressure is 0 KPag.

The function block has the capability to use keypad values when the live
values from field devices are out of range or communication with
devices is lost. The function block supports continuous operations and
reporting. The function block also supports maintenance mode totalizer
when the meter run is under maintenance.

The function block can be configured to use with external ST103A or the
native I/O of the ControlEdge RTU.
Liq_NaturalGas This function block calculates volume correction factors for Natural gas
liquids (LNG/LPG ) according to API 11.2.4, API 11.2.2/11.2.2M and API
11.2.5. It takes input from the flow meter in terms of Pulse/flow rate and
calculate Gross Standard Volume, and Mass. The function block
supports base density from a offline densitometer and live measured
density from single/dual densitometer (fast loop). The block can take
inputs either in US or Metric systems. The base temperature and
pressure is 60 Deg F and 0 psig in US units. The base temperature is

302
Chapter 9 - Configuring Function Blocks

Function Block Description


15/20 Deg C and base pressure is 0 KPag in METRIC units.

The function block has the capability to use keypad values when the live
values from field devices are out of range or communication with
devices is lost. The function block supports continuous operations and
reporting. The function block also supports maintainence mode totalizer
when meter run is under maintenance. In order to get accuracy as
stated in API 11.2.4, the RoundingMethod needs to be set as enabled (1
as part of the configuration).

The function block can be configured to use with external ST103A or the
native I/O of the ControlEdge RTU.

Input
Data
Input Parameter Description Apply to
types
MeterRunID Integer Identifier for the configured All
Meter Run.

Possible values 1 to 12
(Redundant), 1 to 4 (Non-
Redundant)
MeterType Integer Type of the flow meter: All

l 1 for Turbine meter or


l 2 for Positive
Displacement Meter
l 3 for Ultrasonic Meter or
l 4 for Coriolis Meter
l 5 for Station Totalizer
InputUnit Integer Unit for all the input parameters. All
The value should be 1 for US or
2 for Metric.
ContractUnit Integer Unit for all the ouput All
parameters. The value should
be 1 for US or 2 for Metric.

303
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
CorMtrAsDensiMtr Integer Option to set whether the All
Coriolis meter acts as
Densitometer. The values
should be either 1 for Yes or 0
for No. This parameter is
applicable only for Corolis meter
type.
ThermalExpansionFactor REAL Thermal expansion factor at Liq_
60°F. This input parameter is SpecialProducts
only applicable for Special
Products. For other commodity
types this parameter is not
present.
DensiMtrAvailable Integer Option to set whether the All
measured desity from live
Denstiometer is available or
offline base desity will be used .
The value should be either 1 for
Yes or 0 for No.
DensiMtrCount Integer The number of Densitometers All
available. The value should be
either 1 for Single or 2 for Dual
densitometer.
DensiTemp REAL Parameter to set the All
Densitometer temperature. The
value should be in Fahrenheit
for US unit and in Celcius for
Metric unit.
DensiTempLoLo REAL This is the LoLo limit for All
Densitometer temperature. The
value should be in Fahrenheit
for US unit and in Celcius for
Metric unit.
DensiTempLo REAL This is the Lo limit for All
Densitometer temperature. The
value should be in Fahrenheit
for US unit and in Celcius for
Metric unit.

304
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
DensiTempHi REAL This is the Hi limit for All
Densitometer temperature. The
value should be in Fahrenheit
for US unit and in Celcius for
Metric unit.
DensiTempHiHi REAL This is the HiHi limit for All
Densitometer temperature. The
value should be in Fahrenheit
for US unit and in Celcius for
Metric unit.
DensiTempIOSelection Integer I/O selection for Densitometer All
Temperature. The value should
be 1 for Live or 2 for Keypad
value.
DensiTempStsStatus USINT Analog input channel status for All
Densitometer Temperature.

The value should be 0 for good


or any positive integer for bad
status.
DensiTempKeypadVal REAL Keypad value for Densitometer All
temperature. The value that
should be used when the
Densitometer temperature
status is bad.
DensiPressure REAL Parameter to set the All
Densitometer pressure. The
value should be in Psig for US
unit and in Kpag for Metric unit.
DensiPressureLoLo REAL This is the LoLo limit for All
Densitometer pressure. The
value should be in Psig for US
unit and in Kpag for Metric unit.
DensiPressureLo REAL This is the Lo limit for All
Densitometer pressure. The
value should be in Psig for US
unit and in Kpag for Metric unit.

305
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
DensiPressureHi REAL This is the Hi limit for All
Densitometer pressure. The
value should be in Psig for US
unit and in Kpag for Metric unit.
DensiPressureHiHi REAL This is the HiHi limit for All
Densitometer pressure.The
value should be in Psig for US
unit and in Kpag for Metric unit.
DensiTempIOSelection Integer I/O selection for Densitometer All
pressure. The value should be 1
for Live or 2 for Keypad value.
DensiPressStsStatus USINT Analog input channel status for All
Densitometer Pressure.

The value should be 0 for good


or any positive integer for bad
status.
DensiPressKeypadVal REAL Keypad value for Densitometer All
pressure. The value that should
be used when the Densitometer
pressure status is not good.
Densi1MeasuredDensity REAL Density value of the All
Densitometer 1. The value
should be in lb/ft^3 for US unit
and kg/m^3 for Metric unit.
Densi2MeasuredDensity REAL Density value of the All
Densitometer 2. The value
should be in lb/ft^3 for US unit
and kg/m^3 for Metric unit. This
value is applicable only for Dual
Densitometer
MeasuredDensityIOSel Interger I/O selection for Density. The All
value should be 1 for Live or 2
for Keypad value.
Densi1Status USINT Status of Densitometer 1 . The All
value should be 0 for good
status or any positive integer for

306
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
bad status.
Densi2Status USINT Status of Densitometer 2. The All
value should be 0 for good
status or any positive integer for
bad status.
PreferredDensiMtr Interger Parameter to select the All
preferred Densitometer. The
value should be 1 for
Densitometer 1 and 2 for
Densitometer 2.
DensiKeypadValue REAL Keypad value for Densitometer All
measured density. The value
should be in lb/ft^3 for US unit
and kg/m^3 for Metric unit. This
value should be a base density
value. When on-line live
densitometer status is bad, base
density will be used a keypad
value.
BaseDensity REAL Density at Base conditions. The All
value should be in lb/ft^3 for US
unit and kg/m^3 for Metric unit.
BaseTemperature REAL Temperature at Base All
conditions. The value should be
in Fahrenheit for US unit and in
Celcius for Metric unit. The
recommended default is 60 Deg
F for US and 15/20 Deg C for
Metric.
MeterFactor REAL Meter K factor to convert pulse All
form flow meter into volume.
The value should be in
pulse/ft^3 for US unit in
pulse/m^3 for Metric unit. When
the flow type is equal to analog,
this is the correction factor to
apply for volume calculation and
default value should be 1.0.

307
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
RoundingMethod Integer Option to enable or disable the All
rounding of output parameter
values. The value should be 0
for Disabled and 1 for Enabled.
Temp REAL Parameter to set the meter All
temperature. The value should
be in Fahrenheit for US unit and
in Celcius for Metric unit.
TempLoLo REAL This is the LoLo limit for meter All
temperature. The value should
be in Fahrenheit for US unit and
in Celcius for Metric unit.
TempLo REAL This is the Lo limit for meter All
temperature. The value should
be in Fahrenheit for US unit and
in Celcius for Metric unit.
TempHi REAL This is the Hi limit for meter All
temperature. The value should
be in Fahrenheit for US unit and
in Celcius for Metric unit.
TempHiHi REAL This is the HiHi limit for meter All
temperature. The value should
be in Fahrenheit for US unit and
in Celcius for Metric unit.
TempIOSelection Integer I/O selection for meter All
temperature. The value should
ne 1 for Live or 2 for Keypad
value.
TempStsStatus USINT Analog input channel status for All
meter temperature. The value
should be 0 for good or any
positive integer for bad status.
TempKeypadVal REAL Keypad value for meter All
temperature. The value that
should be used when the meter
temperature status is bad.

308
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
Pressure REAL Parameter to set the meter All
pressure. The value should be
in Psig for US unit and in Kpag
for Metric unit.
PressureLoLo REAL This is the LoLo limit for meter All
pressure. The value should be
in Psig for US unit and in Kpag
for Metric unit.
PressureLo REAL This is the LoLo limit for meter All
pressure. The value should be
in Psig for US unit and in Kpag
for Metric unit.
PressureHi REAL This is the Hi limit for meter All
pressure.The value should be in
Psig for US unit and in Kpag for
Metric unit.
PressureHiHi REAL This is the HiHi limit for meter All
pressure. The value should be
in Psig for US unit and in Kpag
for Metric unit.
PressureIOSelection Integer I/O selection for meter pressure. All
The value should ne 1 for Live or
2 for Keypad value.
PressureStsStatus USINT Analog input channel status for All
meter pressure. The value
should be 0 for good status or
any positive integer for bad
status.
PressureKeypadVal REAL Keypad value for meter All
pressure. The value that should
be used when the meter
pressure status is bad.
PulseOrAnalogInput Integer Parameter to set the flow type. All
The value should be 0 for Pulse
and 1 for Analog.
IOType Interger Parameter to set the I/O type for All

309
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
Pulse input. The value should
be 1 for ST103A (3rd party
hardware) and 2 for Native I/O.
LowPulseCutoff UINT Low pulse cutoff value checks All
the no flow condition in the
calculations. If the Pulse
increment is less than this
number, it will be considered as
no flow condition.
Pulse UDINT The pulse counter value. All
STMsgId UDINT Message ID from the ST103A All
device. This will be used as
heartbeat to know whether
ST103A is live and
communicating with
ControlEdge RTU. MessageID
will increment 2 in 1 seconds.
STWDWaitTime UINT Maximum wait time in seconds All
for the ST103A to restore the
connection after connection
failure with ControlEdge RTU.
Beyond this limit, pulse
increments will not be utliized in
volume calculations. The status
for hourly/daily/Batch totals will
be set to 1, i.e. the totals are
suspicious.
MaxPulseIncrement UDINT Maximum pulse increment limit. All
If the pulse increment is beyond
this limit, an alarm will be
generated.
Analog REAL Value of analog input if flow type All
is qual to Analog. The value
should be in lb^3/hr for US unit
or m^3/hr for Metric unit.
AnalogLoLo REAL This is the LoLo limit for analog All
input. The value should be in
lb^3/hr for US unit or m^3/hr for

310
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
Metric unit.
AnalogLo REAL This is the Lo limit for analog All
input. The value should be in
lb^3/hr for US unit or m^3/hr for
Metric unit
AnalogHi REAL This is the Hi limit for analog All
input. The value should be in
lb^3/hr for US unit or m^3/hr for
Metric unit.
AnalogHiHi REAL This is the HiHi limit for analog All
input. The value should be in
lb^3/hr for US unit or m^3/hr for
Metric unit.
AveragingVariable Integer Parameter to set the variable All
used for flow weighted
averaging. The value should be
0 for Gross Volume or 1 for
Mass. For Liquid EFM, the
averaging is based on flow
weighted.
ContractHour Integer Parameter represents the time All
of daily QTR generation, as the
day roll over to next day. Its
value should be from 0 to 23.
This has to be set according to
the contract.
OperationType Integer Parameter to set the type of All
Operation. The value should be
1 for Continuous or 2 for Batch.
When the operation type is
equal to Batch, by default batch
reporting and hourly reporting
within batch will be configured
automatically. When the mode
is continuous, hourly and daily
reports will be configured by
default.

311
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
MaintMode Integer Parameter to Start or Stop the All
Maintenance Mode. The value
should be either 0 for
Maintenance end or 1 for
Maintenance Start. When
Maintenance mode is started,
an independent totalizer will be
started and accumulate all the
flow until the maintenance mode
is stopped. During this period,
non-resettable totals,
hourly/daily/batch totals will be
not incremented.
BatchIdentifier Integer Identifier for a Batch operation. All
This number will be incremented
for every batch.
RetroKfactor Integer Parameter to set for All
recalculation of totals if proving
happens during a batch process
and totals are adjusted with new
Meter K factor. By default this
parameter is set enabled.
WaterAndSedMeasAvbl Integer Parameter to set whether the Liq_CrudeOil
Water and Sediments is
available for the Crude Oil. The
value should be 1 if available
otherwise 0.
WaterAndSediments REAL Parameter to set the percentage Liq_CrudeOil
of Water and Sediments present
in the Crude Oil.
WaterAndSedIOSel Integer I/O selection for Water and Liq_CrudeOil
Sediments value. The value
should be 1 for Live or 2 for
Keypad value.
WaterAndSedStatus USINT Analog input channel status for Liq_CrudeOil
Water and Sediments.The value
should be 0 for good status or
any positive integer for bad

312
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description Apply to
types
status.
WaterAndSedKeypad REAL Keypad value in percentage for Liq_CrudeOil
Water and Sediments. The
value that should be used when
the Water and Sediments status
is bad.
CPLCalcType Integer CPL Calculation Type. The Liq_NaturalGas
value should be 1 for None or 2
for API21.2 or 3 for API21.2M.
ConverCriteria REAL IP2 Convergence limit. Default Liq_NaturalGas
value is 0.001.
MaxIterations Integer IP2 Max loop limit. Default value Liq_NaturalGas
is 50.
IterationMethod Integer Main calculation method. The Liq_NaturalGas
value should be either 1 for
ASTM or 2 for IP2
VapourPrInput REAL Parameter to set the user Liq_NaturalGas
observed Vapour Pressure
Input.
VapourPrCalcMethod Integer Vapour Pressure calculation Liq_NaturalGas
options. The value should be 1
for None, 2 for User Observed
or 3 for API 11.2.5.
Lowflowcutoff REAL Low flow cutoff value checks the All liquid types
no flow condition in the function blocks in
calculations. If the flow is s less API21.2_V2
than this number, it will be library.
considered as no flow condition.
Unit is m3/hr for Metric unit,
ft3/hr for US unit.

313
Chapter 9 - Configuring Function Blocks

Output
Data Apply
Input Parameter Description
types to
Out_Code Integer This out parameter returns success or fail All
code. The value will be 0 for success or -1
for Exception or +ve value for Error codes.
BaseDensityComputed LREAL Density at Base conditions. The value will be All
in lb/ft^3 for US unit and in kg/m^3 for Metric
unit.
MeterDensity LREAL Density at measurement or metering All
conditions. The value will be in lb/ft^3 for US
unit and in kg/m^3 for Metric unit.
ObservedDensity LREAL Observed Density or measured density. The All
value will be in lb/ft^3 for US unit and in
kg/m^3 for Metric unit.
NetStdVolume LREAL This parameter is Net Standard volume All
increment. It is in ft^3/sec for US unit system
and in m^3/sec for Metric unit system.
GrossStdVolume LREAL This parameter is Gross Standard volume All
increment. It is in ft^3/sec for US unit system
and in m^3/sec for Metric unit system.
SedAndWaterVolume LREAL This parameter is Sediment And Water All
volume increment. It is in ft^3/sec for US unit
system and in m^3/sec for Metric unit
system.
CTL LREAL Correction factor for effects of temperature All
on the liquid.
CPL LREAL Correction factor for effects of pressure on All
the liquid.
Mass LREAL This parameter is mass increment. It is in All
lb/sec for US unit system and in kg/sec for
Metric unit system.
AvgCTLLH LREAL Average CTL for the previous hour. All
AvgCTLLDOrBat LREAL Average CTL for the previous day or Batch. All
AvgCPLLH LREAL Average CPL for the previous hour. All

314
Chapter 9 - Configuring Function Blocks

Data Apply
Input Parameter Description
types to
AvgCPLLDOrBat LREAL Average CTL for the previous day or Batch. All
AvgObsDenLH LREAL Average Observed Density for the previous All
hour.
AvgObsDenLDOrBat LREAL Average Observed Density for the previous All
day or Batch.
AvgTempLH LREAL Average Temperature for the previous hour. All
AvgTempLDOrBat LREAL Average Temperature for the previous day All
or Batch.
AvgPressLH LREAL Average Pressure for the previous hour. All
AvgPressLDOrBat LREAL Average Pressure for the previous day or All
Batch.
AvgBaseDenLH LREAL Average Base Density for the previous hour. All
AvgBaseDenLDOrBat LREAL Average Base Density for the previous day All
or Batch.
SwVTH LREAL Sediments And Water volume total for this All
hour.
SwVLH LREAL Sediment And Water volume total for last All
hour.
SwVTDOrBat LREAL Sediment And Water volume total for this All
day or Batch.
SwVLDOrBat LREAL Sediment And Water volume total for last All
day or Batch.
NSVTH LREAL Net Standard volume total for this hour. All
NSVLH LREAL Net Standard volume total for last hour. All
NSVTDOrBat LREAL Net Standard volume total for this day or All
Batch
NSVLDOrBat LREAL Net Standard volume total for last day or All
Batch
MassTH LREAL Mass total for this hour. All
MassLH LREAL Mass total for last hour. All

315
Chapter 9 - Configuring Function Blocks

Data Apply
Input Parameter Description
types to
MassTDOrBat LREAL Mass total for this day or batch. All
MassLDOrBat LREAL Mass total for last day or batch. All
GSVTH LREAL Gross Standard volume total for this hour. All
GSVLH LREAL Gross Standard volume total for last hour. All
GSVTDOrBat LREAL Gross Standard volume total for this day or All
Batch.
GSVLDOrBat LREAL Gross Standard volume total for last day or All
Batch.
SwVMaint LREAL Sediments And Water volume total for this All
hour in Maintenance mode.
NSVMaint LREAL Net Standard volume total in Maintenance All
mode.
MassMaint LREAL Mass total in Maintenance mode. All
GSVMaint LREAL Gross Standard volume total in Maintenance All
mode.
SwVNR LREAL Non-Resettable Sediment And Water All
volume total.
NSVNR LREAL Non-Resettable Net Standard volume total. All
MassNR LREAL Non-Resettable Mass total. All
GSVNR LREAL Non-Resettable Gross Standard volume All
total.
SwVNRRollover Integer Rollover flag for Non-Resettable Sediments All
And Water volume total. The value 1
indicates Rollover otherwise 0. The value for
roll-over is 999,999,999. The rollover flag
will be on 5 times interval time.
NSVNRRollover Integer Rollover flag for Non-Resettable Net All
Standard volume total. The value 1 indicates
Rollover otherwise 0. The value for roll-over
is 999,999,999. The rollover flag will be on 5
times interval time.
MassNRRollover Integer Rollover flag for Non-ResettableMass total. All
The value 1 indicates Rollover otherwise 0.

316
Chapter 9 - Configuring Function Blocks

Data Apply
Input Parameter Description
types to
The value for roll-over is 999,999,999. The
rollover flag will be on 5 times interval time.
GSVNRRollover Integer Rollover flag for Non-ResettableGross All
Standard volume total. The value 1 indicates
Rollover otherwise 0. The value for roll-over
is 999,999,999. The rollover flag will be on 5
times interval time.
StatusTH Integer Status of the period total for the this hour. All
The value will be 0 for good status or 1 for
bad status.
StatusTD Integer Status of the period total for the this day. The All
value will be 0 for good status or 1 for bad
status.
STIOReset Integer This parameter indicates whether the All
ST103A is restarted or not. The value will be
0 for false or 1 for true. The reset flag will be
on for 5 times of interval time.

Input and Output


Input Data Apply
Description
Parameter types to
BatchMode Any This parameter to set the Batch mode. The value should be All
0 for Batch End and 1 for Batch Start.

NOTE: If the flow type Input is Analog, operation type Batch is not
supported.

Data type
See the following data types for detailed information:

Data types Details


UINT2 TYPE

UINT2: ARRAY [1..2] OF UINT; (*to

317
Chapter 9 - Configuring Function Blocks

Data types Details


support Modbus write*)
END_TYPE
TYPE
REAL5 REAL5: ARRAY [1..7] OF REAL; (*to
support AI*)
END_TYPE
UINT1 TYPE

UINT1: ARRAY [1..1] OF UDINT; (*to


support Pulse A*)
END_TYPE
UDINT2 TYPE

UDINT2: ARRAY [1..3] OF UDINT; (*to


support Pulse E*)
END_TYPE
REAL2 TYPE

REAL2: ARRAY [1..2] OF REAL; (*to


support Freq*)
END_TYPE
PULSE_INPUT_TYPE_DUAL TYPE

PULSE_INPUT_TYPE_DUAL :
STRUCT
GOOD_PULSE : UDINT; (* Good
Pulse*)
END_STRUCT;
END_TYPE
FREQUENCY_INPUT_TYPE TYPE

FREQUENCY_INPUT_TYPE :
STRUCT
STS : USINT; (*Status*)
PV : REAL; (* Frequency *)

318
Chapter 9 - Configuring Function Blocks

Data types Details


END_STRUCT;
END_TYPE
ANALOG_INPUT_TYPE _TP TYPE

ANALOG_INPUT_TYPE _TP :
STRUCT
STS : USINT; (*Status*)
PV : REAL; (* Value *)
EUHI:REAL(* Range Hi *)
EULO: REAL (*Range Low *)
EUHIEX:REAL (*Range Hi Extended *)
EULOEX:REAL (*Range Low Extended
*)
END_STRUCT;
END_TYPE
BATCH_TOTALISE_STRUCT TYPE

BATCH_TOTALISE_STRUCT :
STRUCT
BATCHMODE :INT;
END_STRUCT;
END_TYPE

Error Codes
See the following table for error codes for the function blocks Liq_CrudeOil ,
Liq_RefinedProducts,Liq_LubricatingOil and Liq_SpecialProducts :

Error Code Description


0 No error, Calculations Successful
1 Error - Illegal arguments
2 Error - Memory allocation

319
Chapter 9 - Configuring Function Blocks

Error Code Description


3 Error - VCF out of range
4 Error - Non convergence
5 Error - Temperature out of range
6 Error - Density out of range
7 Error - Pressure out of range
8 Error - Alpha60 out of range
9 Error - Supercritical fluid
10 Error - No reference fluids
11 Error - No Solution

See the following table for error codes for the function block LIQ_
Naturalgas:

Error Code Description


1 Density input is out of range (all calculations)
2 Temperature input is out of range (all calculations )
3 Pressure input is out of range (all calculations )
4 Calculation combination is invalid (all calculations )
14 API.11.2.4: Alpha error
15 API.11.2.4: Interpolation variable error
16 API.11.2.4: TC error
17 API.11.2.4: TRX error
18 API.11.2.4: H2 error
19 API.11.2.4: Saturated density error
20 API.11.2.4: Interpolation factor error
21 API.11.2.4: Step 4-5 error
22 API.11.2.4: Fluid 2 relative density low error
23 API.11.2.4: Step 6 TC2_TC1 error
24 API.11.2.4: RD X < Lower Limit

320
Chapter 9 - Configuring Function Blocks

Error Code Description


25 API.11.2.4: RD 60 Mid error
26 API.11.2.4: Step 9 Phi error
27 API.11.2.4: Step 9 A error
28 API.11.2.4: Step 9 B error
29 API.11.2.4: Step 9 RD 60 Trial error
30 API.11.2.4: Iteration Fail error
31 API.11.2.4: CTL range error
32 API.11.2.4: T60 Step 6 density error
101 API.11.2.4: Density conversion error
102 API.11.2.4: Rounding error
103 API.11.2.4: Reserved
104 API.11.2.4: CTL range error
105 API.11.2.4: CPL range error
106 API.11.2.4: Reserved
107 API.11.2.4: Reserved
108 API.11.2.4: Calculated density range error
109 API.11.2.4: Density units conversion error
110 API.11.2.4: Pressure units conversion error
111 API.11.2.4: CTPL range error
211 API 1122 and API1122M: TR > Max error
212 API 1122 and API1122M: Factor error
301 Ch.11.2.5: relative density out of range
302 Ch.11.2.5: Temperature out of range

321
Chapter 9 - Configuring Function Blocks

LiquidStationTotalizer

Description
The LiquidStationTotalizer function block calculates the meter station totals
for the multiple streams connected to the Station. The Station totals are
calculated by adding relevant individual totals from each stream and
totalizing them to create Station totals. Station totalizer by default totalizes
gross standard volume, net standard volume, mass and water and
sediments volume. The station totalizer by default generates hourly and
daily QTR similar to any other meter runs.

ATTENTION: Station totalizer can be configured for totalizing 2 to 4


meter runs. The maximum quantity that can be added to station
totalizer is 4 and minimum is 2. When configuring the station
totalizer, meter runs of same liquid type, operation type
(period/batch) and contract hours should be considered. This
function block will not do any error handling if the above conditions
are not met.

Input
Data
Input Parameter Description
Type
MeterRunID INT Identifier for the configured Meter Run.
MeterType INT Type of the meter. The value should be {5} for Station
Totalizer.
ContractHour INT This value represents the hour on which a day roll over for
reporting. Its value should be from 0 to 23.
SwVTH1 LREAL Sediments And Water volume total for this hour for the first
meter run.
SwVTDOrBat1 LREAL Sediment And Water volume total for this day or Batch for the
first meter run.
SwVNR1 LREAL Non-Resettable Sediment And Water volume total for the first
meter run.
NSVTH1 LREAL Net Standard volume total for this hour for the first meter run.
NSVTDOrBat1 LREAL Net Standard volume total for this day or Batch for the first
meter run.

322
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
Type
NSVNR1 LREAL Non-Resettable Net Standard volume total for the first meter
run.
MassTH1 LREAL Mass total for this hour for the first meter run.
MassTDOrBat1 LREAL Mass total for this day or batch for the first meter run.
MassNR1 LREAL Non-Resettable Mass total for the first meter run.
GSVTH1 LREAL Gross Standard volume total for this hour for the first meter
run.
GSVTDOrBat1 LREAL Gross Standard volume total for this day or Batch for the first
meter run.
GSVNR1 LREAL Non-Resettable Gross Standard volume total for the first meter
run.
StatusTH1 INT Status of the calculation for this hour for the first meter run. The
value will be {0} for Status good or {1} for bad status.
StatusTD1 INT Status of the calculation for the this day for the first meter run.
The value will be {0} for Status good or {1} for bad status.
SwVTH2 LREAL Sediments And Water volume total for this hour for the second
meter run.
SwVTDOrBat2 LREAL Sediment And Water volume total for this day or Batch for the
second meter run.
SwVNR2 LREAL Non-Resettable Sediment And Water volume total for the
second meter run.
NSVTH2 LREAL Net Standard volume total for this hour for the second meter
run.
NSVTDOrBat2 LREAL Net Standard volume total for this day or Batch for the second
meter run.
NSVNR2 LREAL Non-Resettable Net Standard volume total for the second
meter run.
MassTH2 LREAL Mass total for this hour for the second meter run.
MassTDOrBat2 LREAL Mass total for this day or batch for the second meter run.
MassNR2 LREAL Non-Resettable Mass total for the second meter run.
GSVTH2 LREAL Gross Standard volume total for this hour for the second meter

323
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
Type
run.
GSVTDOrBat2 LREAL Gross Standard volume total for this day or Batch for the
second meter run.
GSVNR2 LREAL Non-Resettable Gross Standard volume total for the second
meter run.
StatusTH2 INT Status of the calculation for this hour for the second meter run.
The value will be {0} for Status good or {1} for bad status.
StatusTD2 INT Status of the calculation for the this day for the second meter
run. The value will be {0} for Status good or {1} for bad status.
SwVTH3 LREAL Sediments And Water volume total for this hour for the third
meter run.
SwVTDOrBat3 LREAL Sediment And Water volume total for this day or Batch for the
third meter run.
SwVNR3 LREAL Non-Resettable Sediment And Water volume total for the third
meter run.
NSVTH3 LREAL Net Standard volume total for this hour for the third meter run.
NSVTDOrBat3 LREAL Net Standard volume total for this day or Batch for the third
meter run.
NSVNR3 LREAL Non-Resettable Net Standard volume total for the third meter
run.
MassTH3 LREAL Mass total for this hour for the third meter run.
MassTDOrBat3 LREAL Mass total for this day or batch for the third meter run.
MassNR3 LREAL Non-Resettable Mass total for the third meter run.
GSVTH3 LREAL Gross Standard volume total for this hour for the third meter
run.
GSVTDOrBat3 LREAL Gross Standard volume total for this day or Batch for the third
meter run.
GSVNR3 LREAL Non-Resettable Gross Standard volume total for the third
meter run.
StatusTH3 INT Status of the calculation for this hour for the third meter run.
The value will be {0} for Status good or {1} for bad status.
StatusTD3 INT Status of the calculation for the this day for the third meter run.

324
Chapter 9 - Configuring Function Blocks

Data
Input Parameter Description
Type
The value will be {0} for Status good or {1} for bad status.
SwVTH4 LREAL Sediments And Water volume total for this hour for the fourth
meter run.
SwVTDOrBat4 LREAL Sediment And Water volume total for this day or Batch for the
fourth meter run.
SwVNR4 LREAL Non-Resettable Sediment And Water volume total for the
fourth meter run.
NSVTH4 LREAL Net Standard volume total for this hour for the fourth meter run.
NSVTDOrBat4 LREAL Net Standard volume total for this day or Batch for the fourth
meter run.
NSVNR4 LREAL Non-Resettable Net Standard volume total for the fourth meter
run.
MassTH4 LREAL Mass total for this hour for the fourth meter run.
MassTDOrBat4 LREAL Mass total for this day or batch for the fourth meter run.
MassNR4 LREAL Non-Resettable Mass total for the fourth meter run.
GSVTH4 LREAL Gross Standard volume total for this hour for the fourth meter
run.
GSVTDOrBat4 LREAL Gross Standard volume total for this day or Batch for the fourth
meter run.
GSVNR4 LREAL Non-Resettable Gross Standard volume total for the fourth
meter run.
StatusTH4 INT Status of the calculation for this hour for the fourth meter run.
The value will be {0} for Status good or {1} for bad status.
StatusTD4 INT Status of the calculation for the this day for the fourth meter
run. The value will be {0} for Status good or {1} for bad status.

Output
Output
Description Description
Parameter
Out_Code INT This out parameter returns success or fail code. The value
wll be {0} for success or {1} for Exception or {+ve value} for

325
Chapter 9 - Configuring Function Blocks

Output
Description Description
Parameter
Error codes.
SwVTH LREAL Sum of Sediments And Water volume total for this hour for
meter runs configured for station total.
SwVTDOrBat LREAL Sum of Sediment And Water volume total for this day or
Batch for station total.
SwVNR LREAL Sum of Non-Resettable Sediment And Water volume total
for station total.
NSVTH LREAL Sum of Net Standard volume total for this hour for station
total.
NSVTDOrBat LREAL Sum of Net Standard volume total for this day or Batch for
station total.
NSVNR LREAL Sum of Non-Resettable Net Standard volume total for
station total.
MassTH LREAL Sum of Mass total for this hour for station total.
MassTDOrBat LREAL Sum of Mass total for this day or batch for station total.
MassNR LREAL Sum of Non-Resettable Mass total for station total.
GSVTH LREAL Sum of Gross Standard volume total for this hour for station
total.
GSVTDOrBat LREAL Sum of Gross Standard volume total for this day or Batch
for station total.
GSVNR LREAL Sum of Non-Resettable Gross Standard volume total for
station total.
StatusTH INT Overall status of the calculation for this hour for station total.
The value will be {0} for Status good or {1} for bad status.
StatusTD INT Overall status of the calculation for the this day for station
total. The value will be {0} for Status good or {1} for bad
status.

326
Chapter 9 - Configuring Function Blocks

Analog_AI_Process

Description
Function block to preprocess the data from the analog input channel of the
ST103A device before the data is used with API21.2 function blocks. The
general preprocessing includes scaling and analog input status
determination.

Input
Input Data
Description
Parameter Type
AI REAL Value read from analog input channel of ST103A device.
EUHi REAL This is the Hi limit for analog input in Engineering units.
EULo REAL This is the Lo limit for analog input in Engineering units.
EUHiHi REAL This is the HiHi limit for analog input in Engineering units.
EULoLo REAL This is the LoLo limit for analog input in Engineering units.
ST103Status INT Status of ST103A device. The value will be {0} for status good or
{1} for communication with ST103A is lost.

Output
Output Data
Description
Parameter Type
PV REAL Process value of the specific analog input channel in scaled to
engineering units.
Status USINT Status of the analog input channel.

Possible values:

0-Channel is good.

1-Channel is offline. The communication with device is lost.

11-The value is higher than the extended high range value.

12- The value is higher than the high range value but lower than the
extended high range value.

327
Chapter 9 - Configuring Function Blocks

Output Data
Description
Parameter Type
13- The value is lower than the low range value but higher than the
extended low range value.

14- The value is lower than than the extended low range value.

TIP: This function block should not be used as a standalone


function. It is internally used by API 21.2 function blocks.

ST103A_Process

Description
Function block to check the connection status of the ST103A device before
the data is used with API21.2 function blocks.

Input
Input Parameter Data Type Description
STMsgld UDINT Message ID from ST103A device

Output
Output Parameter Data Type Description
Status USINT Status of the ST103A device

Possible values:

0-Good status

1- Communication with ST103A device is lost.

TIP: This function block should not be used as a standalone


function. It is internally used by API 21.2 function blocks.

328
Chapter 9 - Configuring Function Blocks

Volume_Correction_FB

Description
This function block computes the corrected Volume for the given CTL and
CPL.

Input
Parameter Data type Description
CTL LREAL Correction factor for effects of temperature on the liquid.
CPL LREAL Correction factor for effects of pressure on the liquid.
MeteredVol LREAL Recorded metered volume by the master meter.

Output
Parameter Data type Description
CorrVol_AtCtlCpl LREAL The corrected volume at this CTL and CPL.

Flowrate_Calc

Description
Function block to compute the flow rate.

Input
Data
Parameter Description
Type
IncCalcVal LREAL The incremental calculated volume or mass to compute the flow
rate.
ExecTime INT Execution time in seconds.

329
Chapter 9 - Configuring Function Blocks

Output
Parameter Data Type Description
Flowrate LREAL Flow rate computed in m^3/hr.

330
CHAPTER

10 EFM METER RUN REGISTERS

This chapter provides details for meter run register range, offset and
register description.

In this section:

Integration with SCADA 332


Meter run register range 332
Meter run register offset 333
QTR rollover details 334
System events 334
Meter run register description 335
Alarm and event operator Bit definition 347

331
Chapter 10 - EFM meter run registers

Integration with SCADA


The periodic/batch flow measurement data from ControlEdge RTU can be
retrieved to SCADA using Enron Modbus communication protocol.
For Experion, both Enron Modbus and DNP3 communication are
supported. For more information about how to build EFM meter templates
in Experion, see "Building Electronic Flow Measurement (EFM)" in the
Quick Builder User's Guide.

Meter run register range


Table 10-1: Meter run register range

Hourly Hourly/
(Interval)/ Daily Alarm AE Boolean Integer Long
Purpose Float
Daily Archive Archive Pointer Range Range Integer
Archive pointers
Run 1 701 - 702 7001- 32 7041 1100 to 3100 to 5100 to 7100
7002 1199 3199 5199 to
7349
Run 2 703 to 7003- 32 7041 1200 to 3200 to 5200 to 7350
704 7004 1299 3299 5299 to
7599
Run 3 705 to 7005- 32 7041 1300 to 3300 to 5300 to 7600
706 7006 1399 3399 5399 to
7849
Run 4 707 to 7007- 32 7041 1400 to 3400 to 5400 to 7850
708 7008 1499 3499 5499 to
8099
Run 5 709 to 7009- 32 7041 1500 to 3500 to 5500 to 8100
710 7010 1599 3599 5599 to
8349
Run 6 711 to 7011- 32 7041 1600 to 3600 to 5600 to 8350
712 7012 1699 3699 5699 to
8599
Run 7 713 to 7013- 32 7041 1700 to 3700 to 5700 to 8600
714 7014 1799 3799 5799 to
8849
Run 8 715 to 7015- 32 7041 1800 to 3800 to 5800 to 8850

332
Chapter 10 - EFM meter run registers

Hourly Hourly/
(Interval)/ Daily Alarm AE Boolean Integer Long
Purpose Float
Daily Archive Archive Pointer Range Range Integer
Archive pointers
716 7016 1899 3899 5899 to
9099
Run 9 717 to 7017- 32 7041 1900 to 3900 to 5900 to 9100
718 7018 1999 3999 5999 to
9349
Run 10 719 to 7019- 32 7041 2000 to 4000 to 6000 to 9350
720 7020 2099 4099 6099 to
9599
Run 11 721 to 7021- 32 7041 2100 to 4100 to 6100 to 9600
722 7022 2199 4199 6199 to
9849
Run 12 723 to 7023- 32 7041 2200 to 4200 to 6200 to 9850
724 7024 2299 4299 6299 to
10099

Meter run register offset


Table 10-2: Meter run register offset

Purpose Boolean Offset Integer Offset Long Integer Offset Float Offset
Run 1 0 0 0 0
Run 2 100 100 100 250
Run 3 200 200 200 500
Run 4 300 300 300 750
Run 5 400 400 400 1000
Run 6 500 500 500 1250
Run 7 600 600 600 1500
Run 8 700 700 700 1750
Run 9 800 800 800 2000

333
Chapter 10 - EFM meter run registers

Purpose Boolean Offset Integer Offset Long Integer Offset Float Offset
Run 10 900 900 900 2250
Run 11 1000 1000 1000 2500
Run 12 1100 1100 1100 2750

QTR rollover details


35 days of audit trail data is stored in ControlEdge 2020 controller for both
gas and liquid meter runs. After 35 days, older data will be replaced with
newer data, that is to say, the data of the last 35 days are retained in the
controller.
Gas QTR

Hourly rollover index: 1050


Daily rollover index: 100
Liquid QTR

Hourly rollover index for API21_2: 918


Hourly rollover index for API21_2_V2: 1050
Daily rollover index: 100

System events
The system events registers are for event reference and cannot be read.
System events table is as follows.

Table 10-3: System Events

Enron Register System Events


3001 EV_SYSTEM_COLD_START
3002 EV_SYSTEM_WARM_START
3003 EV_SYSTEM_POWER_OFF
3004 EV_SYSTEM_WATCHDOG_RESET
3005 EV_SYSTEM_TIME_CHANGED

334
Chapter 10 - EFM meter run registers

Meter run register description


The Enron register mapping for the controller is displayed as follows. The
actual meter run specific register can be calculated by adding the offset
mentioned in the offset table.

Table 10-4: Meter run register description

Meter run Configuration


Enron Register Alarm & Events Description
Parameter
3108 EV_CHANGE_INPUT_UNITS Input Units change
3109 EV_CHANGE_CONTRACT_ Contract Units change
UNITS
3110 EV_CHANGE_VOLUME_UNIT Volume unit change
3111 EV_CHANGE_TEMPRATURE_ Temperature unit change
UNIT
3112 EV_CHANGE_PRESSURE_UNIT Pressure unit change
3113 EV_CHANGE_DENSITY_UNIT Density unit change
3114 EV_CHANGE_FLOW_UNIT Flow unit change
3115 EV_CHANGE_SOFTWARE_ Software revision change
REVISION
3116 EV_CHANGE_METER_ID Meter Id value change
3117 EV_CHANGE_LIQUID_TYPE Liquid type change
7101 EV_CHANGE_IS_ABSOLUTE_ IS_Absolute_Pressure change
PRESSURE
7102 EV_CHANGE_ATMOSPHERIC_ Atmospheric_Pressure change
PRES
7111 EV_CHANGE_DP_LOW_ DP low cutoff change
CUTOFF
7112 EV_CHANGE_IS_PULSE IS_Pulse change
7113 EV_CHANGE_PULSE_LOW_ Pulse low cutoff change
CUTOFF
7114 EV_CHANGE_LOW_FLOW_ Low flow detect time change
DETECT_TIME

335
Chapter 10 - EFM meter run registers

Meter run Configuration


Enron Register Alarm & Events Description
Parameter
7115 EV_CHANGE_LOW_GAS_ Low gas mass cutoff change
MASS_CUTOFF
7120 EV_CHANGE_ Compressibility method change
COMPRESSIBILITY_METHOD
7121 EV_CHANGE_AVERAGING_ Averaging method change
METHOD
7122 EV_CHANGE_CONTRACT_ Contract hour change
HOUR
7123 EV_CHANGE_BASE_TEMP Base temperature change
7124 EV_CHANGE_BASE_PRES Base pressure change
7131 EV_CHANGE_ORIFICE_ Orifice material change
MATERIAL
7132 EV_CHANGE_ORIFICE_TAP_ Orifice tap type change
TYPE
7133 EV_CHANGE_ORIFICE_TAP_ Orifice tap location change
LOCATION
7134 EV_CHANGE_ORIFICE_PIPE_ Orifice pipe material change
MATERIAL
7135 EV_CHANGE_ORIFICE_ Orifice diameter change
DIAMETER
7136 EV_CHANGE_ORIFICE_PIPE_ Orifice pipe diameter change
DIAMETER
7137 EV_CHANGE_ORIFICE_ Orifice viscosity change
VISCOSITY
7138 EV_CHANGE_ORIFICE_REF_ Orifice ref temperature change
TEMP
7139 EV_CHANGE_ORIFICE_PIPE_ Orifice pipe ref temperature
REF_TEMP change
7140 EV_CHANGE_ORIFICE_ Orifice isentropic exp change
ISENTROPIC_EXP
7141 EV_CHANGE_ORIFICE_FLUID_ Orifice fluid type change
TYPE

336
Chapter 10 - EFM meter run registers

Meter run Configuration


Enron Register Alarm & Events Description
Parameter
7148 EV_CHANGE_THERMAL_ Thermal Expansion Factor value
EXPANSION change
7149 EV_CHANGE_TEMP_KEYPAD_ Temperature keypad value
VALUE change
7150 EV_CHANGE_PRES_KEYPAD_ Pressure keypad value change
VALUE
7151 EV_CHANGE_TURB_METER_ Turb meter factor change
FACTOR
7152 EV_CHANGE_ULTRA_METER_ Ultra meter factor change
FACTOR
7153 EV_CHANGE_LIQ_METER_ Liquid Meter Factor value
FACTOR change
7160 EV_CHANGE_GAS_COMP_ Gas comp source change
SOURCE
7161 EV_CHANGE_GAS_COMP_ Gas comp format change
FORMAT
7162 EV_CHANGE_GAS_COMP_ Gas comp Methane change
METHANE
7163 EV_CHANGE_GAS_COMP_ Gas comp Nitrogen change
NITROGEN
7164 EV_CHANGE_GAS_COMP_CO2 Gas comp CO2 change
7165 EV_CHANGE_GAS_COMP_ Gas comp Ethane change
ETHANE
7166 EV_CHANGE_GAS_COMP_ Gas comp Propane change
PROPANE
7167 EV_CHANGE_GAS_COMP_ Gas comp Water change
WATER
7168 EV_CHANGE_GAS_COMP_H2S Gas comp H2S change
7169 EV_CHANGE_GAS_COMP_ Gas comp Hydrogen change
HYDROGEN
7170 EV_CHANGE_GAS_COMP_CO Gas comp CO change

337
Chapter 10 - EFM meter run registers

Meter run Configuration


Enron Register Alarm & Events Description
Parameter
7171 EV_CHANGE_GAS_COMP_ Gas comp Oxygen change
OXYGEN
7172 EV_CHANGE_GAS_COMP_ Gas comp Argon change
ARGON
7173 EV_CHANGE_GAS_COMP_ Gas comp Helium change
HELIUM
7174 EV_CHANGE_GAS_COMP_I_ Gas comp I_Butane change
BUTANE
7175 EV_CHANGE_GAS_COMP_N_ Gas comp N_Butane change
BUTANE
7176 EV_CHANGE_GAS_COMP_I_ Gas comp I_Pentane change
PENTANE
7177 EV_CHANGE_GAS_COMP_N_ Gas comp N_Pentane change
PENTANE
7178 EV_CHANGE_GAS_COMP_ Gas comp Hexane change
HEXANE
7179 EV_CHANGE_GAS_COMP_ Gas comp Heptane change
HEPTANE
7180 EV_CHANGE_GAS_COMP_ Gas comp Octane change
OCTANE
7181 EV_CHANGE_GAS_COMP_ Gas comp Nonane change
NONANE
7182 EV_CHANGE_GAS_COMP_ Gas comp Decane change
DECANE
7190 EV_CHANGE_GAS_RELATIVE_ Gas relative density change
DENSITY
7191 EV_CHANGE_GAS_HEATING_ Gas heating value change
VALUE
7192 EV_CHANGE_ Ref temperature combustion
REFTEMPERATURE_ change
COMBUSTION
7193 EV_CHANGE_ Ref temperature calorimeter
REFTEMPERATURE_ change

338
Chapter 10 - EFM meter run registers

Meter run Configuration


Enron Register Alarm & Events Description
Parameter
CALORIMETER
7194 EV_CHANGE_REFPRESSURE_ Ref pressure calorimeter change
CALORIMETER
7201 EV_CHANGED_TEMP_LOW_ Temperature low low limit
LOW change
7202 EV_CHANGED_TEMP_LOW Temperature low limit change
7203 EV_CHANGED_TEMP_HIGH Temperature high limit change
7204 EV_CHANGED_TEMP_HI_HI Temperature high high limit
change
7205 EV_CHANGED_PRES_LOW_ Pressure low low limit change
LOW
7206 EV_CHANGED_PRES_LOW Pressure low limit change
7207 EV_CHANGED_PRES_HIGH Pressure high limit change
7208 EV_CHANGED_PRES_HI_HI Pressure high high limit change
7209 EV_CHANGED_DIFFPRES_ Diff pressure low low limit
LOW_LOW change
7210 EV_CHANGED_DIFFPRES_LOW Diff pressure low limit change
7211 EV_CHANGED_DIFFPRES_ Diff pressure high limit change
HIGH
7212 EV_CHANGED_DIFFPRES_HI_ Diff pressure high high limit
HI change
7213 EV_CHANGED_PULSE_LOW_ Pulse low low change
LOW
7214 EV_CHANGED_PULSE_LOW Pulse low change
7215 EV_CHANGED_PULSE_HIGH Pulse high change
7216 EV_CHANGED_PULSE_HI_HI Pulse high high change
7217 EV_CHANGED_GASMASS_ Gasmass low low change
LOW_LOW
7218 EV_CHANGED_GASMASS_LOW Gasmass low change
7219 EV_CHANGED_GASMASS_ Gasmass high change

339
Chapter 10 - EFM meter run registers

Meter run Configuration


Enron Register Alarm & Events Description
Parameter
HIGH
7220 EV_CHANGED_GASMASS_HI_ Gasmass high high change
HI
7201 EV_ALARM_TEMP_LOW_LOW Alarm for temp low low
7202 EV_ALARM_TEMP_LOW Alarm for temp low
7203 EV_ALARM_TEMP_HIGH Alarm for temp high
7204 EV_ALARM_TEMP_HI_HI Alarm for temp high high
7205 EV_ALARM_PRES_LOW_LOW Alarm for pressure low low
7206 EV_ALARM_PRES_LOW Alarm for pressure low
7207 EV_ALARM_PRES_HIGH Alarm for pressure high
7208 EV_ALARM_PRES_HI_HI Alarm for pressure high high
7209 EV_ALARM_DIFFPRES_LOW_ Alarm for diff pressure low low
LOW
7210 EV_ALARM_DIFFPRES_LOW Alarm for diff pressure low
7211 EV_ALARM_DIFFPRES_HIGH Alarm for diff pressure high
7212 EV_ALARM_DIFFPRES_HI_HI Alarm for diff pressure high high
7213 EV_ALARM_PULSE_LOW_LOW Alarm for pulse low low
7214 EV_ALARM_PULSE_LOW Alarm for pulse low
7215 EV_ALARM_PULSE_HIGH Alarm for pulse high
7216 EV_ALARM_PULSE_HI_HI Alarm for pulse high high
7217 EV_ALARM_GASMASS_LOW_ Alarm for gasmass low low
LOW
7218 EV_ALARM_GASMASS_LOW Alarm for gasmass low
7219 EV_ALARM_GASMASS_HIGH Alarm for gasmass high
7220 EV_ALARM_GASMASS_HI_HI Alarm for gasmass high high
7201 EV_ALARM_TEMP_LOW_LOW_ Reset alarm for temp low low
RESET
7202 EV_ALARM_TEMP_LOW_ Reset alarm for temp low
RESET

340
Chapter 10 - EFM meter run registers

Meter run Configuration


Enron Register Alarm & Events Description
Parameter
7203 EV_ALARM_TEMP_HIGH_ Reset alarm for temp high
RESET
7204 EV_ALARM_TEMP_HI_HI_ Reset alarm for temp high high
RESET
7205 EV_ALARM_PRES_LOW_LOW_ Reset alarm for pressure low low
RESET
7206 EV_ALARM_PRES_LOW_ Reset alarm for pressure low
RESET
7207 EV_ALARM_PRES_HIGH_ Reset alarm for pressure high
RESET
7208 EV_ALARM_PRES_HI_HI_ Reset alarm for pressure high
RESET high
7209 EV_ALARM_DIFFPRES_LOW_ Reset alarm for diff pressure low
LOW_RESET low
7210 EV_ALARM_DIFFPRES_LOW_ Reset alarm for diff pressure low
RESET
7211 EV_ALARM_DIFFPRES_HIGH_ Reset alarm for diff pressure high
RESET
7212 EV_ALARM_DIFFPRES_HI_HI_ Reset alarm for diff pressure high
RESET high
7213 EV_ALARM_PULSE_LOW_ Reset alarm for pulse low low
LOW_RESET
7214 EV_ALARM_PULSE_LOW_ Reset alarm for pulse low
RESET
7215 EV_ALARM_PULSE_HIGH_ Reset alarm for pulse high
RESET
7216 EV_ALARM_PULSE_HI_HI_ Reset alarm for pulse high high
RESET
7217 EV_ALARM_GASMASS_LOW_ Reset alarm for gasmass low low
LOW_RESET
7218 EV_ALARM_GASMASS_LOW_ Reset alarm for gasmass low
RESET

341
Chapter 10 - EFM meter run registers

Meter run Configuration


Enron Register Alarm & Events Description
Parameter
7219 EV_ALARM_GASMASS_HIGH_ Reset alarm for gasmass high
RESET
7220 EV_ALARM_GASMASS_HI_HI_ Reset alarm for gasmass high
RESET high
7227 EV_CHANGE_DEN_TEMP_ Desitometer Temperature Low
LOW_LOW Low alarm value change
7228 EV_CHANGE_DEN_TEMP_LOW Desitometer Temperature Low
alarm value change
7229 EV_CHANGE_DEN_TEMP_HIGH Desitometer Temperature High
alarm value change
7230 EV_CHANGE_DEN_TEMP_HI_HI Desitometer Temperature High
High alarm value change
7231 EV_CHANGE_DEN_PRES_ Desitometer Pressure Low Low
LOW_LOW alarm value change
7232 EV_CHANGE_DEN_PRES_LOW Desitometer Pressure Low alarm
value change
7233 EV_CHANGE_DEN_PRES_HIGH Desitometer Pressure High
alarm value change
7234 EV_CHANGE_DEN_PRES_HI_HI Desitometer pressure High High
alarm value change
7227 EV_CHANGE_DEN_TEMP_ Desitometer Temperature Low
LOW_LOW_RST Low alarm reset
7228 EV_CHANGE_DEN_TEMP_ Desitometer Temperature Low
LOW_RST alarm value reset
7229 EV_CHANGE_DEN_TEMP_ Desitometer Temperature High
HIGH_RST alarm value reset
7230 EV_CHANGE_DEN_TEMP_HI_ Desitometer Temperature High
HI_RST High alarm value reset
7231 EV_CHANGE_DEN_PRES_ Desitometer Pressure Low Low
LOW_LOW_RST alarm value reset
7232 EV_CHANGE_DEN_PRES_ Desitometer Pressure Low alarm
LOW_RST value reset
7233 EV_CHANGE_DEN_PRES_ Desitometer Pressure High

342
Chapter 10 - EFM meter run registers

Meter run Configuration


Enron Register Alarm & Events Description
Parameter
HIGH_RST alarm value reset
7234 EV_CHANGE_DEN_PRES_HI_ Desitometer pressure High High
HI_RST alarm value reset
7235 EV_ALARM_DEN_TEMP_ Densitometer Temperature
KEYPAD_SET Keypad alarm set
7236 EV_ALARM_DEN_PRES_ Densitometer Pressure Keypad
KEYPAD_SET alarm set
7237 EV_ALARM_TEMP_KEYPAD_ Temperature Keypad alarm set
SET
7238 EV_ALARM_PRES_KEYPAD_ Pressure Keypad alarm set
SET
7239 EV_ALARM_DESITY_KEYPAD_ Density Keypad alarm set
SET
7240 EV_ALARM_BASE_DESITY_ Base Density Keypad alarm set
KEYPAD_SET
7241 EV_ALARM_WATER_SED_ Water and Sediments Keypad
KEYPAD_SET alarm set
7242 EV_ALARM_THERMAL_EXP_ Thermal Expansion Factor
KEYPAD_SET Keypad alarm set
7249 EV_CHANGE_TEMP_KEYPAD_ Meter Temperature Keypad
VALUE Value change
7250 EV_CHANGE_PRES_KEYPAD_ Meter Pressure Keypad Value
VALUE change
7257 EV_CHANGE_DEN_TEMP_ Desitometer Temperature
KEYPAD_VALUE Keypad Value change
7258 EV_CHANGE_PRES_TEMP_ Desitometer pressure Keypad
KEYPAD_VALUE Value change
7260 EV_CHANGE_WATER_SED_ Water and Sediments Keypad
KEYPAD_VALUE Value change
7286 EV_ALARM_NO_FLOW_START No Flow start alarm set
7286 EV_ALARM_NO_FLOW_END No Flow end alarm set

343
Chapter 10 - EFM meter run registers

Meter run Configuration


Enron Register Alarm & Events Description
Parameter
7287 EV_ALARM_ERROR_START Error Start alarm
7287 EV_ALARM_ERROR_END Error End alarm
7288 EV_ALARM_MAINTENANCE_ Maintenance mode start alarm
MODE_START
7288 EV_ALARM_MAINTENANCE_ Maintenance mode end alarm
MODE_END
7289 EV_CHANGE_ANALOG_LOW_ Analog Low Low Alarm Value
LOW Change
7290 EV_CHANGE_ANALOG_LOW Analog Low Alarm Value Change
7291 EV_CHANGE_ANALOG_HIGH Analog High alarm value change
7292 EV_CHANGE_ANALOG_HIGH_ Analog High High alarm value
HIGH change
7289 EV_ALARM_ANALOG_LOW_ Alarm for Analog low low
LOW
7290 EV_ALARM_ANALOG_LOW Alarm for Analog low
7291 EV_ALARM_ANALOG_HIGH Alarm for Analog high
7292 EV_ALARM_ANALOG_HIGH_ Alarm for Analog high high
HIGH
7289 EV_ALARM_ANALOG_LOW_ Reset alarm for Analog low low
LOW_RST
7290 EV_ALARM_ANALOG_LOW_ Reset Alarm for Analog low
RST
7291 EV_ALARM_ANALOG_HIGH_ Reset Alarm for Analog high
RST
7292 EV_ALARM_ANALOG_HIGH_ Reset Alarm for Analog high high
HIGH_RST
7293 EV_CHANGE_PULSE_LOW_ Low Pulse Cut off value change
CUTOFF
7294 EV_CHANGE_MAX_PULSE_ Max Pulse increment value
INCREMENT change
7295 EV_ALARM_RETRO_K_ Retrospective K-factor value
FACTOR_CoRRECTED corrected alarm

344
Chapter 10 - EFM meter run registers

Meter run Configuration


Enron Register Alarm & Events Description
Parameter
7296 EV_CHANGE_DEN_TEMP_IO_ Densitometer Temperature IO
SELECTION Selection change
7297 EV_CHANGE_DEN_PRES_IO_ Densitometer Pressure IO
SELECTION Selection change
7298 EV_CHANGE_MEASURED_ Measured Density IO Selection
DENSITY_IO_SELECTION change
7299 EV_CHANGE_TEMP_IO_ Temperature IO Selection
SELECTION change
7300 EV_CHANGE_PRES_IO_ Pressure IO Selection change
SELECTION
7301 EV_CHANGE_IO_TYPE IO Type change
7302 EV_CHANGE_SDWD_WAIT_ ST103A Watchdog wait time
TIME value change
7303 EV_CHANGE_CORIOLISMTR_ Coriolis Meter as Densitometer
AS_DENSIMTR value change
7304 EV_CHANGE_BASE_DENSITY Base Density value change
7305 EV_CHANGE_DEN_KEYPAD_ Densitometer keypad value
VALUE change
7306 EV_CHANGE_DENSITOMETER_ Densitometer Available value
AVAILABLE change
7307 EV_CHANGE_DENSITOMETER_ Densitometer Count value
COUNT change
7308 EV_CHANGE_PREFERRED_ Preferred Densitometer change
DENSIMTR
7309 EV_CHANGE_IS_SEDIMENTS_ Sediments and Water available
WATER change
7310 EV_CHANGE_ROUNDING_ Rounding Method change
METHOD
7312 EV_CHANGE_CPL_CALC_TYPE CPL Calc type change
7313 EV_CHANGE_CONVERGENCE_ Convergence Criteria value
CRITERIA change

345
Chapter 10 - EFM meter run registers

Meter run Configuration


Enron Register Alarm & Events Description
Parameter
7314 EV_CHANGE_MAX_ Maximum iterations value
ITERATIONS change
7315 EV_CHANGE_ITERATIONS_ Iterations method change
METHOD
7316 EV_CHANGE_VAPOUR_PRES Vapour Pressure value change
7317 EV_CHANGE_VAPOUR_PRES_ Vapour Pressure Calc method
CALC_METHOD change
7318 EV_CHANGE_LOW_FLOW_ Low flow cutoff change
CUTOFF
7319 EV_CHANGE_TEMP_HIGH_ Temperature high limit change
LIMIT
7320 EV_CHANGE_TEMP_LOW_ Temperature low limit change
LIMIT
7321 EV_CHANGE_PRES_HIGH_ Pressure high limit change
LIMIT
7322 EV_CHANGE_PRES_LOW_ Pressure low limit change
LIMIT
7323 EV_CHANGE_DEN_TEMP_ Densitometer Temperature high
HIGH_LIMIT limit change
7324 EV_CHANGE_DEN_TEMP_ Densitometer Temperature low
LOW_LIMIT limit change
7325 EV_CHANGE_DEN_PRES_ Densitometer Pressure high limit
HIGH_LIMIT change
7326 EV_CHANGE_DEN_PRES_ Densitometer Pressure low limit
LOW_LIMIT change

346
Chapter 10 - EFM meter run registers

Alarm and event operator Bit definition


The table below describes the meaning of each bit of the Alarm/Event value
read from the controller over Enron Modbus.

Table 10-5: Alarm and event operator Bit definition

Bit Description
0 Fixed value changed bit
1 NoFlow=1 Flow=0
2 KeyPad SET=1 RST=0
3 Operator entry work value
4 Error Alarm SET=1 RST=0
5 Fixed or variable flag
6 Maintainance Alarm SET=1 RST=0
7 System command change bit
8 Maxpulse Increment/Retrospective K Factor Alarm SET=1 RST=2
9 Operator change identified bit , 1 for events
10 LoLo bit
11 Lo bit
12 Hi bit
13 HiHi bit
14 Rate of change limit
15 l 1 = Alarm Set
l 0 = Alarm Reset

See the following example:


If the Alarm/Event received is 36864 which is 0x9000 in hex and its bitmap
is shown below.

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0

347
Chapter 10 - EFM meter run registers

From the table we see that bit 15 (alarm) and bit 12 (HI) are set. Thus it is a
HI Alarm.
See the following table for the alarm or event type and its alarm state as
well as event state:

Alarm/Event Type Alarm State Event State


LoLo 33792 1536
LoLo-Reset 1024 N/A
Lo 34816 2560
Lo-Reset 2048 N/A
Hi 36864 4608
Hi-Reset 4096 N/A
HiHi 40960 8704
HiHi-Reset 8192 N/A
Flow 2 N/A
No-Flow 32770 N/A
KeyPad Set 32772 516
KeyPad Reset 4 N/A
Error Alarm Set 32784 N/A
Error Alarm Reset 16 N/A
Mainitainance ALarm Set 32832 N/A
Mainitainance Alarm Reset 64 N/A
Maxpulse Increment/ Retrospective K Factor Alarm Set 33024 N/A
Maxpulse Increment/ Retrospective K Factor Alarm Reset 256 N/A
For Gas: N/A 520

l Any Gas component Percentage change


l Base Temperature change
l Base Pressure change
l Flow Temp IO Selection change
l Flow Press IO Selection change
l Low Pulse cut off change

348
Chapter 10 - EFM meter run registers

Alarm/Event Type Alarm State Event State

l Low Flow cut off change


l Contract start day change
l Atmospheric Press change
l Meter factor change
For Liquid:

l Densitometer Available change


l Densitometer Count change
l Coriolis Meter as Densitometer change
l Density Temp IO Selection change
l Density Press IO Selection change
l Measured Density IO Selection change
l Preferred Densitometer change
l Base Density change
l Base temperature change
l Meter factor change
l Rounding method change
l Temperature IO Selection change
l Pressure IO Selection change
l Low Pulse Cutoff change
l Low Flow Cutoff change
l Max Pulse Increment change

349
Notices

NOTICES
Trademarks
Experion® is a registered trademark of Honeywell International, Inc.
ControlEdge™ is a trademark of Honeywell International, Inc.
OneWireless™ is a trademark of Honeywell International, Inc.

Other trademarks
Microsoft and SQL Server are either registered trademarks or trademarks
of Microsoft Corporation in the United States and/or other countries.
Trademarks that appear in this document are used only to the benefit of the
trademark owner, with no intention of trademark infringement.

Third-party licenses
This product may contain or be derived from materials, including software,
of third parties. The third party materials may be subject to licenses,
notices, restrictions and obligations imposed by the licensor. The licenses,
notices, restrictions and obligations, if any, may be found in the materials
accompanying the product, in the documents or files accompanying such
third party materials, in a file named third_party_licenses on the media
containing the product, or at http://www.honeywell.com/en-us/privacy-
statement.

Documentation feedback
You can find the most up-to-date documents in the Support section of the
Honeywell Process Solutions website at:
https://process.honeywell.com/us/en/support/product-documents-
downloads
If you have comments about Honeywell Process Solutions documentation,
send your feedback to: [email protected]
Use this email address to provide feedback, or to report errors and
omissions in the documentation. For immediate help with a technical
problem, contact HPS Technical Support through your local Customer
Contact Center, or by raising a support request on the Honeywell Process
Solutions Support website.

350
Notices

How to report a security vulnerability


For the purpose of submission, a security vulnerability is defined as a
software defect or weakness that can be exploited to reduce the operational
or security capabilities of the software.
Honeywell investigates all reports of security vulnerabilities affecting
Honeywell products and services.
To report a potential security vulnerability against any Honeywell product,
please follow the instructions at:
https://www.honeywell.com/en-us/product-security.

Support
For support, contact your local Honeywell Process Solutions Customer
Contact Center (CCC). To find your local CCC visit the website,
https://process.honeywell.com/us/en/contact-us.

Training classes
Honeywell holds technical training classes that are taught by process
control systems experts. For more information about these classes, contact
your Honeywell representative, or see http://www.automationcollege.com.

351
Notices

352

You might also like