Flow generation program, flow generation device, and flow generation method

The flow generation program simplifies the verification of control programs by generating a reduced event flow diagram, addressing the complexity of variable relationships in programmable controllers, thereby easing the verification burden.

WO2024189778A1PCT designated stage expired Publication Date: 2024-09-19MITSUBISHI ELECTRIC CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/JP2023/009884
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-03-14
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

The complexity of relationships between variables in control programs executed by programmable controllers at FA sites makes verification work burdensome, as existing techniques extract numerous dependency relationships that result in overly complex relationships, difficult for users to manage.

Method used

A flow generation program and device that analyze changes in variable values, acquire relevant log information, and connect events to generate a simplified event flow diagram, excluding initial and directly or indirectly connected events to reduce the number of variables in the flow, thereby simplifying verification work.

Benefits of technology

The solution reduces the burden of verification work by presenting a simplified event flow diagram that clearly shows the relationships between events, making it easier for users to understand and verify control programs executed by programmable controllers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure JP2023009884_19092024_PF_FP_ABST
    Figure JP2023009884_19092024_PF_FP_ABST
Patent Text Reader

Abstract

A program according to the present invention causes a flow generation device (10) to function as a generation unit (12). The generation unit (12) generates a flow in which two or more events are connected in series by: executing a connecting operation in which a second event, with which the degree of relevance is the highest, the degree of relevance indicating the degree of relevance to a first event that occurred in a first variable among a plurality of variables included in a control program, is selected on the basis of log information from among events that occurred in a second variable, the second variable being different from the first variable, and in which the second event is connected to the first event, while considering an initial event that occurred in an initial variable among the plurality of variables as the first event; and then iteratively executing the connecting operation while considering the second event connected as a result of the immediately preceding iteration of the connecting operation as a new first event, with the initial event as well as events directly or indirectly connected to the initial event excluded from events from among which a new second event is selected.
Need to check novelty before this filing date? Find Prior Art

Description

Flow generation program, flow generation device, and flow generation method

[0001] The present disclosure relates to a flow generation program, a flow generation device, and a flow generation method.

[0002] In factory automation (FA), various processing steps are realized by controlling devices using programmable controllers, which control devices in accordance with the contents of control programs executed by the programmable controllers.

[0003] This control program may be subject to verification to confirm whether the programmable controller operates as expected by the user. Verification of a control program focuses on the relationships between variables included in the control program to examine how a specific event affects the control process or to investigate the cause of the occurrence of a specific event. Therefore, a technique for extracting the relationships between variables from a control program and its execution log has been proposed (see, for example, Patent Document 1). Patent Document 1 describes a technique for extracting pairs of variables having dependencies by analyzing the source code of a control program, and correcting the extracted dependencies based on the analysis results of the execution log.

[0004] Patent No. 6833129

[0005] In a control program that includes many variables, the number of variables that have dependencies on one variable can be enormous. Therefore, 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 the variables, which may make the user's verification work difficult. Therefore, there is room for reducing the burden of verification work for control programs executed by programmable controllers.

[0006] The present disclosure has been made in light of the above-mentioned circumstances, and aims to reduce the burden of verification work related to control programs executed by programmable controllers.

[0007] In order to achieve the above object, the flow generation program of the present disclosure causes a computer to function as: log information acquisition means for acquiring log information indicating the transition of values ​​of each of multiple variables included in a control program for controlling an apparatus when the control program is executed by a programmable controller; and generation means for performing a connection operation in which a second event having the highest degree of relevance, indicating the degree of relevance to a first event that has occurred in a first variable among the multiple variables, is selected from events that have occurred in a second variable different from the first variable based on the log information and connected to the first event, performing the connection operation using an initial event that has occurred in an initial variable among the multiple variables as the first event, and then repeating the connection operation while setting the second event connected by the previous connection operation as the new first event and excluding the initial event and events directly or indirectly connected to the initial event from the selection candidates for the new second event, thereby generating a flow in which two or more events are connected in series, and generating an event flow diagram showing the generated flow.

[0008] According to the present disclosure, the generation unit generates a flow in which two or more events are connected in series by repeatedly performing a connection operation while excluding an initial event and events directly or indirectly connected to the initial event from the selection of a new second event. This prevents a huge number of combinations of variables included in the control program from appearing in the flow. This reduces the burden of verifying the control program executed by the programmable controller.

[0009] FIG. 1 is a diagram showing the relationship between a flow generating device, a PLC (Programmable Logic Controller), and equipment according to the first embodiment. FIG. 2 is a diagram showing an example of a control program according to the first embodiment. FIG. 3 is a diagram showing a functional configuration of a flow generating device according to the first embodiment. FIG. 4 is a diagram showing an example of log information according to the first embodiment.

[0010] Hereinafter, a flow generating device according to an embodiment of the present disclosure will be described in detail with reference to the drawings.

