Method and device for industrial field reproduction of PLC
By obtaining the interrupt event records and hardware monitoring records of the PLC, querying the associated monitoring values and visually reproducing them in the development program screen, the problem of low fault diagnosis efficiency of PLC is solved, and the cause of hardware abnormality is quickly positioned, and the fault diagnosis efficiency is improved.
Patent Information
- Application Number
- CN202411769265.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2044-12-04
AI Technical Summary
In the prior art, the fault diagnosis efficiency of PLC is not high, and it is difficult to quickly locate the hardware reasons that cause PLC operation abnormalities in industrial sites.
By obtaining the persistent interrupt event records and hardware monitoring records stored in the PLC, query the associated monitoring values of the target interrupt event, and visually reproduce the target hardware variables in the program content screen of the development program to visualize the cause of potential abnormalities.
It improves the fault diagnosis efficiency of PLC in industrial sites, can quickly locate the hardware causes that cause PLC work abnormalities, and reduces the time and cost of troubleshooting.
Smart Images

Figure CN119225273B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to industrial automation technology, and in particular to a method for industrial field reproduction of PLC, a device for industrial field reproduction of PLC, an electronic device, a non-transitory computer-readable storage medium, and a computer program product. Background Art
[0002] PLC (Programmable Logic Controller) is an industrial automation control device, and PLC can be applied to various industrial automation control requirements based on the development program. Among them, various hardware variables in the industrial field can be defined in the PLC development program, so that the PLC can use these variables as input variables, intermediate variables and output variables respectively, to realize industrial automation control in the industrial field.
[0003] If the PLC works abnormally, it is necessary to troubleshoot the hardware cause of the abnormal PLC work through fault diagnosis, for example, to determine whether the abnormal work is caused by the abnormal field hardware deployed in the industrial site, or by a program error (bug) in the development program of the PLC itself. Therefore, based on the fault diagnosis results, on-site maintenance can be implemented at the industrial site to eliminate abnormal factors.
[0004] However, the fault diagnosis efficiency in the prior art is not high. Therefore, how to improve the fault diagnosis efficiency of PLC in industrial sites has become a technical problem to be solved in the prior art. Summary of the invention
[0005] In an embodiment of the present application, a method for industrial site replication of PLC, a device for industrial site replication of PLC, an electronic device, a non-transitory computer-readable storage medium, and a computer program product are provided, which help to improve the fault diagnosis efficiency of PLC in industrial sites.
[0006] An embodiment of the present application provides a method for industrial field reproduction of a PLC, comprising:
[0007] Obtain interrupt event records and hardware monitoring records persistently stored in the PLC; wherein the interrupt event records include hardware interrupt events and corresponding event occurrence times generated by the PLC during field work based on the development program, the hardware interrupt events are triggered by hardware status in the industrial site, the PLC is configured to enable monitoring functions during field work based on the development program, the hardware monitoring records include historical monitoring values and corresponding historical monitoring times obtained by the PLC monitoring target hardware variables during field work based on the development program, and the target hardware variables include hardware variables in the industrial site;
[0008] Starting from the time when the target interrupt event occurs, performing a time reverse query on the historical monitoring times corresponding to the multiple historical monitoring values in the hardware monitoring record;
[0009] Based on the query result of the time reverse query, determine the associated monitoring value of the target interrupt event; wherein the target interrupt event is any hardware interrupt event in the interrupt event record, and the associated monitoring value includes a historical monitoring value in the hardware monitoring record that has an associated relationship with the target interrupt event, and the historical monitoring value that has the associated relationship with the target interrupt event includes the historical monitoring value monitored for the last time before the event occurrence time of the target interrupt event, so as to reflect whether the target hardware variable has an induced state for the target interrupt event;
[0010] Utilizing the associated monitoring value, the target hardware variable is visually reproduced at the screen element used to represent the target hardware variable in the program content screen of the development program; wherein the program content screen is used to visually present the hardware topological relationship in the industrial site, and the visual reproduction of the target hardware variable at the screen element is used to visualize the potential abnormal cause of the PLC's working abnormality at the hardware level.
[0011] In some examples, optionally, the method further includes: presenting event description information of the target interruption event and the program content screen displaying the associated monitoring value in the same interface window.
[0012] In some examples, optionally, presenting the event description information of the target interrupt event and the program content screen displaying the associated monitoring value in the same interface window includes: in response to a first human-computer interaction operation detected in the query interface window, visually presenting the event description information of all hardware interrupt events in the interrupt event record in the query interface window; in response to a second human-computer interaction operation detected in the query interface window, highlighting the event description information of the target interrupt event in the query interface window; in response to a third human-computer interaction operation detected in the query interface window, initiating a successful query of the associated monitoring value; in response to a successful query of the associated monitoring value, visually presenting the program content screen displaying the associated monitoring value in the query interface window.
[0013] In some examples, optionally, the query interface window includes an event drop-down menu, a start button, and a screen display area; the first human-computer interaction operation is used to expand the event drop-down menu, and the event drop-down menu is used to visually present event description information of all hardware interrupt events in the interrupt event record in the expanded state; the second human-computer interaction operation is used to select the target interrupt event in the event drop-down menu in the expanded state, and the event drop-down menu is restored to a collapsed state in response to the second human-computer interaction operation, and the event drop-down menu is also used to selectively visually present event description information of the target interrupt event in the collapsed state; the third human-computer interaction operation is a click operation on the start button; the program content screen that displays the associated monitoring value is visually presented in the screen display area.
[0014] In some examples, optionally, the use of the associated monitoring value to visually reproduce the target hardware variable at a screen element used to represent the target hardware variable in the program content screen of the development program includes: displaying a variable status identifier of the target hardware variable and at least one of the associated monitoring value at the screen element used to represent the target hardware variable in the program content screen; wherein the variable status identifier is determined based on a comparison result of the associated monitoring value and a preset variable reference calibration value, the variable reference calibration value is used to represent a normal variable value of the target hardware variable, and the variable status identifier is used to represent whether the associated monitoring value of the target hardware variable is normal during on-site work based on the development program.
[0015] In some examples, optionally, the variable state identifier of the target hardware variable and at least one of the associated monitoring values are displayed at the screen element in the program content screen used to represent the target hardware variable, including: displaying the variable state identifier of the target hardware variable at the screen element in the program content screen used to represent the target hardware variable; and displaying the associated monitoring value of the target hardware variable at the screen element in the program content screen used to represent the target hardware variable in response to a human-computer interaction operation occurring at the variable state identifier.
[0016] In some examples, optionally, the method further includes: visually reproducing the program content screen of the target hardware variable at the screen element of the target hardware variable, and visually presenting it in a query interface window; wherein the query interface window is independent of a programming interface window of the development program.
[0017] In some examples, optionally, the method also includes: obtaining program layout information of the development program; wherein the program layout information includes the layout position of the target hardware variable in the development program; based on the layout position of the target hardware variable in the development program, determining the screen element in the program content screen for representing the target hardware variable.
[0018] In some examples, optionally, the development program is a graphical program written in a graphical programming language, and the screen elements in the program content screen used to represent the target hardware variables include: graphical elements in the graphical program used to represent graphical nodes where the target hardware variables appear.
[0019] In some examples, optionally, the graphical programming language includes any one of a ladder diagram, a function block diagram, a sequential function flow chart, and a continuous function block.
[0020] In some examples, optionally, the development program is a textual program written in a textual programming language, and the screen elements in the program content screen used to represent the target hardware variables include: text characters of the program text in the textual program used to define the target hardware variables.
[0021] In some examples, optionally, the textual programming language includes an instruction list or a structured text.
[0022] Another embodiment of the present application provides a device for industrial field reproduction of PLC, including:
[0023] A data export module, used to obtain interrupt event records and hardware monitoring records persistently stored in the PLC; wherein the interrupt event records include hardware interrupt events generated by the PLC during field work based on the development program and the corresponding event occurrence time, the hardware interrupt event is triggered by the hardware status in the industrial site, the PLC is configured to enable the monitoring function during the field work based on the development program, the hardware monitoring record includes the historical monitoring value and the corresponding historical monitoring time obtained by the PLC monitoring the target hardware variable during the field work based on the development program, and the target hardware variable includes the hardware variable in the industrial site;
[0024] Data query module, used to:
[0025] Starting from the time when the target interrupt event occurs, performing a time reverse query on the historical monitoring times corresponding to the multiple historical monitoring values in the hardware monitoring record; and
[0026] Based on the query result of the time reverse query, determine the associated monitoring value of the target interrupt event; wherein the target interrupt event is any hardware interrupt event in the interrupt event record, and the associated monitoring value includes a historical monitoring value in the hardware monitoring record that has an associated relationship with the target interrupt event, and the historical monitoring value that has the associated relationship with the target interrupt event includes the historical monitoring value monitored for the last time before the event occurrence time of the target interrupt event, so as to reflect whether the target hardware variable has an induced state for the target interrupt event;
[0027] A virtual reproduction module is used to utilize the associated monitoring value to visually reproduce the target hardware variable at the screen element used to represent the target hardware variable in the program content screen of the development program; wherein the program content screen is used to visually present the hardware topological relationship in the industrial site, and the visual reproduction of the target hardware variable at the screen element is used to visualize the potential abnormal cause of the PLC's working abnormality at the hardware level.
[0028] In some examples, optionally, the virtual reproduction module is further used to: present the event description information of the target interruption event and the program content screen displaying the associated monitoring value in the same interface window.
[0029] In some examples, optionally, the virtual reproduction module is specifically configured to: in response to a first human-computer interaction operation detected in the query interface window, visually present in the query interface window the event description information of all hardware interrupt events in the interrupt event record; in response to a second human-computer interaction operation detected in the query interface window, highlight the event description information of the target interrupt event in the query interface window; in response to a third human-computer interaction operation detected in the query interface window, initiate a successful query of the associated monitoring value; in response to a successful query of the associated monitoring value, visually present in the query interface window the program content screen that displays the associated monitoring value.
[0030] In some examples, optionally, the virtual reproduction module is specifically configured to: display a variable status identifier of the target hardware variable and at least one of the associated monitoring values at a screen element in the program content screen used to represent the target hardware variable; wherein the variable status identifier is determined based on a comparison result of the associated monitoring value and a preset variable reference calibration value, the variable reference calibration value is used to represent a normal variable value of the target hardware variable, and the variable status identifier is used to represent whether the associated monitoring value of the target hardware variable is normal during on-site work based on the development program.
[0031] In some examples, optionally, the virtual reproduction module is specifically configured to: display the variable state identifier of the target hardware variable at the screen element used to represent the target hardware variable in the program content screen; and display the associated monitoring value of the target hardware variable at the screen element used to represent the target hardware variable in the program content screen in response to a human-computer interaction operation occurring at the variable state identifier.
[0032] In some examples, optionally, the virtual reproduction module is also used to: visually reproduce the program content screen of the target hardware variable at the screen element of the target hardware variable, and visually present it in a query interface window; wherein the query interface window is independent of the programming interface window of the development program.
[0033] In some examples, optionally, the virtual reproduction module is also used to: obtain program layout information of the development program; wherein the program layout information includes the layout position of the target hardware variable in the development program; based on the layout position of the target hardware variable in the development program, determine the screen element in the program content screen used to represent the target hardware variable.
[0034] Another embodiment of the present application provides an electronic device, including a processor, wherein the processor is used to execute the method described in the above embodiment.
[0035] Another embodiment of the present application provides a non-transitory computer-readable storage medium, which stores instructions. When the instructions are executed by a processor, the processor executes the method as described in the above embodiment.
[0036] Another embodiment of the present application provides a computer program product, including computer executable instructions, which implement the method described in the above embodiment when executed by a processor.
[0037] Based on the embodiments of the present application, the interrupt event records and hardware monitoring records persistently stored inside the PLC can be obtained, wherein among all the historical monitoring values of the target hardware variables in the hardware monitoring records, the historical monitoring values that are temporally correlated with the hardware interrupt event that caused the PLC to work abnormally can be queried, and the queried historical monitoring values can also be displayed in the program content screen of the PLC development program at the screen element used to characterize the target hardware variable, so that the historical monitoring values of the target hardware variable can be used to virtually reproduce the key hardware conditions of the PLC's industrial site when a hardware interrupt event occurs in the program content screen. Furthermore, based on the virtual reproduction method of displaying the historical monitoring values of the target hardware variables in combination with the hardware interrupt event, it is helpful to quickly locate the hardware causes that cause the PLC to work abnormally in the industrial site, so as to improve the fault diagnosis efficiency of the PLC's industrial site. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The following drawings are only used to illustrate and explain the present application, and do not limit the scope of the present application:
[0039] Figure 1 It is an exemplary flow chart of the method for industrial field reproduction of PLC in the embodiment of the present application;
[0040] Figure 2 It is a schematic diagram of a replication example of the method for industrial on-site replication of PLC in an embodiment of the present application;
[0041] Figure 3 It is a schematic diagram of an extended example of the reproduction of the method for industrial field reproduction of PLC in the embodiment of the present application;
[0042] Figure 4 An example schematic diagram of a query interface window provided for the method for industrial field reproduction of PLC in an embodiment of the present application;
[0043] Figure 5It is a schematic diagram of an exemplary structure of a device for industrial field reproduction of PLC in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In order to make the objectives, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below with reference to the accompanying drawings and examples.
[0045] For example, in the embodiments of the present application, the virtual reproduction of the industrial site can be realized by means of the monitoring function of the PLC on the hardware variables, the hardware interrupt function of the PLC, and the development software for writing the development program of the PLC. For example, the development software for writing the development program of the PLC can be IDE (Integrated Development Environment) software.
[0046] Exemplarily, in an embodiment of the present application, the PLC's monitoring function for hardware variables is usually performed during the debugging phase of the development program when the development software and the PLC are in a communication state. That is, during the on-site debugging phase of the development program, the PLC can monitor any hardware variables in the development program, and the monitoring values generated by the PLC through real-time monitoring during the debugging phase can be instantly transmitted to the development software (such as IDE software). Thus, by viewing the monitoring values presented in real time in the monitoring interface window of the development software, programmers can understand whether the development program is in line with the industrial automation control requirements of the industrial site where the PLC is located, so as to determine whether the development program needs to be further optimized.
[0047] Exemplarily, in an embodiment of the present application, the monitoring function of the PLC is also enabled during the field work period when the PLC is running based on the development program, and, unlike the field debugging stage in which the monitoring value is transmitted to the development software (such as IDE software) in real time, the monitoring value of the target hardware variable in the development program during the field work period of the PLC can be persistently stored inside the PLC, wherein the target hardware variable can include at least one hardware variable selected by program code definition or human-computer interaction configuration among all the hardware variables of the development program of the PLC. That is, the embodiment of the present application can configure the PLC to monitor the target hardware variables in the development program during the field work period based on the development software, and persistently store the monitoring value of the target hardware variable and the corresponding monitoring time. In this case, the hardware monitoring record can be persistently stored in the PLC, and the hardware monitoring record can include: the historical monitoring value obtained by the PLC monitoring the target hardware variable during the field work period based on the development program, and the corresponding historical monitoring time.
[0048]
[0049] For example, in the embodiment of the present application, referring to the hardware monitoring record shown in Table 1, the target hardware variable to be monitored in the development program may not be limited to one, and different target hardware variables may be distinguished by identification information such as variable definition. In Table 1, the historical monitoring value obtained by monitoring any target hardware variable and the corresponding historical monitoring time may be associated with the identification information (such as variable definition) of the target hardware variable and stored in the hardware monitoring record of persistent storage.
[0050] Exemplarily, in an embodiment of the present application, the PLC can enable corresponding functions in response to an interrupt event when running a development program. The interrupt of the PLC may include software interrupts and hardware interrupts, that is, the interrupt event may include software interrupt events and hardware interrupt events, the software interrupt may be triggered by a program interrupt condition defined by the development program (that is, the software interrupt event may include a program interrupt condition defined by the development program), and the hardware interrupt may be triggered by a target hardware state of the industrial site (that is, the hardware interrupt event may include a target hardware state of the industrial site), and the target hardware state that triggers the hardware interrupt may be related to a hardware abnormality of the industrial site.
[0051] Exemplarily, in an embodiment of the present application, the PLC may be configured to persistently store hardware interrupt events during field work based on the development software. That is, the PLC may persistently store interrupt event records, and the interrupt event records persistently stored in the PLC may include: hardware interrupt events generated by the PLC during field work based on the development program, and the corresponding event occurrence time.
[0052] Exemplarily, in the embodiments of the present application, please refer to the interrupt event record shown in Table 2. The hardware interrupt event may not be limited to one type. Different hardware interrupt events can be distinguished by using identification information such as event type, and the hardware interrupt event may include the default hardware interrupt event of the PLC and the custom hardware interrupt event defined by the development program.
[0053]
[0054] Exemplarily, the embodiment of the present application is based on the above-mentioned improvement. If the PLC has a working abnormality during field work, the interrupt event record and hardware monitoring record persistently stored inside the PLC can be obtained. Among them, the historical monitoring value of the target hardware variable recorded in the hardware monitoring record can only reflect the variable state of the target hardware variable during the working period in isolation, but cannot reflect whether the variable state of the target hardware variable is related to the working abnormality of the PLC; the hardware interrupt event in the interrupt event record can be used to infer the potential abnormal causes of the PLC's working abnormality, but these potential abnormal causes are limited to the hardware level and cannot accurately locate the specific hardware in the industrial environment.
[0055] Exemplarily, in an embodiment of the present application, by utilizing the time correlation between a hardware interrupt event and a historical monitoring value of a target hardware variable, potential abnormal causes related to the hardware interrupt event can be visualized at the hardware level corresponding to the target hardware variable, and the visualization of the potential abnormal causes at the hardware level can be visualized through development software (such as IDE software).
[0056] Exemplarily, in an embodiment of the present application, the development software (e.g., IDE software) may have a programming interface window, wherein the programming interface window may support the use of any programming language supported by the PLC, such as a graphical programming language or a textual programming language, to write a development program. For example, a graphical programming language may include a ladder diagram (Ladder Diagram, LD), a function block diagram (Function Block Diagram, FBD), or a sequential function chart (Sequential Function Chart, SFC), or a continuous function block (Continuous Function Block, CFC); a textual programming language may include an instruction list (Instruction List, IL), or a structured text (Structured Text, ST). Moreover, in the program content screen of the development program, the target hardware variables to be monitored may be presented in a graphic style such as a ladder diagram, a function block diagram, a sequential function chart, or a continuous function block, or the target hardware variables to be monitored may also be presented in a character style such as an instruction list or a structured text.
[0057] Exemplarily, in an embodiment of the present application, the program content screen of the development program can be used to visualize the hardware topology relationship in the industrial site, so as to realize the overall virtual presentation of the industrial site; and the historical monitoring value of the target hardware variable and the hardware interrupt event with time association can also be displayed at the screen element of the target hardware variable in the program content screen. Thus, the key hardware conditions when the hardware interrupt event occurs can be virtually reproduced in the virtually presented industrial environment. Furthermore, it can help to quickly locate the hardware causes of the abnormal operation of the PLC in the industrial site, so as to improve the fault diagnosis efficiency of the PLC in the industrial site.
[0058] Figure 1 This is an exemplary flow chart of the method for industrial field reproduction of PLC in the embodiment of the present application. Figure 1 In an embodiment of the present application, a method for industrial field reproduction of PLC may include:
[0059] S110: Obtain interrupt event records and hardware monitoring records persistently stored in the PLC; wherein, the interrupt event records include hardware interrupt events and corresponding event occurrence times generated by the PLC during field work based on the development program, and the hardware monitoring records include historical monitoring values and corresponding historical monitoring times obtained by the PLC during field work based on the development program when monitoring target hardware variables.
[0060] S130: Query the associated monitoring value of the target interrupt event in the hardware monitoring record; wherein the target interrupt event is any hardware interrupt event in the interrupt event record, and the associated monitoring value includes the historical monitoring value in the hardware monitoring record that has an associated relationship with the target interrupt event, and the associated relationship is determined based on the event occurrence time of the target interrupt event and the historical monitoring time of the associated monitoring finger.
[0061] Exemplarily, in an embodiment of the present application, the target interrupt event may include: among all hardware interrupt events of the development program of the PLC, at least one hardware interrupt event selected through program code definition or human-computer interaction configuration.
[0062] S150: Using the queried associated monitoring value, visually reproduce the target hardware variable at a screen element used to represent the target hardware variable in a program content screen of the development program.
[0063] Exemplarily, in an embodiment of the present application, S150 may specifically include: displaying at least one of a variable status identifier and an associated monitoring value of a target hardware variable at a screen element in a program content screen of a development program that is used to represent a target hardware variable; wherein the variable status identifier of any target hardware variable may be determined based on a comparison result of the associated monitoring value of the target hardware variable and a variable reference calibration value pre-set for the target hardware variable, the variable reference calibration value (e.g., a single value, a discrete multi-value, or a continuous value range) set for any target hardware variable is used to represent a normal variable value of the target hardware variable, and the variable status identifier of any target hardware variable may be used to represent whether the associated monitoring value of the target hardware variable is normal during field work based on the operation of the development program.
[0064] Exemplarily, in an embodiment of the present application, if S150's visualization reproduction of any target hardware variable includes displaying the variable state identifier and associated monitoring value of the target hardware variable, then the display of the variable state identifier and associated monitoring value may be asynchronous display or synchronous display.
[0065] Exemplarily, in an embodiment of the present application, if S150's visualization reproduction of any target hardware variable includes displaying a variable state identifier and an associated monitoring value of the target hardware variable, then S150 may specifically include: displaying the variable state identifier of the target hardware variable at a screen element in the program content screen that is used to represent any target hardware variable; in response to a human-computer interaction operation occurring at the variable state identifier of any target hardware variable, displaying the associated monitoring value of the target hardware variable at a screen element in the program content screen that is used to represent the target hardware variable, wherein the associated monitoring value of the target hardware variable may be displayed simultaneously adjacent to the variable state identifier of the target hardware variable, or the associated monitoring value of the target hardware variable may replace the variable state identifier of the target hardware variable and be displayed simultaneously at the screen element.
[0066] As can be seen from the above process, based on the method for industrial site reproduction of PLC in the embodiment of the present application, the interrupt event records and hardware monitoring records persistently stored inside the PLC can be obtained, wherein, among all the historical monitoring values of the target hardware variables in the hardware monitoring records, the historical monitoring values that are temporally correlated with the hardware interrupt event that caused the PLC working abnormality can be queried, and the queried historical monitoring values can also be displayed in the program content screen of the PLC development program at the screen elements used to represent the target hardware variables. Thus, the historical monitoring values of the target hardware variables can be used to virtually reproduce the key hardware conditions of the PLC's industrial site when a hardware interrupt event occurs in the program content screen.
[0067] Exemplarily, in an embodiment of the present application, if the development program is a graphical program written in a graphical programming language, the screen elements in the program content screen used to represent any target hardware variables may include: graphic elements in the graphical program used to represent the graphic nodes where the target hardware variables appear.
[0068] Figure 2 Schematic diagram of a method for industrial on-site reproduction of PLC in an embodiment of the present application. Figure 2 Taking the case where the development program is a graphical program written using a ladder diagram, and the visual reproduction of the target hardware variable in S150 includes the display of the associated monitoring value of the target hardware variable as an example, the graphic nodes of the graphical program in the program content screen may include state class components 211~213 and a multi-signal unit 220, and the target hardware variables may include component state variables for representing the component states of the state class components 211~213, and pin output variables for representing the output values of the signal pins of the multi-signal unit 220.
[0069] Exemplarily, in an embodiment of the present application, any one of the state-type elements 211 to 213 may include a switching component with two states, such as a relay or a lamp, and if the target hardware variable includes an element state variable for characterizing the element state of the state-type elements 211 to 213, then the element state of the state-type elements 211 to 213 may include closed and open, and the data type of the historical monitoring value characterizing the element state variable may be Boolean data, that is, the monitoring value of the element state variable may include True corresponding to one of closed and open, and False corresponding to the other of closed and open.
[0070] Exemplarily, in an embodiment of the present application, the multi-signal unit 220 may include a data processing unit such as a CTU (CollectTransfer Unit) having multiple signal pins, and if the target hardware variable includes a pin output variable for characterizing the output value of a signal pin (such as a count value pin CV) of the multi-signal unit 220, then the output value of the signal pin (such as the count value pin CV) of the multi-signal unit 220 can be a binary, decimal or hexadecimal quantized value, and the data type of the historical monitoring value characterizing the pin output variable can be a binary, decimal or hexadecimal quantized value.
[0071] Exemplarily, in the embodiments of the present application, the state class elements 211-213 can be considered as graphic nodes where the state variables of the elements appear, and the signal pins of the multi-signal unit 220 can be considered as graphic nodes where the pin output variables appear. Thus, the screen elements used to represent the target hardware variables in the program content screen (i.e., the graphic elements used to represent the graphic nodes where the target hardware variables appear in the graphic language) can include: graphic elements used to represent the graphic nodes where the state variables of the elements appear (i.e., the state class elements 211-213) in the ladder diagram, and / or graphic elements used to represent the graphic nodes where the pin output variables appear (i.e., the corresponding signal pins of the multi-signal element 220). Thus, for the target hardware variable representing the element state variable of the state class element 211~213, its associated monitoring value "True" or "False" that has a temporal correlation with the target interrupt event can be displayed in the ladder diagram at the graphic element of the graphic node (i.e., the state class element 211~213) where the element state variable appears; for the target hardware variable representing the pin output variable of the multi-signal unit 220, its associated monitoring value "231" that has a temporal correlation with the target interrupt event can be displayed in the ladder diagram at the graphic element of the graphic node (i.e., any signal pin of the multi-signal element 220) where the pin output variable appears.
[0072] Figure 3 This is a schematic diagram of an extended example of the method for industrial on-site reproduction of PLC in the embodiment of the present application. Figure 3 , taking the case where the development program is a graphical program written using a ladder diagram, and S150's visualization of the target hardware variable includes the display of the variable state identifier and the associated monitoring value of the target hardware variable as an example, the corresponding variable state identifier (for example, a character-type identifier of "normal" or "abnormal") can be displayed at the state class elements 211~213 and the signal pins of the multi-signal unit 220. In this case, if a human-computer interaction operation such as a click operation occurs on the variable state identifier (for example, a character-type identifier of "normal" or "abnormal") of any one of the state class elements 211~213, or any signal pin of the multi-signal unit 220, then the associated monitoring value of the corresponding target hardware variable can be displayed simultaneously with the variable state identifier of the target hardware variable adjacent to each other (for example, in the form of a dialog box).
[0073] Exemplarily, in the embodiment of the present application, similar to the ladder diagram, if the development program is a graphical program written using a function block diagram or a continuous function block, the target hardware variable can also include the component state variable of the state class component and the pin output variable of the signal pin of the multi-signal unit, and the screen element used to represent the target hardware variable in the program content screen (i.e., the graphic element used to represent the graphic node where the target hardware variable appears in the graphic language) can include: the graphic element used to represent the graphic node where the component state variable appears in the function block diagram or the continuous function block, and / or the graphic element used to represent the graphic node where the pin output variable appears. Thus, the associated monitoring value of the temporal association relationship between the component state variable and the target interrupt event can be displayed at the graphic element of the graphic node where the component state variable appears in the function block diagram or the continuous function block; the associated monitoring value of the temporal association relationship between the pin output variable and the target interrupt event can be displayed at the graphic element of the graphic node where the pin output variable appears in the function block diagram or the continuous function block.
[0074] Exemplarily, in an embodiment of the present application, if the development program is a graphical program written using a sequential function flow chart, then the specified hardware variables may also include component state variables of state-type components and pin output variables of signal pins of multi-signal units, and the graphic nodes where component state variables or pin output variables occur may include "steps" or "transfer conditions" or "actions" in the graphical program.
[0075] Exemplarily, in an embodiment of the present application, if the development program is a textual program written in a textual programming language such as an instruction table or structured text, then the screen elements used to characterize the target hardware variables in the program content screen may include: text characters of the program text used to define the target hardware variables in the textual program. In this case, the associated monitoring value of the target hardware variable and the target interrupt event that has a temporal association relationship can be displayed at the text characters of the program text that defines the target hardware variable in the textual program. Furthermore, based on the virtual reproduction method of displaying the historical monitoring values of the target hardware variables in combination with the hardware interrupt event, it is helpful to quickly locate the hardware causes of the abnormal operation of the PLC in the industrial site, so as to improve the fault diagnosis efficiency of the PLC in the industrial site.
[0076] Exemplarily, in an embodiment of the present application, at the historical monitoring moment that is the same as the event occurrence time of the hardware interrupt event, the historical monitoring value monitored for the target hardware variable may have been in a state after the hardware interrupt event actually occurred. Therefore, when performing a query, S130 can start from the event occurrence time of the target interrupt event, and perform a time-reverse query on the historical monitoring moments corresponding to multiple historical monitoring values recorded in the hardware monitoring record, and determine the associated monitoring value of the target interrupt event based on the query result of the time-reverse query. For example, the historical monitoring value corresponding to the historical monitoring moment before the event occurrence time of the target interrupt event and adjacent to the event occurrence time of the target interrupt event is determined as the associated monitoring value of the target interrupt event, that is, the historical monitoring value monitored for the last time before the event occurrence time of the target interrupt event is determined as the associated monitoring value of the target interrupt event, so as to ensure that the queried associated monitoring value can reflect the induced state of the target interrupt event.
[0077] Exemplarily, in an embodiment of the present application, a program content screen for visually reproducing the target hardware variable can be presented in a programming interface window of the development software (e.g., IDE software). If so, the visual reproduction of the target hardware variable using the associated monitoring value can occur in the programming interface window in the form of a floating icon at the screen element used to characterize the target hardware variable, but the floating icon will interfere with the human-computer interaction operation used to edit the development program in the programming interface window. Therefore, in an embodiment of the present application, it is preferred to set a query interface window independent of the programming interface window for the development software (e.g., IDE software), and the program content screen for displaying the associated monitoring value can be presented in the query interface window of the development software (e.g., IDE software). That is, the method for industrial field reproduction of PLC in the embodiment of the present application may also include: visually reproducing the program content screen of the target hardware variable at the screen element of the target hardware variable, and visually presenting it in the query interface window; wherein the query interface window is independent of the programming interface window of the development program.
[0078] Exemplarily, in an embodiment of the present application, the event description information of the target interruption event (such as the event type) can be presented in association with a program content screen that displays the associated monitoring values of the target interruption event. For example, the method for industrial site reproduction of PLC in an embodiment of the present application may also include: presenting the event description information of the target interruption event and the program content screen that displays the associated monitoring values of the target interruption event in the same interface window, and the above-mentioned query interface window can support the same-window presentation of the event description information of the target interruption event and the program content screen that displays the associated monitoring values of the target interruption event.
[0079] Exemplarily, the method for industrial on-site reproduction of PLC in the embodiment of the present application may also include:
[0080] In response to a first human-computer interaction operation detected in the query interface window, visually presenting event description information of all hardware interrupt events in the interrupt event record in the query interface window;
[0081] In response to a second human-computer interaction operation detected in the query interface window, highlighting event description information of the target interruption event in the query interface window;
[0082] In response to a third human-computer interaction operation detected in the query interface window, initiating a successful query of the associated monitoring value;
[0083] In response to a successful query of the associated monitoring value, a program content screen showing the associated monitoring value is visually presented in the query interface window.
[0084] Figure 4 This is a schematic diagram of an example of a query interface window provided by the method for industrial field reproduction of PLC in the embodiment of the present application. Figure 4 The query interface window may include an event drop-down menu 31, a start button 32, and a screen display area 33, and:
[0085] The first human-computer interaction operation may be used to expand the event drop-down menu 31, and the event drop-down menu 31 is used to visually present event description information (such as event type) of each hardware interrupt event in the interrupt event record in an expanded state;
[0086] The second human-computer interaction operation can be used to select a target interruption event in the event drop-down menu 31 in the expanded state. The event drop-down menu 31 can be restored to the collapsed state in response to the second human-computer interaction operation. Moreover, the event drop-down menu 31 can also be used to selectively visually present event description information (such as event type) of the target interruption event in the collapsed state in response to the second human-computer interaction operation.
[0087] The third human-computer interaction operation may be a click operation on the start button 32;
[0088] The program content screen showing the associated monitoring value of the target interrupt event may be visually presented in the screen display area 33 .
[0089] Exemplarily, in an embodiment of the present application, if a program content screen is presented in the query interface window, then, similar to mapping the window content of the programming interface window to the query interface window (e.g., screen display area 33), in this case, in order to ensure the consistency between the program content screen presented in the query interface window and the window content of the programming interface window, the method for industrial site reproduction of PLC in an embodiment of the present application may also include:
[0090] Acquire program layout information of the development program, that is, acquire program layout information determined by the development program in the programming interface window; wherein the program layout information includes the layout position of the target hardware variable in the development program, for example, if the development program is written using a ladder diagram, the program layout information may be graphic layout information of the ladder diagram, and for another example, if the development program is written using a structured text, the program layout information may be text layout information of the structured text;
[0091] Based on the layout position of the target hardware variable in the development program, the screen element used to represent the target hardware variable in the program content screen is determined, so that the target interrupt event can be located at the determined screen element in the program content screen for visual reproduction using the associated monitoring value.
[0092] Figure 5 This is an exemplary structural diagram of a device for industrial field reproduction of PLC in an embodiment of the present application. Figure 5 In an embodiment of the present application, a device for industrial field reproduction of PLC may include:
[0093] The data export module 510 is used to obtain the interrupt event records and hardware monitoring records persistently stored in the PLC; wherein the interrupt event records include the hardware interrupt events generated by the PLC during the field work period based on the development program and the corresponding event occurrence time, and the hardware monitoring records include the historical monitoring values and the corresponding historical monitoring time obtained by the PLC during the field work period based on the development program on monitoring the target hardware variables;
[0094] The data query module 530 is used to query the associated monitoring value of the target interrupt event in the hardware monitoring record; wherein the target interrupt event is any hardware interrupt event targeted in the interrupt event record, for example, the target interrupt event may include at least one hardware interrupt event selected through program code definition or human-computer interaction configuration from all hardware interrupt events of the development program of the PLC, the associated monitoring value includes a historical monitoring value in the hardware monitoring record that has an associated relationship with the target interrupt event, and the associated relationship is determined based on the event occurrence time of the target interrupt event and the historical monitoring time of the associated monitoring value;
[0095] The virtual reproduction module 550 is used to visually reproduce the target hardware variable at the screen element used to represent the target hardware variable in the program content screen of the development program by using the queried associated monitoring value.
[0096] Exemplarily, in an embodiment of the present application, the virtual reproduction module 550 can be specifically configured to: display at least one of the variable status identifier and the associated monitoring value of the target hardware variable at the screen element used to represent the target hardware variable in the program content screen of the development program; wherein, the variable status identifier of any target hardware variable can be determined based on the associated monitoring value of the target hardware variable and the comparison result of the variable reference calibration value pre-set for the target hardware variable, the variable reference calibration value set for any target hardware variable (for example, a single value, a discrete multi-value, or a continuous value range) is used to represent the normal variable value of the target hardware variable, and the variable status identifier of any target hardware variable can be used to represent whether the associated monitoring value of the target hardware variable is normal during the on-site work based on the development program.
[0097] Exemplarily, in an embodiment of the present application, if the virtual reproduction module 550's visual reproduction of any target hardware variable includes displaying the variable state identifier and associated monitoring value of the target hardware variable, then the display of the variable state identifier and associated monitoring value may be asynchronous display or synchronous display.
[0098] Exemplarily, in an embodiment of the present application, if the virtual reproduction module 550 includes displaying the variable state identifier and the associated monitoring value of the target hardware variable for visual reproduction of any target hardware variable, then the virtual reproduction module 550 may be specifically configured to: display the variable state identifier of the target hardware variable at a screen element in the program content screen that is used to represent any target hardware variable; and display the associated monitoring value of the target hardware variable at a screen element in the program content screen that is used to represent the target hardware variable in response to a human-computer interaction operation occurring at the variable state identifier of any target hardware variable, wherein the associated monitoring value of the target hardware variable may be displayed simultaneously adjacent to the variable state identifier of the target hardware variable, or the associated monitoring value of the target hardware variable may replace the variable state identifier of the target hardware variable and be displayed simultaneously at the screen element.
[0099] Based on the device for industrial site reproduction of PLC in the embodiment of the present application, the interrupt event record and hardware monitoring record persistently stored inside the PLC can be obtained, wherein among all the historical monitoring values of the target hardware variables in the hardware monitoring record, the historical monitoring value that is temporally associated with the hardware interrupt event that causes the abnormal operation of the PLC can be queried, and the queried historical monitoring value can also be displayed in the program content screen of the development program of the PLC at the screen element used to characterize the target hardware variable, so that the historical monitoring value of the target hardware variable can be used to virtually reproduce the key hardware status of the industrial site of the PLC when the hardware interrupt event occurs in the program content screen. Furthermore, based on the virtual reproduction method of displaying the historical monitoring value of the target hardware variable in combination with the hardware interrupt event, it is helpful to quickly locate the hardware cause of the abnormal operation of the PLC in the industrial site, so as to improve the fault diagnosis efficiency of the PLC industrial site.
[0100] Exemplarily, in an embodiment of the present application, at the historical monitoring moment that is the same as the event occurrence time of the hardware interrupt event, the historical monitoring value monitored for the target hardware variable may have been in a state after the hardware interrupt event actually occurred. Therefore, the data query module 530 can be specifically configured as follows: starting from the event occurrence time of the target interrupt event, the historical monitoring moments corresponding to multiple historical monitoring values recorded in the hardware monitoring record are queried in reverse time order, and the associated monitoring value of the target interrupt event is determined based on the query result of the reverse time order query. For example, the historical monitoring value corresponding to the historical monitoring moment before the event occurrence time of the target interrupt event and adjacent to the event occurrence time of the target interrupt event is determined as the associated monitoring value of the target interrupt event, that is, the historical monitoring value monitored for the last time before the event occurrence time of the target interrupt event is determined as the associated monitoring value of the target interrupt event, so as to ensure that the queried associated monitoring value can reflect the induced state of the target interrupt event.
[0101] Exemplarily, in an embodiment of the present application, a program content screen for visually reproducing the target hardware variable can be presented in a programming interface window of the development software (e.g., IDE software). If so, the visual reproduction of the target hardware variable using the associated monitoring value can occur in the programming interface window in the form of a floating icon at the screen element used to characterize the target hardware variable, but the floating icon will interfere with the human-computer interaction operation used to edit the development program in the programming interface window. Therefore, in an embodiment of the present application, it is preferred to set a query interface window independent of the programming interface window for the development software (e.g., IDE software), and the program content screen for visually reproducing the target hardware variable can be presented in the query interface window of the development software (e.g., IDE software). That is, the virtual reproduction module 550 can be specifically configured to: visualize the program content screen of the target hardware variable at the screen element of the target hardware variable, and visually present it in the query interface window; wherein the query interface window is independent of the programming interface window of the development program.
[0102] Exemplarily, in an embodiment of the present application, the event description information of the target interruption event (such as the event type) can be presented in association with a program content screen that displays the associated monitoring values of the target interruption event. For example, the virtual reproduction module 550 can also be used to: present the event description information of the target interruption event and the program content screen that displays the associated monitoring values of the target interruption event in the same interface window, and the above-mentioned query interface window can support the same-window presentation of the event description information of the target interruption event and the program content screen that displays the associated monitoring values of the target interruption event.
[0103] Specifically, the virtual reproduction module 550 can also be used for:
[0104] In response to a first human-computer interaction operation detected in the query interface window, visually presenting event description information of all hardware interrupt events in the interrupt event record in the query interface window;
[0105] In response to a second human-computer interaction operation detected in the query interface window, highlighting event description information of the target interruption event in the query interface window;
[0106] In response to a third human-computer interaction operation detected in the query interface window, initiating a successful query of the associated monitoring value;
[0107] In response to a successful query of the associated monitoring value, a program content screen showing the associated monitoring value is visually presented in the query interface window.
[0108] For example, the example structure of the query interface window supporting the first human-computer interaction operation, the second human-computer interaction operation and the third human-computer interaction operation can be found in Figure 4, I will not go into details here.
[0109] Exemplarily, in an embodiment of the present application, if a program content screen is presented in the query interface window, then, similar to mapping the window content of the programming interface window to the query interface window (e.g., the screen display area 33), in this case, in order to ensure the consistency between the program content screen presented in the query interface window and the window content of the programming interface window, the virtual reproduction module 550 can also be used to:
[0110] Acquiring program layout information of the development program, that is, acquiring program layout information determined by the development program in the programming interface window; wherein the program layout information includes the layout position of the target hardware variable in the development program, for example, if the development program is written using a ladder diagram, the program layout information may be graphic layout information of the ladder diagram, and for another example, if the development program is written using a structured text, the program layout information may be text layout information of the structured text; and,
[0111] Based on the layout position of the target hardware variable in the development program, the screen element used to represent the target hardware variable in the program content screen is determined, so that the target interrupt event can be located at the determined screen element in the program content screen for visual reproduction using the associated monitoring value.
[0112] Another embodiment of the present application provides an electronic device, such as a portable electronic device such as a notebook computer, including a processor, wherein the processor is used to execute the method described in the above embodiment.
[0113] Another embodiment of the present application provides a non-transitory computer-readable storage medium, which stores instructions. When the instructions are executed by a processor, the processor executes the method as described in the above embodiment.
[0114] Another embodiment of the present application provides a computer program product, including computer executable instructions, which implement the method described in the above embodiment when executed by a processor.
[0115] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for industrial field reproduction of PLC, characterized in that: include: Obtain interrupt event records and hardware monitoring records persistently stored in the PLC; wherein the interrupt event records include hardware interrupt events and corresponding event occurrence times generated by the PLC during field work based on the development program, the hardware interrupt events are triggered by hardware status in the industrial site, the PLC is configured to enable monitoring functions during field work based on the development program, the hardware monitoring records include historical monitoring values and corresponding historical monitoring times obtained by the PLC monitoring target hardware variables during field work based on the development program, and the target hardware variables include hardware variables in the industrial site; Starting from the time when the target interrupt event occurs, performing a time reverse query on the historical monitoring times corresponding to the multiple historical monitoring values in the hardware monitoring record; Based on the query result of the time reverse query, determine the associated monitoring value of the target interrupt event; wherein the target interrupt event includes any hardware interrupt event in the interrupt event record, and the associated monitoring value includes a historical monitoring value in the hardware monitoring record that has an associated relationship with the target interrupt event, and the historical monitoring value that has the associated relationship with the target interrupt event includes the historical monitoring value monitored for the last time before the event occurrence time of the target interrupt event, so as to reflect whether the target hardware variable has an induced state for the target interrupt event; Utilizing the associated monitoring value, the target hardware variable is visually reproduced at the screen element used to represent the target hardware variable in the program content screen of the development program; wherein the program content screen is used to visually present the hardware topological relationship in the industrial site, and the visual reproduction of the target hardware variable at the screen element is used to visualize the potential abnormal cause of the PLC's working abnormality at the hardware level.
2. The method according to claim 1, characterized in that The method further includes: presenting the event description information of the target interruption event and the program content screen showing the associated monitoring value in the same interface window.
3. The method according to claim 2, characterized in that The presenting the event description information of the target interrupt event and the program content screen showing the associated monitoring value in the same interface window includes: In response to a first human-computer interaction operation detected in the query interface window, visually presenting event description information of all hardware interrupt events in the interrupt event record in the query interface window; In response to a second human-computer interaction operation detected in the query interface window, highlighting event description information of the target interruption event in the query interface window; In response to a third human-computer interaction operation detected in the query interface window, initiating a successful query of the associated monitoring value; In response to a successful query of the associated monitoring value, the program content screen displaying the associated monitoring value is visually presented in the query interface window.
4. The method according to claim 1, characterized in that The step of visually reproducing the target hardware variable at a screen element representing the target hardware variable in a program content screen of the development program by using the associated monitoring value includes: At the screen element used to represent the target hardware variable in the program content screen, a variable status identifier of the target hardware variable and at least one of the associated monitoring values are displayed; wherein the variable status identifier is determined based on a comparison result of the associated monitoring value and a preset variable reference calibration value, the variable reference calibration value is used to represent a normal variable value of the target hardware variable, and the variable status identifier is used to represent whether the associated monitoring value of the target hardware variable is normal during on-site work based on the development program.
5. The method according to claim 4, characterized in that The displaying of at least one of the variable state identifier of the target hardware variable and the associated monitoring value at the screen element for representing the target hardware variable in the program content screen comprises: Displaying the variable status identifier of the target hardware variable at the screen element used to represent the target hardware variable in the program content screen; In response to a human-computer interaction operation occurring at the variable state identifier, the associated monitoring value of the target hardware variable is displayed at a screen element for representing the target hardware variable in the program content screen.
6. A device for industrial field reproduction of PLC, characterized in that: include: A data export module, used to obtain interrupt event records and hardware monitoring records persistently stored in the PLC; wherein the interrupt event records include hardware interrupt events generated by the PLC during field work based on the development program and the corresponding event occurrence time, the hardware interrupt event is triggered by the hardware status in the industrial site, the PLC is configured to enable the monitoring function during the field work based on the development program, the hardware monitoring record includes the historical monitoring value and the corresponding historical monitoring time obtained by the PLC monitoring the target hardware variable during the field work based on the development program, and the target hardware variable includes the hardware variable in the industrial site; Data query module, used to: Starting from the time when the target interrupt event occurs, performing a time reverse query on the historical monitoring times corresponding to the multiple historical monitoring values in the hardware monitoring record; Based on the query result of the time reverse query, determine the associated monitoring value of the target interrupt event; wherein the target interrupt event is any hardware interrupt event in the interrupt event record, and the associated monitoring value includes a historical monitoring value in the hardware monitoring record that has an associated relationship with the target interrupt event, and the historical monitoring value that has the associated relationship with the target interrupt event includes the historical monitoring value monitored for the last time before the event occurrence time of the target interrupt event, so as to reflect whether the target hardware variable has an induced state for the target interrupt event; A virtual reproduction module is used to utilize the associated monitoring value to visually reproduce the target hardware variable at the screen element used to represent the target hardware variable in the program content screen of the development program; wherein the program content screen is used to visually present the hardware topological relationship in the industrial site, and the visual reproduction of the target hardware variable at the screen element is used to visualize the potential abnormal cause of the PLC's working abnormality at the hardware level.
7. An electronic device, characterized in that: The method comprises a processor configured to execute the method as claimed in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium stores instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 5.
9. A computer program product, characterized in that The method comprises computer executable instructions which, when executed by a processor, implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Control system, method, program and information processing device
CN106062722A
Data display program, programmable display, and reproduction simulator for programmable display
CN114945880A
Debugging historical information reproduction method and device and storage medium
CN117573565A
Method for monitoring operation state of PLC (Programmable Logic Controller)
CN118131682A