The First Step to Mastering PLC: Single Button Start-Stop Program!

Today, I will introduce some control programs for single button start-stop (also known as one-click start-stop programs). This involves using a momentary button: press once to turn on a light bulb, press again to turn it off, and repeat… Although this seems like a simple program, many people may struggle to implement it. This topic was also a question posed to me during an interview shortly after I graduated. In fact, there are many ways to write this program, and analyzing these methods can deepen our understanding of the PLC’s working scan process.

The working process of a PLC consists of three steps:

1. Input Detection, detecting the status of various buttons and switches.

2. Program Scanning, scanning through the program to execute the corresponding operations.

3. Output Refresh, outputting the results of the program to control the corresponding loads, such as indicator lights.

The First Step to Mastering PLC: Single Button Start-Stop Program!

Now, let’s take a look at various implementations. Implementation 1

The First Step to Mastering PLC: Single Button Start-Stop Program!

By using a toggle output instruction, we can achieve the desired effect. This is the simplest control method, which is easy to understand without further analysis. Implementation 2: Using a Counter

The First Step to Mastering PLC: Single Button Start-Stop Program!

After pressing the button for the first time

In the first scan cycle, the rising edge of X0 will activate (the rising edge only activates for one scan cycle), turning on the Y0 coil. Note that during this cycle, the normally open contact of Y0 will not close because the program scans from top to bottom and left to right. Continuing down, the normally open contact of C0 does not close, and the scan proceeds to the next line, where the rising edge of X0 activates the C0 counter, recording a count of 1.

The First Step to Mastering PLC: Single Button Start-Stop Program!

In the second scan cycle, since the Y0 coil was activated in the previous cycle, the normally open contact of Y0 will now close, creating a self-locking condition. Since the rising edge can only activate for one scan cycle, all X0 inputs will not activate during this cycle, and the counter retains the value of 1. The result of the next cycle will be the same as in the second cycle, with Y0 remaining lit.After pressing the button for the second timeIn the first scan cycle, the first line, X0 continues to activate the Y0 coil, and Y0 continues to self-lock; in the third line, the normally open contact of the counter remains open; in the fourth line, the rising edge of X0 activates again, causing the C0 counter to record a count of 2. The final output result is that Y0 is still lit.In the second scan cycle, in the first line of the program, since the C0 counter recorded a count of 2 in the previous cycle, the normally closed contact of C0 opens, releasing the self-lock of Y0, turning it off; in the third line, the normally open contact of C0 will close, resetting the C0 counter. Since the rising edge can only activate for one scan cycle, all X0 inputs are off during this cycle, resulting in Y0 turning off, the C0 counter resetting, and the program returning to its initial state.There are many other implementations that can achieve this functionality. Due to the length of the explanation, we will cover them in future discussions. Implementation 3

The First Step to Mastering PLC: Single Button Start-Stop Program!

Implementation 4

The First Step to Mastering PLC: Single Button Start-Stop Program!

Implementation 5

The First Step to Mastering PLC: Single Button Start-Stop Program!

Implementation 6

The First Step to Mastering PLC: Single Button Start-Stop Program!

Implementation 7

The First Step to Mastering PLC: Single Button Start-Stop Program!

Implementation 8

The First Step to Mastering PLC: Single Button Start-Stop Program!

Implementation 9

The First Step to Mastering PLC: Single Button Start-Stop Program!

In fact, there are many more implementations; there should be over 30 different ways to write this. The instructor will introduce each one to you later. If you have a specific implementation you want to hear about, feel free to leave a message!

The First Step to Mastering PLC: Single Button Start-Stop Program!

The First Step to Mastering PLC: Single Button Start-Stop Program!Click here if you likeThe First Step to Mastering PLC: Single Button Start-Stop Program!Learn PLC and Electrical Courses for Free, click to read the original text.

Leave a Comment