S7-200 SMART: Siemens Entry-Level PLC Quick Control Solutions for Small Equipment

I remember once visiting a food factory where the owner spent over twenty thousand on a packaging machine. Suddenly, it stopped working! When I opened the electrical cabinet, the indicator lights on the Siemens S7-200 SMART were flashing like it was New Year’s. The operator was as anxious as a cat on a hot tin roof, saying that pressing the start button had no effect. I checked the program and, lo and behold, they had connected the material level detection switch as NC (Normally Closed), but the program was written as NO (Normally Open)! I modified the program in two minutes, and the machine started buzzing again, resuming packaging. The owner was dumbfounded and said, “Is that it?” Haha, yes, that’s it!

△ Basic Understanding of S7-200 SMART

The S7-200 SMART is an entry-level PLC (Programmable Logic Controller, akin to an industrial “super switch combination”) launched by Siemens. It is cheaper than its sibling, the S7-1200, but still has sufficient functionality for small to medium-sized equipment. There are several CPU models, with common ones being SR20, ST30, ST40, etc., where the numbers indicate the I/O points.

For wiring, pay attention to the markings on the screw terminals: L+ is 24V DC positive, and M is the ground. Input points are labeled I0.0, I0.1, and so on, while output points are labeled Q0.0, Q0.1, etc. Make sure to tighten the connections, as loose wires can cause sparks.

On-site Tip: Don’t rush to install it after purchase; set the address first! Each SMART unit is shipped with an IP address of 192.168.0.1. If you connect two units on the same subnet, they will conflict. Use the STEP 7-MicroWIN SMART software to change the address in the system module before installation.

The programming software to use is STEP 7-MicroWIN SMART, not the regular MicroWIN! These two software packages look like siblings, but they are not compatible; if you mix them up, the program won’t upload.

Note! The communication port of the SMART is a standard RJ45 Ethernet port, which is much more convenient than the RS485 port of the older S7-200 version; you can connect it directly to a computer using an Ethernet cable.

△ A Simple Start-Stop Control Example

Let’s create the most common control: a start button, a stop button, and control a motor. Assume the start button is connected to I0.0 (Normally Open), the stop button to I0.1 (Normally Closed), and the motor to Q0.0.

LD I0.0    // Read the start button
O M0.0     // Internal relay for self-locking
AN I0.1    // AND with the negated stop button
= M0.0     // Store the result in M0.0

LD M0.0    // Read the internal relay status
= Q0.0     // Output to the motor

This program essentially creates a self-locking circuit; once the start button is pressed, even if it is released, the motor will continue to run until the stop button is pressed. M0.0 is a “virtual relay” that exists in memory, not an actual component.

Warning ⚠️: Many beginners do not realize that I0.1 must be connected to a Normally Closed button, resulting in the program not running. Remember: the stop button almost always needs to use a Normally Closed contact! This way, even if the wire breaks, the equipment will stop immediately, which is safer.

On-site Tip: If you want to add an indicator light, just add a line <span>LD M0.0</span> and then <span>= Q0.1</span>, connecting the indicator light to Q0.1. Additionally, in real projects, it’s best to add an emergency stop button, which would be connected in series with a Normally Closed contact before I0.1.

△ Applications of Counters and Timers

The SMART timers include TON (On Delay), TOF (Off Delay), and TONR (Retentive On Delay). I most commonly use TON; for example, to control a motor to run for 5 seconds:

LD I0.0        // Read the start button
TON T33, 50    // T33 timer, timing for 50 units (100ms×50=5 seconds)
LD T33         // Read the timer status
= Q0.0         // Control the motor

Counters are also widely used; CTU is for counting up, and CTD is for counting down. Here’s a simple packaging count:

LD I0.2        // Material detection photoelectric switch
EU             // Rising edge detection to prevent multiple counts from one signal
CTU C1, 10     // C1 counter, preset value 10
LD C1          // Read the counter status (1 when it reaches 10)
R C1           // Reset the counter
= Q0.2         // Trigger the next action

This program is essentially counting products; when it counts to 10, it will trigger Q0.2 (which can activate a solenoid valve to push out the finished product), and then it starts counting again.

On-site Tip: Photoelectric switches can sometimes be unstable and may count multiple times. You can add a 10ms TON timer before the counter for filtering, which works great.

Practical Exercise: Use the S7-200 SMART to create a simple washing machine controller: fill water for 2 minutes → wash for 5 minutes → drain for 2 minutes → alarm notification. You only need 4 output points!

△ Processing Analog Signals

To be honest, the SMART is quite capable of handling analog signals. For example, to read a 4-20mA sensor signal, you need to use an analog input module AI. The analog input will be an integer from 0 to 32000, and you need to perform a linear conversion:

LD SM0.0           // System always has a bit set to 1
MOVE AIW0, MW10    // Move the analog input value from AIW0 to memory MW10
MUL MW10, +100     // Multiply by 100
DIV MW10, +32000   // Divide by 32000
= MW20             // Store the result in MW20

This operation converts 0-32000 to 0-100, for example, to display a liquid level of 0-100%.

Be careful! If you find the analog readings unstable and fluctuating, you can add an averaging filter:

LD SM0.0
MOVE MW20, MW22    // Save the last value
ADD MW20, MW22     // Current + last
DIV MW20, +2       // Divide by 2 to get the average
= MW20             // Store the result back in MW20

Warning ⚠️: Always use shielded cables for analog signal lines! Otherwise, the signal is prone to interference. I’ve seen cases in cement plants where a temperature sensor connected with ordinary wire would show wild fluctuations when the inverter started, scaring the owner quite a bit.

Leave a Comment