3. Instructions
570
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Example Programming
When CIO 0.00 is ON in the following example, SWRIT(640) writes the data in D100 to the specified
word in the stack starting at D0. In this case, the stack pointer indicates D7 and the offset value is 3, so
the data in D4 is overwritten. SWRIT(640) does not change the pointer.
SWRIT
D0
&3
D100
0.00
B
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
A
D100
A
−3
PLC memory
address
Stack pointer
Last word
in stack
Stack
pointer
Stack pointer
Last word
in stack
PLC memory address of
last word in the stack
The stack pointer position remains
unchanged after the data is written.
(Overwrite)
Stack
pointer
PLC memory address of
last word in the stack