Entering Parameters; Updates To Arithmetic Status Bits - Allen-Bradley SLC 500 Series Reference Manual

Hide thumbs Also See for SLC 500 Series:
Table of Contents
4-16
Math Instructions
Publication 1747-RM001G-EN-P - November 2008
Anytime an underflow or overflow occurs in the
TIP
destination file, minor error bit S:5/0 must be reset
by the program. This must occur before the end of
the current scan to prevent major error code 0020
from being declared. This instruction can overflow
before the offset is added.
Note that the term rate is sometimes referred to as slope. The rate function is
limited to the range -3.2768 to 3.2767. For example, -32768/10000 to
+32767/10000.

Entering Parameters

The value for the following parameters is between -32,768 to 32,767.
• Source can be either a constant or a word address
• Rate (or slope) is the positive or negative value you enter divided by
10,000. It can be either a constant or a word address
• Offset can be either a constant or a word address

Updates to Arithmetic Status Bits

The arithmetic status bits are found in Word 0, bits 0 to 3 in the status file.
After an instruction is executed, the arithmetic status bits in the status file are
updated.
Table 4.13 Processor Function
With this Bit
The Processor
S:0/0
Carry (C)
is reserved.
S:0/1
Overflow (V)
sets if an overflow is detected; otherwise resets. On overflow,
minor error bit S:5/0 is also set and the value -32,768 or 32,767
is placed in the destination. The presence of an overflow is
checked before and after the offset value is applied.
S:0/2
Zero (Z)
sets when destination value is zero.
S:0/3
Sign (S)
sets if the destination value is negative; otherwise resets.
(1)
If the result of the Source times the Rate, divided by 10000, is greater than 32767, the SCL instruction
overflows, causing error 0020 (Minor Error Bit), and places 32767 in the Destination. This occurs regardless of
the current offset.
(1)
Table of Contents
loading

Table of Contents