DATE_AND_TIME |
Top Previous Next |
This data type is 8 bytes big and that is why it cannot be loaded into the only 4 bytes big accu with ‘L’ anymore but only transfered as parameter. A typical DATE_AND_TIME-constant looks like this:
DT#99-12-24-18:30:39.7 Opening of presents 1999
The meaning of the bytes is (BCD-coded):
Byte 0 Year Byte 1 Month Byte 2 Day Byte 3 Hour Byte 4 Minute Byte 5 Second Byte 6 1/100 - Second Byte 7 (High-Nibble): 1/1000 - Second
You can save the weekday in the low-nibble of byte 7, but this function is not supported by TrySim.
With the IEC-Function FC 3 you can assemble a DT-variable out of DATE and TIME_OF_DAY.
The IEC-function FC6 extracts the date out of a DT variable. The IEC-function FC8 extracts the time of day out of a DT variable. The IEC-function FC9 compares two DTs to equal. The IEC-function FC12 compares DT1 >= DT2. The IEC-function FC14 compares DT1 > DT2. The IEC-function FC18 compares DT1< = DT2. The IEC-function FC23 compares DT1 < DT2. The IEC-function FC28 compares DT1 <> DT2.
Please note that DT parameter of functions are transfered in TrySim in a completely different way as in STEP ®7. That is why you should avoid accesses to DT parameter by the address register.
See also:
|