15.2 IEC
15.2.1 Date and time as complex data types
The DATE_AND_TIME data type is a complex data type like ARRAY, STRING, and
STRUCT. The permissible memory areas for complex data types are the data block (DB)
and local data (L stack) areas. If you use the data type DATE_AND_TIME as formal
parameter in an instruction, due to the complex data type you can specify only one of the
following formats:
n A block-specific symbol from the variable declaration table for a specific block
n A symbolic name for a data block, such as e.g. "DB_sys_info.System_Time", made
up of the following parts:
– A name defined in the symbol table for the number of the data block (e.g.
"DB_sys_info" for DB 5)
– A name defined within the data block for the DATE_AND_TIME element (e.g.
"Time" for a variable of data type DATE_AND_TIME contained in DB 5)
You cannot pass constants as actual parameters to formal parameters of
the complex data types, including DATE_AND_TIME. Also, you cannot
pass absolute addresses as actual parameters to DATE_AND_TIME.
15.2.2 FC 1 - AD_DT_TM - Add duration to instant of time
The function FC 1 adds a duration D (time) to an instant of time T (date and time) and
provides a new instant of time (date and time) as the result. The instant of time T must be
in the range DT#1990-01-01-00:00:00.000 ... DT#2089-12-31-23:59:59.999. The function
does not check the input parameters. If the result of the addition is not within the valid
range, the result is limited to the corresponding value and the binary result (BR) bit of the
status word is set to "0".
Parameter Declaration Data type Memory area Description
T* INPUT DATE_AND_TIME D, L Instant of time in format DT
D INPUT TIME I, Q, M, D, L
Constant
Duration in Format TIME
RET_VAL* OUTPUT DATE_AND_TIME D, L Sum in format DT
*) You can assign only a symbolically defined variable for the parameter.
15.2.3 FC 2 - CONCAT - Concatenate two STRING variables
The function FC 2 concatenates two STRING variables together to form one string. If the
resulting string is longer than the variable given at the output parameter, the result string
is limited to the maximum set length and the BR bit is set to "0".
Actual parameters for
DATE_AND_TIME
Description
Parameter
Description
VIPA SPEED7
Standard
IEC > FC 2 - CONCAT - Concatenate two STRING variables
HB00 | OPL_SP7 | Operation list | en | 18-30 805