ADD_***_PL7 : Add a period
Original instructions
Description of the function
The ADD_***_PL7 function adds a period to a date or to a time expressed in the DT format or TOD format of PL7.
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 Source_Value
ADD_TOD_PL7 Time_to_Add
ST Result_Value
Representation in ST
Representation applied to a time of day:
Result_Value := ADD_TOD_PL7(Source_Value, Time_to_Add);
Description of parameters
The following table describes the input parameters:
Parameter
Type
Comment
Source_Value
ARRAY [0..3] OF INT
Date or time.
Table of 4 integers.
Time_to_Add
Period to be added to Source_Value
Note : this time is expressed in the TIME format of PL7 and this with an accuracy of the order of one tenth of a second. As Source_Value is expressed to the nearest second, Time_to_Add is rounded to the nearest second.
The following table describes the output parameters:
Parameter
Type
Comment
Result_Value
ARRAY [0..3] OF INT
Result_Value is of the same type as Source_Value.
Table of 4 integers.
NOTE: management of leap years must be provided for in the application.
Execution errors
When Source_Value is in the DINT format (TOD of PL7), there is a change of day if Result_Value is greater than 24:00:00. In this case the system bit %S18 is set at 1 and the value of Result_Value is only significant with a modulo 24:00:00.
When Source_Value is in the ARRAY [0..3] OF INT format (DT of PL7) and if Result_Value is outside the authorized range of values, the system bit %S18 is set at 1 and the value of Result_Value is also at the maximum limit.
If one of the input parameters cannot be interpreted and is inconsistent with the function format then the system bit %S18 is set at 1 and Result_Value is: