Allen-Bradley MicroLogix 1200 Reference Manual page 168

Hide thumbs Also See for MicroLogix 1200:
Table of Contents

Advertisement

11-6
Conversion Instructions
Publication 1762-RM001C-EN-P
To convert numbers larger than 9999 BCD, the source
NOTE
must be the Math Register (S:13). You must reset the
Minor Error Bit (S:5.0) to prevent an error.
Example
The BCD value 32,760 in the math register is converted and stored in
N7:0. The maximum source value is 32767 (BCD).
S:14
0000 0000 0000 0011
15
0
0
0
0
3
3
You should convert BCD values to integer before you manipulate them in
your ladder program. If you do not convert the values, the controller
manipulates them as integers and their value may be lost.
If the math register (S:13 and S:14) is used as the source
NOTE
for the FRD instruction and the BCD value does not
exceed four digits, be sure to clear word S:14 before
executing the FRD instruction. If S:14 is not cleared and a
value is contained in this word from another math
instruction located elsewhere in the program, an incorrect
decimal value is placed in the destination word.
FRD
FRD
From BCD
Source
S:13
00032760<
Dest
N7:0
32760<
S:13
0010 0111 0110 0000
15
0
5-digit BCD
2
7
6
0
2
7
6
0
N7:0 Decimal 0111 1111 1111 1000

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Micrologix 1500

Table of Contents