Installation manual

Publication 1747-RM001G-EN-P - November 2008
Math Instructions 4-15
Example 2
In the second example, an analog I/O combination module (1746-NIO4I) is
in slot 1 of the chassis. We want to control the proportional valve connected
to output 0. The valve takes a
4 to 20 mA signal to control how far it opens (0 to 100%). (Assume that
additional logic is present in the program that calculates how far to open the
valve in percent and places a number between 0 and 100 into N7:21.) The
analog module provides a 4 to 20 mA output signal for a number between
6242 to 31,208. The following program rung directs an analog output to
provide a 4 to 20 mA signal to the proportional valve (N7:21), based on a
number between 0 and 100.
Scale Data (SCL)
When this instruction is true, the value at the source address is multiplied by
the rate value. The rounded result is added to the offset value and placed in the
destination.
Example
0000
SCP
Scale
w/Parameters
Input
N7:21
0<
Input
Min. 0
0<
Input
Max. 100
100<
Scaled
Min. 6242
6242<
Scaled
Max. 31208
31208<
Output
O:1.0
0<
SCP
0001
END
SCL
SCALE
Source
Rate [/10000]
Offset
Dest
Output Instruction
Fixed SLC
5/01
SLC
5/02
SLC
5/03
SLC
5/04
SLC
5/05
••••
SCL
SCALE
Source N7:0
100
Rate [/10000] 25000
Offset 127
Dest N7:1
377
The source 100 is multiplied by 25000 and
divided by 10000 and added to 127. The
result, 377, is placed in the destination.