Analysis of Programming Cases for S7-200SMART PLC Analog Input Module

1. Introduction: Application of Analog Input Modules in Industrial Control

In industrial automation systems, continuously varying physical quantities such as temperature, pressure, and flow need to be converted into digital signals throughanalog input modules for processing by PLCs. The Siemens S7-200SMART, as a representative of compact PLCs, has its expansion analog modules (such as EM AE04 and EM AI08) widely used in small to medium-sized control systems. This article takes theEM AE04 module as an example, providing a detailed analysis of the entire process from hardware wiring, software configuration to program writing through a practical case oftemperature monitoring of a generator set, helping engineers quickly master the application methods of analog input modules.

2. Hardware Preparation: Module Selection and Wiring Specifications

1. Module Model and Technical Parameters

EM AE04 is a commonly used 4-channel analog input module in the S7-200SMART series, supporting voltage (0-10V, ±5V, etc.) and current (0-20mA) signals, utilizing a 12-bit A/D converter. The digital range for unipolar input is 0-27648, and for bipolar it is -27648 to 27648. The module requires an external DC 24V power supply and communicates with the CPU through a rear connector, eliminating the need for traditional DIP switch settings of the S7-200, with configuration completed entirely through software.

2. Sensor and Module Wiring

Taking a three-wire temperature transmitter (outputting a 0-10V voltage signal corresponding to 0-150℃) as an example, the wiring steps are as follows:

Power Configuration: The transmitter requires an independent 24V power supply (avoid using the PLC’s built-in 24V to prevent short circuits affecting the PLC), with the positive terminal connected to the transmitter’s “+” and the negative terminal connected to the module’s “M” terminal;

Signal Connection: The transmitter’s signal output terminal connects to the module’s 0+ (positive terminal of channel 0), and the signal negative terminal is connected to the module’s 0- after being commoned with the power negative terminal;

Unused Channel Handling: Channel 1 (same group as channel 0) must be shorted to prevent interference (since EM AE04 channels 0/1 and 2/3 are two groups, the signal types in the same group must be consistent).

Wiring Diagram (recommended to refer to Siemens official documentation):

The module terminal block from left to right is “L+ (24V positive)”, “M (24V negative)”, “0+”, “0-”, “1+”, “1-”, “2+”, “2-”, “3+”, “3-”, with the three-wire transmitter’s “signal+” connected to “0+”, “signal-” connected in parallel with “power-” to “0-”, and “power+” connected to the external 24V positive.

3. Software Configuration: Hardware Configuration and Parameter Settings

1. Programming Software and System Block Configuration

Using STEP 7-Micro/WIN SMART software, after creating a new project, hardware configuration must be completed in the “System Block”:

Add Module: In the “Hardware” tab, select “EM AE04” from the right directory and drag it into the CPU expansion slot;

Channel Settings: Double-click the module to enter the parameter configuration interface, select “Voltage” → “0-10V” for channel 0 group (channels 0/1), set the suppression frequency to 50Hz (to match the industrial power grid frequency and reduce interference), and choose “Medium” for the smoothing function (balancing response speed and signal stability);

Download Configuration: Click “Download” to send the system block to the PLC, and restart the CPU to make the configuration effective.

Configuration Notes: If current signals (such as 4-20mA) need to be connected simultaneously, the corresponding channel group must be set to “Current”, and the 4-20mA corresponding digital range is 5530-27648 (not 0-27648).

4. Programming Case: Temperature Acquisition and Range Conversion

1. Core Requirements and Variable Definitions

Requirement: Convert the 0-10V signal collected from EM AE04 channel 0 (corresponding to 0-150℃) into the actual temperature value, storing it in VD100 for subsequent control logic.

Variable Table:

Variable

Address

Type

Description

Analog Input Value

AIW16

INT

Raw digital value of channel 0 (0-27648)

Actual Temperature Value

VD100

REAL

Converted temperature (℃)

2. Range Conversion Formula and Implementation

Method 1: Using the Analog Conversion Library (Recommended)

S7-200SMART supports the porting of the SCALE library from S7-200, using the “S_ITR” (Integer to Real) function block for conversion:

Input Parameters:

Input: AIW16 (raw digital value);

Ish: 27648 (upper limit of digital value corresponding to 0-10V);

Isl: 0 (lower limit of digital value);

Osh: 150.0 (upper limit of temperature, ℃);

Osl: 0.0 (lower limit of temperature, ℃);

Output: VD100 (conversion result).

Method 2: Manually Writing Conversion Program (When No Library Available)

Based on the general formula Ov = [(Osh – Osl)*(Iv – Isl)/(Ish – Isl)] + Osl, the implementation steps in ladder diagram are:

1. Convert AIW16 (INT) to Double Integer (DI), then to Real (REAL) and store in VD20;

2. Calculate Numerator: (VD20 – 0.0) * (150.0 – 0.0) → Result stored in VD24;

3. Calculate Denominator: 27648.0 – 0.0 → Result stored in VD28;

4. Division Operation: VD24 / VD28 → Result stored in VD100 (i.e., actual temperature).

Program Example (Ladder Diagram Description):

Network 1: LDI SM0.0 (Always ON), call “ITD” (AIW16→VD20), then call “DTR” (VD20→VD20);

Network 2: LDR VD20, SUBR 0.0, MULR 150.0, STR VD24;

Network 3: LDR 27648.0, SUBR 0.0, STR VD28;

Network 4: LDR VD24, DIVR VD28, STR VD100.

3. Data Monitoring and Verification

In the software “Status Table”, add VD100 to force the verification of AIW16 value conversion correctness:

When AIW16=0, VD100=0.0℃;

When AIW16=13824 (mid-value), VD100=75.0℃;

When AIW16=27648, VD100=150.0℃.

5. Debugging and Troubleshooting: Common Issues Resolution

1. No Signal Input or Value Fluctuation

Wiring Check: Use a multimeter to measure whether the transmitter output is 0-10V, and check if the voltage between module “0+” and “0-” is normal;

Configuration Verification: Confirm that the channel type in the system block matches the actual signal (e.g., if mistakenly set to current, there will be no reading);

Interference Prevention Measures: Use twisted pair shielded cables for signal, with the shield grounded at one end (near the transmitter) and kept away from power cables.

2. Conversion Value Deviation Too Large

Module Calibration: Use the “Tools” → “Calibration” function to perform zero and full-scale calibration on the module;

Formula Check: When calculating manually, confirm the variable data types (e.g., whether INT to REAL conversion is correct to avoid overflow);

Power Stability: Use an oscilloscope to detect ripple on the 24V power supply; if the ripple is too large, increase the filter capacitor.

3. Alarm Handling

Enable “Exceed Upper Limit” and “Exceed Lower Limit” alarms in the system block; when the temperature >150℃ or <0℃, the PLC status word will set the corresponding alarm bit (which can be read through SM special registers), and the program can trigger audible and visual alarms or shutdown protection.

6. Conclusion and Extended Applications

This article provides a detailed introduction to the wiring specifications, configuration steps, and programming implementation of the S7-200SMART EM AE04 module through a temperature monitoring case. In practical applications, adjustments to signal types and conversion parameters must be made based on the sensor type (such as 4-20mA pressure transmitters), with the core being to master the conversion logic of “analog quantity – digital quantity – engineering quantity”.

Extension Directions:

Multi-channel Acquisition: Reuse program structure to achieve multi-parameter monitoring through addresses like AIW18 (channel 1), AIW20 (channel 2), etc.;

Data Filtering: Add moving average algorithms in the program (e.g., averaging over 10 continuous acquisitions) to further stabilize the signal;

HMI Integration: Connect VD100 with SMART LINE touch screens to display temperature curves in real-time and set upper and lower limit alarms.

Analysis of Programming Cases for S7-200SMART PLC Analog Input Module

Please like, share, and forward.

Leave a Comment