PLC reading analog signals must have an analog input module, which is often called an AI module.
Commonly used analog quantities such as pressure , temperature , humidity, flow , etc. need to be converted into current signals or voltage signals by a transmitter. Current signals are commonly used 4-20mA, or voltage signals 1-5V, and of course there are other types.
When these analog signals are connected to the AI module, the AI module converts the analog signals into digital quantities through the AD converter, that is, in SM331 in the Siemens PLC system, 0-27648, the converted numbers are different in different PLCs.
The picture above shows the SM331 module. Through the four range selection modules on the back, you can freely select different signal types.
The above picture corresponds to the internal wiring diagram and description information of the analog module. Users can connect various transmitters according to this diagram.
After completing the module selection and external wiring, PLC programming is performed to convert the data collected by the AI module into engineering values, that is, pressure, temperature, flow, etc.
When using Siemens STEP7 software for programming, function block FC105 is generally used, which is the analog signal standardization program. Its specific algorithm is as follows:
OUT = [((FLOAT (IN) – K1)/(K2–K1)) ∗ (HI_LIM–LO_LIM)] + LO_LIM
Parameter BIPOLAR=1, then the value of parameter IN is bipolar, and the value range is between -27648 and 27648. The value of constant “K1” is “-27648.0” and the value of “K2” is “+27648.0”.
Parameter BIPOLAR=0, then the value of parameter IN is unipolar, and the value range is between 0 and 27648. The value of constant “K1” is “0.0” and the value of “K2” is “+27648.0”.
The meaning of other parameters can be referred to the figure above.
The picture above shows the programmed AI signal standardization program. For the parameter IN, it is the PIW value, HI_LIM and LO_LIM are the upper and lower limits of the range, and OUT is the actual engineering value.