[0011] Embodiment 1. A flow generating device 10 according to this embodiment corresponds to a management terminal connected to a PLC 21, which is a programmable controller, as shown in Fig. 1, and used by a user to manage the PLC 21. In particular, the flow generating device 10 generates a flow representing the relationships between a large number of variables included in a control program 211 executed by the PLC 21, thereby assisting the user in debugging the control program 211. The flow generating device 10 may be connected to the PLC 21 via a communication line such as a USB (Universal Serial Bus) cable, or may be connected to the PLC 21 via a field network.

[0012] The PLC 21 is a control device that controls the devices 22 in a factory by executing a control program 211 that has been written in advance. While one device 22 is representatively shown in FIG. 1 , the PLC 21 may be connected to a plurality of devices 22 to control these multiple devices 22. For example, the PLC 21 may receive a signal from the device 22, which is a sensor, indicating that the device 22 has detected a workpiece being transported on a belt conveyor, and may transmit an operation command to another device 22, which is a robot, based on the received signal to process the workpiece. The PLC 21 may be connected to the device 22 by a signal line that transmits a voltage signal or a current signal, or may be connected to the device 22 via a field network.

[0013] The control program 211 is created by a user using the flow generating device 10 as a management terminal and written to the PLC 21. The control program 211 is a sequence program written in ladder language, as shown in a simplified form in Fig. 2. The control processing defined in the control program 211 is usually repeatedly executed by the PLC 21 to perform the same process on multiple workpieces.

[0014] As shown in FIG. 2 , the control program 211 includes input variables each having a name combining an "X" (indicating a signal input to the PLC 21) with a numerical value identifying the input signal, and output variables each having a name combining a "Y" (indicating a signal output from the PLC 21 to the device 22) with a numerical value identifying the output signal. In the example of FIG. 2 , the value of the output variable "Y1" is controlled according to the input variable "X1," and the value of the output variable "Y2" is controlled according to the input variable "X2." For example, the value of the input variable "X1" corresponds to a signal input from the device 22, which is a sensor, and the value of the output variable "Y1" corresponds to a signal output to the device 22, which is a robot. The values ​​of the variables are stored in an area of ​​the memory of the PLC 21 that corresponds to the name of the variable. The variables handled by the control program 211 are also called devices. Types of devices include bit devices, which indicate a 1-bit value corresponding to either an ON state or an OFF state, and word devices, which indicate word-sized values.

[0015] In the verification of the control program 211, it is necessary to trace the relationships between events that occur for the values ​​of variables and events that occur for the values ​​of other variables. While the relationships between variables can be understood by referring to the source code of the control program 211, it is difficult to understand all the relationships indicated in complex source code, and it is not necessary to clarify all the relationships in tasks such as post-event maintenance. Therefore, the flow generation device 10 estimates the flow of events that are expected to be most closely related from multiple events that occur for variables based on the history of the values ​​of the variables when the control program 211 is executed, and provides this to the user.

[0016] Here, the relationships between variables and events may be causal, dependent or subordinate relationships, or may be correlations, co-occurrences or confounding relationships in which a connection can be inferred after the fact even if there is no connection in the source code of the control program 211.

[0017] The flow generation device 10 is configured with hardware elements for functioning as a computer. In detail, as shown in Fig. 3, the flow generation device 10 has a processor 101, a main memory unit 102, an auxiliary memory unit 103, an input unit 104, an output unit 105, and a communication unit 106. The main memory unit 102, the auxiliary memory 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.

[0018] The processor 101 includes a CPU (Central Processing Unit) or an MPU (Micro Processing Unit) as a processing circuit. The processor 101 realizes various functions and executes the processes described below by executing a program P1 stored in the auxiliary storage unit 103. The program P1 corresponds to a so-called engineering tool and is an example of a flow generation program that causes the flow generation device 10 to function as described below.

[0019] The main memory unit 102 includes a RAM (Random Access Memory). A program P1 is loaded into the main memory unit 102 from the auxiliary memory unit 103. The main memory unit 102 is used as a working area for the processor 101.

[0020] The auxiliary storage unit 103 includes a non-volatile memory such as an EEPROM (Electrically Erasable Programmable Read-Only Memory) and an HDD (Hard Disk Drive). In addition to the program P1, the auxiliary storage unit 103 stores various data used in the processing of the processor 101. The auxiliary storage unit 103 supplies the processor 101 with data used by the processor 101 in accordance with instructions from the processor 101. The auxiliary storage unit 103 also stores data supplied from the processor 101.

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

[0022] The output unit 105 includes output devices such as a light emitting diode (LED), a liquid crystal display (LCD), and a speaker, and presents various information to the user in accordance with instructions from the processor 101.

[0023] The communication unit 106 includes a communication interface circuit for communicating with an external device. The communication unit 106 receives a signal from the outside and outputs data indicated by this signal to the processor 101. The communication unit 106 also transmits a signal indicating the data output from the processor 101 to the external device.

[0024] The above-described hardware configurations work together to perform various functions of the flow generation device 10. In detail, as shown in Fig. 4, the flow generation device 10 includes a log information acquisition unit 11 that acquires log information indicating transitions in the values ​​of variables included in the control program 211, a generation unit 12 that generates flows of events that occur in the variables based on the log information, an output unit 13 that outputs a data file 31 indicating the generated flows, and a UI unit 14 that functions as an interface with the user 41.

[0025] The log information acquisition unit 11 is mainly realized by the communication unit 106. The log information acquisition unit 11 receives log information such as that shown in FIG. 5 from the PLC 21. As shown in FIG. 5, the log information is a chronological collection of records that associate a date and time, an identifier of a variable that is an input variable or an output variable, and an event that occurred in the variable at the date and time. In the following, an example will be described in which all variables recorded in the log information indicate a 1-bit value, and an event is a change in the value of the variable from OFF to ON or from ON to OFF. OFF corresponds to zero, and ON corresponds to 1.

[0026] The generation unit 12 is mainly realized by the processor 101. The generation unit 12 generates a flow in which events recorded in the log information are connected in series, generates an event flow diagram showing the generated flow, and outputs the generated event flow diagram to the output unit 13 and the UI unit 14.

[0027] The output unit 13 is mainly realized by cooperation between the processor 101 and the communication unit 106. The destination of the data file 31 output by the output unit 13 may be a recording medium such as a memory card that is detachable from the flow generation device 10, or may be a storage device connected via a field network or a local area network (LAN).

[0028] The UI unit 14 is mainly realized by the cooperation of the input unit 104 and the output unit 105. The UI unit 14 acquires information input by the user 41 and provides it to the generation unit 12, causing the generation unit 12 to generate a flow based on this information. The UI unit 14 also presents the event flow diagram generated by the generation unit 12 to the user 41.

[0029] Next, the flow generation process executed by the flow generation device 10 will be described in detail with reference to Figures 6 to 13. The flow generation process shown in Figure 6 corresponds to an example of a flow generation method executed by the flow generation device 10.

[0030] In the flow 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 may be source code or an object-format program. The log information acquisition unit 11 corresponds to an example of a log information acquisition means that acquires log information indicating the transition of values ​​of multiple variables included in a control program for controlling a device when the control program is executed by a programmable controller. Next, the generation unit 12 executes a preparation process for generating a flow (step S2).

[0031] 7, in the preparation process, the generation unit 12 extracts logs of variables included in the control program 211 from the log information (step S21). Specifically, the generation unit 12 scans the control program 211 to identify all input variables and output variables used in the control program 211, and extracts records related to the identified variables from the log information. If the log information includes only records related to the input variables and output variables used in the control program 211, step S21 may be omitted.

[0032] Next, the generation unit 12 calculates the time difference between events that occur in the variables for all combinations of two variables (step S22). Specifically, the generation unit 12 calculates the time difference in the log information for all combinations of events of input variables and events of output variables. For example, as shown in FIG. 8 , there are eight combinations of a preceding event in which the input variable X1 changes from OFF to ON and subsequent events of all output variables Y1 to Y4, because there are two types of events for each output variable. If there are four input variables, X1 to X4, there are two types of events for each variable, so the total number of combinations is 64.

[0033] Returning to FIG. 7 , following step S22, the generation unit 12 calculates a representative value of the calculated difference and an index value of the variation for each combination of events (step S23). As described above, the process defined in the control program 211 is repeatedly executed. Therefore, since each event can occur repeatedly, the time difference between two specific combinations of events is usually calculated multiple times. For example, in the log information of FIG. 5 , similar events occur repeatedly at approximately 15-minute intervals, so the combination of an event in which the input variable X1 turns ON and a subsequent event in which the output variable Y1 turns ON is recorded multiple times, and other combinations are also recorded multiple times.

[0034] Note that multiple subsequent events occur after one preceding event. For example, after an event at 0:00:00, where input variable X1 turns ON, multiple events occur where output variable Y1 turns ON, and it is sufficient to calculate the difference between these events and the most recent event.

[0035] 8 illustrates the representative value and index value of the calculated difference for each combination. Here, the representative value is the average value, and the index value of the variation is the standard deviation. However, without being limited to this, the representative value may be the median or the mode, and the index value may be the coefficient of variation.

[0036] Returning to FIG. 7 , upon completion of step S23, the process by the flow generation device 10 returns from the preparation process to the flow generation process shown in FIG. 6 . As shown in FIG. 6 , following the preparation process of step S2, the flow generation device 10 sets an initial event for the flow (step S3). The initial event is an event that serves as the starting point of the flow, and the flow generation device 10 accepts the designation of the initial event from the user. For example, as shown in FIG. 9 , by clicking on input variable X1 in the control program displayed on the UI unit 14, a submenu is displayed, from which the event of this variable is designated as the initial event. The initial event may be the first event that occurs for the designated variable as shown in FIG. 9 , or the user may further designate the type of event to be designated as the initial event. The variable for which the initial event occurs corresponds to an example of an initial variable.

[0037] Returning to Figure 6, the generation unit 12 sets the initial event as the first event, selects the second event that has the highest degree of relevance to the first event from the events that satisfy the event conditions 1 to 4, and performs a connection operation to connect it to the first event (step S4).

[0038] Condition 1 is that the index value of the variation is equal to or less than a threshold value. For example, if an event in which input variable X1 turns ON is set as the initial event and the threshold value is 1.0, the standard deviation for the combination with the event in which output variable Y3 turns ON shown in FIG. 8 is 1.1, which exceeds the threshold value. Therefore, the event in which output variable Y3 turns ON is not selected as the second event. The threshold value may be specified by the user.

[0039] Condition 2 is that the event is a subsequent event. If an event in which the input variable X1 turns ON is set as the initial event, the event that follows this initial event will be selected as the second event. For this reason, in Figure 8, the eight combinations of subsequent events in which the preceding event is an event in which the input variable X1 turns ON satisfy condition 2, but condition 2 is not satisfied for combinations in which the subsequent event is an event in which the input variable X1 turns ON.

[0040] Condition 3 is that if the variable in which the first event occurred is an input variable, it is an event that occurred in an output variable, and if the variable in which the first event occurred is an output variable, it is an event that occurred in an input variable. If the event of input variable X1 is set as the initial event, the events of output variables Y1 to Y4 become candidates for selection of the second event, and other events of input variable X1 and other input variables X2 to X4 do not become candidates for selection of the second event. If a representative value and an index value are calculated for a combination of an input variable and an output variable as in the preparation process described above, condition 3 may be omitted.

[0041] Condition 4 is different from the following exclusion targets: the initial event, other events that occurred in the variable in which the initial event occurred, connecting events directly or indirectly connected to the initial event, and other events that occurred in the variable in which the connecting event occurred. However, in the case of condition 4 in step S4 where an event that turns input variable X1 ON is set as the initial event, the event of this input variable X1 will be excluded.

[0042] The events that satisfy conditions 1 to 4 are, for example, two events shown in FIG. 8: an event in which the output variable Y1 turns ON and an event in which the output variable Y2 turns ON.

[0043] The generation unit 12 selects, as the second event, the event with the highest relevance to the first event from among the events that satisfy conditions 1 to 4. The smaller the representative value, the higher the relevance. For example, where P is the relevance and Q is the representative value, the relevance is expressed by the formula P = 1 / (Q + 1), but this is not limiting and other formulas may be used. Note that, since the relevance corresponds one-to-one with the representative value, the generation unit 12 may treat the representative value as the relevance. From the events to be selected, the generation unit 12 may select, as the second event, the event with the smallest representative value. In the example of FIG. 8, the event in which the output variable Y1 is ON is selected as the second event.

[0044] As a result, as shown in Figure 10, node 51, which indicates a first event in which input variable X1 turns ON, is connected to node 52, which indicates a second event in which output variable Y1 turns ON. In Figure 10, nodes 51 and 52 are connected by arrows indicating a chronological relationship, but they may also be connected by lines of a type other than arrows. In Figure 10, square nodes correspond to input variables, and oval nodes correspond to output variables. Hatching on nodes corresponds to events that turn ON.

[0045] 6 , following step S4, the generation unit 12 executes a connection operation in which the second event connected in the previous connection operation is set as a new first event, and a new second event having the highest degree of association with the new first event is selected from the events that satisfy conditions 1 to 4 and connected (step S5). For example, in step S5 after an event that causes output variable Y1 to be ON is connected to the initial event as shown in FIG. 10 , the event corresponding to node 52 is set as the new first event, and the same connection operation as in step S4 is repeated. As a result, node 53 corresponding to the event that causes input variable X2 to be OFF is connected to node 52, as shown in FIG. 11 .

[0046] The connection operation performed in steps S4 and S5 corresponds to an example of a connection operation in which a second event having the highest relevance, indicating the degree of relevance to a first event occurring in a first variable among a plurality of variables, is selected from events occurring in a second variable different from the first variable based on log information and connected to the first event.

[0047] 6, after step S5, the generation unit 12 determines whether any events remain that can be connected to the end of the flow (step S6). That is, it determines whether any events remain that satisfy conditions 1 to 4 when the last connected event is set as the new first event.

[0048] If it is determined that there are still connectable events remaining (step S6; Yes), the generation unit 12 repeats the connection operation of step S5. As a result, as shown in Fig. 11, nodes 54 to 56 are connected in order, and a flow is generated in which events of input variables and events of output variables are alternately connected in series.

