Data Conversion; Bin Bcd Conversion - Mitsubishi MELSEC-q Programming Manual

Melsec q series; melsec l series
Hide thumbs Also See for MELSEC-q:
Table of Contents

Advertisement

5 MELSEC FUNCTIONS

5.6 Data Conversion

5.6.1 BIN
BCD conversion
The specified BIN 16-bit data (0 to 9999) is converted into BCD 4-digit data.
Function definition
5.6.2 32-bit BIN
BCD conversion
The specified BIN 32-bit data (0 to 99999999) is converted into BCD 8-digit data.
Function definition
5 - 23
BCD_M
BOOL BCD_M (BOOL EN, ANY16 S1, ANY16 D);
Argument Name
EN
S1
D
Return Value
BOOL
Execution condition
Example of use
(* When execution condition X0 turns ON, the BIN data stored in D0 is
(* converted into BCD, and the result is stored into D100.
BCD_M (X0, D0, D100);
Corresponding MELSEC command
BCD (Conversion from BIN data to 4-digit BCD data)
BOOL DBCD_M (BOOL EN, ANY32 S1, ANY32 D);
Argument Name
EN
S1
D
Return Value
BOOL
Execution condition
Example of use
(* When execution condition X0 turns ON, the BIN data stored in dwData1 is
(* converted into BCD, and the result is stored into Result.
DBCD_M (X0, dwData1, Result);
Corresponding MELSEC command
DBCD (Conversion from BIN data to 8-digit BCD data)
IN/OUT
Execution condition (Function is executed only when the
IN
result is TRUE)
Data to be converted (BIN 16-bit data)
IN
OUT
Conversion result (BCD 4-digit data)
DBCD_M
IN/OUT
Execution condition (Function is executed only when the
IN
result is TRUE)
Data to be converted (BIN 32-bit data)
IN
Conversion result (BCD 8-digit data)
OUT
For the usable data type, refer to "3.2.2
About ANY type".
Description
Description
Description
Description
*)
*)
*)
*)
5 - 23

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec-l

Table of Contents