PLC state machine programming Article 4-historical state processing, plc Article 4

Source: Internet
Author: User

PLC state machine programming Article 4-historical state processing, plc Article 4

Today, we add the previous control task to the historical state. This task will be complicated. For such tasks, we tend to automatically generate PLC programs and write them by ourselves, which is prone to errors. But for demonstration, we can try it. Let's get down to the truth. below is our control task.

Control Task

This task is based on the previous one. An emergency stop button is added. When the EMStop emergency stop button is pressed, the device stops immediately. After troubleshooting, we hope that the device will continue to run from the fault. For such a task, we need to introduce the historical status.

The following is the state machine of the task.

In the Logic state machine, an Action sub-state is added, and the Action State contains logical control. The Action State contains an additional H letter, indicating that the Action state is a historical state. When the State is changed from Action to Alarm and then enters the Action state again, it does not start from the OnLeftPos default state, it starts from the last time it leaves. The following is the SCL program.

Control Program


Note the following points:


The state machine is a little complicated, and the program is hard to write. Next we will discuss how to automatically generate a program from a state machine.




Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.