ADD_LDT_LTIME¶
Adds a long duration to a long date-and-time.
Note
This feature requires IEC 61131-3 Edition 3. Use
--dialect iec61131-3-ed3 to enable it. See
Enabling Dialects and Features for details.
Signature¶
┌───────────────┐
IN1 ─┤ │
│ ADD_LDT_LTIME ├─ OUT
IN2 ─┤ │
└───────────────┘
FUNCTION ADD_LDT_LTIME : LDATE_AND_TIME
VAR_INPUT
IN1 : LDATE_AND_TIME;
IN2 : LTIME;
END_VAR
END_FUNCTION
The return type is LDATE_AND_TIME.
Inputs
Name |
Type |
Description |
|---|---|---|
|
|
The date-and-time to offset. |
|
|
The duration to add. |
Outputs
Name |
Type |
Description |
|---|---|---|
Return value |
|
IN1 offset by IN2. |
Description¶
Returns a new LDATE_AND_TIME offset from IN1 by the duration
IN2. The duration is converted from milliseconds to seconds before
being added.
The short form is ADD_DT_TIME. An operand of the
short type (DATE_AND_TIME and TIME where LDATE_AND_TIME and
LTIME is expected) is accepted and widened to 64 bits.
Example¶
result := ADD_LDT_LTIME(LDT#2000-01-01-00:00:00, LTIME#1h);
(* result = LDT#2000-01-01-01:00:00 *)
See Also¶
ADD_DT_TIME — the short form
SUB_LDT_LTIME — subtract a duration from a long date-and-time
SUB_LDT_LDT — difference between two long date-and-times
References¶
IEC 61131-3 Edition 3, Table 30