Data Conversion Instructions; Converting Binary Data To Bcd 4-Digit 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

6.5

Data Conversion Instructions

Converting binary data to BCD 4-digit data

BCD(P)
These instructions convert the binary data in the device specified by (s) to BCD data, and store the converted data in the
device specified by (d).
Binary data is used in operations in CPU module. Use this instruction to display numeric values on seven-segment display
unit equipped with BCD decoder.
Ladder diagram
(s)
Setting data
■Descriptions, ranges, and data types
Operand
Description
(s)
Binary data or the head device where the binary data is
stored
(d)
Head device for storing the BCD data
■Applicable devices
Operand
Bit
X, Y, M, L,
SM, F, B, SB
(s)
(d)
Processing details
• These instructions convert the 16-bit binary data (0 to 9999) in the device specified by (s) to BCD 4-digit data, and store the
converted data in the device specified by (d).
-32768 16384 8192 4096 2048 1024
(s)
BIN 9999
0
0
Make sure to set them to "0".
8000 4000 2000 1000
(d)
BCD 9999
1
0
Thousands place
• Data specified by (s) can be converted if it is within the range from K0 to K9999 BCD (decimal).
• The table below shows nibble specification for the data in the device specified by (s) and (d).
Command
input
(s)
BCD
When "K4Y000" is specified
6 BASIC INSTRUCTIONS
242
6.5 Data Conversion Instructions
(d)
Word
U\G T, ST,
T, ST, C, D,
C, LC
W, SD, SW, R
512
256
128
1
0
0
1
1
1
0
BCD conversion
800
400
200
100
80
0
1
1
0
0
1
1
Hundreds place
Tens place
CPU module BCD
(d)
Y14 to
Y10 to
Y17
Y13
Structured text
ENO:=BCD(EN,s,d);
ENO:=BCDP(EN,s,d);
Range
0 to 9999
Double word Indirect
U\G
Z
LC
64
32
16
8
4
2
1
0
0
0
1
1
1
1
40
20
10
8
4
2
1
0
0
1
1
0
0
1
Ones place
BIN
Y4 to
Y0 to
Y7
Y3
BCD
Data type
16-bit signed binary
BCD 4-digit
Constant
specification
LZ
K, H
Data type (label)
ANY16
ANY16
Others
E
$

Advertisement

Table of Contents
loading

Table of Contents