2-189
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Math Instructions
2
Inc and Dec
Inc and Dec
z Inc
The Inc instruction increments target data InOut. If the result exceeds the maximum value of InOut,
InOut returns to the minimum value.
z Dec
The Dec instruction decrements target data InOut. If the result exceeds the minimum value of InOut,
InOut returns to the maximum value.
Inc: Increments an integer value.
Dec: Decrements an integer value.
Instruction Name FB/FUN Graphic expression ST expression
Inc Increment FUN Inc(InOut);
Dec Decrement FUN Dec(InOut);
Variables
Name Meaning I/O Description Valid range Unit Default
InOut Target data In-out Target data Depends on data type.
--- ---
Out Return
value
Output Always TRUE TRUE only --- ---
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
InOut OKOKOKOKOKOKOKOK
Out OK
Function
(@)Inc
EN ENO
InOut
Out
(@)Dec
EN ENO
InOut
Out