1. Field of the Invention
The invention generally relates to debugging methods and, more particularly, to a method for debugging a programmable logic controller.
2. Description of Related Art
A programmable logic controller is a digital computer used in automation of industrial processes, such as control of machinery on factory assembly lines. The programmable logic controller is an example of a real time system since output results must be produced in response to input conditions within a limited time. While the fundamental concepts of programmable logic controller programming are common to all manufacturers, differences in input/output addressing, memory organization, and instruction sets mean that programmable logic controller programs are never perfectly interchangeable among different devices. Even within the same product line of a single manufacturer, different models may not be fully compatible.
The programs of the programmable logic controller are very complicated; input/output errors are difficult to locate and indentify, and debugging of them is equally laborious. When an element of an exterior input/output contact is activated, a corresponding figure of the program of the programmable logic controller is noted. The program of the programmable logic controller is also difficult to maintain because it has no module classification following compilation and most functions and relationships therein are hidden from the user.
What is needed, therefore, is a method for quickly and easily debugging a programmable logic controller.
A method for debugging a programmable logic controller is provided. In the present embodiment, the method includes setting up an invariant logic formula, which then checks a program. If the program satisfies the invariant logic, debugging is complete and the process returns to checking the program. If the program does not satisfy the invariant logic formula, program checking stops and a warning signal and position or timing of the error in the program are issued.
Advantages and novel features of the present method for debugging a programmable logic controller will become more apparent from the following detailed description of preferred embodiments when taken in conjunction with the accompanying drawings.
The components in the drawings are not necessarily drawn to scale, the emphasis instead being placed upon clearly of the principles of the present invention.
Corresponding reference characters indicate corresponding parts. The exemplifications set out herein illustrate at least one preferred embodiment of the present method for debugging a programmable logic controller, in one form, and such exemplifications are not to be construed as limiting the scope of the invention in any manner.
Referring to
In Step 1, an invariant logic formula is set up, according to the invariant rule, that is, the result of all the input signals after compilation equals the result of all the output signals. The invariant logic formula includes a series logic (AND) and a parallel logic (OR). Referring also to
The rule of the series logic satisfies the following formula:
(A&B)=C, wherein & is series logic (AND).
Setting up the series invariant logic formula satisfies the following formula:
(A&B)−C=0.
Referring to
(A|B)=C, wherein | is a parallel logic (OR).
Setting up the parallel invariant logic formula satisfies the following formula:
(A|B)−C=0.
In Step 2, a program is checked by the invariant logic formula. The program of the programmable logic controller is checked by the parallel invariant logic formula and series invariant logic formula.
In Step 3, if the program satisfies the invariant logic formula, debugging is complete and the process returns to the program checking step 2. In Step 4, if the program does not satisfy the invariant logic formula, program checking stops and a warning signal and position and timing of the program error are issued. Referring to
It should be noted that the method uses an invariant logic formula to monitor a program of the programmable logic controller and provides quick and easy location of an input/output signal error or logic program error therein.
(
(
(A001&TIMER2)−A002=0 (3), where I702 and A002 are normal close contacts. Because formulae (2) and (3) are interdependent, formula (2) operates simultaneously with formula (1). The invariant logic formula of the emergency stop module, after simplification, is:
(
Accordingly, hundreds of input/output signals of the program to be monitored have been simplified to a few tens of invariant logic formulae. Thus, the logic simplification step reduces the loading of the programmable logic controller.
Finally, it is to be understood that the above-described embodiments are intended to illustrate rather than limit the invention. Variations may be made to the embodiments without departing from the spirit of the invention as claimed. The above-described embodiments illustrate the scope of the invention but do not restrict the scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
200810300648.5 | Mar 2008 | CN | national |