DELTA_***: Difference between two dates
Original instructions
Description of the function
The DELTA_*** function calculates the time variation between two dates or times in PL7 format.
The additional parameters EN and ENO can be configured.
Available functions
The available functions are as follows:
Representation in FBD
Representation applied to a time of day:
Representation in LD
Representation applied to a time of day:
Representation in IL
Representation applied to a time of day:
LD Input_IN1
DELTA_TOD Input_IN2
ST Delay1
Representation in ST
Representation applied to a time of day:
Delay1:= DELTA_TOD(Input_IN1, Input_IN2);
Description of parameters
The following table describes the input parameters:
Parameter
Type
Comment
Input_IN1
ARRAY [0...3] OF INT
Date or time for which we wish to calculate the variation from Input_IN2.
Input_IN2
ARRAY [0...3] OF INT
Date or time for which we wish to calculate the variation from Input_IN1
NOTE: Input_IN1 and Input_IN2 must be of the same type.
The following table describes the output parameters:
Parameter
Type
Comment
Delay1
Delay1 contains the absolute value of the time elapsed between the two inputs Input_IN1 and Input_IN2.
Note: this time is expressed with a precision of a tenth of second.
Runtime errors
If Delay1 exceeds the maximum value allowed for a DINT format, an overflow occurs, in which case Delay1 = 0 and the system bit %S18 is set to 1.
If one of the input parameters cannot be interpreted and is inconsistent with the function format, then Delay1 = 0 and the system bit %S18 is set to 1.