
14-5
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
14.3 Integer to BCD
The Integer to BCD conversion instruction reads the contents specified in the
input parameter IN as an integer value and converts this value to a three-digit
number in binary coded decimal format (BCD, " 999). The output
parameter OUT provides the result. If an overflow occurs, ENO is 0.
Certain restrictions apply to the placement of the Integer to BCD conversion
box (see Section 6.1).
Table 14-3 Integer to BCD Conversion Box and Parameters
LAD Box
Parameter Data Type Memory Area Description
IB
D
EN BOOL I, Q, M, D, L Enable input
_
EN ENO
ENO BOOL I, Q, M, D, L Enable output
IN OUT
IN INT I, Q, M, D, L Integer number
OUT WORD I, Q, M, D, L Result in BCD format
Status Word Bits
BR CC 1 CC 0 OV OS OR STA RLO FC
Write 1 – – x x 0 1 x x
I 0.0
If the signal state of input I 0.0 is 1, the
conversion is executed. The contents of
memory word MW10 is read as an
integer and converted to a three-digit
number in BCD format. The result is
stored in memory word MW12. If an
overflow occurred, the signal state of
output Q 4.0 is 1. If the signal state at
input EN is 0 (that is, if the conversion is
not executed), the signal state of output
Q 4.0 is also 1.
Q 4.0
I_BCD
IN
EN ENO
MW10 MW12
Function is executed (EN = 1):
NOT
OUT
Figure 14-3 Integer to BCD
Description
Move and Conversion Instructions
Comentários a estes Manuais