![Omron CJ1G-CPUxx Скачать руководство пользователя страница 646](http://html1.mh-extra.com/html/omron/cj1g-cpuxx/cj1g-cpuxx_instructions-manual_742491646.webp)
625
Table Data Processing Instructions
Section 3-17
Description
SSET(630) secures a stack with N words beginning at TB and ending at
TB+(N–1). The first two words of the stack (TB+1 and TB) contain the 8-digit
hexadecimal PLC memory address of the last word in the stack. The next two
words (TB+3 and TB+2) contain the stack pointer. The stack pointer is the
PLC memory address of the next word in the stack that will be overwritten by
PUSH(632); its initial value is the address of TB+4.
SSET(630) automatically initializes the data region of the stack (TB+4 through
TB+(N–1)) to zeroes. The following diagram shows the basic structure of a
stack.
SSET(630) just establishes and initializes a stack. Use the following instruc-
tions to store in the stack and read data from the stack.
1,2,3...
1.
PUSH(632) stores data in the stack one word at a time.
2.
FIFO(633) and LIFO(634) read data from the stack. FIFO(633) reads the
first word that was stored; LIFO(634) reads the last word that was stored.
3.
The stack pointer value in the stack control word is automatically updated
when PUSH(632), FIFO(633), or LIFO(634) is executed. Normally, users
need not be concerned about the stack control word. When accessing the
contents of the stack other than by using the above instructions, set the
stack pointer value using the Index Register (IR) for indirect referencing.
Flags
Precautions
The minimum value for the number of words in the stack (N) is 5 because N
includes the four words that contain the pointer to the last word in the stack
and the stack pointer. An error will occur if N isn’t in the range 0005 to FFFF.
Examples
When CIO 000000 is ON in the following example, SSET(630) secures a 10-
word stack from D00000 to D00009. D00000 and D00001 contain the PLC
memory address of the last word in the stack. D00002 and D00003 contain
the stack pointer. The stack itself begins in D00004.
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
N
m+(N–1)
m+(N–1)
Last word
in stack
Stack
pointer
PC memory
address
N words
in stack
TB
TB+1
TB+2
TB+3
Name
Label
Operation
Error Flag
ER
ON if N isn’t within the specified range of 0005 to FFFF.
OFF in all other cases.
Содержание 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 ...