Publication 1747-RM001G-EN-P - November 2008
4-14 Math Instructions
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.
Application Examples
Example 1
In the first example, an analog I/O combination module (1746-NIO4I) is in
slot 1 of the chassis. A pressure transducer is connected to input 0 and we
want to read the value in engineering units. The pressure transducer measures
pressures from 0 to 1000 psi and provides a 0 to 10V signal to the analog
module. For a 0 to 10V signal, the analog module provides a range between 0
to 32,767. The following program rung places a number between 0 and 1000
into N7:20 based on the input signal coming from the pressure transducer into
the analog module.
Table 4.12 Processor Function
With this Bit The Processor
S:0/0 Carry (C) always resets.
S:0/1 Overflow (V) sets if overflow generated or an unsupported input is detected;
otherwise resets.
S:0/2 Zero (Z) sets when destination value is zero; otherwise resets.
S:0/3 Sign (S) sets if the destination value is negative; otherwise resets.
0000
SCP
Scale
w/Parameters
Input
I:1.0
0<
Input
Min. 0
0<
Input
Max. 32767
32767<
Scaled
Min. 0
0<
Scaled
Max. 1000
1000<
Output
N7:20
0<
SCP
0001
END