2-881
2 Instruction Descriptions
NJ-series Instructions Reference Manual (W502)
Other Instructions
2
Get**Cnt
Get**Cnt
The Get**Cnt instruction gets the values of free-running counters of the specified cycle.
The Get**Cnt instruction gets the values of free-running counters of the specified cycle.
A free-running counter is a counter that is incremented at a specific period. Out is the current value of
the count. The counter period is 100 ns, 1 us, 1 ms, 10 ms, 100 ms, or 1 s.
The name of the instruction is determined by counter period. For example, if the counter period is
10 ms, the instruction name is Get10msCnt.
The following example is for the Get1sCnt instruction.
Instruction Name FB/FUN Graphic expression ST expression
Get**Cnt Get Incrementing
Free-running
Counter Group
FUN Out:=Get**Cnt();
"**" must be 100 ns, 1 us, 1 ms,
10 ms, 100 ms, or 1 s.
Variables
Name Meaning I/O Description Valid range Unit Default
Out Count Output Value of free-running
counter
Depends on data type.
--- ---
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
Out OK
Function
Get**Cnt
EN ENO
Out
"**" must be 100 ns, 1us, 1 ms, 10 ms,
100 ms, or 1 s.
abc:=Get1sCnt();
LD ST
abc
Get1sCnt
EN ENO
Out=abc
12
13
14
15
16
1 s