[0049] If it is determined in step S6 that there are no connectable events remaining (step S6; No), the generation unit 12 determines whether the events of all variables have been connected in the flow (step S7). In the example of Fig. 11, the event of the input variable X3 and the event of the output variable Y2 are not included in the flow, so the determination in step S7 is negative.

[0050] If it is determined that the events of all variables are not connected (step S7; No), the generation unit 12 sets an event occurring in an unconnected variable as a first event, and executes a connection operation to select a second event that is most highly related to the first event from the events that satisfy conditions 1 to 3 and condition 5 and connect it to the first event (step S8). For example, an event in which input variable X3 becomes ON is set as the first event. Note that the method for selecting one unconnected variable and the method for selecting the type of event related to the selected variable are arbitrary.

[0051] Condition 5 is that the event is part of a flow. Therefore, step S8 can be said to be a step of searching for a connection destination for connecting the unconnected event to the flow. When the event corresponding to node 54 is selected as the event with the highest degree of association from among the events that satisfy conditions 1 to 3 and 5, node 57, which corresponds to the event that turns input variable X3 ON, is connected to node 54, as shown in FIG.

[0052] Thereafter, the generation unit 12 repeats the determination in step S7. As a result, any event is connected to the flow for all variables. For example, as shown in FIG. 12 , node 58, which corresponds to the event in which output variable Y2 becomes ON, is connected to node 57.

[0053] If the determination in step S7 is repeated without a new event being connected, the generation unit 12 may make it easier to connect the event to the flow by omitting or changing some of the conditions determined in step S8. For example, the generation unit 12 may increase the threshold value for condition 1 or omit condition 2. Furthermore, if a new event is not connected even after changing the conditions, the generation unit 12 may determine that all connectable events have already been connected to the flow and may make a positive determination in step S7.

[0054] If it is determined in step S7 that all variable events have been connected to the flow (step S7; Yes), the generation unit 12 generates an event flow diagram showing the generated flow, displays the event flow diagram on the UI unit 14, and outputs a data file showing the event flow diagram to the output unit 13 (step S9). Specifically, as shown in FIG. 13, the UI unit 14 displays arrows connecting nodes with representative values ​​of the time differences between events. This allows the user 41 to easily recognize which events occurred and how long they occurred. The output unit 13 corresponds to an example of output means for outputting a data file showing the event flow diagram.

[0055] As described above, the generation unit 12 generates a flow in which two or more events are connected in series by repeatedly performing a connection operation while excluding an initial event and events directly or indirectly connected to the initial event from the selection targets for a new second event. This prevents a huge number of combinations of variables included in the control program 211 from appearing in the flow. This reduces the burden of verifying the control program 211 executed by the PLC 21.

[0056] Furthermore, the degree of association between events is high when the representative value of the difference between the time a first event occurs and the time a second event occurs is small. Generally, it can be assumed that there is some kind of relationship between events that occur with a short time difference. Therefore, it is expected that an appropriate flow of events indicated by log information can be obtained.

[0057] The connecting operation is an operation of selecting a second event from events whose index value indicating the variation in time difference is smaller than a threshold value. If this index value is large, the relationship between the events is considered weak, and therefore connecting inappropriate events is avoided.

[0058] Furthermore, after generating a flow in which events are connected in series, the generation unit 12 selects from the events that make up the flow an event that has the highest degree of association with an unconnected event that has occurred in one of multiple variables but is not included in the flow, and connects the unconnected event to the selected event, thereby modifying the flow to obtain a flow that represents the relationships between as many variables as possible.

[0059] Furthermore, a connection operation is an operation of connecting an output variable to an input variable and an input variable to an output variable. Generally, the PLC 21 controls the device 22 in response to an input signal, so in the control program of the PLC 21, an output variable event occurs in response to an input variable event. Furthermore, the PLC 21 receives a new signal input as a result of controlling the device 22 and acting on the outside, so an input variable event occurs in response to an output variable event. In this way, the input variable event and the output variable event have an alternating influence, so a flow that matches the actual situation can be obtained.

[0060] The first and second events that are the targets of the connection operation are an increase or decrease in the value of one bit. Here, an increase corresponds to a change to the ON state, and a decrease corresponds to a change to the OFF state. Since bit devices often correspond to the presence or absence of input or output in the control program 211, it is expected that a flow that appropriately represents the order in which the presence or absence of input and output is determined will be obtained.

[0061] Furthermore, the generation unit 12 generates a flow by repeating the connection operation while excluding from the selection targets for the new second event the initial event, other events that occurred in the variable in which the initial event occurred, connection events directly or indirectly connected to the initial event, and other events that occurred in the variable in which the connection event occurred, with the second event connected by the previous connection operation as the new first event. This generates a flow in which one event is adopted for each variable. Since it is rare for all events that occur in a given variable to be meaningful, and it is usually the case that only one type of event should be focused on, the generated flow is expected to not include unnecessary events.

