Editing a Template
This topic provides information about editing a Realflo template. It includes information that is general to editing a device template file, but it uses Realflo-specific situations that you might encounter.
For example, you might need information that helps you support certain versions of Realflo software in the Modbus Realflo EIE.
See the following subsections for more information:
- Supporting Software Versions
- Specifying Units for Static Pressure
- To Specify Units for Static Pressure
For more information about working with device template files, see Device Template Files.
Supporting Software Versions
This subsection provides an example of edits you might need to make to support a version of Realflo software that is older than the version the sample template is written for. (The current sample template assumes that you are on v6.8 or later Realflo software.) You can use the subsection as a tutorial for making other similar edits.
Specifying Units for Static Pressure
In this example, the problem involves specifying units for static pressure. Such units are required for CygNet SCADA use as well as use with CygNet Measurement.
Assume that you have a fresh sample template and must make an edit to support v6.79 or earlier Realflo software. V6.79 or earlier Realflo software uses a single register to set the atmospheric pressure value, if it applies, and the unit type of static pressure. Register 7145 contains this value.
If the data group element R49553 ("Atmospheric Pressure") is set to a non-zero value, the register 7145 value represents measured local atmospheric pressure. Such a configuration setting implies that your static pressure is gauge. (Atmospheric pressure plus gauge pressure make up absolute pressure.) You must edit your template to ensure that your static pressure units are gauge (that is, psig).
If the data group element R49553 ("Atmospheric Pressure") is set to a zero (0) value, the register 7145 value is no longer used to represent measured local atmospheric pressure. Instead, such a configuration setting implies that your static pressure is absolute. (Atmospheric pressure plus gauge pressure make up absolute pressure.) You must edit your template to ensure that your static pressure units are absolute (that is, psi).
The following example and procedure provide details to help you correctly edit your template. They include information about remapping data group elements so that the correct register and units are used.
Example
|
<!--The following sample data group defines units for all meters. MRunUnits defines the register (7145) that static pressure depends on in order to establish its units. And it provides logic for setting the unit type to be used for static pressure when unit sets are used and more than one unit type is possible. Note that this data group depends on the dgCat attribute value cfgUnitSets as well as unitSetDefinitions.--> <MRunUnits niceName="Meter Run Units" canSend="true" uccSend="true" baseOrd="1" maxCnt="10" dgCat="cfgUnitSets"> <dgElements byteOrder="bigEndian" secLev="4" type="r4"> <InUnits desc="Input Units" regDef="1:0" unitSetName="input" hidden="true"/> <InUnitsS desc="Input Units Type" type="string" ref="InUnits" mapVal="EUnitSet"/> <OutUnits desc="Output Units" regDef="2:0" unitSetName="output" hidden="true"/> <OutUnitsS desc="Output Units Type" type="string" ref="OutUnits" mapVal="EUnitSet"/> <!--The following element specifies that register 7145 represents static pressure units.--> <SPTypRaw desc="SP Sensor Type (raw)" regDef="3:0" hidden="true"/> <!--The following element uses the value in register 7145 to determine which pressure unit to use for static pressure data group elements that include the unitsCat attribute value staticPresIn.--> <SPTyp desc="SP Sensor Type #" isRef="1" unitsCat="staticPresIn" unitSetName="input" hidden="true" type="string"> <!--In effect, the following logic provides an if-else statement to determine what units to use for static pressure depending on the value of the SPTypRaw data group element.--> <ref prec="0" refOp="opSelect"> <selection> <s0 assign="0" operandLeftId="SPTypRaw" op="EQ" operandRight="0"/> <s1 assign="1" operandLeftId="SPTypRaw" op="GT" operandRight="0"/> </selection> </ref> </SPTyp> <SPTypS desc="SP Sensor Type" type="string" isRef="1"> <ref prec="0" refOp="opSelect"> <selection> <s0 assign="0" operandLeftId="SPTypRaw" op="EQ" operandRight="0"/> <s1 assign="1" operandLeftId="SPTypRaw" op="GT" operandRight="0"/> </selection> </ref> <ref prec="1" refOp="opMapVal"> <mapVal> <e0 value="1-Absolute"/> <e1 value="2-Gauge"/> </mapVal> </ref> </SPTypS> </dgElements> <modbusReadBlocks> <block1 funcCode="3" regCnt="1" regNum="7100" ordIncrement="250" regByteLen="4"/> <block2 funcCode="3" regCnt="1" regNum="7146" ordIncrement="250" regByteLen="4"/> <block3 funcCode="3" regCnt="1" regNum="7145" ordIncrement="250" regByteLen="4"/> </modbusReadBlocks> <modbusWriteBlocks> <block1 funcCode="16" regCnt="1" regNum="7100" ordIncrement="250" regByteLen="4"/> <block2 funcCode="16" regCnt="1" regNum="7146" ordIncrement="250" regByteLen="4"/> <block3 funcCode="16" regCnt="1" regNum="7145" ordIncrement="250" regByteLen="4"/> </modbusWriteBlocks> </MRunUnits> |
To Specify Units for Static Pressure
- Open a sample Realflo template in a text editor of your choosing.
- Delete the AtmPresN data group element from the FlwRunCfg data group. Doing so removes the possibility of confusing the correct atmospheric pressure value with the incorrect one.
- Confirm the R49553 data group element is in the FlwRunCfg data group. This data group element is the source of atmospheric pressure for v6.79 or earlier Realflo software.
- Edit the MRunUnits data group to ensure that static pressure is associated with the correct unit type. MRunUnits defines the register (7145) that static pressure depends on in order to establish its units. And it provides logic for setting the unit type to be used for static pressure when unit sets are used and more than one unit type is possible. Note that this data group depends on the dgCat attribute value cfgUnitSets as well as unitSetDefinitions.
- Go to the MRunUnits data group and edit block3 in the read and write blocks so that the regNum attribute is set to register 7145, not 7342. (Additional fine tuning of the read and write blocks might be desired.) This ensures that the register that data group element R49553 is mapped to is the same for SPTypRaw, since both rely on the same value.
- Add logic to the SPTyp data group element to define what unit type to use if the value of register 7145 is zero (0) or non-zero. The logic determines which pressure unit type is used for all data group elements that include the unitsCat attribute value staticPresIn. See the sample above for the new XML.
- Optional: If you are using static pressure in an associated CygNet Measurement system, edit the applicable FMS configuration item mapping.
- Locate the eFMS_CFG_ATMOSPHERIC_PRESSURE configuration item in the fmsMaps element.
- Change the configuration item's deid attribute value from AtmPresN to R49553. This ensures that the FMS configuration item is mapped to the correct atmospheric pressure value.
- Save your changes, load the edited template to a Device Definition Service (DDS), and confirm any data group element that includes the unitsCat attribute value staticPresIn displays the unit type (psi or psig) you expect.


