Section 87: Source code of industrial control project donated by Zheng Wenxian

Publisher:满足的36号Latest update time:2016-03-14 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Opening remarks:
According to the preview in the previous section, this section was originally going to talk about a small project about serial ports, but at noon today, a customer from Xiamen showed up, so I decided to insert this section first.
His name is Zheng Wenxian, and he is a PLC developer. This afternoon he asked me to help him write an industrial control program for him to learn. It is also based on Zhu Zhaoqi's 51 single-chip microcomputer learning board. He wants to modify the source code and transplant it to the industrial control board he made. I quoted 4,000 yuan at first, but he bargained it down to 1,000 yuan. I saw that it was not difficult and agreed. I spent 3 hours this afternoon to finally finish it. Zheng Wenxian paid the money and told me on the phone that he said that sharing happiness is worse than sharing it alone. Resources can only play their greatest value when shared. Therefore, he decided to donate the source code for everyone to learn together. Thank you very much for his charitable act. Sow good seeds and reap good fruits. Good people will have a peaceful life. His project is not difficult. It is very similar to the content of my Section 25. It can be done with slight modifications. For specific functional requirements, please see the following point (2).
 
(1) Hardware platform:
Based on Zhu Zhaoqi 51 single-chip microcomputer learning board.
 
(2) Functions to be implemented:
His system controls two cylinders without any sensors. The first cylinder extends out first and retracts after 1 second. Then the second cylinder extends out again and retracts after 1 second, completing a process, and then the cycle starts over. Each process is counted plus 1 and displayed on the 4-digit digital tube on the right. The 4-digit digital tube on the left displays the set maximum count limit. Once this count limit is exceeded, it will stop automatically. There are 4 buttons, one button is used to start, and one button is used for emergency stop. The other two buttons are plus and minus buttons, which are used to set the maximum count limit displayed on the left. Power failure requires that data is not lost. If the plus and minus buttons are pressed at the same time, the current count content can be cleared.
These 4 buttons are independent buttons. S1 is the plus button, S5 is the minus button, S9 is the start button, and S13 is the emergency stop button. The 74HC595 drives the LED light with the screen print D1 to simulate the first cylinder, and the LED light with the screen print D2 to simulate the second cylinder.

(3) The source code is explained as follows:
 Chapter 87 Source Code Explanation.rar  (6.53 KB, Downloads: 453)
 
Closing remarks:
    Thanks again to Zheng Wenxian for his selfless contribution. Sections 38 to 45 are about serial ports. Most of my serial port programs rely on time to identify whether each string of data has been received. Section 41 does not rely on time, but uses specific keywords to quickly identify whether the data string has been received. In the next section, I plan to combine my latest project experience to continue to talk about an example in this regard. For more details, please listen to the next analysis - when the host continuously sends a string of data to the slave, how can the slave serial port quickly intercept the valid data string.
Reference address:Section 87: Source code of industrial control project donated by Zheng Wenxian

Previous article:Section 88: MCU quickly intercepts valid data strings by using keywords
Next article:Section 1: Wu Jianhong talks about the misunderstandings of beginners in single-chip microcomputers

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号