[0062] The flow generation device 10 also includes an output unit 13 that outputs a data file 31 representing the event flow diagram. This makes it easier to use the event flow diagram. For example, it is easy to create a manual that includes the event flow diagram.

[0063] Second Embodiment Next, a second embodiment will be described, focusing on the differences from the first embodiment described above. Note that the same reference numerals are used for configurations that are the same as or equivalent to those in the first embodiment. This embodiment differs from the first embodiment in that inappropriate sample values ​​calculated as time differences are eliminated before calculating an appropriate representative value.

[0064] The control process defined in the control program 211 is preferably executed periodically, but may be temporarily stopped when an abnormality such as a momentary power outage occurs. The time difference calculated in the preparation process from the log information recorded during such an exceptional period may include an outlier that is significantly different from the 15 or 16 seconds that occurs during normal operation, as shown in FIG.

[0065] Therefore, the generation unit 12 detects outliers in the distribution of time differences and calculates a representative value from sample values ​​of one or more time differences after excluding the detected outliers. For example, the generation unit 12 removes outliers using the so-called 3σ method. Specifically, the generation unit 12 calculates the mean value and standard deviation using all sample values ​​of time differences and repeats the process of removing sample values ​​that are more than three times the mean value and standard deviation from the distribution of time differences until no sample values ​​are removed from the distribution of time differences. In the example of FIG. 14, the process of determining sample values ​​to be removed is repeated six times, resulting in sample values ​​of 972 seconds or longer being removed as outliers.

[0066] Furthermore, if both the first and second events that are the targets of the connection operation occur only once in the control process defined by the control program 211, the time difference between these events will be approximately constant. However, if at least one of the first and second events occurs two or more times in the control process, the time difference between the events will not necessarily be constant. For example, as shown in Figure 15, time differences of approximately 20 seconds and approximately 80 seconds may alternate for the same combination of events.

[0067] Therefore, the generation unit 12 calculates a representative value based on the results of clustering the sample values ​​of the time differences. For example, the generation unit 12 performs clustering using the k-means method and calculates a representative value and a variation index value for each cluster. The generation unit 12 then adopts the representative value and index value of at least one cluster as values ​​to be used for the connection operation. For example, the generation unit 12 may adopt a cluster with a small representative value, a cluster with a small index value, or a weighted average of the values ​​of all clusters.

[0068] As described above, the generation unit 12 detects outliers in the distribution of time differences and calculates a representative value from sample values ​​of one or more time differences from which the detected outliers have been removed. This allows an appropriate representative value to be calculated, thereby obtaining a flow that is in line with reality.

[0069] Furthermore, the generation unit 12 calculates a representative value based on the result of clustering the sample values ​​of the time difference. For example, for a distribution that can be appropriately considered as two clusters as shown in Figure 15, a representative value calculated in the same manner as in embodiment 1 would be a value that hardly appears in the actual log information. In contrast, the generation unit 12 according to this embodiment calculates a representative value based on the result of clustering, thereby obtaining a representative value that is more in line with reality.

[0070] Embodiment 3. Next, the following describes embodiment 3, focusing on the differences from embodiment 1 described above. Note that the same reference numerals are used for configurations that are the same as or equivalent to embodiment 1 described above. This embodiment differs from embodiment 1 in that the log information does not include the date and time, and the time difference is not used in the connection operation.

[0071] As illustrated in FIG. 16, the log information according to this embodiment corresponds to the log information according to the first embodiment with the date and time omitted. Based on this log information, in the preparation process, as illustrated in FIG. 17, the frequency with which the two events occur consecutively without any other events in between is counted for all combinations of two events. The generation unit 12 then executes the connection operation using this frequency as the relevance. This generates a flow similar to that of the first embodiment. Note that the determination of condition 1 shown in FIG. 6 regarding the connection operation is omitted.

[0072] As explained above, in a connection operation, the second event that is most highly related to the first event is the event that occurs immediately after the first event with a higher frequency than other events. This makes it possible to generate a flow from a log that does not include time stamps.

[0073] Although the embodiments of the present disclosure have been described above, the present disclosure is not limited to the above-described embodiments.

[0074] For example, in the first and second embodiments, the format of the log information is not limited to a format that associates an event with the time of occurrence. The log information may be information in which the values ​​of variables are recorded at a sampling period shorter than the period of the control process, regardless of whether an event occurs. The presence or absence of an event may be determined in the preparation process from such information. The log information may be information that directly or indirectly indicates the transition of the values ​​of variables when the control program is executed by the PLC 21.

[0075] Although the example in which the log information acquiring unit 11 acquires the log information from the PLC 21 has been described, the present invention is not limited to this example. The log information acquiring unit 11 may acquire log information provided by a user.

[0076] Furthermore, although the flow is generated using events for all variables included in the control program 211, this is not limiting. The UI unit 14 may receive from the user a designation of a partial program corresponding to a part of the control program, and the generation unit 12 may generate a flow targeting the variables included in this partial program. The UI unit 14 corresponds to an example of a user interface means for receiving a designation of a partial program included in the control program.

[0077] Furthermore, the conditions used in the connection operation may be arbitrarily changed. For example, condition 3, which is used to alternately connect an input variable event and an output variable event, may be omitted. This allows an input variable event to be connected to another input variable event, or an output variable event to be connected to another output variable event.

[0078] Although the example of generating a flow using one type of event per variable has been described, this is not limiting. For example, a flow may be generated using all events for a variable specified by the user. That is, the exclusion target of condition 4 shown in FIG. 6 may be the connecting event connected to the initial event and the flow.

[0079] The generation unit 12 performs a connection operation with an initial event that occurs in an initial variable among multiple variables as the first event, and then repeats the connection operation with the second event connected by the previous connection operation as the new first event, while excluding the initial event and events directly or indirectly connected to the initial event from the selection candidates for the new second event, thereby generating a flow in which two or more events are connected in series, and corresponds to an example of a generation means for generating an event flow diagram showing the generated flow.

[0080] Furthermore, condition 2 may be changed from a subsequent event to a preceding event relative to the first event, or may be omitted. In the above embodiment, because condition 2 is a subsequent event, events that occurred after the initial event are connected in order, resulting in a flow of events that occurred after the initial event. This flow can be said to be a flow of events that are influenced by the initial event. On the other hand, if condition 2 is changed to a preceding event, events that occur before the initial event are connected in order, resulting in a flow that traces the events that caused the initial event.

[0081] In the connection operation according to the third embodiment, the second event having the highest relevance to the first event may also be an event that occurs more frequently immediately before the first event than other events.

[0082] Although an example has been described in which an increase and a decrease in the value of one bit are treated as different types of events, a change in value may be treated as a single type of event without distinguishing between an increase and a decrease. Furthermore, events that occur in a bit device are not limited to an increase or decrease in value, and may be changed to other events or other events may be added. An example of such other events is when an ON or OFF value is held for a specified period of time or longer.

[0083] Furthermore, the events that make up a flow are not limited to events that occur in a bit device, but may also be events that occur in a word device.

[0084] The functions of the flow generating device 10 according to the above-described embodiment can be realized by dedicated hardware or by a general computer system.

[0085] For example, by storing and distributing program P1 on a computer-readable recording medium such as a flexible disk, a CD-ROM (Compact Disk Read-Only Memory), a DVD (Digital Versatile Disk), or an MO (Magneto-Optical disk), and installing program P1 on a computer, a device that executes the above-mentioned processing can be configured.

[0086] Furthermore, the program P1 may be stored in a disk device of a server device on a communication network such as the Internet, and may be downloaded to a computer by superimposing it on a carrier wave, for example.

[0087] The above process can also be achieved by starting and executing the program P1 while transferring it via a network such as the Internet.

[0088] Furthermore, the above-described processing can also be achieved by executing all or part of program P1 on a server device, and executing program P1 while the computer sends and receives information about the processing via a communications network.

[0089] In addition, when the above-mentioned functions are realized by an operating system (OS) or by the OS working together with an application, only the parts other than the OS may be stored on a medium and distributed, or may be downloaded to a computer.

[0090] Furthermore, the means for realizing the functions of the flow generating device 10 is not limited to software, and some or all of the functions may be realized by dedicated hardware or circuits.

[0091] The present disclosure allows various embodiments and modifications without departing from the broad spirit and scope of the present disclosure. Furthermore, the above-described embodiments are intended to explain the present disclosure and do not limit the scope of the present disclosure. In other words, the scope of the present disclosure is defined by the claims, not the embodiments. Various modifications made within the scope of the claims and the meaning of equivalent disclosures are considered to be within the scope of the present disclosure.

[0092] The present disclosure is suitable for verification work of control programs used in FA sites.

[0093] 10 Flow generation device, 11 Log information acquisition unit, 12 Generation unit, 13 Output unit, 14 UI unit, 101 Processor, 102 Main memory unit, 103 Auxiliary memory unit, 104 Input unit, 105 Output unit, 106 Communication unit, 107 Internal bus, 21 PLC, 211 Control program, 22 Device, 31 Data file, 41 User, 51 to 58 Node, P1 Program.

Claims

1. A flow generation program for causing a computer to function as: a log information acquisition means for acquiring log information indicating transitions in the values ​​of multiple variables included in a control program for controlling an equipment, when the control program is executed by a programmable controller; and a generation means for selecting a second event having the highest degree of relevance to a first event that has occurred in a first variable of the multiple variables based on the log information, from among events that have occurred in a second variable different from the first variable, and connecting the second event to the first event, by performing a connection operation using an initial event that has occurred in an initial variable of the multiple variables as the first event, and then repeating the connection operation while setting the second event connected by the previous connection operation as the new first event, and excluding the initial event and events directly or indirectly connected to the initial event from the selection targets for the new second event, thereby generating a flow in which two or more events are connected in series, and generating an event flow diagram showing the generated flow.

2. The flow generation program of claim 1, wherein the log information indicates the changes in the values ​​of the multiple variables in relation to time when the processing defined by the control program is repeatedly executed by the programmable controller, and the degree of association is high when a representative value of the difference between the time when the first event occurs and the time when the second event occurs is small.

3. The flow generation program according to claim 2, wherein the connection operation is an operation of selecting the second event from among events having an index value indicating the variation in difference that is smaller than a threshold value.

4. A flow generation program as described in claim 3, wherein, after generating the flow, the generating means selects from the events constituting the flow an event that has the highest degree of relevance to an unconnected event that has occurred in any of the plurality of variables but is not included in the flow, and connects the unconnected event to the selected event to modify the flow.

5. The flow generation program according to any one of claims 2 to 4, wherein the generation means detects outliers in the distribution of the differences, and calculates the representative value from one or more of the differences from which the detected outliers have been excluded.

6. The flow generation program according to any one of claims 2 to 5, wherein the generation means calculates the representative value based on a result of clustering a plurality of sample values ​​of the difference.

7. A flow generation program according to any one of claims 2 to 6, wherein the event flow diagram shows the flow using nodes corresponding to events and lines connecting the nodes corresponding to the connected events, and shows the flow by adding the representative value to the lines.

8. The flow generation program of claim 1, wherein the log information indicates the changes in the values ​​of each of the multiple variables when the processing defined by the control program is repeatedly executed by the programmable controller, and the second event having the highest degree of relevance to the first event is an event that occurs more frequently immediately before or after the first event than other events.

9. A flow generation program according to any one of claims 1 to 8, wherein, when the first variable is an input variable corresponding to an input to the programmable controller, the second variable is an output variable corresponding to an output from the programmable controller to the device, and, when the first variable is the output variable, the second variable is the input variable.

10. A flow generation program according to any one of claims 1 to 9, wherein the first variable and the second variable are variables representing a one-bit value, and the first event and the second event are a change in the value of the one bit.

11. The flow generating program according to claim 10, wherein the first event and the second event are an increase or a decrease in the value of the one bit, respectively.

12. A flow generation program as claimed in any one of claims 1 to 11, wherein the generation means generates the flow by repeating the connection operation while excluding from the selection targets for the new second event the second event connected by the previous connection operation as the new first event, an event that has occurred in the initial variable, a connection event directly or indirectly connected to the initial event, and another event that has occurred in a variable in which the connection event has occurred.

13. A flow generation program according to any one of claims 1 to 12, further causing the computer to function as a user interface means for accepting designation of a partial program included in the control program, and the plurality of variables being variables included in the partial program.

14. The flow generation program according to any one of claims 1 to 13, further causing the computer to function as: output means for outputting a data file showing the event flow diagram.

15. A flow generation device comprising: a log information acquisition means for acquiring log information indicating transitions in the values ​​of multiple variables included in a control program for controlling an appliance when the control program is executed by a programmable controller; and a generation means for performing a connection operation of selecting a second event having the highest degree of relevance indicating the degree of relevance to a first event occurring in a first variable among the multiple variables based on the log information from events occurring in a second variable different from the first variable, and connecting the second event to the first event, using an initial event occurring in an initial variable among the multiple variables as the first event, and then repeating the connection operation while setting the second event connected by the previous connection operation as the new first event, and excluding the initial event and events directly or indirectly connected to the initial event from the selection targets for the new second event, thereby generating a flow in which two or more events are connected in series, and generating an event flow diagram indicating the generated flow.

16. A flow generation method comprising: a log information acquisition means acquires log information indicating transitions in the values ​​of multiple variables included in a control program for controlling an equipment when the control program is executed by a programmable controller; a generation means executes a connection operation to select a second event having the highest degree of relevance to a first event that has occurred in a first variable among the multiple variables based on the log information, from events that have occurred in a second variable different from the first variable, and connects the second event to the first event, using an initial event that has occurred in an initial variable among the multiple variables as the first event, and then repeats the connection operation while setting the second event connected by the previous connection operation as the new first event, and excluding the initial event and events directly or indirectly connected to the initial event from the selection targets for the new second event, thereby generating a flow in which two or more events are connected in series; and the generation means generates an event flow diagram indicating the flow.

Citation Information

Patent Citations

  • Process monitoring device

    JP2019053537A

  • Monitoring system and monitoring method

    JP2020052714A

  • Monitoring device and programmable logic controller system

    JP2022158228A

  • Device abnormality monitoring method and system

    WO2010082322A1