Reference Operations

Reference operations are required by advanced reference methods in order for advanced reference methods to compute data. The operations listed and described in the topics below enable you to interface with CygNet proprietary code to perform computations commonly required by device template file developers and administrators. Without an operation, a method would only define the components of a computation without performing the desired computation.

On their own, reference operations are useless; they must be included in a reference method in the correct way. Reference operations can be used singly or in conjunction with other reference operations, depending on the logic of the computation you want to perform. Operands derive from user-defined constants or referenced data group elements (DataGroupElement) from within the same device template file as the referencing method.

Define a reference operation by using the refOp attribute in conjunction with the relevant operation name. Other supporting attributes and values might be required, depending on the operation used and the logic of your computation.

Example

<StrkPeriod desc="Stroke Period (secs/stroke)" type="r4" isRef="1">

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

<ref prec="1" refOp="opDiv" value="60"/>

<ref prec="2" refOp="opPow" value="-1"/>

</StrkPeriod>

For more information, see Reference Methods.

Available Reference Operations

The following table lists and describes all available CygNet reference operations. Use names of operations exactly as listed when including them within a device template file; spelling and case matter.

Browse by letter:     [opA]     [opB]     [opD]     [opE]     [opF]     [opM]     [opP]     [opS]     [opT]     [opU]    

Operation Description

opAbs

Use this operation to assign the absolute value of a referenced value to a data group element.

opAbs is only valid when used with a preceding ref element that specifies the initial value.

opAdd

Use this operation to add a specified value to a specified constant value. This operation was formerly known as opAddVal.

opAdd is only valid when used with the attribute value. The value of value must be an integer, floating-point, or hex.

For an example, see Arithmetic Examples – Addition (A).

opAddId

Use this operation to add a specified value to a specified reference data group element value.

opAddId is only valid when used with the attribute deid. The value of deid must be valid and it cannot be recursive; that is, it cannot reference itself.

For an example, see Arithmetic – Addition (B).

opAssign

Use this operation to set a constant value as the data group's initial value.

opAssign is only valid when used with the attribute value. The value of value must be an integer, floating-point, or hex.

For an example, see Assignment Examples – Assign a Constant.

opAssignId

Use this operation to set a reference data group element value as the data group's initial value.

opAssignId is only valid when used with the attribute deid. The value of deid must be valid and it cannot be recursive; that is, it cannot reference itself.

For an example, see Assignment Examples – Assign a Data Group Element Value.

opAverage

Use this operation to assign the average value from a set of data values.

opAverage is only valid when used with the child elements dataSet and item, which together form a simple structure of items from which an average value can be assigned.

opAverage can be used to assign an average value for its parent data group element using values that are outside of the data set, but at least one item in the data set must be present for opAverage to operate.

For an example, see Arithmetic Examples – Average Value (A and B).

opBitMask

Use this operation to convert a value to a bit mask by using a constant value.

opBitMask is only valid when used with the attribute value. The value of value must be an integer or hex.

For an example, see Bit Mask Examples – Bit Mask (B).

opBitPos

Use this operation to return the binary value in a bit position that is specified by using a constant value.

opBitPos is only valid when used with the attribute value. The value of value must be an integer or hex.

For an example, see Bit Position Examples – Bit Position (B).

opBitStuff

Use this operation to "stuff" a bit (0 or 1) into a specified position of another binary value. The value returned is decimal.

opBitStuff is only valid when used with the attribute deid. The value of deid must be valid and it cannot be recursive; that is, it cannot reference itself.

For an example, see Bit Position Examples – Bit Stuff from Referenced Data Group Element.

opBitXorMask

Use this operation to apply a constant XOR bit mask to a specified value.

opBitXorMask is only valid when used with the attribute value. The value of value must be an integer or hex.

For an example, see Bit Mask Examples – XOR Bit Mask (C).

opDiv

Use this operation to divide a specified value by a specified constant value. This operation was formerly known as opDivVal.

opDiv is only valid when used with the attribute value. The value of value must be an integer, floating-point, or hex.

Because this operation introduces the illogical possibility of division by zero (0), special attributes are available to account for the possibility:

  • divZeroAction: This attribute can use returnSentinel, returnFalse, or blank as its value. returnSentinel requires you to also use the attribute divZeroSentinel, where you specify a constant. returnFalse returns N/A and no computation takes place. Blank returns zero ("0") and no computation takes place.
  • divZeroSentinel: This attribute is only used if returnSentinel is used as the value for divZeroAction. Its value is a user-defined numeric constant.

Division by zero could occur if you are using division operations, a multiplicative inverse, or two-point scaling.

For an example, see Arithmetic Examples – Division (A).

