Publication 1763-RM001C-EN-P - October 2009
Conversion Instructions
209
Updates to Math Status Bits
Changes to the Math Register
Contains the 5-digit BCD result of the conversion. This result is valid at
overflow.
Example
The integer value 9760 stored at N7:3 is converted to BCD and the BCD
equivalent is stored in N7:0. The maximum BCD value is 9999.
Math Status Bits
With this Bit:
The Controller:
S:0/0
Carry
always resets
S:0/1
Overflow
sets if BCD result is larger than 9999. On overflow, the minor
error flag is also set.
S:0/2
Zero Bit
sets if result is zero, otherwise resets
S:0/3
Sign Bit
sets if the source word is negative; otherwise resets
TIP
To convert numbers larger than 9999 decimal, the
destination must be the Math Register (S:13). You must
reset the Minor Error Bit (S:5/0) to prevent an error.
TOD
To BCD
Source
N7:3
9760<
Dest
N10:0
9760<
TOD
9
7
6
0
N7:3
Decimal
0010
0110
0010
0000
9
7
6
0
N7:0
4-digit BCD
1001
0111
0110
0000
MSB
LSB
The destination value is
displayed in BCD format.
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive