Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - When uploading the plc program, the following error will appear.
When uploading the plc program, the following error will appear.
When uploading the PLC program, the following error analysis program is as follows:

Automatic research results content programming content:

First, programming is not combined with the actual wiring. When learning PLC, everyone has an inertial thinking, and all switches connected to the input point of PLC will be regarded as normally open inputs, so the written program is very close to the control circuit of the electrical schematic diagram. For example, the control part of the self-locking circuit is controlled by PLC. I believe that most beginners should write programs like this. Obviously, downloading this program to PLC will not work properly. After the PLC is powered on, both X 1 and X2 are powered on, and the normally closed contacts of X 1 and X2 corresponding to the program will be disconnected, so no matter what signal X0 inputs, Y0 will not output. The solution is either to change the input of external circuit to normally open, or to change X 1 and X2 to normally open contacts in the program. However, it is recommended to change the program. After all, the program depends on the correct connection of peripheral circuits. For example, the most common emergency stop buttons in equipment are connected with normally closed contacts, so pay special attention when writing programs.

Second, multi-coil output

This problem is the most common among novices, and it can be said that 90% people have stepped on this thunder. There are only two reasons, one is that I can't master the working principle of PLC well, and the other is that the program is not standardized.

Although the coil of the same soft element can appear twice or more in the program, it is generally not allowed to output with two coils. Note that I'm talking about the general situation, such as X0 inching control Y0 output. I can write the following form of double circle, but this program is meaningless.

Third, the subroutine special timer is not used in the subroutine.

Mitsubishi Fx3U is equipped with eight timers, which can be used for subroutines: T 192~T 199 (it can also be used as an ordinary timer). Subroutine timer is not widely used in engineering projects, and its function is to run in subroutines when subroutines stop calling.

Fourth, use the reset instruction in the subroutine. If you use the counter in the main program and reset the counter by calling the subroutine, you will find that the calculator can no longer count. In fact, this problem will be particularly emphasized when I teach subroutines. Don't use the reset and edge instructions in the subroutine (unless you can handle their logical relationship), but when we talk about the motor speed measurement program later, some students will still write the reset high-speed counter in the subroutine, which makes the program unable to debug. To analyze why this happens, we must first be familiar with the working principle of PLC-scanning cycle (also called operation cycle). Take the above picture as an example. After the system enters the subroutine, it will execute 【 RST·C0 】 and then return to the calling place. At this time, the system has reset the C0 counter, but the system has not scanned that the condition for executing 【 rst C0 】 has been broken, so in the judgment of the system, it will be considered that the command 【 rst C0 】 has been in the state of being executed, which leads to that C0 has been in the state of being reset, so it is impossible to count any more.

5. Using MOV instruction to reset the counter to transmit instructions can clear the current value of the counter, but it cannot reset the contacts of the counter. As for the reason, anyone who has studied ST structure text programming will understand, so I won't discuss it here.

Six, used for FB block.

Seven, the data type does not match the instruction.

We humans can easily compare the numbers 1.5 and 5. As long as our intelligence is normal, we all know 1.5.

Eight, floating-point numbers sometimes can't directly use comparison instructions. We have calculated 0. 1 1×2.6=0.286, assigned 0.286 to the d 0 register, and then used the [LDE= D0 0.286] contact comparison instruction to output the Y0 coil. What is the result? D0 is obviously equal to 0.286, so this contact should be conductive and the output Y0 is reasonable. Why is this not an output? The reason for the above-mentioned "counterintuitive" problem is related to the computer representation of floating-point numbers. In small PLC (such as FX3U), there are only single-precision floating-point numbers, and the standard used is IEEE-754 (I will introduce it in detail later). The loss of precision is inevitable in any computer and any programming language, mainly due to the incomplete conversion of decimal numbers to binary numbers. For example, converting 0.65 into a binary number gives (0.65)10 = (0.10100101... In the above example, I use another programming language, LabVIEW, to show you the result of computer calculation of 0. 1 1×2.6, and you will understand why Y0 can't be output.

Yes, the result of computer calculation is 0.2600000000.

Nine, the register number overlap

This problem often happens. The picture above is a program written by a student. Obviously, D0 and D 1 have formed a double integer register, and then using D 1 is a case of register reuse, so we can only skip D 1 and use D2 to store the next data. Those who have made this mistake will not go into details here. Please slap yourself first. X. When using tag programming, we don't pay attention to the automatic allocation of software components being occupied. In fact, many teachers are reluctant to teach students to use tag programming, because some people really can't use this thing well, and teachers will be tired. But I teach, and I prefer challenging things. Closer to home, in fact, this problem is well solved. Either label (including array) is used instead of directly programming with soft components+numbers, or the automatic allocation settings of soft components are modified. Both methods are presented. What ~ don't understand? Again, I'll talk about it in detail later. XI. When writing positioning related programs, the coaxial pulse output is closely connected with Emmm, and the chat record can be viewed directly. There are still many students asking this question. Let me give you a brief description. When many people do multi-point positioning control on the same axis, as long as one positioning control instruction is executed, the completion mark of this instruction is immediately taken as the start mark of the next positioning instruction. At this time, they will find that the second positioning instruction doesn't work at all, and the reason is related to the working principle of PLC. For example, this program that controls Y2 to do relative positioning twice is a kind of "seamless connection" programming writing (this is a negative textbook, don't learn this). When the first DRVI instruction ends, M 1 1 is set and M 10 is reset. At this point, the PLC scan is not finished. According to the system, the positioning instruction driven by M 10 has not finished yet, and the next DRVI instruction has started immediately. At this time, the system will think that we have executed two positioning control instructions at the same time, so it is impossible. The correct way is to add a certain dead time between two instructions. I wish you a happy life, thanks for asking?