Installation manual
Publication 1747-RM001G-EN-P - November 2008
Data Handling Instructions 5-3
Updates to the Math Register, S:13 and S:14
Contains the 5-digit BCD result of the conversion. This result is valid at
overflow.
Example 1
The integer value 9760 stored at N7:3 is converted to BCD and the BCD
equivalent is stored in N10:0. The maximum BCD value possible is 9999.
Example 2
The integer value 32760 stored at N7:3 is converted to BCD. The 5-digit BCD
value is stored in the math register. The lower 4 digits of the BCD value is
moved to output word O:2 and the remaining digit is moved through a mask
to output word O:3.
When using the math register as the destination parameter in the TOD
instruction, the maximum BCD value possible is 32767.
TIP
However, for BCD values above 9999, the overflow
bit is set, resulting in minor error bit S:5/0 also being
set. Your ladder program can unlatch S:5/0 before the
end of the scan to avoid major error 0020, as done in
this example.
TOD
TO BCD
Source N7:3
9760
Dest N10:0
9760
9760N7:3 Decimal 0010 0110 0010 0000
9760N10:04-digit BCD1001 0111 0110 0000
The destination value is displayed in BCD
format.