Topic: DMD0016

TOBCD - Integer/Real To BCD


The Integer/Real To BCD (TOBCD) instruction is used to convert a positive Integer or Real (floating point) value to a BCD (binary coded decimal) value.

 

Note: only the integer portion of a real number will be converted to BCD.

 

Note: negative input values cannot be converted, the result will always be 0.

 

Parameters:

Note: Use the F9 key (Element Browser) or Down-Arrow key (Auto-Complete) at any time to see a complete list of the memory locations that are valid in the current field of the instruction.

 

Input - designates the location that contains the Integer or Real value to convert. This can be any positive value or any readable numeric location.

 

BCD Output - designates a location to store BCD result. This can be any writable numeric location.

 


See Also:

 


Related Topics:

Note: although Do-more controllers do not natively support BCD, the following two instructions are available for converting data from 3rd party devices which is formatted as BCD.

 

 


Rung Example: