Analysis of several problems that may occur during the use of PLC

Publisher:真诚相伴Latest update time:2024-03-19 Source: elecfansKeywords:PLC Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

As the core of the industrial field, PLC is widely used in many products. In-depth understanding of the use and solution knowledge will greatly promote the promotion and service improvement of PLC. This article selects ladder diagram as the programming language in terms of hardware and software. This article selects several problems that are prone to occur during the use of PLC and analyzes the solutions.


The control mode of PLC belongs to stored program control. Its control function is realized by the program stored in the memory. If the control function needs to be modified, it is only necessary to change the control program, which realizes the software control. The advantage of programmable controller lies in the word "can". From the software point of view, its control program can be edited and modified; from the hardware point of view, its external device configuration is variable. The focus of building a PLC control system is the compilation of the control program, but the selection of external devices will also affect the compilation of the program. Therefore, when designing the program, it should be combined with actual needs, and hardware and software should be considered comprehensively.

d622e686-5f95-11ee-939d-92fbcf53809c.jpg

1. Selection of external input devices and use of PLC input relays

1. Collection of external input signals

The external devices of PLC mainly refer to the input and output devices in the control system, among which the input devices are the main electrical appliances that send various control signals to the system. When writing the control program, you must pay attention to whether the external input device uses normally open or normally closed contacts, and compile the program based on this. Otherwise, control errors are likely to occur.

There is an input relay area dedicated to input status storage in the PLC's internal memory. The status of each input device (switch, button, travel switch or sensor signal) is stored in this area via the input interface circuit. Each input relay can store an input device status. The "relay" used in the PLC is not a physical relay, but a "soft relay", which can provide countless normally open and normally closed contacts for programming. Each "soft relay" corresponds only to one bit in the PLC storage unit. If the bit state is "1", it means that the "soft relay coil" is energized, and all the contacts of the relay in the program are activated. As a device for the PLC to receive external master command signals, the input relay is connected to the external input device through wiring, and its "coil" state can only be driven by external input signals.

The input device is the normally closed contact of button SB0, and the coil state of input relay X0 depends on the state of SB0. When the button is not pressed, the coil state of input relay X0 is "1" (power-on state), and all X0 contacts in the program are activated, that is, the normally open contact is connected and the normally closed contact is disconnected; if the button is pressed, the coil state of input relay X0 is "0" (power-off state), and all X0 contacts in the program return to normal. If the input device connected to the input relay is the normally open contact of button SB0, the situation is exactly the opposite: when the button is not pressed, the coil state of input relay X0 is "0" (power-off state), and all X0 contacts in the program do not act; if the button is pressed, the coil state of input relay X0 is "1" (power-on state), and all X0 contacts in the program act.

2. The parking button uses a normally closed type

Since the PLC only determines the on/off status of the contacts in its memory when running the program, and does not directly identify the external device, the selection of external devices is closely related to the contact type in the program when programming. This is a problem that is easy to occur when programming PLCs in accordance with the electrical control schematic diagram. The most typical example is the parking control in the basic control - "start, stop and protect control".

In the start-stop-protection control system, button SB0 is used for parking control, so its normally closed contact is connected in series with the control circuit. SB1 is the start button, and its normally open contact is used. If the same device is used (i.e., SB0 for parking uses a normally closed contact, and SB1 for starting uses a normally open contact), and a PLC is used for this control, a ladder diagram program needs to be programmed.

3. The parking button should be normally open.

If you want to compile a ladder diagram program that conforms to our usual reading habits), when selecting an external parking device, you need to connect the normally open contact of button SB0 to X0.

The contact type used for the stop signal X0 in the program is different, and the reason is that the contact type of the external stop button connected to the input relay X0 is different. The ladder diagram program shown in Figure 4 is more in line with our reading habits and is easier to analyze its logical control function. Therefore, in the PLC control system, external switches and buttons are generally normally open, whether used for starting or stopping. This is a problem that needs special attention when using PLC.

2. PLC "serial" operation mode and control program compilation

One of the important differences between PLC and relay contactor control is the different working methods. The relay contactor control system works in a "parallel" mode, that is, it works in a simultaneous execution mode. As long as a current path is formed, several electrical appliances may operate at the same time. PLC works in a "serial" mode. When PLC executes the program in a loop, it performs logical operations from top to bottom in the order in which the statements are written, and the results of the previous logical operations will affect the results of the logical operations of the following statements. Therefore, when programming ladder diagrams, the position of each statement will also have a key impact on the control function. For example: X0 is connected 3 times, Y3 is connected, X0 is connected again once, and Y3 is disconnected. X0 is connected 3 times, and Y3 is disconnected the moment it is connected.

In the above two programs, the logical conditions before output Y3, counter CTl02 and internal general relay R0 are the same, only the position of the statement where counter CTl02 is located has changed, and the running results of the two programs are completely different. This is because the way CTl02 affects output Y3 has changed. When executing the first program, the state of output Y3 will be judged first, and then the state of CTl02 will be judged. The state change of CTl02 can only affect Y3 in the next scan cycle; when executing the second program, the state of CTl02 will be judged first, and then the state of output Y3 will be judged. The state change of CTl02 will directly affect the state of Y3 in this scan cycle.

From the above discussion, it can be concluded that since PLC adopts "serial" working mode, even if it is the same component, its working state will be different if it is in a different position in the ladder diagram. Therefore, when using the ladder diagram to compile the control program, the control task should be fully analyzed and the position of each programming component should be reasonably arranged to achieve more accurate control.

3. PLC programming elements

The various functions of PLC are mainly realized by running the control program. When compiling a program, it is necessary to use the programming elements (i.e. soft elements) provided by the PLC reasonably. There are two commonly used programming elements in FPO type PLC: bit elements (bit) and word elements (word). The bit element is actually a binary bit unit provided by the PLC memory area, also known as a soft relay, which is mainly used as a programming element for basic sequential instructions, such as input relay Xn, output relay Yn, internal general relay Rn, timer (counter), etc. The way it participates in control is mainly to change the on and off state of the corresponding contact to affect the logical operation result, that is, the output.

A word element is a word unit (16 bits) in the PLC memory area, which is mainly used as a programming element for functional instructions and advanced instructions, and is usually used to store data, such as data register DTn, timer (counter) setting value SVn, elapsed value EVn, etc. Word elements have no contacts and usually participate in control with their overall content.

It is worth noting that each bit in the input (X) area, output (Y) area and internal general (R) area in the memory can be used as a bit element, and every 16 bits can constitute a word element. For example, WRIO is a word element composed of 16 bit elements R100~R10F. Once the content in the word element changes, the status of these 16 bits will also change. WR0 is the word element, which is the programming element of the left shift instruction SR, and Y0 is the coil of the output soft relay. X0, X1, X2, and X3 are the contacts of the input soft relay. Among them, the R4 contact in step 4 is the normally open contact of the bit element R4, and the bit element R4 is a bit in the word element WR0, so its state is limited by the shift result of WR0.

4. Programming method of sequential control with multiple steps and same output

Sequential control is a common type of control task in production sites, and step instructions are dedicated to sequential control in the PLC instruction library. When programming step instructions, the program is divided into independent program segments according to the process flow. When executing, the CPU strictly follows the ladder diagram programming sequence. The next program segment can only be activated after the previous program segment is executed, and the previous program segment is reset before the next program segment is executed. In addition, the output used in each program segment is not allowed to be repeated in terms of syntax. This brings certain difficulties when solving the situation where there are multiple steps with the same output in the sequential control task. This problem can be easily solved with the help of internal general relays.

[1] [2]
Keywords:PLC Reference address:Analysis of several problems that may occur during the use of PLC

Previous article:PLC outputs random numbers between 0 and 100
Next article:Steps to create SCL function blocks in Siemens TIA Portal

Recommended ReadingLatest update time:2024-11-16 09:36

Introduction to Graph Programming of PLC Sequential Control Method
1. Continuation As mentioned above, there are three common methods of sequential control, namely SCL instruction case...of, Siemens' own Graph, and sequential control by transmitting step numbers. Today we will introduce the second common method of sequential control, Graph programming. 1.1 Case Overview
[Embedded]
Introduction to Graph Programming of PLC Sequential Control Method
Learn about PLC programming algorithms in one article
PLC programming algorithm (1) There are only three quantities in PLC: switch quantity, analog quantity and pulse quantity. As long as you understand the relationship between the three, you can master PLC skillfully. 1. Switch quantity is also called logic quantity, which means it has only two values, 0 or
[Embedded]
Design of automatic batching control system based on PLC
introduction With the development of economy and the progress of science and technology, the application of automatic control system in industrial production is becoming more and more extensive. The automatic control system based on Siemens PLC has achieved great development and application. By using PLC contro
[Embedded]
Design of automatic batching control system based on PLC
SIMATIC S7-1500 PLC communication and its application - PROFIBUS structure and type
PROFIBUS Communication Overview PROFIBUS is Siemens' fieldbus communication protocol and one of the fieldbus standards in the IEC61158 international standard. The fieldbus PROFIBUS meets the important requirement of field-level data accessibility in the production process. On the one hand, it covers the communi
[Embedded]
SIMATIC S7-1500 PLC communication and its application - PROFIBUS structure and type
PLC field example electrical schematic diagram explanation
Reduced Voltage Starting Control of Three-phase Asynchronous Motor 1. Y-△ step-down starting control of three-phase asynchronous motor The relay contactor control of the Y-△ step-down starting of the three-phase asynchronous motor is transformed into a PLC control system. (1) Determine the I/O signal
[Embedded]
PLC field example electrical schematic diagram explanation
Wiring method between sensor and PLC controller
"We bring you the wiring method of sensors and PLCs, 20 wiring diagrams, isn't it super rich? Come and take a look! 1. Overview01 The digital input interface of PLC is not complicated. In order to improve the anti-interference ability, the input interface of PLC uses photocouplers to isolate the inpu
[Embedded]
Wiring method between sensor and PLC controller
PLC troubleshooting flow chart share power failure check operation failure check input and output failure check
1. General inspection According to the overall inspection flowchart, find out the general direction of the fault point, and gradually refine it to find the specific fault, as shown in the figure below. 2 Power supply Fault check If the power light is off, you need to check the power supp
[Embedded]
PLC troubleshooting flow chart share power failure check operation failure check input and output failure check
What is the function of PLC interrupt?
PLC understands the interrupt function in this way. When understanding the interrupt, we must first understand the PLC operation cycle or scan cycle. It is necessary to talk about the process of PLC sequential control cycle execution. This is the premise for understanding the interrupt and must be mastered. It is di
[Embedded]
What is the function of PLC interrupt?
Latest Embedded 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号