Recording medium, flow generation device, and flow generation method

By generating an event flow diagram and selecting the most relevant events based on log information for connection, the problem of complex variable dependencies in programmable logic controller (PLC) control program verification is solved, and the verification operation is simplified.

CN120569679BActive Publication Date: 2026-06-23MITSUBISHI ELECTRIC CORP

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
MITSUBISHI ELECTRIC CORP
Filing Date
2023-03-14
Publication Date
2026-06-23

AI Technical Summary

Technical Problem

Existing technologies for verifying programmable logic controller (PLC) control programs suffer from complex variable dependencies, leading to an excessive workload for verification.

Method used

The process generation device generates an event flowchart, selects the most relevant events based on log information to connect them, generates a process in which two or more events are connected in series, and eliminates unnecessary combinations of variables.

Benefits of technology

It reduces the burden of verification work related to the control program executed by the programmable controller and simplifies the user's verification process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120569679B_ABST
    Figure CN120569679B_ABST
Patent Text Reader

Abstract

The program causes a flow generation device (10) to function as a generation section (12). The generation section (12) generates a flow in which two or more events are connected in series by performing a connection operation in which, from events generated from variables other than a first variable, a second event having the highest degree of association with a first event generated from the first variable among a plurality of variables included in a control program is selected on the basis of log information and the second event is connected to the first event, repeatedly excluding the first event and events directly or indirectly connected to the first event from selection targets of a new second event after the first event generated from the initial variable among the plurality of variables is set as a first event, and setting the second event connected by the previous connection operation as the new first event.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a computer-readable recording medium storing a process generation program, a process generation apparatus, and a process generation method. Background Technology

[0002] In a Factory Automation (FA) field, various processing procedures are implemented by controlling instruments through a programmable logic controller (PLC). The control of instruments implemented by the PLC follows the rules specified in the control program executed by the PLC.

[0003] The control program sometimes serves as a verification tool to confirm whether the programmable controller has acted as expected by the user. In verifying the control program, the focus is on the relationships between the variables contained within it, investigating how specific phenomena affect the control process or identifying the causes of specific phenomena. Therefore, a technique for extracting the relationships between variables from the control program and its execution log has been proposed (for example, see Patent Document 1). Patent Document 1 describes a technique that extracts a group of variables with dependencies by parsing the source code of the control program, and then modifies the extracted dependencies based on the parsing results of the execution log.

[0004] Patent Document 1: Japanese Patent No. 6833129 Summary of the Invention

[0005] Regarding control programs containing a large number of variables, the number of other variables that depend on one variable can become enormous. Consequently, the number of variable groups extracted using the technology in Patent Document 1 also increases. As a result, even if the dependencies are corrected based on the analysis results of the execution log, the user may be presented with overly complex relationships between variables, potentially making verification tasks difficult. Therefore, there is room to reduce the burden of verification tasks related to control programs executed by programmable controllers.

[0006] The present invention was made in view of the above circumstances, and its purpose is to reduce the burden of verification work related to the control program executed by the programmable controller.

[0007] To achieve the above objectives, the process generation program of the present invention enables a computer to function as the following units: a log information acquisition unit that acquires log information indicating the shifts in the values ​​of multiple variables included in a control program used by a programmable controller to control an instrument; and a generation unit that generates a process in which two or more events are connected in series, and generates an event flow diagram representing the generated process. The process is generated by performing a connection operation after setting an initial event generated by an initial variable among multiple variables as the first event, setting a second event connected through the previous connection operation as the new first event, excluding the initial event and events directly or indirectly connected to the initial event from the selection of the new second event, and repeating the connection operation. The connection operation selects the second event with the highest correlation degree representing the degree of association with the first event generated by the first variable among multiple variables from events generated by the second variable that are different from the first variable, based on the log information, and connects the second event with the first event.

[0008] The effects of the invention

[0009] According to the present invention, the generation unit generates a flow in which two or more events are connected in series by excluding the initial event and events directly or indirectly connected to the initial event from the selection of new second events and repeating the connection operation. This avoids the appearance of a large combination of variables included in the control program within the flow. Therefore, it reduces the burden of verification work related to the control program executed by the programmable controller. Attached Figure Description

[0010] Figure 1 This is a diagram showing the relationship between the process generation device, PLC (Programmable Logic Controller), and instruments involved in Implementation Method 1.

[0011] Figure 2 This is a diagram illustrating an example of the control program involved in Implementation Method 1.

[0012] Figure 3 This is a diagram showing the hardware structure of the process generation apparatus according to Embodiment 1.

[0013] Figure 4 This is a diagram showing the functional structure of the process generation apparatus involved in Implementation Method 1.

[0014] Figure 5 This is a diagram illustrating an example of log information related to Implementation Method 1.

[0015] Figure 6 This is a flowchart illustrating the process generation process involved in Implementation Method 1.

[0016] Figure 7 This is a flowchart illustrating the preparation process involved in Implementation Method 1.

[0017] Figure 8 This is a diagram showing an example of representative values ​​and index values ​​calculated in the preparation process involved in Implementation Method 1.

