Download Print this page

Converting Bcd 4-Digit Data To Binary Data - Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

Converting BCD 4-digit data to binary data

BIN(P)
These instructions convert the binary-coded decimal data in the device specified by (s) to binary data, and store the converted
data in the device specified by (d).
Use this instruction to convert a binary-coded decimal (BCD) value such as a value set by a digital switch into binary (BIN)
data and to receive the converted binary data so that the data can be handled in operations in CPU module.
Ladder diagram
(s)
FBD/LD
EN
ENO
s
d
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s)
Binary-coded decimal data or the head device where the
binary-coded decimal data is stored
(d)
Head device for storing the binary data
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L, SM,
F, B, SB, S
(s)
(d)
Processing details
• These instructions convert the BCD 4-digit data (0 to 9999) in the device specified by (s) to 16-bit binary data, and store the
converted data in the device specified by (d).
8000 4000 2000 1000
1
0
(s)
BCD 9999
×10
32768 16384 8192 4096 2048 1024
(d)
BIN 9999
0
0
(1)
(1): Filled with 0s.
7 BASIC INSTRUCTIONS
286
7.5 Data Conversion Instructions
(d)
Word
T, ST, C, D, W,
SD, SW, R
800
400
200
100
80
0
1
1
0
0
1
1
3
×10
2
BIN
512
256
128
1
0
0
1
1
1
0
Structured text
ENO:=BIN(EN,s,d);
ENO:=BINP(EN,s,d);
Range
0 to 9999
Double word Indirect
U\G
Z
LC
40
20
10
8
4
2
1
0
0
1
1
0
0
1
×10
1
×10
0
64
32
16
8
4
2
1
0
0
0
1
1
1
1
Data type
BCD 4-digit
16-bit signed binary
Bit
Bit
Constant
specification
LZ
K, H
Data type (label)
ANY16
ANY16
BOOL
BOOL
Others
E
$

Hide quick links:

Advertisement

loading