bcd_to_bin
Function - Converts a Binary Coded Decimal (BCD) value to a binary value.
Inputs
|
Input |
Data Type |
Range |
Unit |
Default |
Description |
|---|---|---|---|---|---|
|
IN |
DINT |
|
|
|
Integer value in BCD. |
Outputs
|
Output |
Data Type |
Range |
Unit |
Description |
|---|---|---|---|---|
|
Q |
DINT |
|
|
|
Remarks
- The input must:
- Be positive.
- Represent a valid BCD value.
Truth Table
|
IN |
Q |
|---|---|
|
-2 |
0 (invalid) |
|
0 |
0 |
|
16 (16#10) |
10 |
|
15 (16#0F) |
0 (invalid) |
FBD Language Example
FFLD Language Example
- In the FFLD Language, the operation is executed only if the input rung (EN) is TRUE.
- The output rung (ENO) keeps the same value as the input rung.
IL Language Example
Not available.
ST Language Example
Q := BCD_TO_BIN (IN);
See Also




