Devices > Remote Devices > Device Template Files > Elements and Attributes > ref

ref

The ref element defines the element contents of a data group element that uses an advanced reference method. ref must be part of an advanced reference method that uses the appropriate reference operation attributes. Do not confuse the ref element with the ref attribute.

This element is:

To learn about how this element relates to other elements in a CygNet device template file, see Template File Hierarchy.

See also Reference Methods.

Example

Attributes

The following table lists and describes attributes generally applicable to this element. However, not all of the attributes listed here are applicable to all EIEs. Additionally, some attributes are required for use in every device template file of a certain EIE, but others may be used on a case-by-case or device-by-device basis, depending on your specific needs. All attributes in templates are case sensitive; but the case sensitivity of attribute values is based on context.

Note: Occasionally, device template files for different EIEs use attributes of the same name that do different things. Efforts are made in this document to highlight cases where an attribute by one name does different things in different EIEs.

Browse by letter:     B     D     F     I     M     P     R     S     V

Attribute Description

baseTime

baseTime specifies a starting date as the basis of a time conversion. It can be used in conjunction with isUTC.

Value:
  • Default value is January 1, 1970.

See also opTimeSeconds and Time Formatting Examples – Seconds Date/Time.

bitShift

bitShift works with bMsk for legacy and extended (new) references, opSelect reference operation, and EFM mappings to indicate whether or not to shift off the masked low bits.

Value:
  • false: Specifies that you do not want to shift bits.
  • signed: Specifies that you want to preserve the sign bit during the shift.
  • unsigned: Specifies that you want to shift the entire value.
  • Default is unsigned.

See also opBitMask and Bit Mask Examples.

bPosDest

bPosDest specifies the destination position of a bit. Bit position enumeration starts with 0, the least significant bit position. bPosDest is used in reference methods.

Value:
  • Integer value only.
  • The integer chosen can be affected by the reference method's data type.

See also opBitStuff and Bit Position Examples – Bit Stuff from Referenced Data Group Element.

bXorMask

bXorMask (bit XOR mask) performs a bitwise XOR operation on a referenced value when one or more bits are to be affected. bXorMask is used in reference methods.

Value:
  • Requires integer and hex only. If using hex, the hex number must start with 0x (i.e., 0xF, 0x0F, 0x00F, or 0x000F).
  • Must be greater than or equal to 0 (0x0 hex).
  • Must fit in a 32-bit field.

deid

deid specifies the data group element ID (DEID) of a referenced data group element from which to use a value.

eFMS and eGMR elements usually require deid. However, in special cases a register number (regNum) can be used instead of a deid value to associate a data item with a data source.

Value:
  • Any DEID of a valid source DataGroupElement element within the same data group as deid.
  • The deid value cannot be recursive; that is, it cannot reference the DataGroupElement element of which it is a part.
  • The source DataGroupElement element cannot itself be a reference DataGroupElement element.

See also selection and eFMS, eGMR.

deidDate

deidDate references a data group element that provides a source date value. deidDate is used in various time conversions.

Value:
  • Valid and applicable DEID.
  • Source format varies depending on the method with which it is used.

See also cvtRef Conversion Method and Reference Methods – Time Formatting Examples.

deidDay

deidDay references a data group element that provides a source day value. deidDay is used in various time conversions.

Value:
  • Must be a number 1-31.

See cvtRef Conversion Method and Reference Methods – Time Formatting Examples.

deidHour

deidHour references a data group element that provides a source hour value. deidHour is used in various time conversions.

Value:
  • Must be a number 0-23.

See also cvtRef Conversion Method and Reference Methods – Time Formatting Examples.

deidMinute

deidMinute references a data group element that provides a source minute value. deidMinute is used in various time conversions.

Value:
  • Must be a number 0-59.

See also cvtRef Conversion Method and Reference Methods – Time Formatting Examples.

deidMonth

deidMonth references a data group element that provides a source month value. deidMonth is used in various time conversions.

Value:
  • Must be a number 1-12.

See also cvtRef Conversion Method and Reference Methods – Time Formatting Examples.

deidSecond

deidSecond references a data group element that provides a source month value. deidSecond is used in various time conversions.

Value:
  • Must be a number 0-59.

See also cvtRef Conversion Method and Reference Methods – Time Formatting Examples.

deidTime

deidTime references a data group element that provides a source time value. deidTime is used in various time conversions.

Value:
  • Valid and applicable DEID.
  • Source format varies depending on the method with which it is used.

See also cvtRef Conversion Method and Reference Methods – Time Formatting Examples.

deidYear

deidYear references a data group element that provides a source year value. deidYear is used in various time conversions.

Value:
  • Must be a four-digit number.

See also cvtRef Conversion Method and Reference Methods – Time Formatting Examples.

destUnits

destUnits specifies the unit type output. Must be used in conjunction with srcUnits. destUnits is used in reference methods.

Value:
  • Any valid CygNet unit type.

