Scaling of Analog Input
461 531 626
Connecting a signal from the NORM_X function block to the SCALE_X function block can be done using a local temporary variable of Real type (LI-100-norm in the example below):
Operation of the scaling can be verified by forcing values of 0, 13824 and 27648 (corresponding to 0, 50 and 100 %) to the analog input.
Signals from the analog input units are 16 bit INT values. The mos significant bit (b15) is the sign of the value (0="+", 1="-"). The following 12 [or 8] bits (b14..b3[b7]) make the actual analog measurement value. Rest of the 16 bits (b2[b6]..b0) are set to zero.
Analog input's and output's INT values have a range of 0d .. 27648d (0000 0000 0000 0000b .. 0110 1100 0000 0000b, 0000h .. 6C00h).
Overflow is shown with a value of 7FFFh and underflow with a value of 80D0h.
Source: S7-300 and M7-300 Programmable Controllers Module Specifications (pdf, n. 2 MB)
Process Value (PV) of a PID controller can be scaled using the integrated scaling function of the PID function block. Other analog signals can be scaled using FC105 SCALE function block. It can be found at Libraries -> Standard Library -> TI-S7 Converting Blocks.
In the example below an input signal LI-004 from peripheral address PIW256 is scaled to 0.0 .. 1.6 m.
Note that PIW256 has to be declared to be of INT type!
<< Previous Page (7) Simulating PID Compact with PLCSIM | Sivu 8/12 | Next Page >> (9) Simulating Input Signals with Force Table |