2 Instruction Descriptions
2-138
NJ-series Instructions Reference Manual (W502)
CTU
The CTU instruction increments the counter value when the counter input signal is received. The preset
value and counter value must have an INT data type.
The CTU instruction creates an up counter. The preset value and counter value must have an INT data
type.
When reset signal Reset changes to TRUE, counter value CV changes to 0 and counter output Q
changes to FALSE. When counter input signal CU changes to TRUE, CV is incremented. When the
value of CV reaches the value of PV or higher, the value of Q changes to TRUE.
After the value of CV reaches the value of PV or higher, the value of CV does not change even if the
value of CU changes to TRUE.
CU is ignored while Reset is TRUE. CV is not incremented.
Instruction Name FB/FUN Graphic expression ST expression
CTU Up-counter FB CTU_instance (CU, Reset,
PV, Q, CV);
Variables
Name Meaning I/O Description Valid range Unit Default
CU Counter
input
Input
Counter input
Depends on data type.
---
FALSE
Reset Reset
signal
TRUE: Reset CV to 0.
PV Preset
value
Counter preset value 0 to 32767 0
Q Counter
output
Output
TRUE: Counter output ON
FALSE: Counter output OFF
Depends on data type.
--- ---
CV Counter
value
Counter present value 0 to 32767
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
CU OK
Reset OK
PV OK
QOK
CV OK
Function
CTU
CU Q
Reset CV
PV
CTU_instance