[0018] Figure 9 This is a diagram illustrating an example of specifying an initial event according to Implementation Method 1.

[0019] Figure 10 The first figure shows a connection example of the events involved in Implementation 1.

[0020] Figure 11 This is the second diagram, which shows a connection example of the events involved in Implementation Method 1.

[0021] Figure 12 This is Figure 3, which shows a connection example of the events involved in Implementation 1.

[0022] Figure 13 This is a diagram illustrating an example of an event flow diagram displayed by the UI (User Interface) section according to Embodiment 1.

[0023] Figure 14 This is a diagram used to illustrate the exclusion of deviation values ​​involved in Implementation Method 2.

[0024] Figure 15 This is a diagram used to illustrate the clustering involved in Implementation Method 2.

[0025] Figure 16 This is a diagram illustrating an example of log information related to Implementation Method 3.

[0026] Figure 17 This is a diagram illustrating an example of the frequency of counting in the preparation process involved in Implementation 3. Detailed Implementation

[0027] Hereinafter, the process generation apparatus according to the embodiments of the present invention will be described in detail with reference to the accompanying drawings.

[0028] Implementation Method 1

[0029] like Figure 1As shown, the process generation device 10 in this embodiment is connected to the programmable logic controller (PLC) 21, serving as a management terminal used by the user to manage the PLC 21. Specifically, the process generation device 10 assists in debugging the user-executed control program 211 by generating a flow representing the relationships between multiple variables included in the control program 211 executed by the PLC 21. The process generation device 10 can be connected to the PLC 21 via a communication cable such as a USB (Universal Serial Bus) cable, or via a field network.

[0030] PLC 21 is a control device in the factory that controls instrument 22 by executing a pre-written control program 211. Figure 1 The diagram typically shows one instrument 22, but a PLC 21 can also be connected to multiple instruments 22 to control them. For example, the PLC 21 can receive signals from the instruments 22 indicating that the instruments 22, acting as sensors, have detected workpieces being transported on a belt conveyor. Based on the received signals, the PLC 21 sends operation commands to other instruments 22, which act as robots, to process the workpieces. The PLC 21 can be connected to the instruments 22 via signal lines that transmit voltage or current signals, or it can be connected via a field network.

[0031] The control program 211 is created by a user using the process generation device 10 as a management terminal and written to the PLC 21. For example, in... Figure 2 As illustrated in the simplified example, control program 211 is a sequential program described in ladder diagram language. The control processes specified in control program 211 are typically executed repeatedly by PLC 21 to perform the same operations on multiple workpieces.

[0032] like Figure 2 As shown, the control program 211 includes named input variables and named output variables. The names of the input variables are obtained by combining "X," representing the signal input to PLC 21, with a numerical value used to identify the input signal. The names of the output variables are obtained by combining "Y," representing the signal output from PLC 21 to instrument 22, with a numerical value used to identify the output signal. Figure 2In the example, the value of the output variable "Y1" is controlled corresponding to the input variable "X1", and the value of the output variable "Y2" is controlled corresponding to the input variable "X2". For example, the value of the input variable "X1" corresponds to the signal input from the instrument 22, which acts as a sensor, and the value of the output variable "Y1" corresponds to the signal output to the instrument 22, which acts as a robot. The values ​​of the variables are stored in the memory of the PLC 21 in the area corresponding to the name of the variable. The variables processed by the control program 211 are also called devices. As types of devices, there are bit devices that represent a 1-bit value corresponding to either the ON state or the OFF state, and word devices that represent the value of the word size.

[0033] In the verification operation of control program 211, it is necessary to explore the relationship between the events generated by the values ​​of variables and the events generated by the values ​​of other variables. While referring to the source code of control program 211 can reveal the relationships between variables, it is difficult to understand all the relationships shown in the complex source code. Furthermore, in post-maintenance operations, it is not necessary to explicitly define all relationships. Therefore, the process generation device 10, based on the history of variable values ​​during the execution of control program 211, estimates the process flow of the events with the strongest expected relationships based on the multiple events generated by the variables and provides this information to the user.

[0034] Here, the relationship between variables and events can be a causal relationship, a dependency relationship, or a subordinate relationship. It can also be a correlation, co-occurrence relationship, or intertwining relationship that is inferred to be related even if there is no relationship in the source code of control program 211.

[0035] The process generation apparatus 10 consists of hardware elements that function as a computer. Specifically, such as... Figure 3 As shown, the process generation apparatus 10 includes a processor 101, a main storage unit 102, an auxiliary storage unit 103, an input unit 104, an output unit 105, and a communication unit 106. The main storage unit 102, the auxiliary storage unit 103, the input unit 104, the output unit 105, and the communication unit 106 are all connected to the processor 101 via an internal bus 107.

[0036] The processor 101 includes a CPU (Central Processing Unit) or MPU (Micro Processing Unit) as a processing circuit. The processor 101 performs various functions and executes the processing described later by executing the program P1 stored in the auxiliary storage unit 103. The program P1 is equivalent to a so-called engineering design tool, and is an example of a process generation program that enables the process generation device 10 to function as described later.

