The cvtF attribute enables you to specify a conversion keyword by which to convert source data into a different target format. This enables the consumption of field-device data in a format acceptable to a CygNet SCADA host.
The attribute cvtF is defined in data group elements in a device template file (that is, a device definition). The cvtF attribute is not restricted to a single protocol like cvtRef is. Applicable supporting attributes (that is, parameters) are typically defined in the same data group element as the cvtF value they support. For example, Scale requires that sourceType be defined in the same data group element as Scale.
cvtF values typically apply to all EIEs; when exceptions occur, they are called out. For example, sometimes a cvtF value is specific to a single EIE, and sometimes an EIE cannot make use of a cvtF value. Data converted by a cvtF conversion method can be reformatted by using a reference method.
Example
|
<DateTime niceName="Date and Time" canSend="true" uccSend="true" dgProtocol="Internal"> <dgElements secLev="4"> <DeviceTime desc="Device DateTime" type="r8"/> <HostTime desc="Host DateTime" type="r8"/> <EPTime desc="Raw Device Time" type="ui4" hidden="true" paramID="3" cvtF="3ByteTime"/> <EPDate desc="Raw Device Date" type="r8" hidden="true" paramID="4" cvtF="3ByteDate"/> </dgElements> </DateTime> |
See the following subsections for more information:
| cvtF Conversion Methods | ||
|---|---|---|
| Byte Conversions | Date-Time Conversions | Numeric Conversions |
The following cvtF conversion functions all enable the conversion from one byte format to another.
Reverses bytes from the field device before processing them.
The following attributes apply to this cvtF method:
See CopyBytes.
Takes a string of two-byte characters and converts the string to a string of single-byte characters using only the high byte or low byte of each character.
The following attributes apply to this cvtF method:
Copies bytes into a data group element in the format in which they originated at the field device.
The following attributes apply to this cvtF method:
See ConvertBigEndianToLittleEndian.
Reverses the order of the two-byte words in a four-byte item without reversing the bytes in each word.
The following attributes apply to this cvtF method:
The following cvtF conversion functions all enable the conversion from one date-time format to another.
Converts three one-byte integer date values (where one byte represents years, one byte represents months, and one byte represents days) to a Microsoft standard date-time format (COleDateTime) value. For example, hex 17 0C 0D with a formatDate value of DDMMYY would display as 23 12 13.
The following attributes apply to this cvtF method:
Converts three one-byte integer time values (where one byte represents hours, one byte represents minutes, and one byte represents seconds) to a total number of seconds.
No directly applicable attributes or parameters.
Converts three one-byte integer time values (where one byte represents hours, one byte represents minutes, and one byte represents seconds) to a string in the format HH:MM:SS.
The following attributes apply to this cvtF method:
Converts six one-byte integer date-time values (where one byte represents years, one byte represents months, one byte represents days, one byte represents hours, one byte represents minutes, and one byte represents seconds) to a Microsoft standard date-time format (COleDateTime) value.
No directly applicable attributes or parameters.
Converts six one-byte integer date-time values (where one byte represents years, one byte represents months, one byte represents days, one byte represents hours, one byte represents minutes, and one byte represents seconds) to a Microsoft standard date-time format (COleDateTime) value. Then it formats the COleDateTime value to a string in the format %Y/%m/%d %H:%M:%S.
No directly applicable attributes or parameters.
Converts two consecutive two-byte big-endian values in Bristol Babcock time (that is, Julian time) format to a double-precision floating point value. Specific to BSAP EIE devices.
The following attribute applies to this cvtF method:
Converts a source data value from a four-byte integer that represents the hour of the day in UTC to an unsigned four-byte integer hour in local time as specified on the remote device.
No directly applicable attributes or parameters.
Converts a source date-time value in number of seconds since January 1, 1970 (time_t) to a Microsoft standard date-time format (COleDateTime) value. (You can format the converted value using a reference data group element that defines a ref attribute and format attribute in combination.)
No directly applicable attributes or parameters.
Converts a four-byte integer time value (where two bytes represent hours and two bytes represent minutes) to total seconds. Only whole hour and whole minute values apply; seconds that might have been part of the source time are dropped.
No directly applicable attributes or parameters.
Converts a four-byte integer time value (where two bytes represent hours, one byte represents minutes, and one byte represents seconds) to total seconds.
The following attributes apply to this cvtF method:
Converts a four-byte integer time value (where two bytes represent hours and two bytes represent scaled minutes) to total seconds. Only whole hour and whole minute values apply; seconds that might have been part of the source time are dropped.
The following attributes apply to this cvtF method:
Converts two consecutive two-byte big-endian values in Bristol Babcock time (that is, Julian time) format to a Microsoft standard date-time format (COleDateTime) value. (The first two source bytes represent days, and the next two source bytes represent second increments.)
The following attributes apply to this cvtF method:
Converts two consecutive two-byte big-endian values in Bristol Babcock time (that is, Julian time) format to a Microsoft standard date-time format (COleDateTime) value. (The first two source bytes represent days, and the next two source bytes represent second increments.)
No directly applicable attributes or parameters.
Converts two consecutive two-byte big-endian values in Bristol Babcock time (that is, Julian time) format to a Microsoft standard date-time format (COleDateTime) value. (The first two source bytes represent days, and the next two source bytes represent second increments.) Then it formats the COleDateTime value to a string in the format %Y/%m/%d %H:%M:%S.
No directly applicable attributes or parameters.
Converts an unsigned integer time_t value (seconds since Jan 1, 1970) to a date-time string in the following format: DD-MM-YYYY HH:mm:ss. If no time values are returned, none are displayed. Specific to Lufkin MPC/RPC EIE and Lufkin SAM EIE devices.
No directly applicable attributes or parameters.
Converts from a NuFlo-specific format to a Microsoft standard date-time format (COleDateTime) value.
No directly applicable attributes or parameters.
Converts a word-swapped, big-endian, 32-bit UNIX time in UTC to a Microsoft standard date-time format (COleDateTime) value.
No directly applicable attributes or parameters.
Converts a word-swapped, big-endian, 32-bit UNIX time in UTC to a Microsoft standard date-time format (COleDateTime) value. Then it formats the COleDateTime value to a string in the format %d-%b-%Y %H:%M:%S.
No directly applicable attributes or parameters.
Converts a four-byte native date-time to a Microsoft standard date-time format (COleDateTime) value.
No directly applicable attributes or parameters.
Converts a four-byte native date-time to a Microsoft standard date-time format (COleDateTime) value. Then it formats the COleDateTime value to a string in the format %d-%b-%Y %H:%M:%S.
No directly applicable attributes or parameters.
Converts two consecutive floating point values to a Microsoft standard date-time format (COleDateTime) value.
No directly applicable attributes or parameters.
Converts six two-byte integer date and time values (where two bytes represent years, two bytes represent months, two bytes represent days, two bytes represent hours, two bytes represent minutes, and two bytes represent seconds) to a Microsoft standard date-time format (COleDateTime) value. (An extraneous two-byte integer value representing day of week is not considered.)
No directly applicable attributes or parameters.
Converts six one-byte integer date-time values (where one byte represents years, one byte represents months, one byte represents days, one byte represents hours, one byte represents minutes, and one byte represents seconds) to a Microsoft standard date-time format (COleDateTime) value.
The following attributes apply to this cvtF method:
Converts a 32-bit local Unix time value to a string value or to a Microsoft standard date-time format (COleDateTime) value, depending on data type defined. The source value is read in little endian. To display the source value as a string, define type="string". To display the source value in the Microsoft standard date-time format, define type="r8".
The following attributes apply to this cvtF method:
Converts a source date-time value in number of milliseconds since January 1, 1970 (time_t) to a Microsoft standard date-time format (COleDateTime) value. Assumes an 8-byte integer representing ms.
The following attributes apply to this cvtF method:
Converts a source date-time value in number of seconds since January 1, 1970 (time_t) to a Microsoft standard date-time format (COleDateTime) value. (You can format the converted value using a reference data group element that defines a ref attribute and format attribute in combination.)
The following attributes apply to this cvtF method:
Converts a string date-time value to a Microsoft standard date-time format (COleDateTime) value. (You can format the converted value using a reference data group element that defines a ref attribute and format attribute in combination.)
The following attributes apply to this cvtF method:
Converts a source unsigned integer date-time value in number of seconds since January 1, 1970 (time_t) to a date-time string in the following format: DD-MM-YYYY HH:mm:ss. If no time values are returned, none are displayed.
No directly applicable attributes or parameters.
Example
|
<SysStrtSec desc="Startup Date Time Secs" type="string" paramID="652" cvtF="UInt2DateTimeString"/> |
The following cvtF conversion functions all enable the conversion from one numeric format to another.
Converts a native twelve-bit floating-point value to a 32-bit IEEE floating-point value. Specific to Micro1c EIE devices.
No directly applicable attributes or parameters.
Converts a negative floating-point value to a positive floating-point value by flipping the sign bit.
No directly applicable attributes or parameters.
Converts a Digital Equipment Corporation (DEC) floating-point value to an IEEE 754 floating-point value.
The following attributes apply to this cvtF method:
Converts from a native floating-point format to an Intel floating-point format.
No directly applicable attributes or parameters.
Converts an unscaled source integer to a scaled floating point number. The conversion requires the following parameters: a manufacturer-defined minimum count scale constant of 204.6, a manufacturer-defined maximum count scale constant of 1023, a user-defined analog scale minimum value, and a user-defined analog scale maximum value. The user-defined values are configured on the field device and read by the AnlgMax and AnlgMin data elements in the ProgData data group. The values are then displayed by the ScaleMax and ScaleMin data elements in each instance of the AnalogCfg data group. A value out of count range returns 0.0. Specific to Lufkin MPC/RPC EIE and Lufkin SAM EIE devices.
The following attributes apply to this cvtF method:
Converts an unscaled source integer to a scaled floating point number. The conversion requires the following parameters: a manufacturer-defined minimum count scale constant of 0.0, a manufacturer-defined minimum analog scale constant of 0.0, a user-defined count scale maximum value, and a user-defined analog scale maximum value. The user-defined values are configured on the field device and read by the MaxCount and MaxWeight data elements in the ProgData data group. A value out of count range returns 0.0. Specific to Lufkin MPC/RPC EIE and Lufkin SAM EIE devices.
No directly applicable attributes or parameters.
Converts two consecutive two-byte big-endian register values by multiplying the first register value by 10000 and adding it to the second register value.
The following attributes apply to this cvtF method:
Converts from an integer to a version number in text in the format "n.n.n".
No directly applicable attributes or parameters.
Converts from an integer to a version number in text in the format "n.n.n".
No directly applicable attributes or parameters.
Converts a source eight-byte accumulator value to a destination 64-bit IEEE floating-point value. The source eight-byte value is big endian and is made up of a four-byte integer and a four-byte floating-point value.
No directly applicable attributes or parameters.
Converts a one-byte, binary-coded decimal number to a ui4 data type (four-byte unsigned integer).
No directly applicable attributes or parameters.
Note: Data types do not always convert precisely to other data types, especially when they are used in conjunction with a scale factor that is not appropriate to the destination data type. Before using this conversion method, test that the source data type is convertible to a destination data type to the precision you require.
Multiplies a source value by a multiplier. By default, the multiplier is 1.
The following attributes apply to this cvtF method:
Example
|
<GgeAgSpmAm desc="Gauge Avg Accum SPM" regNum="47541" cvtF="Scale" type="r4" sourceType="ui4" scaleFactor=".1" readOnly="true"/> |
Converts a 32-bit integer value to a numeric string value in the format "n.n.n". The source value is read in little endian, where the first two bytes are converted to the leftmost n, the next byte is converted to the middle n, and the final byte is converted to the rightmost n. Typically the source value is expected to represent a register number.
The following attributes apply to this cvtF method:
Converts a 32-bit integer value to a numeric string stream number in the format "nnnn.nn.nn".
No directly applicable attributes or parameters.
Converts a three-byte, binary-coded decimal number to a ui4 data type (four-byte unsigned integer).
No directly applicable attributes or parameters.
Converts a native three-byte binary TLP value into a human-readable string TLP value.
No directly applicable attributes or parameters.
Converts a two-byte, binary-coded decimal number to a ui4 data type (four-byte unsigned integer).
No directly applicable attributes or parameters.
Converts a four-byte unsigned integer to a string value representing version. The low word represents the minor revision and revision; the high word represents the revision. Specific to FBNet EIE devices.
No directly applicable attributes or parameters.