Omron CS1G/H-CPUxxH Instructions Manual page 682

Sysmac cs series; sysmac cj series
Hide thumbs Also See for CS1G/H-CPUxxH:
Table of Contents

Advertisement

Table Data Processing Instructions
Description
Pointer
Flags
Precautions
Examples
000000
SNUM
D00000
D00300
Last word
Stack
in stack
pointer
Area
Data Registers
Index Registers
Indirect addressing
using Index Registers
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.
Stack
TB
n
TB+1
TB+2
m
TB+3
TB+4
A
Last word
in stack
Name
Error Flag
ER
The stack must be defined in advance with SSET(630).
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.)
D00000
PLC memory address of
last word in the stack
D00001
D00002
Stack pointer
D00003
D00004
D00005
D00006
D00007
D00008
D00009
TB
---
---
,IR0 to ,IR15
–2048 to +2047 ,IR0 to –2048 to +2047 ,IR15
DR0 to DR15, IR0 to IR15
,IR0+(++) to ,IR15+(++)
,–(– –)IR0 to, –(– –)IR15
PLC memory
address
Counts the number of words
(N) from the address of the
beginning of the stack (TB+4)
to the pointer position -1.
D
m
n
Label
ON if the number of words of data in the stack (the value
output to D) is 0.
OFF in all other cases.
PLC memory
address
Counts number of data
words. (3 in this example.)
Section 3-17
D
DR0 to DR15
N
Operation
D:D00300
0003Hex
661

Advertisement

Table of Contents
loading

Table of Contents