Enumeration Mapping Examples

This topic provides numerous useful examples of the various ways you can use reference methods in your device template files to perform conversions with constant values and/or reference data group element values. A sample device template file using each example is available upon request; it can be loaded to a DDS and used to test your reference methods. It is called ReferenceTester.dtf.

The referenced enumeration table can be scoped to a data group element, scoped to a device template file (using an enums table), or be one of several global tables.

See the following subsections for details:

For information about example data group elements and values used below, see Example Values.

Data Group Element Enumeration Lookup (A)

The following basic reference method example references the data group element raw5, the value of which (5) is mapped to the e5 enumeration in the RefOpt table. The result is "Text 5". "Text 5" is then set as the value for the parent data group element EnumA.

<EnumA desc="Enumeration Lookup Method A" readOnly="true" type="string" ref="raw5" mapVal="RefOpt">

<RefOpt>

<e0 value="Text 0"/>

<e1 value="Text 1"/>

<e2 value="Text 2"/>

<e3 value="Text 3"/>

<e4 value="Text 4"/>

<e5 value="Text 5"/>

<e6 value="Text 6"/>

<defVal value="Default Text"/>

</RefOpt>

</EnumA>

Useful attributes to know are ref, mapVal, and value. The lowercase letter e represents an enumerated value when followed by a number. A useful element to know is defVal.

Data Group Element Enumeration Lookup (B)

The following advanced reference method example references the data group element raw5, the value of which (5) is mapped to the e5 enumeration in the mapVal table. The first ref element references the operation opAssignId and the data group element raw5 to assign the current value of raw5 as the initial value for EnumB. The second ref element references the operation opMapVal to request a mapped string value from the mapVal table using the assigned initial value. The result is "Text 5". "Text 5" is then set as the value for the parent data group element EnumB.

<EnumB desc="Enumeration Lookup Method B" readOnly="true" type="string" isRef="1">

<ref prec="0" refOp="opAssignId" deid="raw5"/>

<ref prec="1" refOp="opMapVal">

<mapVal>

<e0 value="Text 0"/>

<e1 value="Text 1"/>

<e2 value="Text 2"/>

<e3 value="Text 3"/>

<e4 value="Text 4"/>

<e5 value="Text 5"/>

<e6 value="Text 6"/>

</mapVal>

</ref>

</EnumB>

Useful attributes to know are isRef, prec, refOp, deid, and value. Useful elements to know are ref and mapVal. The lowercase letter e represents an enumerated value when followed by a number.

Template Enumeration Lookup (A)

The following basic reference method example shows an EnumTA data group element that references the data group element raw5, the value of which (5) is mapped to the e5 enumeration in the enumRefOpt table. The result is "Text 5". "Text 5" is then set as the value for the parent data group element EnumTA.

<dataGroups>

<DataGroup>

<dgElements>

<EnumTA desc="Template Enumeration Lookup A" readOnly="true" type="string" ref="raw5" mapVal="enumRefOpt"/>

</dgElements>

<DataGroup>

</dataGroups>

...

<enums>

<enumRefOpt>

<e0 value="Text 0"/>

<e1 value="Text 1"/>

<e2 value="Text 2"/>

<e3 value="Text 3"/>

<e4 value="Text 4"/>

<e5 value="Text 5"/>

<e6 value="Text 6"/>

<defVal value="Default Text"/>

</enumRefOpt>

</enums>

Useful attributes to know are ref, mapVal, and value. A useful element to know is enums. The lowercase letter e represents an enumerated value when followed by a number. A useful element to know is defVal.

Template Enumeration Lookup (B)

The following advanced reference method example shows an EnumTB data group element that references the data group element raw5, the value of which (5) is mapped to the e5 enumeration in the enumRefOpt table. The result is "Text 5". "Text 5" is then set as the value for the parent data group element EnumTB.

<dataGroups>

<DataGroup>

<dgElements>

<EnumTB desc="Template Enumeration Lookup B" type="string" isRef="1">

<ref prec="0" refOp="opAssignId" deid="raw5"/>

<ref prec="1" refOp="opMapVal" mapVal="enumRefOpt"/>

</EnumTB>

</dgElements>

<DataGroup>

</dataGroups>

...

<enums>

<enumRefOpt>

<e0 value="Text 0"/>

<e1 value="Text 1"/>

<e2 value="Text 2"/>

<e3 value="Text 3"/>

<e4 value="Text 4"/>

<e5 value="Text 5"/>

<e6 value="Text 6"/>

<defVal value="Default Text"/>

</enumRefOpt>

</enums>

Useful attributes to know are ref, mapVal, and value. A useful element to know is enums. The lowercase letter e represents an enumerated value when followed by a number. A useful element to know is defVal.

Template Enumeration-Enumeration Lookup

The following advanced reference method example references the data group elements raw5 and raw2. The value of raw2 (2) indicates which enumeration from EMapEnums to use (EEnergy). The value of raw5 (5) is mapped to the e5 enumeration in the EEnergy table ("BTU"). The resultant value of "BTU" is set as the value for the data group element Enum2EnumG.

<Enum2EnumG desc="Global Enum-Enum Lookup" type="string" isRef="1">

<ref prec="0" refOp="opAssignId" deid="raw5"/>

<ref prec="1" refOp="opMapToMapVal" deid="raw2" mapVal="EMapEnums"/>

</Enum2EnumG>

. . .

<enums>

<EMapEnums>

<e0 value="EDistance"/>

<e1 value="EEnergy"/>

<e2 value="EPressure"/>

</EMapEnums>

<EDistance>

<e0 value="in"/>

<e1 value="ft"/>

<e2 value="yd"/>

<e3 value="mi"/>

<e4 value="mm"/>

<e5 value="cm"/>

<e6 value="km"/>

</EDistance>

<EEnergy>

<e0 value="J"/>

<e1 value="KJ"/>

<e2 value="MJ"/>

<e3 value="GJ"/>

<e4 value="cal"/>

<e5 value="BTU"/>

</EEnergy>

<EPressure>

<e0 value="inH2O"/>

<e1 value="kPa"/>

<e2 value="psi"/>

<e3 value="mmH2O"/>

<e4 value="bar"/>

<e5 value="atm"/>

</EPressure>

</enums>

Useful attributes to know are ref, mapVal, and value. A useful element to know is enums. The lowercase letter e represents an enumerated value when followed by a number.

Global Enumeration Lookup

Global enumerations are hard-coded global tables that are accessed from within a device template file by using mapVal to define one of the keywords below. Values are hard-coded strings that are displayed in CygNet SCADA when the applicable numeric value is provided by a field device.

The GlobalEnum element references the data group element raw1 to request a mapped string value from the global RefGlobalEAISet table. The result is "1-Alarm Set" because the value from raw1 is used to reference the string that correlates to value 1 hard coded for RefGlobalEAISet.

<GlobalEnum desc="Global Enumeration Lookup" type="string" ref="raw1" mapVal="RefGlobalEAISet"/>

Useful attributes to know are ref and mapVal.

Global Enumeration Keyword Values

The following table lists and describes global enumeration keyword values. Global enumerations are hard-coded global tables that are accessed from within a device template file by using mapVal to define one of the keywords below. Values are hard-coded strings that are displayed in CygNet SCADA when the applicable numeric value is provided by a field device.

Keyword Value

RefGlobalEAISet

  • 0-No Alarm
  • 1-Alarm Set

RefGlobalEDisEn

  • 0-Disabled
  • 1-Enabled

RefGlobalEEnDis

  • 0-Enabled
  • 1-Disabled

RefGlobalEFail

  • 0-Good
  • 1-Fail

RefGlobalEGoBad

  • 0-Good
  • 1-Bad

RefGlobalENoYes

  • 0-No
  • 1-Yes

RefGlobalEOnOff

  • 0-On
  • 1-Off

RefGlobalEOpen

  • 0-Open
  • 1-Closed

RefGlobalEParity

  • 0-None
  • 1-Even
  • 2-Odd

RefGlobalERange

  • 0-In Range
  • 1-Out of Range

RefGlobalERotat

  • 0-Clockwise
  • 1-Counter clockwise

RefGlobalEValInv

  • 0-Valid
  • 1-Invalid

RefGlobalEYesNo

  • 0-Yes
  • 1-No

Back to top