2 Instruction Descriptions
2-544
NJ-series Instructions Reference Manual (W502)
ADD_TIME
The ADD_TIME instruction adds two times.
The ADD_TIME instruction adds two times, In1 and In2. The result of addition in Out is also a time.
The following example is for when In1 is T#1d2h3m4s and In2 is T#5d6h7m8s.
Instruction Name FB/FUN Graphic expression ST expression
ADD_TIME Add Time FUN Out:=ADD_TIME(In1, In2);
Variables
Name Meaning I/O Description Valid range Unit Default
In1 Add time 1
Input
Add time 1
Depends on data type. ns T#0s
In2 Add time 2 Add time 2
Out Total time Output Total time Depends on data type. ns ---
Boolean
Bit strings Integers
Real
numbers
Times, durations,
dates, and text strings
BOOL
BYTE
WORD
DWORD
LWORD
USINT
UINT
UDINT
ULINT
SINT
INT
DINT
LINT
REAL
LREAL
TIME
DATE
TOD
DT
STRING
In1 OK
In2 OK
Out OK
Function
(@)ADD_TIME
EN ENO
In1 Out
In2
abc:=ADD_TIME(T#1d2h3m4s, T#5d6h7m8s);
LD ST
abc
ADD_TIME
EN ENO
In1
In2
T#1d2h3m4s
T#5d6h7m8s
+
T#1d2h3m4s
T#5d6h7m8s
T#6d8h10m12s
In1
In2
Out=abc