CN110908900A - Method and device for analyzing PLC program by applying key frame deduction method - Google Patents

Method and device for analyzing PLC program by applying key frame deduction method Download PDF

Info

Publication number
CN110908900A
CN110908900A CN201911093914.6A CN201911093914A CN110908900A CN 110908900 A CN110908900 A CN 110908900A CN 201911093914 A CN201911093914 A CN 201911093914A CN 110908900 A CN110908900 A CN 110908900A
Authority
CN
China
Prior art keywords
key
key frame
logic
plc program
deduction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911093914.6A
Other languages
Chinese (zh)
Inventor
赵斌
陈硕
沈世超
武猛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenhua Yuedian Zhuhai Port Coal Terminal Co Ltd
Original Assignee
Shenhua Yuedian Zhuhai Port Coal Terminal Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenhua Yuedian Zhuhai Port Coal Terminal Co Ltd filed Critical Shenhua Yuedian Zhuhai Port Coal Terminal Co Ltd
Priority to CN201911093914.6A priority Critical patent/CN110908900A/en
Publication of CN110908900A publication Critical patent/CN110908900A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs
    • G06F11/3608Software analysis for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation

Abstract

The invention discloses a method and a device for analyzing a PLC program by applying a key frame deduction method, belonging to the field of automatic programs and comprising the following steps: counting logic contents corresponding to various operation functions of the PLC program and registers corresponding to the logic contents in operation; selecting a plurality of registers as key registers, and taking the numerical values of the key registers before and after the logic content operation as key frames; deducing key frames generated by the running sequence and the running times of the logic contents; and judging whether the key frame is consistent with the data record in the operation record, and if so, judging that the deduction is correct. The invention can deduce the correct operation sequence and operation times of the logic content by setting whether the key frame and the deduction key frame are consistent with the data in the operation record, and can deduce the operation sequence and operation times of the logic content causing the error of the operation amount.

Description

