PLC programming entry learning - solutions - Huaqiang Electronic Network

Single chip microcomputer STM32L151CCU6
SMD aluminum electrolytic capacitor
Photocoupler

1. Programming requires strong perseverance and patience

People have their own strengths. Some people see programming as a lengthy and boring job; some people see programming as a fun intellectual game. If you are the former, I strongly recommend that you stay away from the job. After all, programming work is a challenge to people's perseverance and patience. In my lab, many students will be surprised to see that I am facing the focus of this pile of symbols. In fact, this is of interest. Interest has given me enough perseverance and patience. After countless failures, when I saw that the symbols were arranged neatly according to my thoughts, and the plc was running in an orderly manner according to my requirements, the interest was greatly satisfied, just like getting through the gate of a game. So, I told these students: You are seeing a bunch of boring and weird symbols, I see a group of passionate dancers, and I am their director. 2. Programming requires confidence to practice. I once taught a student to learn AutoCAD. My only requirement for her is practice. I told her: What do you do, you can't make a picture redraw; the worst result is a system crash, it doesn't matter, the system redo, come back; as long as the computer is not smashed, how can it do. Two years later, I saw the CAD drawings she made, and I also sighed. By the same token, only by continuously running these instructions on the PLC and observing the results of the operation can the PLC instructions be clarified. Many beginners are confused about PLC's face, often because of fear and damage to equipment. And there is no reason for these fears. It is very important to read the manual carefully, but reading alone is not an engineer. What's more, the contents of the manual are not exhaustive. When I came into contact with unfamiliar instructions, I like to program a small program to let the PLC run. Then modify the conditions one by one, observe the results of the operation (MicroWin provides users with very good monitoring methods), and then re-understand the description of the manual, so that you can understand the role and use of these instructions very intuitively. Don't worry about any problems with the program you write, it will affect the normal operation of the PLC. There is no problem with the program, only the PLC can be found to run. Finding problems and solving problems is an improvement in one's ability. Regardless of the hardware operation, as far as the software is concerned, I have never encountered any damage to the PLC due to software problems. There is no need to worry about the possible consequences of the wrong connection of the relay circuit. Therefore, bold practice is the only way to plc programming. Of course, bold practice is not a barbaric operation, but must follow the necessary norms. Another thing to note is that you should never mount the load until the program is verified without reliability, so as to avoid unnecessary losses. The digital output has an LED display; analog processing can be solved by some hardware or software simulation. 3, programming requires meticulous logic thinking programming itself is a logical thinking process. In high-level languages, the most used ones are ifthenelse and select, which are the causal relationships in logic. The PLC program is composed of these causal relationships: whether the condition is established, and then decides to execute the corresponding instruction. The original PLC was used to replace the relay logic circuit, so it inherits the description of the relay circuit with the contact as the trigger condition. In the PLC, the metal contacts of the relay are replaced by virtual contacts, and the logic relationship expressed by the relay circuit is completely preserved. Even if a numerical process that is difficult for the relay circuit is introduced, the PLC is fundamentally performing a causal relationship. Therefore, the logical relationship between the various events of the object is a preparation that must be carefully prepared before programming. After I received a task, the first thing was to sort out a logical relationship diagram, repeatedly discuss with the user, obtain the user's approval, and then actually enter the program writing process. 4, indispensable knowledge PLC program is directly applied to the specific process of the object, then the understanding of the specific process of the object is very important. In the process of communication with the user, I will use the knowledge of UnitOperation that I have mastered to analyze the user's process, assist the user to organize the various logical relationships in the process control, and even include the configuration of various instruments and hardware. This is due to the profession I have studied. Of course, you can't ask all engineers who work on PLC programs to have my experience. But there are two kinds of knowledge that are indispensable: First, the hardware knowledge of process instrumentation, including sensors, transmitters (secondary instruments) and PLC itself, which is the basis for building control systems; second, process control theory, including The principles and applications of various control models, the most important of which are the two-position adjustment and PID adjustment models. PID regulation is currently the most widely used process control method, and it is highly variable. The best way to learn PID is to read. Almost all books that explain process control have content about PIDs. Reading more basic related books is very useful for understanding PID. I found that many netizens lacked this knowledge when they entered the PLC field. This is not terrible; the terrible thing is that the parties cannot calm down to make up for the shortcomings of knowledge. We should not blame the school for not teaching the content, but to pay attention to how to learn this knowledge. Many of the problems encountered in the work are not mentioned in the school. This cannot be the reason for our refusal to work. We should respond to these issues with a positive attitude. My experience is that the knowledge that is learned to solve problems at work is easier to remember than the things that go to school. 5, develop a good programming habits Everyone programming will have different habits and characteristics, can not be consistent. But some good habits should still be followed by most people. First, rationalize the logical relationship, timing relationship, and compile the program block diagram; second, reasonably allocate the main program, subroutine and interrupt program; third, allocate the register reasonably and compile the register symbol table. PLC programming is closer to single-chip microcomputer, or PLC is a modular single-chip microcomputer. Therefore, many operations of the PLC are directly directed to the register. If unreasonable register address overlap occurs in the program, unpredictable consequences will occur. Compiling the register symbol table not only avoids the above problems (MicroWin has a problem prompt), but also makes the program more readable. This is similar to the variables defined in VB. VB programming is concerned with events, not emphasizing the concept of main programs and subroutines, because the work of the VB main program is done by the operating system of the PC. PLC is not. The PLC program is mainly based on the main program, and the CPU continuously executes the main program in a loop, and the subroutine or the interrupt program is called only when the trigger condition is established. That is, the tasks performed by the subroutine and the interrupt program are not required at all times. If you put these tasks in the main program, you will increase the workload of the main program and reduce the efficiency of the program. This is consistent with the programming idea of ​​the microcontroller. The use of subroutines can make the logic of the entire program clearer. And subroutines can be written, debugged, and finally "installed" to the main program. This way you can solve the problem one by one. PLC programming, whether LAD or STL, is not as intuitive and interesting as VB, and not as good as CAD. But it is much more visible than the assembly language of the microcontroller. For beginners, the programming of LAD (Ladder) is relatively straightforward and easier to use.

Electric Gangway Winch

Electric Powerful Winch,Electric Gangway Winch,High Speed Electric Winch,Marine Electric Gangway Winch

RUDONG HONGXIN MACHINERY CO.,LTD , https://www.rdhxmfr.com