Converting Int To Bcd - 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

15.21

Converting INT to BCD

INT_TO_BCD(_E)
These functions convert INT type data to BCD type data.
Ladder diagram
[Without EN/ENO]
s
d
Setting data
■Descriptions, types, and data types
Argument
EN
s
ENO
d
Processing details
■Operation processing
• These functions convert the INT type data input to (s) to BCD type data and output from (d).
(s)
9999
INT
3276816384
8192
9999
0
0
1
Make sure to set them to "0".
8000 4000
2000
9999H
1
0
0
Thousands place Hundreds place
• A value input to (s) is the INT type data value and within the range from 0 to 9999.
■Operation result
1.
Function without EN/ENO
The following table lists the operation results.
Operation result
No operation error occurred
An operation error occurred
2.
Function with EN/ENO
The following table lists the execution conditions and operation results.
Execution condition
EN
TRUE (Executes operation)
FALSE (Stops operation)
*1 When FALSE is output from ENO, data output from (d) is undefined. In that case, modify a program so that the data output from (d) is
not used.
15 TYPE CONVERSION FUNCTIONS
712
15.21 Converting INT to BCD
[With EN/ENO]
EN
ENO
s
Description
Execution condition (TRUE: Execution, FALSE: Stop)
Input
Output status (TRUE: Normal, FALSE: Abnormal)
Output
4096
2048
1024
512
256
128
64
0
0
1
1
1
0
0
Conversion to Binary Coded Decimal
1000
800
400
200
100
80
40
1
1
0
0
1
1
0
Tens place
Operation result
ENO
TRUE (Operation error did not occur)
FALSE (Operation error occurred)
FALSE
Structured text
[Without EN/ENO]
d:=INT_TO_BCD(s);
[With EN/ENO]
d:=INT_TO_BCD_E(EN,ENO,s);
d
(d)
9999H
BCD
32
16
8
4
2
1
0
0
1
1
1
1
20
10
8
4
2
1
0
1
1
0
0
1
Ones place
(d)
Operation output value
Indefinite value
*1
*1
Type
Data type
Input variable
BOOL
Input variable
INT
Output variable
BOOL
Output variable
WORD
(d)
Operation output value
Indefinite value
Indefinite value

Advertisement

Table of Contents
loading

Table of Contents