Get**Cnt
The Get**Cnt instruction gets the values of free-running counters of the specified cycle.
Instruction
Name
Get**Cnt
Get Incrementing
Free-running
Counter Group
Variables
Name
Meaning
Out
Count
Bit strings
Out
Function
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.
LD
EN
16
15
Out=abc
14
13
12
NJ-series Instructions Reference Manual (W502)
FB/FUN
FUN
EN
"**" must be 100 ns, 1us, 1 ms, 10 ms,
100 ms, or 1 s.
I/O
Description
Output
Value of free-running
counter
Get1sCnt
ENO
abc
1 s
Graphic expression
Get**Cnt
ENO
Out
Valid range
Depends on data type.
Integers
OK
ST
abc:=Get1sCnt();
2 Instruction Descriptions
ST expression
Out:=Get**Cnt();
"**" must be 100 ns, 1 us, 1 ms,
10 ms, 100 ms, or 1 s.
Unit
Default
---
---
Times, durations,
dates, and text strings
2
2-881