omron — BCD real-valued function

BCD real-valued function BCD real-valued function Syntax BCD (value) Function Convert a real value to Binary Coded Decimal (BCD) format. Usage Considerations The BCD function is most useful when used in conjunction with the BITS command, instruction, and function (see below). Parameter value Real-valued expression defining the value to be converted. Details The BCD function converts an integer value in the range 0 to 9999 into its BCD representation. This can be used to set a BCD value on a set of external output signals. Example If you want to use digital signals 4 to 8 to output a BCD digit:

The instruction BITS 4,4 = BCD(digit) converts the value of the real variable digit to BCD and impresses it on external output signals 4-8. Related Keyword DCB real-valued function eV+Language Reference Guide, v2.x, 18319-000 Rev A Page 83