Programming technology in the design (transfer)

zhaozj2021-02-16  221

The programming technology of PLC is highly reliable, simple, easy to use, and maintenance, can adapt to high temperature impacts in the industrial site, vibration, etc. The advantages of harsh environments. Therefore, it is increasingly widely used in the field of automatic control of mechanical equipment, production flow lines and production processes.

1 pay attention to the problem

1.1 pay attention to the rules

The structure and instruction systems of various PLC products are different, but the basic rules of the design ladder chart are roughly the same. At the time of programming, pay attention to the following rules:

A various relay coils cannot be connected directly to the left bus bar. If there is, it can be connected via a normally closed contact or dedicated internal auxiliary relay (such as 1813 only ON) in the program.

The B coil is not reused, and the same contacts as the coil number can be used repeatedly.

The right side of the C output coil can be placed, the contact must be placed on the left side of the coil.

The D trapezoidal chart is not endless instructions.

1.2 PLC unreasonable programming

It is easy to treat the ladder diagram in the way of the analysis circuit, and the design ladder map is sometimes difficult to intuitively determine its rationality, so it is easy to compile or unreasonable programs.

a unpalatable bridge type loop

See Fig. 1 (a), (b) The ladder chart is an unparalleled bridge type loop, and it must be changed to the corresponding form to be accepted by the PLC.

The unreasonable arrangement of the loop in the B trapezole can result in more programming time and memory space. The execution time of the instruction is long compared to the circuit (C) (D) shown in FIG. It is seen from the instruction table (c) more of the mostly used OR-LD and AND-LD instructions, accounting for programming time and storage space. Therefore, the (c) may not be adopted, and the (d) scheme should be employed.

The C PLC is in the programming order.

When the PLC is working, it is different from the electrical relay control line. The former is executed in serial, and the latter is executed in parallel; Thus, the first one starts a second cycle. Therefore, it is not possible to ignore the program order when programming, and the order of execution is different. See Figure 2 Ladiographic (E) and (f).

The same is the same for relay lines. However, in the PLC, since the instruction execution is different, it can see that its operation results are different from the ladder chart. Therefore, the analysis of the program arrangement and its execution results are not ignored when programming, and select, reasonable programming.

1.3 Common errors in PLC

The general PLC has self-diagnostic functions that can be detected in various errors. Common mistakes are as follows:

A did not end the instruction.

The B program is too long, causing the scan time to exceed the limit. (Such as small machines can not exceed 130ms)

c Do not reuse the same coil, the same number of timer, counter.

D Jump Directive (JMP and JME) use too much or no pair. (Such as small machine restrictions should not exceed 8 times)

The E set address exceeds the address range allowed by the program.

f Use certain instructions to exceed the specified limits.

G Some instructions are not properly used for "software" or "hardware" inside the PLC. (, Such as: Coil instructions are not available for input relays, only for output relays, etc.)

2 programming technology

2.1 Timer programming method

The delay time of the timer is determined by the set value. Once the timer satisfies the condition start timing, start from the set value, automatically reduces by 0.1s or 0.01s, and independent of the program execution. When the timer setting value is reduced to zero, its delay contact action is operated. Since the timer is not related to the program execution after the timing condition is fixed, if the programming is not programmed, it will generate a malfunction. As shown in Fig. 3 (g), it is not programmed for timer trapezinal. In addition to any point time period in A, B, and C, the counter can count normally, but if the timer is at any timer action in A, B, and C, the counter does not count, generates a false count. Figure 3 (h) is the correct programming method of the timer, and the timer does not have a false count. It can be seen that the timer is programmed to consider the programming purpose when programming. 2.2 Instructions Implementation Methods for Reducing the Number of Input Points

From Figure 3 (j), in the first time the button (SB) is pressed, the input relay 0000 normally open contact is temporarily closed, and the secondary pulse instruction DIFU is turned on, the secondary relay 1100 is turned on, one pair The normally open contact is turned on the output contact 100, and the normally open contact of 0500 closed the 0500 self-locking, and the external device is started. At the same time, another pair of normally open contacts at 0500 is closed, and the 1000 is turned on. When the button (SB) is pressed the second time, the ring circuit of 1100 is turned on, and the normally closed contact of 1000, the normally closed contact of 1000 is turned off, and the external device is stopped. When the button (SB) is pressed, the external device starts running. When the button (SB) is pressed, the external device stops working. So on and so forth. It can be seen that start / stop sharing a button (SB) can use a PLC input point.

2.3 Signal filtering method

Sports equipment or sensors, generally stroke, left and right, regardless of the sensor is a contact mechanical switch, or a contactless switch, there is a jitter during operation, which generates a pulse waveform when it is opened This will count. Therefore, signal filtering must be performed. Its method is to see Figure 3 (k) two time relays in the ladder diagram. The first time relay delay time t1 = 100 ms, it specifically filters the jitter wave and tip pulse interference signal front edge of the useful signal; the second time relay is used to eliminate the use of the useful signal back along the shake wave, its delay time T2 = 2s . Here, T1, T2 is long, determined to the type and moving speed of the sensor used. This method is to prevent jitter of the signal front and rear, and filter out of the tip pulse interference through the signal line.

3 Conclusion

The program of the PLC must be correct and must be verified by actual work. It is worth noting that the same instruction, due to the difference in the factory batch of the PLC, some details may not be exactly the same, it should be clear. Then, some instructions can be performed once, but they can't repeated multiple times. Some instructions can be performed in subroutine and may not be the same as the main program. These details must be clarified, and it is easy to make mistakes. It is also important to use the internal device. If there is a power-down protection, some don't. Be sure to use the power-down protection device, it cannot be used. The timer, the number front of the counter (randomized and different), and the PLC is less than the interrupt timing of the interrupts, which can be used for the precision. If you use an exact timer, it is not an interrupt timer that will not be guaranteed by the time.

转载请注明原文地址:https://www.9cbs.com/read-7795.html

New Post(0)