See also opUnitConversion, Unit Conversion Examples – Unit Conversion (B), and PNT Engineering Units.

format

format converts source data group element data into a human-readable format in a reference method conversion in a destination data group element.

Value:
  • Any CygNet-defined and applicable formatting keyword may be used. See below.
  • CygDateTime: Days since midnight 12/30/1899
  • Date: dd-MMM-yy
  • DateTime: dd-MMM-yy hh:mm:ss
  • Duration: d hh:mm:ss
  • FeetInchesFromInches: Converts a number of inches into feet (') and inches (").
  • General Date: MM/dd/yyyy hh:mm:ss AM/PM
  • Long Date: Day of Week, Month dd, yyyy
  • Long Time: hh:mm:ss AM/PM
  • Medium Date: dd-MMM-yy
  • Medium Time: hh:mm AM/PM
  • MMM dd yyyy hh:mm:ss: MMM dd yyyy hh:mm:ss
  • Short Date: MM/dd/yyyy
  • Short Time: hh:mm
  • Time: hh:mm:ss

See also Reference Methods.

formatDate

formatDate specifies the format by which to interpret source data before it is converted to the Microsoft standard date-time format. For example, specifying MMddyy ensures that a source date format of two-digit month, two-digit day, and two-digit year is properly converted to the Microsoft standard date-time format.

Value:
  • ddMMyy
  • ddMMyyyy
  • ddyyMM
  • ddyyyyMM
  • MMddyy
  • MMddyyyy
  • MMyydd
  • MMyyyydd
  • yyddMM
  • yyMMdd
  • yyyyddMM
  • yyyyMMdd

See opTimeEnron and Time Formatting Examples - Enron Date/Time.

formatTime

formatTime specifies the format by which to interpret source data before it is converted to the Microsoft standard date-time format. For example, specifying HHmmss ensures that a source time format of two-digit hour, two-digit minute, and two-digit second is properly converted to the Microsoft standard date-time format.

Value:
  • HHmm
  • HHmmss

See opTimeEnron and Time Formatting Examples - Enron Date/Time.

isUTC

isUTC specifies that time in a time conversion is UTC. It can be used in conjunction with baseTime.

Value:
  • Default value is January 1, 1970.

See opTimeSeconds and Time Formatting Examples – Seconds Date/Time.

mapVal

mapVal maps an enumeration table keyword to an enumeration table of the same name.

The referenced 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. First the data group element in which the mapVal attribute is defined is searched for a table local to it. If no such table is found, a wider search occurs in which the device template file and the global tables are searched for a corresponding enumeration table of the same name.

mapVal can be used in both a basic reference method and an advanced reference method in similar ways. In a basic reference method, mapVal must be defined in-line along with a ref attribute. In an advanced reference method, if mapVal is used, it must be defined in-line along with a refOp attribute set to opMapVal.

If the mapVal attribute references an enumeration table in a device template file, a drop-down menu containing the defined enum values will display when editing the specified data group element value on the data group's View Data dialog box. The enumeration values must be unique for the values to display in a drop-down menu.

(In an eFMS or eGMR element, mapVal is used in combination with the deid attribute, which maps the eFMS or eGMR element to a value.)

Value:
  • Must match the name of the applicable enumeration table.
  • Must be unique within the applicable scope so that no name conflicts occur.

See also enums and Enumeration Mapping Examples.

prec

prec specifies the order of operator precedence for each ref element used in an advanced reference method.

Value:
  • Any integer as long as it establishes an order of operation relative to other applicable ref elements.
  • The numbers used to signify precedence do not need to start at 0 and they do not need to be consecutive, but lower numbers always precede higher numbers in the order of operation.

refOp

refOp specifies the name of a reference operation; reference operations are required components of advanced reference methods. One reference operation must be used in each ref element.

Value:

scaleFactor

scaleFactor defines a constant multiplier. Multiplication is powered by some other mechanism, like the reference operation opScaleFactor or the cvtF conversion method Scale.

scaleFactor cannot be used in the same element as scaleFactorId. It also cannot be used in the same element as any two-point scaling attribute, like scaleLoRaw.

Value:
  • Must be an integer or floating point number.

scaleFactorId

scaleFactorId multiplies a value by a referenced value. The original, non-scaled input value must be preserved in a different data group element in the same data group. scaleFactorId is used in linear scaling in reference methods.

scaleFactorId cannot be used in the same element as scaleFactor. It also cannot be used in the same element as any two-point scaling attribute, like scaleLoRaw.

Value:
  • Requires a valid referenced data group element ID (DEID) that is in the same data group.
  • The referenced DEID cannot be recursive (i.e., self-referential).

scaleHiEng

scaleHiEng defines a high engineering value in a two-point engineering scale. The original, non-scaled input value must be preserved in a different data group element in the same data group. scaleHiEng is used in linear scaling in reference methods.

scaleHiEng cannot be used in the same element as scaleHiEngId. It also cannot be used in the same element as any non-two-point scaling attribute, like scaleFactor or scaleOffset.

Value:
  • Requires a numeral (positive, negative, or float) only.

scaleHiEngId

scaleHiEngId defines a high engineering value in a two-point engineering scale. The original, non-scaled input value must be preserved in a different data group element in the same data group. scaleHiEngId is used in linear scaling in reference methods.

scaleHiEngId cannot be used in the same element as scaleHiEng. It also cannot be used in the same element as any non-two-point scaling attribute, like scaleFactor or scaleOffset.

Value:
  • Requires a valid referenced data group element ID (DEID) that is in the same data group.
  • The referenced DEID cannot be recursive (i.e., self-referential).

scaleHiRaw

scaleHiRaw defines a high raw value in a two-point raw scale. The original, non-scaled input value must be preserved in a different data group element in the same data group. scaleHiRaw is used in linear scaling in reference methods.

scaleHiRaw cannot be used in the same element as scaleHiRawId. It also cannot be used in the same element as any non-two-point scaling attribute, like scaleFactor or scaleOffset.

Value:
  • Requires a numeral (positive, negative, or float) only.

scaleHiRawId

scaleHiRawId defines a high raw value in a two-point raw scale. The original, non-scaled input value must be preserved in a different data group element in the same data group. scaleHiRawId is used in linear scaling in reference methods.

scaleHiRawId cannot be used in the same element as scaleHiRaw. It also cannot be used in the same element as any non-two-point scaling attribute, like scaleFactor or scaleOffset.

Value:
  • Requires a valid referenced data group element ID (DEID) that is in the same data group.
  • The referenced DEID cannot be recursive (i.e., self-referential).

scaleLoEng

scaleLoEng defines a low engineering value in a two-point engineering scale. The original, non-scaled input value must be preserved in a different data group element in the same data group. scaleLoEng is used in linear scaling in reference methods.

scaleLoEng cannot be used in the same element as scaleLoEngId. It also cannot be used in the same element as any non-two-point scaling attribute, like scaleFactor or scaleOffset.

Value:
  • Requires a numeral (positive, negative, or float) only.

scaleLoEngId

scaleLoEngId defines a low engineering value in a two-point engineering scale. The original, non-scaled input value must be preserved in a different data group element in the same data group. scaleLoEngId is used in linear scaling in reference methods.

scaleLoEngId cannot be used in the same element as scaleLoEng. It also cannot be used in the same element as any non-two-point scaling attribute, like scaleFactor or scaleOffset.

Value:
  • Requires a valid referenced data group element ID (DEID) that is in the same data group.
  • The referenced DEID cannot be recursive (i.e., self-referential).

scaleLoRaw

scaleLoRaw defines a low raw value in a two-point raw scale. The original, non-scaled input value must be preserved in a different data group element in the same data group. scaleLoRaw is used in linear scaling in reference methods.

scaleLoRaw cannot be used in the same element as scaleLoRawId. It also cannot be used in the same element as any non-two-point scaling attribute, like scaleFactor or scaleOffset.

Value:
  • Requires a numeral (positive, negative, or float) only.

scaleLoRawId

scaleLoRawId defines a low raw value in a two-point raw scale. The original, non-scaled input value must be preserved in a different data group element in the same data group. scaleLoRawId is used in linear scaling in reference methods.

scaleLoRawId cannot be used in the same element as scaleLoRaw. It also cannot be used in the same element as any non-two-point scaling attribute, like scaleFactor or scaleOffset.

Value:
  • Requires a valid referenced data group element ID (DEID) that is in the same data group.
  • The referenced DEID cannot be recursive (i.e., self-referential).

scaleOffset

scaleOffset adds an input value to a constant value. The original, non-scaled input value must be preserved in a different data group element, typically in the same data group.

scaleOffset cannot be used in the same element as scaleOffsetId. It also cannot be used in the same element as any two-point scaling attribute, like scaleLoRaw.

Value:
  • Requires a numeral (positive, negative, or float) only.

scaleOffsetId

scaleOffsetId adds an input value to a referenced value. The original, non-scaled input value must be preserved in a different data group element in the same data group. scaleOffsetId is used in linear scaling in reference methods.

scaleOffsetId cannot be used in the same element as scaleOffset. It also cannot be used in the same element as any two-point scaling attribute, like scaleLoRaw.

Value:
  • Requires a valid referenced data group element ID (DEID) that is in the same data group.
  • The referenced DEID cannot be recursive (i.e., self-referential).

srcUnits

srcUnits specifies the unit type input. Must be used in conjunction with destUnits. srcUnits is used in reference methods.

Value:
  • Any valid CygNet unit type.

See also opUnitConversion, Unit Conversion Examples – Unit Conversion (B), and PNT Engineering Units.

value

value specifies a constant value. The value used must be relevant to the context in which value is used.

Value:
  • Depends on context. Often numeric, but may be string in the appropriate circumstance.
Back to top

Let us know how we can improve this topic.

CygNet at weatherford.com

© 2020 Weatherford. All rights reserved.