Справочник Пользователя для Mitsubishi Electronics QCPU

Скачать
Страница из 1204
6-89
WORD(P)
1
2
3
4
4
6
7
8
6
.3 Data conversion
 instructions
6
.3.8 Conversion from BIN
 32-bit to BIN 16
-bit data (WORD(
P))
6.3.8  
Conversion from BIN 32-bit to BIN 16-bit data (WORD(P))
WORD(P)
Function
Converts BIN 32-bit data at device designated by 
 to BIN 16-bit data with sign, and stores the 
result at a device designated by 
.
Devices can be designated in the range from -32768 to 32767.
Operation Error
(1) In the following case, an operation error occurs, the error flag (SM0) turns ON, and an error 
code is stored into SD0.
 • The contents of the data designated by 
+1 and 
 are outside the range of  32768 to 
32767.
(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]
[Operation]
:
 
BIN 32-bit data or head number of the devices where the BIN 32-bit data is stored (BIN 32 bits)
:
 
Head number of the devices where the converted BIN 16-bit data will be stored (BIN 16 bits)
Setting 
Data
Internal Devices 
R, ZR
J
\
U
\G
Zn
Constants
K, H
Other
Bit
Word
Bit
Word
––
––
––
Basic
Process
High
performance
Redundant Universal
Command
Command
WORDP
WORD
S
D
D
S
WORDP
WORD
S
D
S
D
S
D
BIN 32-bit data
Upper 16 bits
+1
Lower 16 bits
BIN 16-bit data
S
S
D
S
S
Step
Instruction
Device
8253
H
FFFF8253
H
D100
R100
R101
(-32173)
(-32173)