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

Table of Contents

Advertisement

Operand Specifications
Word addresses
Area
CIO
WR
HR
TB
C
OK
OK
OK
S
Flags
Name
Error Flag
Function
SWRIT(640) overwrites the data in the desired word with the data specified in S. The location of the
desired word is calculated by subtracting the offset value in C from the stack pointer (TB+3 and TB+2).
SWRIT(640) does not change the stack pointer. The stack must be defined in advance with SSET(630).
Pointer
Offset value
C
Hint
SWRIT(640) can be used to change the data for an item currently on a conveyor. The position of the
desired item is simply the number of items back (the offset value) from the most recent item added to
the conveyor.
CS/CJ/NSJ Series Instructions Reference Manual (W474)
AR
T
C
DM
EM
OK
OK
OK
OK
OK
Label
P_ER
• ON if the specified write location is not within the stack area.
• ON if the offset value specified in C is 0 or greater than the maximum data region size (FFFB hex).
• ON if the contents of the stack pointer (TB+3 and TB+2) is less than or equal to the PLC memory
address of first word in the data region of the stack (TB+4). (This is a stack under flow error.)
• OFF in all other cases.
Stack
TB
n
TB+1
TB+2
m
TB+3
TB+4
B
C
D
Last word
in stack
Writes the data (A) without
changing the stack pointer.
Indirect DM/EM
addresses
Con-
stants
@DM
*DM
DR
@EM
*EM
---
---
OK
OK
OK
OK
Operation
PLC memory
address
TB
TB+1
TB+2
TB+3
TB+4
Pointer
m
Last word
n
in stack
A
S
Overwrites the data in the desired
word with the data in S.
The address of the desired word is
calculated by subtracting the offset
value from the stack pointer address.
3. Instructions
Registers
Flags
Pulse
bits
Indirect
IR
TK
CF
using IR
---
OK
---
---
Stack
n
m
A
C
D
m
n
TR
bits
---
---
3
567

Advertisement

Table of Contents
loading

Table of Contents