Overview

The Hex Repeater templates are xml files that define what commands can be sent to the device and what items are available for each command. It determines what the device will provide to ACM and OPC Clients. 

Template Structure

The content of the template file consists of the following:

Template

An outer element named “Template” with three child elements:


Template Node Example

Commands

Each Hex Repeater command is defined in a “Command” element within the “Commands” element.

Command Node Example

Each “Command” element must have the following child elements:

<Instance>X</Instance>

Where ‘X’ is a number between 1 and 254.

                <Instance>X</Instance>
                Where ‘X’ is a number between 1 and 254.

Each Hex Repeater item is defined in an “Item” element within the “Items” element of the command it belongs to. Each “Item” element must have the following child elements:

ActionSequences

Each Hex Repeater action sequence is defined in an “ActionSequence” element within the “ActionSequences” element.

ActionSequence Node Example

Each “ActionSequence” element must have the following child elements:

There are two reserved words that are used for an action sequence that requires a full configuration of the field device. The text “PowerFail” and “LostAllData” are specifically detected by the ACM Hex Repeater driver to handle special case configuration actions.

An action sequence is triggered when all of the following criteria are met:

EFM


EFM Node Example

The EFM node is used to tell the protocol driver how to assign data for a CFX file (or PGAS file) from the items that are retrieved with a given command.

Template Modification

The “EFM” element is the only one that may need manual modification.

In this template example, command 5D is used to read a single item -- the name of the meter. The xml for that command definition is listed below:

<Command>
	<Name>EGMMeterInfo_Read</Name>
	<CommandType>Upload</CommandType>
	<CommandFormat>Upload</CommandFormat>
	<CommandNumber>5D</CommandNumber>
	<DataOffset>3</DataOffset>
	<ByteCount>12</ByteCount>
	<ResponseExpected>True</ResponseExpected>
	<VariableLengthResponse>False</VariableLengthResponse>
	<SendUserID>False</SendUserID>
	<SendByteCount>True</SendByteCount>
	<ResponseOptions>7</ResponseOptions>
	<WritePair>5E</WritePair>
	<Instances>
		<Instance>1</Instance>
		<Instance>2</Instance>
		<Instance>3</Instance>
		</Instances>
			<Items>
				<Item>
					<Name>Value1</Name>
					<ItemNumber>1</ItemNumber>
					<ItemType>EI</ItemType>
					<DataOffset>0</DataOffset>
					<DataLength>96</DataLength>
					<DataType>String</DataType>
					<DataStringType/>
					<ValidityOffset>0</ValidityOffset>
					<ValidityLength>0</ValidityLength>
					<Description>Meter Id</Description>
				</Item>
			</Items>
</Command>

The “Items” element has one “Item” element that defines the value for the single item in this command. In this example, the item’s number is ‘1’ (defined in the “ItemNumber” element) and its type is “EI” (defined in the “ItemType” element). The item’s description is ‘Meter Id’.

To direct that item to the correct location in a CFX file (or PGAS file), an entry is added to the “EFM” element for that command and item; including the item’s number and type:

<EFM>
	<EFM_Command>
		<CommandNumber>5D</CommandNumber>
			<EFM_Item>
				<Name>Meter Number</Name>
				<IsPolled>T</IsPolled>
				<Type>EI</Type>
				<Number>1</Number>
				<Value></Value>
				<EFM_Id>-1027</EFM_Id>
			</EFM_Item>
	</EFM_Command>
</EFM >

An “EFM_Command” element is added with one “EFM_Item” element (more than one “EFM_Item” element can exist within the “EFM_Command” element if more than one item is associated with the command and more than one item has to be identified for CFX (or PGAS)).

The “EFM_Command” element must specify the Hex Repeater command that retrieves the item’s value. Each item that must be identified in an “EFM_Item” element must have the following nodes:

One other format for the “EFM_Item” element is acceptable and used for the case where a value read from the device must be translated into a meaningful value for CFX (or PGAS). In this format, the “Value” element is expanded to include translation information:

<Value>
	<MappedValue>
		<Value>U</Value>
		<EFM_ID>-4037</EFM_ID>
	</MappedValue>
	<MappedValue>
		<Value>D</Value>
		<EFM_ID>-4036</EFM_ID>
	</MappedValue>
</Value>

When value translation is required, the “Value” element must have a “MappedValue” element for each possible value that is read from the device. The “MappedValue” element has these children:

Data Files

Upload Command Data

Whenever an ‘Upload’ command is sent, the driver retrieves the data and updates any OPC items that may be advised. The driver also stores the data in a file.

Those files are typically located here: C:\ProgramData\Autosol\Communication Manager\7\DataFiles\HexRepeater\UploadCommandData

The data is stored in files with names created from the ACM object id number, the command number, and the instance number. The command number is actually the ‘Download’ command number that goes along with the ‘Upload’ command number that was used to retrieve the data (Upload and Download commands come in pairs).

A typical file name will look like this: Device_00005_Command_4A_Instance_01.txt

The files are stored because the device is able to tell the driver that it has lost its configuration. When the device signals that is has lost its configuration, the driver reads those files and sends ‘Download’ commands with the data previously retrieved and stored. That data restores the device’s configuration.

You may occasionally see an error log message that says, “Failed to open upload storage data file “<filename>””. This doesn’t always indicate an error situation. The message may appear in the log for any of these reasons:

  1. ACM has just sent an upload command to read data and is now trying to store the information for later use. If ACM can’t create or open the file, it will log this error. This should only happen if ACM doesn’t have permission to create the file in its ‘data files’ path or can’t create the path where it needs to store the file.
  2. ACM has received an OPC write to an item that belongs to an upload/download command pair. To write the item, ACM must write the entire data content of the download command. The data content is what’s read from the device during an upload command and stored in the upload file. Any of these three conditions might occur when ACM receives an OPC write for one or more download items:
    1. ACM can successfully find and read the upload data file. It will write the full data content in the download command along with any OPC write item data, and the above error will not be logged.
    2. The upload file doesn’t exist. ACM may not have performed an upload for the specific command, or the file may have been manually deleted or moved. If the file doesn’t exist, the above error message will be logged. When this happens, ACM performs an upload command before issuing the write command. After the upload command has completed, ACM stores the upload data from the command in the data file. It then uses the upload data, plus any values it received during the OPC write, and sends a download command with the new data. If that completes successfully, ACM will store the upload data including the new written value(s) in the upload storage file.
    3. ACM performs an upload command and tries to store the data content from the command. If it cannot create the file for the data storage, it will log the above error message. If this happens, the probable cause is that ACM does not have permission to create the file or one of the directories in the file storage path.

Event Data

Change Event Data Item Mapping

The following table shows the mapping between the item text parsed (EFM_Item.Name) from the device to the EFM_Item.EFM_ID for publishing.

Some Item entries are duplicated indicating more than one mapping exists for an item due to the string name differing by template load.


Item NameEFM ID
Nitrogen - Mole %-2012
Methane - Mole %-2011
CO2 - Mole %-2003
Ethane - Mole %-2004
Propane - Mole %-2022
i-butane - Mole %-2009
n-butane - Mole %-2013
i-pentane - Mole %-2010
n-pentane - Mole %-2020
n-hexane - Mole %-2017
n-heptane - Mole %-2016
n-octane - Mole %-2019
n-nonane - Mole %-2018
n-decane - Mole %-2014
H2S - Mole %-2007
H2O - Mole %-2006
Helium - Mole %-2008
oxygen - Mole %-2021
CO - Mole %-2002
Hydrogen - Mole %-2005
Argon - Mole %-2001
Specific Gravity-1040
Temp when Line measu-1035
Temp when Orif measu-1032
Orifice Size-1030
Line Size-1033
Orifice Type-1031 (See Mapped Values Table Below)
Line Type-1034 (See Mapped Values Table Below)
Pipe Taps Location-1045 (See Mapped Values Table Below)
Atmos. Pres.-1001
Contract Pres. Base-1002
Contract Temp. Base-1003
Low DP Limit - No Fl-1014
ATMOS-PR-1001
ORI-SIZE-1030
LINE-SIZE-1033
FT-OF-LINE-MEAS-1035
FT-ORI-BORE-MEAS-1032
TAP-LOCATION(0-or-1)-1045 (See Mapped Values Table Below)
ORI-PLAT-TYP(0-1-or--1031 (See Mapped Values Table Below)
LINE-TYP(0-1-or-2)-1034 (See Mapped Values Table Below)
Low-DP-Cutoff-1015
FCALC-SELECT-7002 (Unknown Value)
DYNAMIC-VISCOSITY-1053
HV-Man-Val-6057
SG-Man-Val-1040
CO2--CARB-DIOXIDE-2003
N2-----NITROGEN-2012
C1-----METHANE-2011
C2-----ETHANE-2004
C3-----PROPANE-2022
H2O----WATER-2006
H2S----HYD-SULFIDE-2007
H2-----HYD-2005
CO----CARB-MONOXIDE-2002
O2-----OXYGEN-2021
IC4----I-BUTANE-2009
NC4--N-BUTANE-2013
IC5----I-PENTANE-2010
NC5--N-PENTANE-2020
C6-----HEXANE-2017
C7-----N-HEPTANE-2016
C8-----N-OCTANE-2019
C9-----N-NONANE-2018
C10---N-DECANE-2014
He-----HELIUM-2008
Ar-----ARGON-2001
CONTRACT-BASE-PR-1002
CONTRACT-BASE-FT-1003
CONTRACT-HOUR-1009
Dry ideal BTU0
Pres. Index0
Temp. Index0
Low DP Index0
High DP Index0
Volume Index0
Flow Index0
Calib. Switch Index0
Maint. Switch Index0
Turbine Meter Index0
Meter ID Number0
User Description0
Temp. Units0
Orifice / Turbine-1029 (See Mapped Values Table Below)
Pres. Conversion Fac0
DP Conversion Fac0
Flow Conversion Fac0
Line Sz Conversion F0
Orifice Sz Conver. F0
Turbine Meter Factor0
Low Turbine Meter Lm0
High Turbine Meter L0
Volume Corr. Factor0
Volume Conversion Fa0
FPV Analysis Method-1021 (See Mapped Values Table Below)
Temp. Manual / Instr0

Change Event Data Item Mapped Values

The following table shows the mapped values used when an item's value is mapped to an EFM ID based on a value passed.

Item NameValueEFM ID
Pipe Taps LocationU-4037
Pipe Taps LocationD-4036
Orifice TypeStainless-4023
Orifice TypeCarbon Steel-4021
Orifice TypeMonel-4022
Line TypeStainless-4023
Line TypeCarbon Steel-4021
Line TypeMonel-4022
TAP-LOCATION(0-or-1)U-4037
TAP-LOCATION(0-or-1)D-4036
ORI-PLAT-TYP(0-1-or-Stainless-4023
ORI-PLAT-TYP(0-1-or-Carbon Steel-4021
ORI-PLAT-TYP(0-1-or-Monel-4022
LINE-TYP(0-1-or-2)Stainless-4023
LINE-TYP(0-1-or-2)Carbon Steel-4021
LINE-TYP(0-1-or-2)Monel-4022
Orifice / TurbineO-4028
Orifice / TurbineT-4030
Orifice / TurbineV-4032
FPV Analysis MethodD-4017
FPV Analysis MethodG-4018