[0037] The main storage unit 102 includes RAM (Random Access Memory). Program P1 is loaded into the main storage unit 102 from the secondary storage unit 103. Furthermore, the main storage unit 102 serves as the working area of ​​the processor 101.

[0038] The auxiliary storage unit 103 includes non-volatile memory such as EEPROM (Electrically Erasable Programmable Read-Only Memory) and HDD (Hard Disk Drive). In addition to program P1, the auxiliary storage unit 103 also stores various data used by the processor 101. The auxiliary storage unit 103 supplies data used by the processor 101 to the processor 101 according to the processor 101's instructions. Furthermore, the auxiliary storage unit 103 stores data supplied from the processor 101.

[0039] The input unit 104 includes input devices such as hardware switches, input keys, keyboards, and pointing devices. The input unit 104 acquires information input by the user and notifies the processor 101 of the acquired information.

[0040] The output unit 105 includes output devices such as LED (Light Emitting Diode), LCD (Liquid Crystal Display), and speakers. The output unit 105 displays various information to the user according to the instructions of the processor 101.

[0041] The communication unit 106 includes a communication interface circuit for communicating with external devices. The communication unit 106 receives signals from the outside and outputs the data represented by those signals to the processor 101. Additionally, the communication unit 106 transmits signals representing data output from the processor 101 to external devices.

[0042] Through the coordinated operation of the aforementioned hardware structure, the process generation device 10 performs various functions. Specifically, such as... Figure 4 As shown, the process generation apparatus 10 includes: a log information acquisition unit 11 that acquires log information representing the shift of values ​​of variables included in the control program 211; a generation unit 12 that generates a process of events generated by the variables based on the log information; an output unit 13 that outputs a data file 31 representing the generated process; and a UI unit 14 that functions as an interface with the user 41.

[0043] The log information acquisition unit 11 is mainly implemented by the communication unit 106. The log information acquisition unit 11 obtains data from the PLC 21. Figure 5 The log information shown in the example is received. Figure 5As shown, log information is a time-series collection of records that associates a date and time, the identifier of a variable used as an input or output variable, and an event that occurs at that date and time. Below, we will illustrate an example where variables recorded in the log information are all represented by a single bit value, and an event is a change in the variable's value from OFF to ON or vice versa. Furthermore, OFF corresponds to zero, and ON corresponds to 1.

[0044] The generation unit 12 is mainly implemented by the processor 101. The generation unit 12 generates a process that connects the events recorded in the log information, generates an event flow diagram representing the generated process, and outputs it to the output unit 13 and the UI unit 14.

[0045] The output unit 13 is mainly implemented by the cooperation of the processor 101 and the communication unit 106. The output target of the data file 31 output by the output unit 13 can be a recording medium such as a memory card that can be installed and removed from the process generation device 10, or a storage device connected via a field network or LAN (Local Area Network).

[0046] The UI unit 14 is mainly implemented through the coordinated operation of the input unit 104 and the output unit 105. The UI unit 14 obtains the information input by the user 41 and provides it to the generation unit 12, thereby enabling the generation unit 12 to generate a process based on the information. In addition, the UI unit 14 displays the event flow diagram generated by the generation unit 12 to the user 41.

[0047] Next, refer to Figures 6-13 The process generation process performed by the process generation device 10 is described in detail. Figure 6 The process generation process shown is equivalent to an example of a process generation method executed by the process generation device 10.

[0048] In the process generation process, the log information acquisition unit 11 acquires the control program 211 and log information from the PLC 21 (step S1). The control program 211 can be source code or an object program. The log information acquisition unit 11 is an example of a log information acquisition unit that acquires log information indicating the shifts in the values ​​of multiple variables included in the control program when the programmable controller executes the control program for controlling the instrument. Next, the generation unit 12 performs preparation processing for generating the process (step S2).

[0049] In the preparation process, such as Figure 7As shown, the generation unit 12 extracts the log of variables included in the control program 211 from the log information (step S21). Specifically, the generation unit 12 scans the control program 211, determines all input and output variables used in the control program 211, and extracts records related to the determined variables from the log information. If the log information only contains records related to the input and output variables used in the control program 211, step S21 can be omitted.

[0050] Next, the generation unit 12 calculates the time difference of the events generated by the two variables for all combinations of the two variables (step S22). Specifically, the generation unit 12 calculates the time difference in the log information for all combinations of the events of the input variable and the events of the output variable. For example, as Figure 8 As shown, considering the combination of the antecedent event of input variable X1 changing from OFF to ON and the subsequent events of all output variables Y1 to Y4, each output variable has 2 possible events, resulting in 8 possible combinations. If the input variables are also X1 to X4, then since each variable has 2 possible events, the total number of combinations is 64.

[0051] Return to Figure 7 After step S22, the generation unit 12 calculates the representative value of the calculated difference and the index value of the fluctuation for each combination of events (step S23). As described above, the processing specified in control program 211 is repeatedly executed. Therefore, since each event may occur repeatedly, the time difference is usually calculated multiple times for a specific combination of two events. For example, in Figure 5 In the log information, because the same event is generated repeatedly at a cycle of about 15 minutes, the combination of the event where the input variable X1 becomes ON and the subsequent event where the output variable Y1 becomes ON is recorded multiple times, and other combinations are also recorded multiple times.

