Logical errors in PLC programming

Publisher:collectorsLatest update time:2022-09-19 Source: elecfans Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

When programming PLC programs, no matter you are a novice or an experienced programmer, you will make the following low-level mistakes. Because this error is non-grammatical, the error cannot be detected by programming software. Once this error occurs, it is sometimes difficult to find it yourself. It is not until the controlled device cannot run or stops at a certain position during debugging and operation that you realize there is a problem. Then you have to search and analyze the PLC program line by line, or execute the program line by line, which is time-consuming and labor-intensive.


So what exactly is it that makes us make such a stupid mistake?

The inherent thinking of relay electrical control is that when compiling a program, one or several input points use physical normally closed contacts (such as stop switches, travel limit switches). In the program, the relay electrical control method is still used, that is, normally closed contacts are still used as conduction conditions.


The following is an example of a simple start-stop and self-locking circuit:

278d0f7a-3732-11ed-ba43-dac502259ad0.jpg

The erroneous PLC program that cannot be run according to the above figure is as follows:

27a498f2-3732-11ed-ba43-dac502259ad0.jpg

After the PLC is powered on, the normally closed points X000 and X002 will be disconnected. That is, the logic value is "0" Y0 = (Y0 + X001) × X000 × X002. From the above digital logic expression, it can be seen that after pressing the start button SB1, the logic value of X001 is "1", and the logic value of Y0 will never change and is always "0". The reason is related to the internal input circuit of the PLC. The following is the equivalent circuit of the internal input of the PLC:

27b6c892-3732-11ed-ba43-dac502259ad0.jpg

The correct PLC program is as follows:

27d8a93a-3732-11ed-ba43-dac502259ad0.jpg

After the PLC is powered on, the normally open points X000 and X002 will be closed. That is, the logic value is "1" Y0=(Y0+X001)×X000×X002. As long as the start button SB1 is pressed, the logic value of X001 is "1" and the logic value of Y0 is "1". Release the start button SB1, the logic value of X001 is "0" but the logic value of Y0 is "1". The relationship between Y0 and X001 is "or", which ensures that the logic value of Y0 is always "1", that is, self-locking. Until the stop button is pressed or an overload occurs (FR0 action), the logic value of Y0 will become "0".


From the simple example above, we can see that novices may not understand that when the external input is normally closed, the logic value changes to "not" after passing through the PLC internal input circuit. And the inherent thinking of relay electrical control affects the old hands. Although this is a low-level error, it is also easy to occur during the program compilation process.


Reference address:Logical errors in PLC programming

Previous article:Motor load calculation method Operating power and acceleration power calculation
Next article:Mathematical function instructions of S7-200 PLC

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号