opDivId

Use this operation to divide a specified value by a specified reference data group element value.

opDivId is only valid when used with the attribute deid. The value of deid must be valid and it cannot be recursive; that is, it cannot reference itself.

Because this operation introduces the illogical possibility of division by zero (0), special attributes are available to account for the possibility:

  • divZeroAction: This attribute can use returnSentinel, returnFalse, or blank as its value. returnSentinel requires you to also use the attribute divZeroSentinel, where you specify a constant. returnFalse returns N/A and no computation takes place. Blank returns zero ("0") and no computation takes place.
  • divZeroSentinel: This attribute is only used if returnSentinel is used as the value for divZeroAction. Its value is a user-defined numeric constant.

Division by zero could occur if you are using division operations, a multiplicative inverse, or two-point scaling.

For an example, see Arithmetic Examples – Division (B).

opExp

This operation has been deprecated; it is no longer available for use. If you currently use this operation, running the CygNet Service Migration Utility during an upgrade automatically converts the operation to its latest equivalent, opPow.

opExpId

This operation has been deprecated; it is no longer available for use. If you currently use this operation, running the CygNet Service Migration Utility during an upgrade automatically converts the operation to its latest equivalent, opPowId.

opFormat

Use this operation to display an input date/time value in a different, user-specified string date/time format.

opFormat is only valid when used with the attribute format. The value of format is a string.

For an example, see Time Formatting Examples – Date/Time Format (B).

opFormatId

Use this operation to convert one reference data group element date/time value to a specified date/time format.

opFormatId is only valid when used with the attribute format. The value of format must be a string.

For an example, see Time Formatting Examples – Date/Time Format (C).

opMapVal

Use this operation to return an enumerated value from a specified enumeration table.

opMapVal is only valid when used with the child element mapVal or in-line with the mapVal attribute.

For an example, see Enumeration Mapping Examples.

opMapToMapVal

Use this operation to handle a situation where one data group element indicates the enumeration to use and another data group element indicates the item in that enumeration.

opMapToMapVal requires attributes for deid and mapVal. The values within mapVal represent the names of global enumerations. The value of the deid indicates which of those enumerations to use.

opMax

Use this operation to assign the maximum value from a set of data values.

opMax is only valid when used with the child elements dataSet and item, which together form a simple structure of items from which a maximum value can be assigned.

opMax can be used to assign a maximum value for its parent data group element using values that are outside of the data set, but at least one item in the data set must be present for opMax to operate.

For an example, see Arithmetic Examples – Maximum Value (A and B).

opMin

Use this operation to assign the minimum value from a set of data values.

opMin is only valid when used with the child elements dataSet and item, which together form a simple structure of items from which a minimum value can be assigned.

opMin can be used to assign a minimum value for its parent data group element using values that are outside of the data set, but at least one item in the data set must be present for opMin to operate.

For an example, see Arithmetic Examples – Minimum Value (A and B).

opMod

Use this operation to assign a modulus value to a data group element.

obMod is only valid when used in conjunction with a value value. This value is the divisor of the previously defined initial value.

opMult

Use this operation to multiply a specified value by a specified constant value. This operation was formerly known as opMultVal.

opMult is only valid when used with the attribute value. The value of value must be an integer, floating=point, or hex.

For an example, see Arithmetic Examples – Multiplication (A).

opMultId

Use this operation to multiply a specified value by a specified reference data group element value.

opMultId is only valid when used with the attribute deid. The value of deid must be valid and it cannot be recursive; that is, it cannot reference itself.

For an example, see Arithmetic Examples – Multiplication (B).

opPow

Use this operation to raise a value by a power specified by a constant value.

opPow is only valid when used with the attribute value. The value of value must be an integer, floating-point, or hex.

For an example, see Arithmetic Examples – Exponent/Raise to Power (A).

opPowId

Use this operation to raise a value by a power specified by a reference data group element value.

opPowId is only valid when used with the attribute deid. The value of deid must be valid and it cannot be recursive; that is, it cannot reference itself.

For an example, see Arithmetic Examples – Exponent/Raise to Power (B).

opScaleFactor

Use this operation to scale a value by a factor specified by a constant value.

opScaleFactor is only valid when used with the attribute scaleFactor. The value of scaleFactor must be an integer or floating-point number.

For an example, see Scaling by Factor and Offset Examples – Scaling by Factor Constant (B).

opScaleFactorId

Use this operation to scale a value by a factor specified by a reference data group element value.

opScaleFactorId is only valid when used with the attribute deid. The value of deid must be valid and it cannot be recursive; that is, it cannot reference itself.

For an example, see Scaling by Factor and Offset Examples – Scaling by Factor Data Group Element (B).

opScaleOffset

Use this operation to scale a value by an offset specified by a constant value.

opScaleOffset is only valid when used with the attribute scaleOffset. The value of scaleOffset must be an integer, floating-point, or hex.

For an example, see Scaling by Factor and Offset Examples – Scaling by Offset Constant (B).

opScaleOffsetId

Use this operation to scale a value by an offset specified by a reference data group element value.

opScaleOffsetId is only valid when used with the attribute deid. The value of deid must be valid and it cannot be recursive; that is, it cannot reference itself.

For an example, see Scaling by Factor and Offset Examples – Scaling by Offset Data Group Element (B).

opSelect

Use this operation in a ref element to specify that child elements make up a selection element.

Can be used with bitShift and bMsk to indicate whether or not to shift off the masked low bits.

For an example, see Assignment Examples – Assign a Conditional Value (A, B, and C).

opSub

Use this operation to subtract from a specified value a specified constant value. This operation was formerly known as opSubVal.

opSub is only valid when used with the attribute value. The value of value must be an integer, floating-point, or hex.

For an example, see Arithmetic – Subtraction (A).

opSubId

Use this operation to subtract from a specified value a specified reference data group element value.

opSubId is only valid when used with the attribute deid. The value of deid must be valid and it cannot be recursive; that is, it cannot reference itself.

For an example, see Arithmetic Examples – Subtraction (B).

opTimeEnron

Use this operation to convert date and time data into the Microsoft standard date-time format.

opTimeEnron is only valid when used with one or more of the following attributes: deidDate and/or deidTime. formatDate and formatTime are optional attributes.

By default, source values are understood to be in Enron format, which is made up of decimal numbers representing MMDDYY.0 and/or HHMMSS.0. But the source value format can vary by device type. Use formatDate and formatTime to accommodate different source formats.

For an example, see Time Formatting Examples – Enron Date/Time.

opTimeComp

Use this operation to convert date and time components into the Microsoft standard date-time format.

opTimeComp is only valid when used with one or more of the following attributes: deidYear (4 digit), deidMonth, deidDay, deidHour, deidMinute, and deidSecond.

For an example, see Time Formatting – Component Date/Time.

opTimeString

Use this operation to convert date and time string data into the Microsoft standard date-time format.

opTimeString is only valid when used with one or more of the following attributes: deidDate and deidTime. Referenced values must be strings in a standard Microsoft date/time format.

For an example, see Time Formatting Examples – String Date/Time.

opTime3Byte

Use this operation to convert 3-byte date and time data into the Microsoft standard date-time format. This date-time representation is used by Thermo SuperFlo II devices.

opTime3Byte is only valid when used with one or more of the following attributes: deidDate and deidTime. Referenced values must be integers where each byte represents a date or time component. For date, the components are as follows: byte 0 = month, byte 1 = day, and byte 2 = 2-digit year. For time, the components are as follows: byte 0 = hour, byte 1 = minute, and byte 2 = second.

For an example, see Time Formatting Examples – 3-Byte Date/Time.

opTimeSeconds

Use this operation to convert seconds into the Microsoft standard date-time format.

opTimeSeconds is only valid when used with the attribute deidTime.

The following optional attributes are also available for use:

  • isUTC: Set to true to indicate that time is in UTC. May be used in conjunction with baseTime.
  • baseTime: Enables you to set a starting date. The default is January 1, 1970. May be used in conjunction with isUTC.

For an example, see Time Formatting Examples – Seconds Date/Time.

opTwoPointScale

Use this operation to perform two-point scaling by using constant scale values.

opTwoPointScale is only valid when used with the attributes scaleLoRaw, scaleHiRaw, scaleLoEng, and scaleHiEng. The value of each of these attributes must be an integer, floating-point, or hex.

For an example, see Two-Point Scaling Examples – Two-Point Scaling by Constants (B).

opTwoPointScaleId

Use this operation to perform two-point scaling by using reference data group element scale values.

opTwoPointScaleId is only valid when used with the attributes scaleLoRawId, scaleHiRawId, scaleLoEngId, and scaleHiEngId. The value of each of these attributes must be a valid data group element and it cannot be recursive; that is, it cannot reference itself.

For an example, see Two-Point Scaling Examples – Two-Point Scaling by Data Group Elements (B).

opUnitConversion

Use this operation to convert one unit type to another.

opUnitConversion is only valid when used with the attributes srcUnits and destUnits. The value of each of these attributes must be a valid unit type and the two unit types must be comparable.

For an example, see Unit Conversion Examples – Unit Conversion (B).

Back to top