Method and device for analyzing PLC program by applying key frame deduction method
Technical Field
The invention relates to the technical field of automation programs, in particular to a method and a device for analyzing a PLC program by applying a key frame deduction method.
Background
In the logistics industry, statistics on weight and quantity of transported goods is needed. In order to improve the statistical efficiency, a plurality of single devices are usually provided to synchronously transport and count the articles, and then the single devices transmit the workload to the production management system to generate and store the job record. After the PLC program is developed, a large number of tests are required, and the PLC program can be put into formal operation after errors are eliminated. The Chinese invention with publication number CN102566562A discloses a method for automatically testing a PLC program, which comprises the following steps: an input step: inputting a PLC program to be tested and test data aiming at the PLC program; and (3) syntax analysis: analyzing an input variable unit, an output variable unit and a logic operation structure from a tested PLC program; analyzing the variable values of the input and the variable values of the expected output from the test data; the testing steps are as follows: substituting the input variable value in the test data into an input variable unit, obtaining an actual output result through the logical operation structure operation, and putting the actual output result into an output variable unit; a comparison step: comparing the actual output result in the output variable unit with the variable value of the expected output, if the actual output result is the same as the variable value of the expected output, the tested program is correct; if not, the tested program makes an error; a display step: and displaying the test result. The patent only tests the PLC program, however, in the logistics industry, the data error is also caused by the operation sequence and the operation times of the logic content of the PLC program, and a method for solving the problem is needed.
Disclosure of Invention
The invention provides a method and a device for analyzing a PLC program by applying a key frame deduction method, which solve the problem of data errors caused by the fact that the running sequence and times of the logic content of the PLC program cannot be tested in the prior art.
The technical scheme of the invention is realized as follows:
a method for analyzing a PLC program by applying a key frame deduction method specifically comprises the following steps:
s1, counting the logic content corresponding to each operation function of the PLC program and the register corresponding to the logic content operation;
s2, selecting a plurality of registers as key registers, and using the values of the key registers before and after the logic content operation as key frames;
s3, deducing key frames generated by the running sequence and the running times of the logic content;
s4, judging whether the key frame in the step S3 is consistent with the data record in the operation record, if so, judging that the deduction is correct, otherwise, repeating the step S3.
The method specifically comprises the following steps of:
s1, counting the logic content corresponding to each operation function of the PLC program and the register corresponding to the logic content operation;
s2, selecting a plurality of registers as key registers, and using the values of the key registers before and after the logic content operation as key frames;
s3, if the workload data corresponding to a certain operation function of the PLC program is wrong, deducing the key frame generated by the logic content operation sequence and the operation times corresponding to the operation function;
and S4, judging whether the key frame in the step S3 is consistent with the data record in the job record, if so, judging that the deduction is correct, wherein the corresponding logic content running sequence and running times are the reasons of errors of the job data, otherwise, repeating the step S3.
As a preferred embodiment of the present invention, the method further comprises the following steps:
s5, the program logic is modified for the reason why the error occurred in the estimated workload data.
As a preferred embodiment of the present invention, the method further comprises the following steps:
and S6, deducing whether the key frames generated by the correct operation and the wrong operation of the logic content lead to errors of the workload data, if no errors exist, judging that the fault is eliminated, otherwise, repeating the step S5.
A PLC program analysis device by applying a key frame deduction method is provided, which realizes the PLC program analysis method by applying the key frame deduction method.
The invention has the beneficial effects that: by setting whether the key frame and the deduction key frame are consistent with the data in the job record, the running sequence and the running times of the correct logic contents can be deduced, and in addition, the running sequence and the running times of the logic contents causing the wrong workload can also be deduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flowchart of an embodiment of a method for PLC program analysis using keyframe derivation according to the present invention;
fig. 2 is a flowchart illustrating another embodiment of a PLC program analysis method using key frame deduction according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, the present invention provides a method for analyzing a PLC program by using a key frame deduction method, which specifically includes the following steps:
s1, counting the logic content corresponding to each operation function of the PLC program and the register corresponding to the logic content operation;
s2, selecting a plurality of registers as key registers, and using the values of the key registers before and after the logic content operation as key frames;
s3, deducing key frames generated by the running sequence and the running times of the logic content;
s4, judging whether the key frame in the step S3 is consistent with the data record in the operation record, if so, judging that the deduction is correct, otherwise, repeating the step S3.
Data records in the operation records have two conditions, one is correct data, and technicians can be helped to design better program logic and optimize a PLC program by deducing the running sequence and the running times of logic contents; and the other is error data, and bugs and problems existing in the PLC program are discovered by deducing the running sequence and the running times of the logic content. The second case will be described in detail below.
As shown in fig. 2, the present invention provides a method for analyzing a PLC program by using a key frame deduction method, which specifically includes the following steps:
s1, counting the logic content corresponding to each operation function of the PLC program and the register corresponding to the logic content operation;
s2, selecting a plurality of registers as key registers, and using the values of the key registers before and after the logic content operation as key frames;
s3, if the workload data corresponding to a certain operation function of the PLC program is wrong, deducing the key frame generated by the logic content operation sequence and the operation times corresponding to the operation function;
and S4, judging whether the key frame in the step S3 is consistent with the data record in the job record, if so, judging that the deduction is correct, wherein the corresponding logic content running sequence and running times are the reasons of errors of the job data, otherwise, repeating the step S3.
S5, the program logic is modified for the reason why the error occurred in the estimated workload data.
And S6, deducing whether the key frames generated by the correct operation and the wrong operation of the logic content lead to errors of the workload data, if no errors exist, judging that the fault is eliminated, otherwise, repeating the step S5.
The invention also discloses a device for analyzing the PLC program by applying the key frame deduction method, which realizes the method for analyzing the PLC program by applying the key frame deduction method.
The following are specific examples of the present invention.
And performing operation flow control by using a Rockwell 1756 series PLC, wherein the operation flow control comprises a flow operation amount counting function, displaying the single machine operation amount selected by the operation flow on a human-computer interaction interface (HMI for short), and sending the operation amount of the operation task to a production management system (MES for short) to generate and store an operation record when the operation is finished or the operation task is switched. In recent work, the data in the work records often have large deviation, and the workload in the last work task is suspected to be accumulated in the work data, so that the PLC program is analyzed by using a key frame deduction method, and the problems are found and solved.
The logic content of the 10 rows related to flow workload statistics in the PLC program is as follows (derived from the ladder diagram):
1)GEQ(BW_M,2)TON(TIMER[0],1000,0);
2)XIC(TIMER[0].DN)MOV(BW_M,BW_M1);
3)EQU(BW_M,0)TON(TIMER[1],1000,0);
4) XIC (TIMER [1]. DN) MOV (0, BW _ M1); the method comprises the following steps that 1/1-4 lines use two on-time delay Timers (TON) preset for 1 second to filter an input signal BW _ M, the communication data are prevented from being flashed due to single-machine communication interruption, and the data after signal filtering are stored into BW _ M1
5) XIC (BW _ Res _ Ord) ONS (ons.0) MOV (BW _ M, BW _ M2) MOV (0, HMI _ AT); the HMI display workload is cleared, when a display clear instruction is received, the current value of the BW _ M is stored into the BW _ M2, and meanwhile, the HMI _ AT is cleared
6)LES(BW_M1,BW_M3)ONS(ons.1)SUB(BW_M1,HMI_AT,BW_M2);
7) GRT (BW _ M1,0) SUB (BW _ M1, BW _ M2, HMI _ AT); assign value to HMI _ AT when BW _ M1 > 0, HMI _ AT BW _ M1 BW _ M2
8) MOV (BW _ M1, BW _ M3); the 6 th row and the 8 th row have the same function, BW _ M1 is stored into BW _ M3 in the 8 th row, and meanwhile, the next time the PLC scans the 6 th row, the PLC detects that BW _ M1 is smaller than BW _ M3, and the BW _ M2 is triggered to be BW _ M1-HMI AT, and the method is used for processing the phenomenon that HMI _ AT and MES _ AT are kept unchanged when the workload is cleared from the stand-alone side
9) XIC (Flow _ Sel _ BW) [ ONS (ons.2) MOV (0, Sel _ AT) MOV (HMI _ AT, Sel _ AT _ M), EQU (HMI _ AT,0) ONS (ons.3) SUB (0, Sel _ AT _ M), GEQ (HMI _ AT, Sel _ AT _ M) SUB (HMI _ AT, Sel _ AT _ M), Se _ AT _ M) ]; and the logic for calculating/Sel _ AT clears the Sel _ AT and stores the HMI _ AT current value into the Sel _ AT _ M when the single-machine clock pulse trigger is selected in the process, the Sel _ AT _ M is triggered by a single pulse when the HMI _ AT is equal to 0, the Sel _ AT is assigned when the Sel _ AT is equal to or more than 0, and the Sel _ AT is assigned when the Sel _ AT is equal to or more than 0
10) SUB (Sel _ AT, MES _ M, MES _ AT), XIO (MES _ Cinst) ONS (ons.4) MOV (Sel _ AT, MES _ M), EQU (Sel _ AT,0) MOV (0, MES _ M); a/MES _ AT calculation logic, MES _ AT equals Sel _ AT-MES _ M, wherein MES _ M is assigned to Sel _ AT when a clock trigger of the switching operation task instruction is received, and MES _ M is reset to zero when Sel _ AT equals 0
The 10 programs contain the following 4 inputs and 2 outputs:
BW _ M (input DINT): the operation accumulated quantity is collected from a single machine on site;
BW _ Res _ Ord (input boost): the operation accumulated amount display zero clearing instruction is sent by an operator from the HMI and can clear the operation amount displayed by the HMI, and meanwhile, the instruction is sent through Ethernet communication and the operation amount data source at the single machine side is cleared;
flow _ Sel _ BW (input BOOL): the operation flow selects a single machine, because different single machines can be selected for operation in different operation flows, when the corresponding single machine is selected in the operation flow, the BOOL amount is TRUE;
MES _ Cinst (input bol): an operation task switching instruction is sent out by an operator from the HMI, the data of the current operation task is sent to the MES to generate an operation record, the current operation task is ended, and the next operation task is started;
HMI _ AT (output DINT): the system is used for displaying the accumulated amount of the HMI operation in real time;
MES _ AT (output DINT): for sending to the MES to generate job records.
The BW _ Res _ Ord instruction may clear the HMI _ AT but the MES _ AT remains unchanged, whereas the MES _ Cinst instruction may clear the MES _ AT but the HMI _ AT remains unchanged. To realize this function, the program is realized by temporarily storing the data of three registers BW _ M2 and Sel _ AT _ M, MES _ M. When the selected Flow starts to operate, the Flow _ Sel _ BW value is constant to TRUE, the HMI _ AT current value is stored into Sel _ AT _ M only AT the beginning of the operation, namely, the initial value of the operation amount during the operation is recorded, and the HMI is prevented from displaying the operation amount and not clearing after the operation is finished last time. And when an MES _ Cinst instruction is received in the operation to switch the operation task, storing the current value of the Sel _ AT into an MES _ M, namely recording the initial value calculated by the MES _ AT of the new operation task after the operation task is switched.
When BW _ Res _ Ord instructions are received in the operation to clear the workload of HMI display, the situation is complicated, and in the first step, the current value of BW _ M is stored into BW _ M2 for recording the initial value calculated by HMI _ AT; secondly, resetting the HMI _ AT, which further causes the condition triggering in line 9, wherein Sel _ AT _ M is-Sel _ AT, which means that the subsequent MES _ AT value cannot be changed after the HMI _ AT is reset, so that the initial value calculated by Sel _ AT is adjusted to-Sel _ AT to compensate the cleared value; and thirdly, sending an instruction through Ethernet communication, and clearing the workload data source AT the single machine side, namely restarting the calculation of the BW _ M from 0, wherein the condition of the 6 th row triggers and the BW _ M2 is reset to zero so as to keep the HMI _ AT from changing due to the clearing of the BW _ M.
In order to find the source of the problem, BW _ Res _ Ord and MES _ Cinst operations are performed in different orders in one job to reproduce the problem and observe data changes in the reproduction process, which is reproduced as follows:
the operation starts, 1382 tons for the first operation, first, the first operation record generated by MES _ Cinst is 1382 tons (normal), then the second operation record generated by BW _ Res _ Ord is 298 tons, the second operation record generated by MES _ Cinst is 298 tons (normal), the third operation record generated without clearing is 101 tons (HMI displays the operation amount is 399 tons), and the third operation record generated by BW _ Res _ Ord, MES _ Cinst is 500 tons (abnormal, normal condition is 101 tons).
As can be seen from the problem reproduction, after the third round of operation is finished, the data cleared by BW _ Res _ Ord is accumulated into the operation record generated by MES _ Cinst, first BW _ Res _ Ord and then MES _ Cinst.
And then analyzing the value change condition of each register by using a key frame deduction method. The key frame deduction method is to select a key register, select the time before and after the change of the register value caused by the trigger of the program condition as a key frame to carry out deduction and analysis according to the change condition of the register value, and ignore the non-key data of the register value which continuously changes along with the time. And (3) deduction of the key frame, namely manually finishing the logic operation originally finished by the PLC in the table, comparing the conclusion of deduction with the actual situation, verifying whether deduction is correct or not, and judging the reason of the problem.
For the problem reproduction, nine registers of BW _ M, BW _ M1, BW _ M2, BW _ M3, HMI _ AT, Sel _ AT _ M, SEL _ AT and MES _ M, MES _ AT are selected as key registers, the time before and after the value of each program logic trigger key register is selected as a key frame, the key registers are analyzed by a key frame deduction method, and the results are as follows:
frame Description of the invention BW_M BW_M1 BW_M2 BW_M3 HMI_AT Sel_AT_M Sel_AT MES_M MES_AT
1 Initial value 0 0 0 0 0 0 0 0 0
2 1382 tons of work 1382 1382 0 1382 1382 0 1382 0 1382
3 MES_Cinst 1382 1382 0 1382 1382 0 1382 1382 0
4 BW_Res_Ord 1382 1382 1382 1382 0 -1382 1382 1382 0
5 BW _ M zeroing 0 1382 1382 1382 0 -1382 1382 1382 0
6 BW _ M return to zero 1 second later 0 0 1382 0 0 -1382 1382 1382 0
7 Next scanning period of PLC 0 0 0 0 0 -1382 1382 1382 0
8 298 tons of operation 298 298 0 298 298 -1382 1680 1382 298
9 MES_Cinst 298 298 0 298 298 -1382 1680 1680 0
10 Operation 101 ton 399 399 0 399 399 -1382 1781 1680 101
11 BW_Res_Ord 399 399 399 399 0 -1781 1781 1680 101
12 BW _ M zeroing 0 399 399 399 0 -1781 1781 1680 101
13 BW _ M return to zero 1 second later 0 0 399 0 0 -1781 1781 1680 101
14 Next scanning period of PLC 0 0 0 0 0 -1781 1781 1680 101
15 MES_Cinst 0 0 0 0 0 -1781 1781 1781 0
15 key frames are selected, wherein 1-7 frames are the 1 st round of operation, 8-9 are the 2 nd round of operation, and 10-15 are the 3 rd round of operation. Only the 1 st operation is described here: frame 1 is the initial value, all registers are 0, frame 2 is the case when BW _ M increases from 0 to 1382 along with the progress of the operation, as the time before MES _ Cinst changes, frame 3 is the time after MES _ Cinst changes and before BW _ Res _ Ord changes, frame 4 is the time after BW _ Res _ Ord changes, frame 5 is the time after single machine response BW _ Res _ Ord, BW _ M returns to zero, frame 6 is the time after BW _ M returns to zero for 1 second, the signal filtering function time is the time causing BW _ M1 to return to zero, frame 7 is the next scanning period of PLC, when BW _ M1 < BW _ M3 is detected, BW _ M2 returns to zero.
It can be seen from the table that, when the job task is switched, according to the program logic, no matter the job task is switched first and then cleared, the job task is switched without clearing, or the job task is switched after being cleared, the data of the job record generated by the MES _ AT should be normal, which is inconsistent with the actual situation when the problem is repeated, and after repeatedly checking that there is no problem in the deduction process, it is determined which condition of the deduction process is different from the actual operation.
After the observation frame 11 is cleared, the three frames 12-14 are all automatic logical operation processes of a program, wherein the BW _ M2 register value is changed from 0 to 399 and then restored to 0, and the value is increased 399 and then decreased 399. Firstly, guessing that the BW _ M2 is not increased 399 for some reason, and is directly reduced 399, the reverse thrust can only be that the BW _ M is already 0 when BW _ Res _ Ord, however, the situation shows that the PLC uses the MSG instruction to send the signal to the single machine from the Ethernet, the single machine receives the signal and carries out logic operation, and then the signal is returned to the PLC from the Ethernet through the MSG instruction, the process time is shorter than the scanning period of the PLC, the communication delay of the Ethernet is not counted, only two times of MSG instruction sending and receiving signals occupy at least two scanning periods of the PLC, and therefore, the guess is logically not successful. Second guess, perhaps for some reason, is that BW _ M2 decreased two times 399 in succession after increasing 399, is BW _ M0, BW _ M2 399 for 1 second between frame 12 and frame 13, if BW _ Res _ Ord was again set to BW _ M2 0 at this time, which means decreased 399 more than once? Key frame deduction is therefore performed again according to this assumption, with the results as follows:
frame Description of the invention BW_M BW_M1 BW_M2 BW_M3 HMI_AT Sel_AT_M Sel_AT MES_M MES_AT
1 Initial value 0 0 0 0 0 0 0 0 0
2 1382 tons of work 1382 1382 0 1382 1382 0 1382 0 1382
3 MES_Cinst 1382 1382 0 1382 1382 0 1382 1382 0
4 BW_Res_Ord 1382 1382 1382 1382 0 -1382 1382 1382 0
5 BW _ M zeroing 0 1382 1382 1382 0 -1382 1382 1382 0
6 BW _ M return to zero 1 second later 0 0 1382 0 0 -1382 1382 1382 0
7 Next scanning period of PLC 0 0 0 0 0 -1382 1382 1382 0
8 298 tons of operation 298 298 0 298 298 -1382 1680 1382 298
9 MES_Cinst 298 298 0 298 298 -1382 1680 1680 0
10 Operation 101 ton 399 399 0 399 399 -1382 1781 1680 101
11 BW_Res_Ord 399 399 399 399 0 -1781 1781 1680 101
12 BW _ M zeroing 0 399 399 399 0 -1781 1781 1680 101
13 BW _ Res _ Ord again within 1 second 0 399 0 399 399 -1781 2180 1680 500
14 BW _ M return to zero 1 second later 0 0 0 0 399 -1781 2180 1680 500
15 PLC Down-Scan period 0 0 -399 0 399 -1781 2180 1680 500
16 BW _ Res _ Ord again 0 0 0 0 0 -2180 2180 1680 500
17 MES_Cinst 0 0 0 0 0 -2180 2180 2180 0
The 1-12 frames are the same as the first key frame derivation and frame 13 is incremented by one BW _ Res _ Ord so that the data changes. It can be seen from the table that this case indeed results in BW _ M2 decreasing twice 399 after increasing 399 to-399, and when BW _ Res _ Ord (frame 13) again results in the already cleared HMI _ AT being restored to 399, requiring another BW _ Res _ Ord (frame 16) to be cleared to continue work after the data is completely stable. More critically, the value of MES _ AT has become 500 AT BW _ Res _ Ord of frame 13, which is consistent with the reality of problem recurrence. In contrast to the operator checking whether or not operations are repeated continuously during BW _ Res _ Ord and the MES _ AT is not cleared and requires additional operations, the answer is that MES _ AT was not cleared before, so that sometimes BW _ Res _ Ord is repeated continuously until MES _ AT shows 0 to save time, depending on the job practice. By integrating the keyframe deduction results and operator responses, it can be determined that the true cause of the problem is that continuous repetitive operations are performed at BW _ Res _ Ord, which triggers a bug and causes an operation record data error.
The real reason of the problem is found, and the problem is solved in the next step. This problem may require the operator to disable the consecutive iterations of BW _ Res _ Ord for resolution from a management perspective, but there may be other situations such as a double click effect on a single mouse click failure, and therefore still decide to modify the program logic, eliminating the problem from the root.
The source of the problem is simply that after a single machine responds to BW _ Res _ Ord, causing BW _ M to return to zero, BW _ M1 takes 1 second to return to zero due to the signal filtering function and triggers subsequent logic operations, if BW _ Res _ Ord again within this 1 second time, BW _ M2 will be mistaken for 0. In order to avoid error writing, the data source of the BW _ M2 in the logic of the row 5 in the original program during zero clearing can be modified from BW _ M to BW _ M1, that is, the value after signal filtering is used to assign the BW _ M2, so that if BW _ Res _ Ord is reset within 1 second, the value recorded by BW _ M2 is still the operation value before zero clearing, and if BW _ Res _ Ord is reset after 1 second, the logical operation caused by BW _ M zero clearing is completed, BW _ M2 is automatically cleared by the program, and the calculation result is not influenced even if 0 is written again, and the problem can be eliminated.
To ensure that the program logic can be modified to eliminate problems, it is proposed to deduce the new program again using key frame deduction, the results are as follows:
frame Description of the invention BW_M BW_M1 BW_M2 BW_M3 HMI_AT Sel_AT_M Sel_AT MES_M MES_AT
1 Initial value 0 0 0 0 0 0 0 0 0
2 1382 tons of work 1382 1382 0 1382 1382 0 1382 0 1382
3 MES_Cinst 1382 1382 0 1382 1382 0 1382 1382 0
4 BW_Res_Ord 1382 1382 1382 1382 0 -1382 1382 1382 0
5 BW _ M zeroing 0 1382 1382 1382 0 -1382 1382 1382 0
6 BW _ M return to zero 1 second later 0 0 1382 0 0 -1382 1382 1382 0
7 Next scanning period of PLC 0 0 0 0 0 -1382 1382 1382 0
8 298 tons of operation 298 298 0 298 298 -1382 1680 1382 298
9 MES_Cinst 298 298 0 298 298 -1382 1680 1680 0
10 Operation 101 ton 399 399 0 399 399 -1382 1781 1680 101
11 BW_Res_Ord 399 399 399 399 0 -1781 1781 1680 101
12 BW _ M zeroing 0 399 399 399 0 -1781 1781 1680 101
13 BW _ Res _ Ord again within 1 second 0 399 399 399 0 -1781 1781 1680 101
14 BW _ M return to zero 1 second later 0 0 399 0 0 -1781 1781 1680 101
15 PLC Down-Scan period 0 0 0 0 0 -1781 1781 1680 101
16 BW _ Res _ Ord again 0 0 0 0 0 -1781 1781 1680 101
17 MES_Cinst 0 0 0 0 0 -1781 1781 1781 0
From the results, after the program is modified, the original function is not affected, and the continuous and repeated BW _ Res _ Ord operation does not cause the data error of the operation record, so that the problem is eliminated.
The invention can deduce the correct operation sequence and operation times of the logic content by setting whether the key frame and the deduction key frame are consistent with the data in the operation record, and can deduce the operation sequence and operation times of the logic content causing the error of the operation amount.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (5)

1. A PLC program analysis method by applying a key frame deduction method is characterized by comprising the following steps:
s1, counting the logic content corresponding to each operation function of the PLC program and the register corresponding to the logic content operation;
s2, selecting a plurality of registers as key registers, and using the values of the key registers before and after the logic content operation as key frames;
s3, deducing key frames generated by the running sequence and the running times of the logic content;
s4, judging whether the key frame in the step S3 is consistent with the data record in the operation record, if so, judging that the deduction is correct, otherwise, repeating the step S3.
2. The method for PLC program analysis using key frame deduction according to claim 1, comprising the steps of:
s1, counting the logic content corresponding to each operation function of the PLC program and the register corresponding to the logic content operation;
s2, selecting a plurality of registers as key registers, and using the values of the key registers before and after the logic content operation as key frames;
s3, if the workload data corresponding to a certain operation function of the PLC program is wrong, deducing the key frame generated by the logic content operation sequence and the operation times corresponding to the operation function;
and S4, judging whether the key frame in the step S3 is consistent with the data record in the job record, if so, judging that the deduction is correct, wherein the corresponding logic content running sequence and running times are the reasons of errors of the job data, otherwise, repeating the step S3.
3. The method of claim 2, further comprising the steps of:
s5, the program logic is modified for the reason why the error occurred in the estimated workload data.
4. The method of claim 3, further comprising the steps of:
and S6, deducing whether the key frames generated by the correct operation and the wrong operation of the logic content lead to errors of the workload data, if no errors exist, judging that the fault is eliminated, otherwise, repeating the step S5.
5. An apparatus for performing PLC program analysis using a key frame deduction method, comprising the steps of implementing the PLC program analysis using a key frame deduction method according to any one of claims 1 to 4.
CN201911093914.6A 2019-11-11 2019-11-11 Method and device for analyzing PLC program by applying key frame deduction method Pending CN110908900A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911093914.6A CN110908900A (en) 2019-11-11 2019-11-11 Method and device for analyzing PLC program by applying key frame deduction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911093914.6A CN110908900A (en) 2019-11-11 2019-11-11 Method and device for analyzing PLC program by applying key frame deduction method

Publications (1)

Publication Number Publication Date
CN110908900A true CN110908900A (en) 2020-03-24

Family

ID=69817163

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911093914.6A Pending CN110908900A (en) 2019-11-11 2019-11-11 Method and device for analyzing PLC program by applying key frame deduction method

Country Status (1)

Country Link
CN (1) CN110908900A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101339532A (en) * 2007-07-06 2009-01-07 中国银联股份有限公司 Web application system automatized test method and apparatus
CN102541045A (en) * 2010-12-31 2012-07-04 镇江灵芯软件实验室有限公司 Method for automatically testing programmable logic controller program
CN103019930A (en) * 2012-11-15 2013-04-03 陈钢 Method for automatically testing programmed logic control (PLC) program containing time control
CN104484269A (en) * 2014-11-27 2015-04-01 北京广利核系统工程有限公司 Method for automatically generating testing script

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101339532A (en) * 2007-07-06 2009-01-07 中国银联股份有限公司 Web application system automatized test method and apparatus
CN102541045A (en) * 2010-12-31 2012-07-04 镇江灵芯软件实验室有限公司 Method for automatically testing programmable logic controller program
CN103019930A (en) * 2012-11-15 2013-04-03 陈钢 Method for automatically testing programmed logic control (PLC) program containing time control
CN104484269A (en) * 2014-11-27 2015-04-01 北京广利核系统工程有限公司 Method for automatically generating testing script

