Omron CJ - REFERENCE MANUAL 02-2010 Reference Manual page 606

Table of Contents

Advertisement

3. Instructions
Operand Specifications
Word addresses
Area
CIO
WR
HR
TB
C
OK
OK
OK
S
Flags
Name
Error Flag
Function
SINS(641) inserts the source data at the desired address and shifts the existing data down one word.
At the same time, SINS(641) increments the stack pointer (TB+3 and TB+2) by 1. The location of the
desired address is calculated by subtracting the offset value in C from the stack pointer.
SINS(641) inserts one word of data into the stack, so there must be at least one available word at the
end of the stack. If the stack is full, an error will occur and the source data will not be inserted.
The stack must be defined in advance with SSET(630).
TB
TB+1
TB+2
TB+3
TB+4
Pointer
Offset value
Last word
in stack
C
Hint
SINS(641) can be used to insert the data for an item that is inserted in the midst of items already on a
conveyor. The position of the insertion point is simply the number of items back (the offset value) from
the most recent item added to the conveyor.
570
AR
T
C
DM
EM
OK
OK
OK
OK
OK
Label
P_ER
• ON if the address indicated by the stack pointer (TB+3 and TB+2) is greater than the PLC memory
address of last word in the data region of the stack. (This is a stack overflow error.)
• ON if the offset value specified is greater than the maximum data region size - 1 (FFFA hex).
• OFF in all other cases.
Stack
PLC memory
address
n
m
Inserts the source data (A)
and increments the stack
pointer.
B
The address of the desired word is
C
calculated by subtracting the offset
D
value from the stack pointer address.
m
n
Indirect DM/EM
addresses
Con-
stants
@DM
*DM
DR
@EM
*EM
---
---
OK
OK
OK
OK
Operation
TB
TB+1
TB+2
TB+3
TB+4
A
Pointer
Last word
in stack
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Registers
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
OK
---
---
Stack
PLC memory
address
n
m+1
The stack pointer is
incremented by +1.
A
B
C
m
D
m+1
TR
bits
---
---

Advertisement

Table of Contents
loading

Table of Contents