[0052] Furthermore, a subsequent event can occur multiple times after a single preceding event. For example, after the input variable X1 becomes ON at 0:00:00, multiple events can occur where the output variable Y1 becomes ON, but only the difference between the preceding and most recent events needs to be calculated.

[0053] exist Figure 8 The example provides representative and index values ​​for the calculated differences for each combination. Here, the representative value is the average, and the index value representing the fluctuation is the standard deviation. However, this is not a limitation; the representative value can also be the median or the most frequent value, and the index value can also be a coefficient of variation.

[0054] Return to Figure 7 If step S23 ends, the processing performed by the process generation device 10 returns from the preparation process to the final processing. Figure 6 The process shown is the generation and processing. For example... Figure 6 As shown, after the preparation process in step S2, the process generation device 10 sets the initial event for the process (step S3). The initial event is the event that marks the start of the process, and the process generation device 10 receives the designation of the initial event from the user. For example, as... Figure 9 As shown, from the submenu displayed in the control program shown in UI section 14 by clicking on the input variable X1, the event for that variable is specified as the initial event. The initial event can be as follows: Figure 9 The event initially generated by the specified variable can also be further specified by the user as the type of event that should be set as the initial event. A variable that generates the initial event is equivalent to an example of an initial variable.

[0055] Return to Figure 6 The generation unit 12 sets the initial event as the first event, selects the second event with the highest correlation to the first event from the events that satisfy the event conditions 1 to 4, and performs a connection operation to connect the second event with the first event (step S4).

[0056] Condition 1 is that the fluctuating index value is less than or equal to a threshold. For example, if the initial event is set to change the input variable X1 to ON, and the threshold is 1.0, then regarding the... Figure 8 The combination of events where the output variable Y3 becomes ON, as shown, exceeds the threshold because its standard deviation is 1.1. Therefore, the event where the output variable Y3 becomes ON is not selected as the second event. Furthermore, the threshold can also be specified by the user.

[0057] Condition 2 refers to a subsequent event. When the event that sets the input variable X1 to ON is set as the initial event, the event following this initial event becomes the selection object for the second event. Therefore, in Figure 8 In the case where the event of input variable X1 becoming ON occurs first, the subsequent events of the eight combinations satisfy condition 2. However, for combinations where the event of input variable X1 becoming ON occurs later, condition 2 is not satisfied.

[0058] Condition 3 refers to the event generated by the output variable when the variable that generated the first event is an input variable, and the event generated by the input variable when the variable that generated the first event is an output variable. When the event of input variable X1 is set as the initial event, the events of output variables Y1 to Y4 are the selection objects for the second event; other events of input variable X1 and events of other input variables X2 to X4 are not the selection objects for the second event. As with the preparation process described above, if the representative value and index value have been calculated for the combination of input and output variables, condition 3 can be omitted.

[0059] Condition 4 refers to events that are different from the following excluded events. Specifically, it refers to events that are different from any of the following: the initial event and other events generated by the variable that generated the initial event, connection events that are directly or indirectly connected to the initial event, and other events generated by the variable that generated the connection event. However, in step S4, where the event of setting the input variable X1 to ON is set as the initial event, the event of the input variable X1 is excluded.

[0060] Events that satisfy conditions 1 to 4 are, for example, Figure 8 The events shown are the events where output variable Y1 becomes ON and the events where output variable Y2 becomes ON.

[0061] The generation unit 12 selects the event with the highest correlation to the first event from the events that satisfy conditions 1 to 4 as the second event. The smaller the representative value, the higher the correlation. For example, if the correlation is set to P and the representative value to Q, the correlation can be expressed by a formula like P = 1 / (Q+1), but it is not limited to this and can be expressed by other formulas. Furthermore, since there is a one-to-one correspondence between the correlation and the representative value, the generation unit 12 can also treat the representative value as the correlation. The generation unit 12 selects the event with the smallest representative value from the events that are selected as the second event. Figure 8 In the example, the event where the output variable Y1 becomes ON is selected as the second event.

[0062] Therefore, as Figure 10 As shown, node 52, representing the second event where the output variable Y1 becomes ON, is connected to node 51, representing the first event where the input variable X1 becomes ON. Figure 10 In the diagram, nodes 51 and 52 are connected by arrows representing their chronological relationship, but they could also be connected by lines of a different type. Furthermore, in... Figure 10 In the diagram, quadrilateral nodes correspond to input variables, and elliptical nodes correspond to output variables. Additionally, the shading of node labels corresponds to events that turn ON.

[0063] Return to Figure 6 After step S4, the generation unit 12 sets the second event connected through the previous connection operation as the new first event, and performs a connection operation (step S5) to select the new second event with the highest correlation to the new first event from the events satisfying conditions 1 to 4. For example, in such a case... Figure 10 In step S5, after connecting the initial event to the event where the output variable Y1 becomes ON, the event corresponding to node 52 is set as the new first event, and the same connection operation as in step S4 is repeated. Thus, as shown... Figure 11 As illustrated, node 53, which corresponds to the event where input variable X2 becomes OFF, is connected to node 52.

[0064] The connection operation performed in steps S4 and S5 is equivalent to an example of the following connection operation, namely, selecting the second event with the highest correlation from the events generated by the second variable, which is different from the first variable, based on log information, indicating the degree of correlation with the first event generated by the first variable among multiple variables, and connecting it with the first event.

[0065] Return to Figure 6 After step S5, the generation unit 12 determines whether there are any remaining events that can be connected to the end of the process (step S6). That is, when setting the last connected event as the new first event, it determines whether there are any remaining events that satisfy conditions 1 to 4.

[0066] If it is determined that there is still a remaining event that can be connected (step S6; Yes), the generation unit 12 repeats the connection operation of step S5. Thus, as... Figure 11 As shown, nodes 54 to 56 are connected in sequence, and the events that generate input variables and the events that generate output variables are alternately connected in series.

[0067] In step S6, if it is determined that no events remain that can be connected (step S6; No), the generation unit 12 determines whether all variables are connected in the process (step S7). Figure 11 In the example, since the events of input variable X3 and output variable Y2 are not included in the process, the result of step S7 is negative.

[0068] If an event is determined to be one in which all variables have not yet been connected (step S7; No), the generation unit 12 sets the event generated by the unconnected variable as the first event and performs a connection operation (step S8) to select the second event with the highest correlation to the first event from the events that satisfy conditions 1 to 3 and condition 5. For example, the event where the input variable X3 becomes ON is set as the first event. Furthermore, the method for selecting one unconnected variable and the method for selecting the category of events related to the selected variable are arbitrary.

[0069] Condition 5 refers to events that constitute the process. Therefore, step S8 can be considered a step of exploring the connection targets of unconnected events to the process. If, from the events satisfying conditions 1-3 and 5, the event corresponding to node 54 is selected as the event with the highest correlation, then... Figure 12 As shown, node 57, which corresponds to the event where input variable X3 becomes ON, is connected to node 54.

[0070] Then, generation unit 12 repeats the determination in step S7. Thus, all variables are linked to a certain event in the process. For example, such as... Figure 12As shown, node 58, which corresponds to the event where the output variable Y2 becomes ON, is connected to node 57.

[0071] Furthermore, if no new events are connected after repeatedly performing the determination in step S7, the generation unit 12 can also make it easier to connect events to the process by omitting or changing a part of the conditions determined in step S8. For example, the generation unit 12 can increase the threshold of condition 1 or omit condition 2. Also, even if no new events are connected after changing the conditions, the generation unit 12 can determine that all connectable events have already been connected to the process, and set the determination result of step S7 to yes.

[0072] In step S7, if it is determined that all variable events are connected to the process (step S7; Yes), the generation unit 12 generates an event flowchart representing the generated process, displays the event flowchart on the UI unit 14, and outputs the data file representing the event flowchart to the output unit 13 (step S9). Specifically, as follows... Figure 13 As shown, the UI unit 14 displays representative values ​​of the time differences between events indicated by the arrows connecting the nodes. This allows the user 41 to easily identify which events occurred at what time intervals. The output unit 13 is an example of an output unit that outputs a data file representing an event flowchart.

[0073] As explained above, the generation unit 12 generates a flow where two or more events are connected in series by excluding the initial event and events directly or indirectly connected to the initial event from the selection of the new second event and repeating the connection operation. This avoids a large combination of variables included in the control program 211 within the flow. Therefore, it reduces the burden of verification work related to the control program 211 executed by the PLC 21.

[0074] Furthermore, the correlation, which indicates the degree to which events are related, increases as the representative value of the difference between the time when event 1 occurred and the time when event 2 occurred decreases. Generally, events with short time differences can be presumed to have some kind of relationship. Therefore, it is expected that the appropriate flow of events as shown in the log information will be obtained.

[0075] Additionally, the join operation selects the second event from those events whose index value representing the fluctuation of time difference is less than a threshold. When this index value is large, the relationship between the events can be considered weak, thus avoiding joining inappropriate events together.

[0076] Furthermore, after generating a process that connects events in a chain, the generation unit 12 selects the event with the highest correlation to any unconnected event that is not included in the process and generates it relative to any of the multiple variables. The unconnected event is then connected to the selected event to modify the process. This allows for the generation of a process that represents the relationships between as many variables as possible.

[0077] Furthermore, connection operations involve connecting output variables to input variables and vice versa. Typically, PLC 21 controls instrument 22 in accordance with the input signals; therefore, in the control program of PLC 21, events of input variables are received, and events of output variables are generated. Additionally, as a result of controlling instrument 22 and acting externally, PLC 21 receives new input signals, thus receiving events of output variables and generating events of input variables. In this way, events of input variables and events of output variables alternately influence each other, thereby achieving a realistic flow.

[0078] Furthermore, the first and second events that become the objects of the connection operation are the increase or decrease of the value of a 1-bit bit. Here, increase corresponds to a change to the ON state, and decrease corresponds to a change to the OFF state. Bit devices are mostly associated with the presence or absence of inputs or outputs in the control program 211, so it is expected that a flow that appropriately represents the decision order for determining the presence or absence of inputs and outputs will be obtained.

[0079] Furthermore, the generation unit 12 sets the second event connected through the previous connection operation as the new first event, excludes the initial event, other events generated by the variable that generated the initial event, connection events directly or indirectly connected to the initial event, and other events generated by the variable that generated the connection event from the selection objects of the new second event, and repeats the connection operation to generate the flow. Thus, a flow is generated that uses one event for each variable. It is rare for all events generated by a certain variable to be meaningful; usually, one type of event should be considered. Therefore, it is expected that the generated flow will not contain unnecessary events.

[0080] Furthermore, the process generation device 10 has an output unit 13 that outputs a data file 31 representing an event flowchart. This makes it easy to utilize the event flowchart. For example, it is possible to easily create a manual containing the event flowchart.

[0081] Implementation Method 2

[0082] Next, Embodiment 2 will be described focusing on its differences from Embodiment 1 described above. Furthermore, equivalent reference numerals will be used for structures that are the same as or equivalent to those in Embodiment 1 described above. This embodiment differs from Embodiment 1 in that it calculates appropriate representative values ​​after excluding inappropriate values ​​from the sample values ​​calculated as time differences.

[0083] The control processes specified in control procedure 211 are preferably executed periodically, but may be temporarily stopped in case of an anomaly such as a momentary halt. The time difference calculated during the preparation process, based on log information including the periods of such exceptions, will be as follows: Figure 14 As shown, this includes deviations that are significantly different from the 15 or 16 seconds typically observed during operation.

[0084] Therefore, the generation unit 12 detects deviations in the distribution of time differences and calculates a representative value based on sample values ​​greater than or equal to one time difference, excluding the detected deviations. For example, the generation unit 12 excludes deviations using the so-called 3σ method. Specifically, the generation unit 12 calculates the mean and standard deviation using all sample values ​​of the time differences, repeating the process of excluding sample values ​​that deviate more than three times from the mean and standard deviation until no further exclusions are found. Figure 14 The example shows that the decision-making process for excluding objects was repeated 6 times, and as a result, sample values ​​greater than or equal to 972 seconds were excluded as deviations.

[0085] Furthermore, when both the first and second events, which are objects of the connection operation, occur only once in the control process defined by control program 211, the time difference between these events is approximately constant. However, when at least one of the first and second events occurs twice or more in the control process, the time difference between the events is not limited to being constant. For example, as... Figure 15 As shown, for the same combination of events, there are sometimes time differences of about 20 seconds and about 80 seconds.

[0086] Therefore, the generation unit 12 calculates the representative value based on the results obtained by clustering the sample values ​​of the time difference. For example, the generation unit 12 performs clustering using the k-means method, and calculates the representative value and the index value of fluctuation for each cluster. Moreover, the generation unit 12 uses the representative value and index value of at least one cluster as the values ​​used in the join operation. For example, the generation unit 12 can use the cluster with the small representative value, the cluster with the small index value, or a weighted average of the values ​​of all clusters.

[0087] As explained above, the generation unit 12 detects deviations in the distribution of time differences and calculates a representative value based on sample values ​​greater than or equal to one time difference, excluding the detected deviations. This allows for the calculation of an appropriate representative value, resulting in a process that accurately reflects reality.

[0088] Furthermore, the generation unit 12 calculates representative values ​​based on the results obtained by clustering sample values ​​of time differences. For example, for... Figure 15 The representative values ​​calculated in the same way as in Implementation 1, where the distributions are considered as two clusters, are values ​​that would hardly appear in actual log information. In contrast, the generation unit 12 in this embodiment calculates representative values ​​based on the clustering results, thus obtaining representative values ​​that are more consistent with reality.

[0089] Implementation Method 3

[0090] Next, Embodiment 3 will be described focusing on its differences from Embodiment 1 described above. Furthermore, equivalent reference numerals will be used for structures that are the same as or equivalent to those in Embodiment 1. This embodiment differs from Embodiment 1 in that the log information does not include date and time, and time differences are not used in connection operations.

[0091] like Figure 16 As illustrated, the log information in this embodiment is equivalent to the log information in Embodiment 1, except that the date and time are omitted. Based on this log information, during the preparation process, such as... Figure 17 As shown, for all combinations of two events, the frequency of these two events occurring consecutively without any other events in between is counted. Furthermore, the generation unit 12 performs a connection operation using this frequency as a correlation coefficient. Thus, the same process as in Embodiment 1 is generated. Furthermore, regarding the connection operation, [details omitted]. Figure 6 The judgment of condition 1 shown.

[0092] As explained above, in the connection operation, the second event, which has the highest correlation with the first event, is the event that occurs most frequently after the first event and is generated more frequently than other events. Therefore, a log generation process can be achieved without accompanying time-based recording.

[0093] The embodiments of the present invention have been described above, but the present invention is not limited to the above embodiments.

[0094] For example, in embodiments 1 and 2, the form of log information is not limited to associating generated events with their timestamps. Log information can also be information that records the values ​​of variables at a sampling period shorter than the control processing cycle, regardless of the presence or absence of an event. Based on such information, the presence or absence of an event can be determined during the preparation process. The log information can be information that directly or indirectly indicates the shift in the values ​​of variables as the PLC 21 executes the control program.

[0095] Furthermore, an example of the log information acquisition unit 11 acquiring log information from PLC 21 has been described, but it is not limited to this. The log information acquisition unit 11 can also acquire log information provided by the user.

[0096] Furthermore, the process is generated using events from all the variables included in the control program 211, but it is not limited to this. Alternatively, the UI unit 14 may receive a specification of a portion of the program corresponding to a part of the control program from the user, and the generation unit 12 may generate the process using the variables included in that portion of the program as objects. The UI unit 14 is an example of a user interface unit that receives a specification of a portion of the program included in the control program.

[0097] Furthermore, the conditions used in the join operation can be arbitrarily changed. For example, condition 3, which is used to alternately join events of input variables and events of output variables, can be omitted. Thus, events of other input variables can be joined to events of input variables, and events of other output variables can be joined to events of output variables.

[0098] Furthermore, an example of generating a process using one type of event for each variable was given, but this is not a limitation. For example, a process can also be generated using all events for a variable specified by the user. That is, it is also possible to... Figure 6 The exclusion object for condition 4 shown is the connection event that is connected to the initial event in the process.

[0099] The generation unit 12 is equivalent to an example of a generation unit. After performing a connection operation by taking the initial event generated by the initial variable among multiple variables as the first event, the generation unit sets the second event connected by the previous connection operation as the new first event, excludes the initial event and the events directly or indirectly connected to the initial event from the selection objects of the new second event, and repeats the connection operation, thereby generating a process in which two or more events are connected in series, and generating an event flow diagram representing the generated process.

[0100] Furthermore, regarding condition 2, it can be changed from a subsequent event to an earlier event relative to event 1, or it can be omitted. In the above embodiment, condition 2 is a subsequent event, so events generated after the initial event are sequentially connected, resulting in a flow of events generated after the initial event. This flow can be described as a flow of events affected by the influence of the initial event. On the other hand, if condition 2 is changed to an earlier event, events preceding the initial event are sequentially connected, resulting in a flow that can be described as a flow tracing back the event that caused the initial event.

[0101] Regarding the connection operation involved in Implementation 3, the second event with the highest correlation to the first event can also be set as an event that occurs immediately before the first event and has a higher frequency than other events.

[0102] Furthermore, an example was given of treating the increase and decrease of a 1-bit value as different types of events, but it is also possible to treat the change of value as a single event without distinguishing between increase and decrease. Additionally, the events generated by a bit device are not limited to the increase and decrease of values; they can be changed to other events, or additional events can be added. For example, other events could include a value that remains ON or OFF for a period greater than or equal to a specified length.

[0103] Furthermore, the events that constitute the process are not limited to events generated by bit devices; they can also be events generated by word devices.

[0104] The functions of the process generation apparatus 10 described above can be implemented using dedicated hardware, or they can be implemented using a conventional computer system.

[0105] For example, by distributing the program P1 stored on a computer-readable recording medium such as a floppy disk, CD-ROM (Compact Disk Read-Only Memory), DVD (Digital Versatile Disk), or MO (Magneto-Optical disk), and installing the program P1 into a computer, an apparatus for performing the above-described processing can be constructed.

[0106] Alternatively, the program P1 can be pre-stored on a disk device of a server device on a communication network such as the Internet, and then downloaded to a computer by superimposing it onto a carrier wave.

[0107] Alternatively, the above processing can also be achieved by forwarding program P1 and starting its execution via a network such as the Internet.

[0108] Furthermore, by executing all or part of program P1 on a server device, the computer can also perform the above-mentioned processing by sending and receiving information related to the processing via a communication network and executing program P1.

[0109] Furthermore, when the above functions are implemented by the OS (Operating System) or through the coordinated action of the OS and applications, only the parts outside the OS can be stored on the medium for distribution, or they can be downloaded to a computer.

[0110] Furthermore, the means of realizing the function of the process generation device 10 are not limited to software; some or all of them can also be realized through dedicated hardware or circuits.

[0111] This invention can be implemented and modified in various ways without departing from its broad spirit and scope. Furthermore, the above-described embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. That is, the scope of the invention is defined not by the embodiments, but by the claims. Moreover, various modifications implemented within the scope of the claims and their equivalents are considered to fall within the scope of this invention.

[0112] Industrial applicability

[0113] This invention is suitable for verification of control programs used in FA field operations.

[0114] Explanation of the label

[0115] 10 Process generation device, 11 Log information acquisition unit, 12 Generation unit, 13 Output unit, 14 UI unit, 101 Processor, 102 Main storage unit, 103 Auxiliary storage unit, 104 Input unit, 105 Output unit, 106 Communication unit, 107 Internal bus, 21 PLC, 211 Control program, 22 Instrument, 31 Data file, 41 User, 51-58 Nodes, P1 Program.

Claims

1. A recording medium that is a computer-readable recording medium storing a flow generation program for causing a computer to function as: a log information acquisition unit that acquires log information indicating a transition of each of values of a plurality of variables included in a control program for controlling an instrument, when a programmable controller executes the control program; and a generation unit that generates a flow in which two or more events are connected in series, generates an event flow diagram indicating the generated flow, the flow being generated by performing a connection operation in which an initial event generated from an initial variable among the plurality of variables is set as a first event, and then, from a second event connected by a previous connection operation, a new first event is set, and from a selection target of the new second event, the initial event and an event directly or indirectly connected to the initial event are excluded, and the connection operation is repeated, the connection operation being an operation of selecting, from events generated from second variables different from a first variable, a second event having a highest degree of association with the first event generated from the first variable among the plurality of variables based on the log information, and connecting the second event to the first event.

2. The recording medium according to claim 1, wherein: the log information shows a transition of values of the plurality of variables when the programmable controller repeatedly executes a process prescribed by the control program, in association with time points, the degree of association is higher when a representative value of a difference between a time point at which the first event is generated and a time point at which the second event is generated is smaller.

3. The recording medium according to claim 2, wherein: the connection operation is an operation of selecting the second event from events having an index value indicating fluctuation of the difference smaller than a threshold value.

4. The recording medium according to claim 3, wherein: the generation unit, after generating the flow, selects, from events constituting the flow, an event having the highest degree of association with an unconnected event generated from an arbitrary one of the plurality of variables and not included in the flow, and connects the unconnected event to the selected event to change the flow.

5. The recording medium according to claim 2, wherein: the generation unit detects an outlier value in a distribution of the differences, and calculates the representative value from the differences greater than or equal to 1 after excluding the detected outlier value.

6. The recording medium according to claim 2, wherein: the generation unit calculates the representative value based on a result of clustering a plurality of sample values of the differences.

7. The recording medium according to claim 2, wherein: the event flow diagram is shown by nodes corresponding to events, lines connecting the nodes corresponding to connected events, and the representative value annotated to the lines.

8. The recording medium according to claim 1, wherein: the log information indicates a transition of each of values of the plurality of variables when the programmable controller repeatedly executes a process prescribed by the control program, The second event with the highest correlation to the first event is an event that occurs immediately before or after the first event and has a higher frequency than other events.

9. The recording medium according to any one of claims 1 to 8, wherein, If the first variable is an input variable corresponding to an input to the programmable controller, then the second variable is an output variable corresponding to an output from the programmable controller to the instrument. If the first variable is the output variable, then the second variable is the input variable.

10. The recording medium according to any one of claims 1 to 8, wherein, The first variable and the second variable are variables representing a 1-bit value. The first event and the second event refer to the change in the value of the 1st bit.

11. The recording medium according to claim 10, wherein, The first event and the second event each refer to the increase or decrease of the value of the 1 bit.

12. The recording medium according to any one of claims 1 to 8, wherein, The generation unit takes the second event connected through the previous connection operation as the new first event, excludes the events generated by the initial variable, the connection events directly or indirectly connected to the initial event, and other events generated by the variable that generated the connection event from the selection objects of the new second event, and repeats the connection operation, thereby generating the process.

13. The recording medium according to any one of claims 1 to 8, wherein, The process generation procedure further enables the computer to function as a user interface unit, which receives specifications for portions of the program included in the control program. The multiple variables are those included in the aforementioned part of the program.

14. The recording medium according to any one of claims 1 to 8, wherein, The process generation program further enables the computer to function as an output unit that outputs a data file representing the event flowchart.

15. A process generation apparatus, comprising: A log information acquisition unit acquires log information indicating the shifts in values ​​of multiple variables within a control program used by the programmable controller to control the instrument; and A generation unit generates a process in which two or more events are connected in series, and generates an event flowchart representing the generated process. The process is generated by performing a connection operation after setting the initial event generated by the initial variable among the multiple variables as the first event, setting the second event connected through the previous connection operation as the new first event, excluding the initial event and events directly or indirectly connected to the initial event from the selection objects of the new second event, and repeating the connection operation. The connection operation selects the second event with the highest correlation degree representing the degree of association with the first event generated by the first variable among the multiple variables from the events generated by the second variable that are different from the first variable, based on the log information, and connects the second event with the first event.

16. A process generation method, comprising: The log information acquisition unit acquires log information, which indicates the shifts in the values ​​of multiple variables contained in the control program used to control the instrument when the programmable controller executes the control program. The generation unit performs a connection operation by setting the initial event generated by the initial variable among the plurality of variables as the first event. Then, it sets the second event, connected through the previous connection operation, as the new first event. From the selection of the new second event, it excludes the initial event and events directly or indirectly connected to the initial event and repeats the connection operation. This generates a flow where two or more events are connected in series. The connection operation selects the second event with the highest correlation (representing the degree of association with the first event generated by the first variable among the plurality of variables) from the events generated by the second variable, which is different from the first variable, based on the log information. The second event is then connected to the first event. The generation unit generates an event flow diagram representing the process.