Similar Documents

Publication Publication Date Title
DE69919404T2 (en) ON-LINE TROUBLESHOOTING AND EXHAUST TRACKING SYSTEM AND METHOD
Korel et al. Test prioritization using system models
US10956291B2 (en) Method, computer apparatus, and user interface for performing automatic test upon storage devices
US3692989A (en) Computer diagnostic with inherent fail-safety
US20160292068A1 (en) Code coverage rate determination method and system
US8418149B2 (en) Differential comparison system and method
CN112395122B (en) Flash memory controller and method thereof
CN113176963B (en) PCIe fault self-repairing method, device, equipment and readable storage medium
KR101936240B1 (en) Preventive maintenance simulation system and method
CN110908900A (en) Method and device for analyzing PLC program by applying key frame deduction method
EP0048991A1 (en) Method and device for the treatment of interruption conditions during the operating sequence in microprogramme-controlled data-processing systems
EP3349082A1 (en) System and simulator for deactivatable simulation of installations or machines within programmable controllers
US8799608B1 (en) Techniques involving flaky path detection
CN111159051A (en) Deadlock detection method and device, electronic equipment and readable storage medium
JP2017224063A (en) Plant controller testing device and testing method
EP3958124A1 (en) Flight management system and method for reporting an intermitted error
US20220035332A1 (en) Information processing apparatus, method of controlling information processing apparatus, production system, method of manufacturing article, and recording medium
CN115080387A (en) Front-end visual debugging method, system, equipment and readable storage medium
CN111751640B (en) Remote controller MCU crystal oscillator detection method
CN110376977B (en) Method, system, device and storage medium for calculating cycle period
CN103365237A (en) Method and device for monitoring and recording component and variable in PLC (Programmable Logic Controller) system
CN110781079A (en) Data processing flow debugging method and device and electronic equipment
KR102307997B1 (en) Method of automating a test of PLC program and PLC server program
CN113094095B (en) Agile development progress determining method and device
JPH11119960A (en) Alarm-logging data display device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination