Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - How does analog convert an integer into a real number or a real number into an integer?
How does analog convert an integer into a real number or a real number into an integer?
SCALE_ X "scaling" and NORM_X "normalization" can be used to convert analog values. These function blocks are located under "Basic Description" and "Conversion Operation" of the "Description" task card in Step 7(TIA Portal). For a detailed description of functions and parameters, please refer to the online help of STEP 7. To get online help for a function block, select the function block (such as SCALE_X) and press "F 1".

The following example assumes that the measurement range is unipolar. Integer value is between 0 and 27648.

The following values are generated by conversion (for example, conversion to temperature by current measurement):

Forming value

(Analog value)

Measured value

(in the range of 0-20mA)

Measured value

(in the range of 4-20mA)

Replacement value

0.0

4.0

20 degrees celsius

69 12

5.0

8.0

52.5 degrees celsius

13824

10.0

12.0

85 degrees celsius

20736

15.0

16.0

1 17.5 degrees Celsius

27648

20.0

20.0

150℃.

Example 1- Analog value is converted into physical value (analog input, taking conversion temperature as an example)

The maximum upper limit is 27648, the minimum lower limit is 0, the corresponding maximum value is150 C, and the converted minimum value is 20 C. Since the input value is an integer data type and the output value is converted into a real data type, the function block NORM_X can convert an integer into a real number. Within the measuring range of 0-20mA, the measured value corresponding to 20000 is14.4676ma.

Figure. 1

As shown in the figure. 1, two function blocks are connected, and the following definitions exist between the input value of function block NORM_X and the output value of function block SCALE_X: