Mitsubishi Electric MELSEC-Q/L Programming Manual page 100

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

Operation error
These functions consist of the following common instructions.
BCD_TO_INT(_E): BIN
BCD_TO_DINT(_E): BIN, WAND
• In any of the following cases, an operation error occurs, the error flag (SM0) is turned ON, and the corresponding error
code is stored to SD0.
Error
Description
code
4100
Values other than 0 to 9 are specified for each digit of (s).
The error above can be suppressed by turning ON SM722.
However, the instruction is not executed regardless of whether SM722 is turned ON or OFF if the specified value is out of the
available range.
Program example
■BCD_TO_INT(_E)
The program which converts BCD type data input to (s) into word (signed) type data, and outputs the operation result from (d).
• Function without EN/ENO (BCD_TO_INT)
[Structured ladder/FBD]
[ST]
g_int1 := BCD_TO_INT(g_word1);
• Function with EN/ENO (BCD_TO_INT_E)
[Structured ladder/FBD]
[ST]
g_bool3 := BCD_TO_INT_E(g_bool1, g_word1, g_int1);
■BCD_TO_DINT(_E)
The program which converts BCD type data input to (s) into double word (signed) type data, and outputs the operation result
from (d).
• Function without EN/ENO (BCD_TO_DINT)
[Structured ladder/FBD]
[ST]
g_dint1 := BCD_TO_DINT(g_dword1);
5 APPLICATION FUNCTIONS
98
5.1 Type Conversion Functions
Q00J/
QnH
QnPH
Q00/
Q01
QnPRH
QnU
LCPU

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents