
661
Table Data Processing Instructions
Section 3-17
Description
SNUM(638) counts the number of data words in the specified stack from the
beginning of the data region at TB+4 to the address before the one indicated
by the stack pointer (TB+3 and TB+2). SNUM(638) does not change the data
in the stack or the stack pointer.
Flags
Precautions
The stack must be defined in advance with SSET(630).
Examples
When CIO 000000 is ON in the following example, SNUM(638) counts the
number of words from the beginning of the data region at D00004 to the stack
pointer position - 1 (D00006) and outputs the result to D00300. (In this case,
the stack pointer indicates D00007.)
Data Registers
---
DR0 to DR15
Index Registers
---
Indirect addressing
using Index Registers
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
Area
TB
D
A
TB
TB+1
TB+2
TB+3
TB+4
N
m
n
D
n
m
PLC memory
address
Pointer
Counts the number of words
(N) from the address of the
beginning of the stack (TB+4)
to the pointer position -1.
Last word
in stack
Stack
Name
Label
Operation
Error Flag
ER
ON if the number of words of data in the stack (the value
output to D) is 0.
OFF in all other cases.
SNUM
D00000
D00300
000000
D00000
D00001
D00002
D00003
D00004
D00005
D00006
D00007
D00008
D00009
D:D00300
0003Hex
PLC memory
address
Stack
pointer
Stack pointer
Last word
in stack
PLC memory address of
last word in the stack
Counts number of data
words. (3 in this example.)
Содержание CJ1G-CPUxx
Страница 3: ...iv N o t i c e ...
Страница 5: ...vi ...
Страница 21: ...xxii Conformance to EC Directives 6 ...
Страница 35: ......
Страница 1131: ...1110 CJ series Instruction Execution Times and Number of Steps Section 4 2 ...
Страница 1143: ...Authorized Distributor Cat No W340 E1 08 Note Specifications subject to change without notice Printed in Japan ...