Teacher Liao Changchu
A university teacher told me: “Recently, while reviewing students’ graduation theses, I found that some students drew flowcharts for PLC programs just like microcontroller programs. However, when the system has analog control links, the flowcharts drawn are difficult to explain the issues, making it hard to create a comprehensive flowchart that reflects the actual program execution. Considering that PLC programs and microcontroller programs are different, microcontrollers execute line by line, whereas PLCs do not.”
The program design for microcontrollers and PLCs is quite different. All programs for microcontrollers are designed by the user, while PLC programs include system programs (referred to as operating systems by Siemens) and user programs. The operating system is responsible for organizing all CPU functions unrelated to specific control tasks. The tasks of the operating system include handling the startup process, refreshing input/output process images, calling user programs, detecting interrupt events and calling interrupt organization blocks, detecting and handling errors, managing memory, and handling communication tasks, among others. Many functions of PLCs, such as scanning modes, timer functions, and interrupt handling, are completed by the operating system. This issue should be considered when drawing flowcharts.
The program for the switch control system of PLCs is described more concisely using sequential function charts. It is also theoretically possible to describe the user program of a PLC using flowcharts, but it is essential to distinguish which functions are completed by the operating system and which are implemented by the user program.
For example, someone asked whether it is necessary to use a jump instruction to wait for a certain signal’s rising edge. This reflects a microcontroller programming mindset. The scanning mode of PLCs reads all switch inputs at the beginning of each scan cycle and determines whether a rising edge has occurred based on changes in the state of the same input point between two consecutive scan cycles. Therefore, there is no need to use backward jump instructions to wait for a specific input signal. If this method is used to query the status of signals, the PLC cannot perform other tasks because all its resources are focused on the query! Moreover, this querying is done within a single scan cycle, which can significantly lengthen the scan cycle and easily lead to watchdog timer timeouts.
In the user program of a PLC, only a single instruction to detect the rising edge is needed to capture the rising edge of the pulse signal. If a quick response is required, an interrupt method can be used, where the user-written interrupt program is called by the system program at the rising edge of the pulse signal.
Speaking of PLCs, I would like to share the latest revision of my nationally acclaimed bestseller, “S7-300/400 PLC Application Technology, 4th Edition”:
Revision Insights:
Since its publication in 2005, it has been 11 years. This book is the first comprehensive introduction to S7-300/400 in China, meeting the urgent needs at the time, gaining popularity among peers, and winning the 2006 Science and Technology Progress Award from the Machinery Industry Press. However, looking back now, I realize that due to my limited depth and breadth of knowledge at that time, the structure and content of the book had many shortcomings. With my continuous learning, engineering practice, and extensive interactions with netizens on Siemens’ website, this book has been continually improved through three revisions and won the 2012-2013 Excellent Bestseller Award from the China Publication Distribution Association.
The 4th edition has optimized and revised the entire content based on the latest hardware and software of S7-300/400. Referring to the processing methods of STEP 7 in Siemens’ new software platform TIA Portal, it introduces some commonly used instructions from the library. Some less frequently used content has been deleted and streamlined, and the frequency converter for PLC communication has been changed to the current mainstream G120.
A mainstream trend in modern industrial control is the increasing application of Ethernet in the intermediate and bottom layers of control networks. Siemens’ industrial control products have fully embraced “Ethernetization”; S7-300/400 CPUs at various levels and the new generation of frequency converters, the SINAMICS G120 and S120 series, all have integrated PROFINET Ethernet interfaces. The new generation of compact PLCs, S7-1200, S7-200 SMART, large and medium-sized PLCs S7-1500, and the new generation of human-machine interface series all have integrated Ethernet interfaces. Almost all distributed I/O ET 200 currently sold have PROFINET communication modules or integrated Ethernet communication interfaces. The 4th edition adds S7 communication and open user communication between S7-300/400 and other S7 PLCs via Ethernet.
Network fault diagnosis is a challenging aspect of on-site maintenance. This book provides detailed descriptions of various simple and practical methods for diagnosing DP networks and Ethernet faults, as well as methods for automatic fault display and simulating network faults through simulation to learn fault diagnosis methods.
A large number of PLC video tutorials can be watched at the Siemens Industrial Support Center’s video learning center. However, there are very few video tutorials for S7-300/400, and the coverage is narrow. The 4th edition of this book provides over 30 video tutorials on the accompanying CD to help novice readers quickly get started. Additionally, the CD includes the Chinese version of STEP 7 V5.5 SP4, simulation software PLCSIM V5.4 SP5, programming language S7-Graph V5.3 SP7, a large number of Chinese user manuals, and over 60 examples that complement the text.
My motto is “Strive for Perfection”. The book I wrote is still far from perfect, but I will continue to work towards this goal.
Jigong Education (WeChat ID: cmpjiaoyu)WeChat public service account hosted by the Machinery Industry Press provides free services for teachers in higher education, such as downloading teaching materials, requesting sample books, online video training, textbook selection and publication, and educational information services.