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

Melsec iq-f fx5 series
Hide thumbs Also See for MELSEC iQ-F FX5 series:
Table of Contents

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)
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
■Applicable devices
Operand
Bit
X, Y, M, L,
SM, F, B, SB
(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
Thousands place
32768 16384 8192 4096 2048 1024
(d)
BIN 9999
0
0
Always becomes "0".
• The data in the device specified by (s) can be converted if it is in the range from 0 to 9999 (BCD).
• The table below shows nibble specification for the data in the device specified by (s) and (d).
Command
input
(s)
BIN
6 BASIC INSTRUCTIONS
246
6.5 Data Conversion Instructions
(d)
Word
U\G T, ST,
T, ST, C, D,
C, LC
W, SD, SW, R
800
400
200
100
80
0
1
1
0
0
1
1
Hundreds place
Tens place
Binary conversion
512
256
128
1
0
0
1
1
1
0
(d)
6
7
In case of K4X0
X14 to
X10 to
X17
X13
BIN CPU module
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
Ones place
64
32
16
8
4
2
1
0
0
0
1
1
1
1
BCD
8
9
X4 to
X0 to
X7
X3
BIN
Data type
BCD 4-digit
16-bit signed binary
Constant
specification
LZ
K, H
Data type (label)
ANY16
ANY16
Others
E
$

Advertisement

Table of Contents
loading

Table of Contents