6 - 66 6 - 66
MELSEC-Q/QnA
6 BASIC INSTRUCTIONS
High Performance
QnA Q4AR
Basic
QCPU
PLC CPU
Process CPU
6.3.6 Conversion from BIN 32-bit to BIN 16-bit data (WORD, WORDP)
Usable Devices
Internal Devices
(System, User)
MELSECNET/10(H)
Direct J
\
Set
Data
Bit Word
File
Register
Bit Word
Special
Function
Module
U
\G
Index
Register
Zn
Constant
K, H
Other
S
D
[Instruction Symbol] [Execution Condition]
Command
Command
WORDP
WORD
ORDP
ORD
S D
S D
[Set Data]
Set Data Meaning Data Type
S
Head number of device where BIN 32-bit data is stored BIN 32 bits
D
Head number of device where BIN 16-bit data will be stored after
conversion
BIN 16 bits
[Functions]
Converts BIN 32-bit data at device designated by
S
to BIN 16-bit data with sign, and stores the
result at a device designated by
D
.
Devices can be designated in the range from -32768 to 32767
The upper 16 bits The lower 16 bits
BIN 32 bit data
BIN 16 bit data
S D
+1
S
[Operation Errors]
(1) In the following cases an operation error occurs, the error flag (SM0) turns ON, and an error
code is stored at SD0.
• The contents of the data designated by
S
+1 and
S
are outside the -32768 and 32767 range. (Error code: 4100)
[Program Example]
(1) The following program converts the BIN 32-bit data at R100 and R101 to BIN 16-bit data when
X20 is ON, and stores it at D100.
[Ladder Mode] [List Mode]
WORD
R100 D100
Instruction
Steps
Device
R100
D100
WORD P
8253
H
FFFF8253
H
D100
R100R101
(-32173) (-32173)
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com