Binary-Time LWORD format specification
The TwinCAT Binary-Time components are coded in LWORD in the following way:
Bit | Component | Type | Value range | Description |
---|---|---|---|---|
0..31 | timeOfDay | TOD | 0..16#05265BFF | Number of milliseconds since midnight of the current day. "16#05265BFF"=23:59:59 and 999 ms=86399999 ms. |
32..47 | day | WORD | 0..16#FFFF | Number of days since January 1, 1984. |
48..63 | reserved | WORD | 0 | These bits are not used. Default: |
Samples
The table below contains some LWORD numerical values and the values after conversion to the formatted Binary-Time string and the structured type T_BinaryTime.
LWORD | STRING(26) | T_BinaryTime |
---|---|---|
16#000000000000 | 'BT#1984-01-01-00:00:00' | STRUCT(timeOfDay:=TOD#00:00:00, day:=0) |
16#000000000001 | 'BT#1984-01-01-00:00:00.001' | STRUCT(timeOfDay:=TOD#00:00:00.001, day:=0) |
16#2F650270E660 | 'BT#2017-03-21-11:22:33.440‘ | STRUCT(timeOfDay:=TOD#11:22:33.440, day:=16#2F65) |
16#30E805265BFF | 'BT#2018-04-12-23:59:59.999' | STRUCT(timeOfDay:=TOD#23:59:59.999, day:=16#30E8) |