Topic: DMD0035 DTCMP - Compare Date/Time |
|
|
|
The Compare Date/Time (DTCMP) instruction compares the Date and/or Time fields of two Date/Time structures.
Note: use the Copy Memory Range (MEMCOPY) instruction to copy from one Data/Time structure to another.
|
|
Parameters:Note: Use the F9 key (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory locations that are valid in the current field of the instruction.
First Date/Time - designates a Date/Time structure. This can be any of the system-defined Date/Time structures, or any user-defined Date/Time structure. Second Date/Time - designates a Date/Time structure to subtract from First Date/Time. This can be any of the system-defined Date/Time structures, or any user-defined Date/Time structure. Compare - selects which fields
in the Date/Time structures to compare
Note: to compare fields of a Date/Time structure other than the Date and Time, for example the Year, or Seconds, use relational contacts referencing those specific fields (.Year, .Seconds, etc.). Set if First Equals Second - designates a bit location in the controller to turn ON if the comparison is equal, otherwise it turns it OFF. This can be any writable bit location. Set if First is Before Second - designates a bit location in the controller to turn ON if the First Date/Time is before (or less than) the Second Date/Time, otherwise it turns it OFF. This can be any writable bit location. Set if First is After Second - designates a bit location in the controller to turn ON if First Date/Time is after (or greater than) the Second Date/Time, otherwise it turns it OFF). This can be any writable bit location.
|
|
|
|
Status Display:The status display shows fully-qualified values for both Date/Time structures.
|
|
|
|
See Also:
|
|
|
|
Related Topics:
|
|
|
|
Rung Example:
|
|
|