These functions convert from BCD to integer:
| Function Name | Description |
|---|---|
| BYTE_BCD_TO_SINT | Convert two BCD digits encoded in a BYTE to a small integer (SINT). |
| WORD_BCD_TO_INT | Convert four BCD digits encoded in a WORD to an integer (INT). |
| DWORD_BCD_TO_DINT | Convert eight BCD digits encoded in a DWORD to a double integer (DINT). |
| LWORD_BCD_TO_LINT | Convert sixteen BCD digits encoded in a LWORD to a long integer (LINT). |
WORD_BCD_TO_INT( 16#1492 )
The function call returns 1492. The bit pattern 0001 0100 1001 0010 is converted to 0000 0101 1101 0100.
IEC 61131-3 Second Edition: Table 22.3.
IEC 61131-3 Third Edition: Table 22.3.
To learn about converting integers to BCD.
Conversion FunctionsTo learn about other conversion functions.
For the meaning of terms used in Fernhill SCADA.