With Modbus-based devices, device-specific date-time register data must be converted from its source format to the Microsoft standard date-time format. CygNet provides conversion methods to do so. Data converted by a cvtRef conversion may itself be converted using a reference method.
Date-time conversions are always introduced using the cvtRef attribute at the data group element (DataGroupElement) level. Register data must be supplied to a conversion method by one or more specific data group elements. Conversions depend on one or more specialized attributes to reference the register data and to modify that data. Date-time conversions are not limited to the "Date and Time" data group; any Modbus data group can be configured to use the conversions supported by the cvtRef attribute.
For more information, click relevant conversion method links below:
| cvtRef Conversion Methods | ||
|---|---|---|
This conversion method applies only to Thermo SuperFlo II devices. Time3Byte converts then combines three-byte date and time data into the Microsoft standard date-time format.
The following are all of the parameters specific to this conversion:
Example
In the following example, the data group element DevTm uses the conversion method Time3Byte. Time3Byte gets its source date from the data group element UnitDate. It gets its source time from the data group element UnitTime.
|
<DevTm desc="Device Time (Local)" type="r8" cvtRef="Time3Byte"deidDate="UnitDate"deidTime="UnitTime"/> |
TimeComp converts date and time component data into the Microsoft standard date-time format.
The following are all of the parameters specific to this conversion:
Example
In the following example, the data group element DevTm uses the conversion method TimeComp. TimeComp gets its dates from the data group element Year, Month, and Day. It gets its times from the data group element Hour, Minute, and Second. And its day of the week comes from DayOfWeek.
|
<DevTm desc="Device Time (Local)" type="r8" cvtRef="TimeComp"deidYear="Year"deidMonth="Month"deidDay="Day"deidHour="Hour"deidMinute="Minute"deidSecond="Second"deidDayOfWeek="DayOfWeek"/> |
TimeEnron converts Enron-format date and time data into the Microsoft standard date-time format. Referenced values must be specified in Enron format, which are decimal numbers representing MMDDYY.0 and/or HHMMSS.0.
The following are all of the parameters specific to this conversion:
Example
In the following example, the data group element DevTm uses the conversion method TimeEnron. TimeEnron gets the Enron date from the data group element UnitDate. It gets the Enron time from the data group element UnitTime.
|
<DevTm desc="Device Time (Local)" type="r8" cvtRef="TimeEnron" deidDate="UnitDate" formatDate="MMddyy" deidTime="UnitTime" formatTime="HHmmss"/> |
TimeString converts date and time string data into the Microsoft standard date-time format.
The following are all of the parameters specific to this conversion:
TimeT converts UTC date and time data (seconds since January 1, 1970) into the Microsoft standard date-time format.
The following are all of the parameters specific to this conversion:
Example
In the following example, the data group element DateTime uses the conversion method TimeT. TimeT gets its timestamp from the data group element STime.
|
<DateTime desc="Timestamp" type="r4" cvtRef="TimeT"deidTime="STime"/> |
TimeTLocal converts local device date and time data (seconds since January 1, 1970) into the Microsoft standard date-time format.
The following are all of the parameters specific to this conversion:
Example
In the following example, the data group element DateTime uses the conversion method TimeTLocal. TimeTLocal gets its timestamp from the data group element STime.
|
<DateTime desc="Timestamp" type="r4" cvtRef="TimeTLocal"deidTime="STime"/> |
This conversion method applies only to Weatherford WellPilot F-22 (CEO-IV) devices. TimeTLocal1980 converts local device date and time data (seconds since January 1, 1980) into the Microsoft standard date-time format.
The following are all of the parameters specific to this conversion:
Example
In the following example, the data group element DateTime uses the conversion method TimeTLocal1980. TimeTLocal1980 gets its timestamp from the data group element AlOnTmRaw.
|
<DateTime desc="Al On Time" type="r8" cvtRef="TimeTLocal1980" arrSize="50" arrRegOff="2" deidTime="AlOnTmRaw" hidden="true"/> |
TimeTLocal2000 converts local device date and time data (seconds since January 1, 2000) into the Microsoft standard date-time format.
The following are all of the parameters specific to this conversion:
Example
In the following example, the data group element CtrlDTOle uses the conversion method TimeTLocal2000. TimeTLocal2000 gets its timestamp from the data group element CtrlDTRaw.
|
<CtrlDTOle desc="Controller Date/Time Ole" deidTime="CtrlDTRaw"cvtRef="TimeTLocal2000" hidden="true"/> |
TimeTLocalOffset converts local device date and time data into the Microsoft standard date-time format. It does so by adding a user-defined string offset to January 1, 1970 then adding the referenced data group element value to the result of that sum. In effect, the arithmetic is January 1, 1970 + secondsSince string date offset + deidTime in seconds = date and time.
The following are all of the parameters specific to this conversion:
Example
In the following example, the data group element DateTime uses the conversion method TimeTLocalOffset. secondsSince specifies a post-January 1, 1970 string date in the format YYYYMMDDHHMMSS. The value in seconds from deidTime is then added to the string specified by secondsSince.
|
<DateTime desc="Timestamp" type="r4" deidTime="STime"cvtRef="TimeTLocalOffset"secondsSince="19751001151035"/> |