Using Math Instructions
8–3
Overflow Trap Bit, S:5/0
Minor error bit (S:5/0) is set upon detection of a mathematical overflow or division
by zero. If this bit is set upon execution of an END statement or a Temporary End
(TND) instruction, the recoverable major error code 0020 is declared.
In applications where a math overflow or divide by zero occurs, you can avoid a
controller fault by using an unlatch (OTU) instruction with address S:5/0 in your
program. The rung must be between the overflow point and the END or TND
statement.
Changes to the Math Register, S:13 and S:14
Status word S:13 contains the least significant word of the 32-bit values of the MUL
and DDV instructions. It contains the remainder for DIV and DDV instructions. It
also contains the first four BCD digits for the Convert from BCD (FRD) and
Convert to BCD (TOD) instructions.
Status word S:14 contains the most significant word of the 32-bit values of the MUL
and DDV instructions. It contains the unrounded quotient for DIV and DDV
instructions. It also contains the most significant digit (digit 5) for TOD and FRD
instructions.
Programming
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive