BCD_TO_INTΒΆ

This function, provided by The library UTIL.Library\ \, converts a byte in BCD format into an INT value:

The input value of the function is type BYTE and the output is type INT.

Where a byte should be converted which is not in the BCD format the output is -1.

Examples in ST:\ \ \ \

i:=BCD_TO_INT(73);  (\* Result is 49 \*)

k:=BCD_TO_INT(151); (\* Result is 97 \*)

l:=BCD_TO_INT(15);  (\* Output -1, because it is not in BCD format  \*)