![background image](http://html1.mh-extra.com/html/omron/sysmac-cs1d-cpu/sysmac-cs1d-cpu_reference-manual_742268789.webp)
750
Table Data Processing Instructions
Section 3-17
Description
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.
SWRIT(640) can be used to change the data for an item currently on a con-
veyor. 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.
Flags
Precautions
The stack must be defined in advance with SSET(630).
The address in the stack pointer must be greater than the PLC memory
address of the beginning of the data region (TB+4). An error will occur if the
stack pointer is less than the PLC memory address of TB+4, i.e., if a stack
underflow error occurs.
Examples
When CIO 000000 is ON in the following example, SWRIT(640) writes the
data in D00100 to the specified word in the stack starting at D00000. In this
Constants
---
#0001 to #FFFB
(Hexadecimal)
#0000 to #FFFF
(Hexadecimal)
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
C
S
A
S
B
C
D
TB
TB+1
TB+2
TB+3
TB+4
m
n
A
C
D
TB
TB+1
TB+2
TB+3
TB+4
m
n
C
n
m
n
m
PLC memory
address
Pointer
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.
Last word
in stack
Stack
Offset value
Writes the data (A) without
changing the stack pointer.
Pointer
Stack
Last word
in stack
Name
Label
Operation
Error Flag
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).
OFF in all other cases.
Содержание SYSMAC CS1D-CPU**
Страница 3: ...iv...
Страница 29: ...xxx...
Страница 185: ...146 List of Instructions by Function Code Section 2 4...
Страница 193: ...154 3 35 4 MOVE BIT MOVBC 568 1274 3 35 5 BIT COUNTER BCNTC 621 1276 3 35 6 GET VARIABLE ID GETID 286 1278...
Страница 1389: ...1350 CJ series Instruction Execution Times and Number of Steps Section 4 2...
Страница 1390: ...1351 Appendix A ASCII Code Table ASCII SP Four leftmost bits Four rightmost bits...
Страница 1391: ...1352 ASCII Code Table Appendix A...