Simulation program, simulation method, and simulation device

By introducing the simulation unit in the simulation program, the simulation time of the virtual controller and the virtual system is synchronized to solve the problem of inconsistent degree of inconsistency when recovering the simulation after stopping, and the accurate simulation of the programmable controller and the FA system.

CN119365835AActive Publication Date: 2025-01-24MITSUBISHI ELECTRIC CORP
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202280097019.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2022-10-18
Publication Date
2025-01-24
Estimated Expiration
2042-10-18

AI Technical Summary

Technical Problem

When performing simulation of programmable controller and FA system, when the simulation is resumed after stopping the operation, the simulation progress of the two is inconsistent, resulting in the inability to perform accurate simulation.

Method used

By introducing the simulation unit in the simulation program, the simulation time of the virtual controller and the virtual system is synchronized with the pre -determined cycle, and the virtual system is used to use the virtual output to simulate the action of the programmable controller and the FA system. Essence

Benefits of technology

When resuming simulation after stopping, it is possible to ensure that the simulation progress of the programmable controller and FA system is consistent, thereby performing accurate simulation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119365835A_ABST
    Figure CN119365835A_ABST
Patent Text Reader

Abstract

The program causes the simulation device (10) to function as: an acquisition unit (11) that acquires an execution program (21a) executed by the programmable controller (21) and system configuration information indicating the configuration of the FA system (22); and a simulation unit (14) that synchronizes a first simulation time of a virtual controller (31) corresponding to the programmable controller (21) and a second simulation time of a virtual system (32) configured on the basis of the system configuration information in units of predetermined cycles. The operation of the programmable controller (21) and the FA system (22) is simulated by causing the virtual controller (31) to execute the execution program (21a) and causing the virtual system (32) to operate by means of a virtual output obtained by causing the virtual controller (31) to execute the execution program (21a).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a simulation program, a simulation method and a simulation device. Background Art

[0002] At the FA (Factory Automation) site, the FA system including various FA devices represented by sensors and servo motors operates according to the instructions of the programmable controller, thereby realizing various processes. Regarding the operation of such a FA system, it is preferable to perform simulation in advance to verify whether there are any problems, the program executed by the programmable controller, or the parameters set in the FA device (for example, refer to Patent Document 1).

[0003] Patent document 1 describes a virtual workshop simulation system having a simulator for simulating a workshop controlled by a controller. In the technology of patent document 1, if the operator performs a "stop" operation, the action of the controller and the calculation of the simulator stop and maintain their states, and if there is a "start" or "execute" operation, the controller and the simulator execute the contents of the instruction corresponding to the operation.

[0004] Patent Document 1: Japanese Patent Application Publication No. 2017-187947 Summary of the invention

[0005] In the technology of Patent Document 1, the simulator simulates the actual machine controller in real time. However, if the operation of the programmable controller is also simulated, the programmable controller of the actual machine can be prepared, and the cooperative operation of the programmable controller and the FA system connected to the programmable controller can be verified earlier.

[0006] Here, the simulation of the programmable controller is performed separately from the simulation of the FA system, rather than simulating the programmable controller and the FA system as one body. This is preferred from the perspective of the burden of simulation software development and future expansibility. However, even when the simulation of the programmable controller and the simulation of the FA system are performed in parallel, when the stop operation is performed, the time on the simulation of both parties is not necessarily the same. That is, the simulation may be stopped in a state where the action until a different time is simulated. Therefore, when resuming the simulation from the stopped state, the progress of the simulation will be different, and it may not be possible to perform accurate simulation of the programmable controller and the FA system.

[0007] The present invention has been made in view of the above circumstances, and an object of the present invention is to perform accurate simulation of a programmable controller and an FA system.

[0008] In order to achieve the above-mentioned purpose, the simulation program of the present invention makes a computer that simulates the respective actions of a programmable controller and a system that acts according to the output from the programmable controller function as the following units: an acquisition unit, which acquires an execution program executed by the programmable controller to generate an output from the programmable controller and system structure information representing the structure of the system; and a simulation unit, which synchronizes the first simulation time of a virtual controller corresponding to the programmable controller and the second simulation time of a virtual system constructed based on the system structure information in units of a predetermined period, and causes the virtual system to act by causing the virtual controller to execute the execution program to obtain a virtual output, thereby simulating the actions of the programmable controller and the system, the acquisition unit acquires a stop instruction for stopping the simulation performed by the simulation unit, and if the stop instruction is acquired by the acquisition unit, the simulation unit stops the simulation of the actions performed by the virtual controller and the virtual system at a timing that synchronizes the first simulation time and the second simulation time.

[0009] Effects of the Invention

[0010] According to the present invention, the simulation unit stops the simulation of the action at a timing that synchronizes the first simulation time with the second simulation time. Thus, the simulation can be resumed by considering the progress of the simulation of the action of the programmable controller and the system as being equal. Therefore, accurate simulation of the programmable controller and the FA system can be performed. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] Figure 1 It is a diagram showing the structure of a simulation device involved in the embodiment.

[0012] Figure 2 It is a diagram showing the hardware configuration of a simulation device according to an embodiment.

[0013] Figure 3 This is a diagram showing an example of information set in the simulation device according to the embodiment.

[0014] Figure 4 This is a diagram showing an example of system configuration information involved in the implementation mode.

[0015] Figure 5 This is a diagram showing an example of controller configuration information according to an embodiment.

[0016] Figure 6 It is a diagram showing a display example of the progress of the simulation according to the embodiment.

[0017] Figure 7 It is a diagram showing an example of time setting data involved in the embodiment.

[0018] Figure 8This is a diagram for explaining the synchronization of simulation time according to the embodiment.

[0019] Fig. 9 This is a diagram showing an example of creating a directed acyclic graph according to an implementation method.

[0020] Fig.10 This is a flowchart showing a virtual controller process and a virtual system process according to the embodiment.

[0021] Fig.11 This is a diagram showing an example in which an instruction to execute or stop simulation of a virtual controller and a virtual system according to the embodiment is transmitted. DETAILED DESCRIPTION

[0022] Hereinafter, a simulation device for executing a simulation program according to an embodiment of the present invention will be described in detail with reference to the drawings.

[0023] Implementation method.

[0024] The simulation device 10 according to this embodiment is as follows: Figure 1 As shown, it is a computer that simulates the operation of the programmable controller 21 and the FA system 22 on software, for example, an industrial PC (Personal Computer), a tablet terminal, or a server device on the network.

[0025] The programmable controller 21 is connected to the FA system 22 via a communication line. The communication line can be a wiring for transmitting a current signal or a voltage signal, a signal line for transmitting serial data, or an industrial network. Alternatively, there can be one or more communication lines. The programmable controller 21 can be connected to the FA system 22 via multiple communication lines of different types.

[0026] The programmable controller 21 outputs a signal to the FA system 22 by executing the execution program 21a. The execution program 21a is, for example, a ladder program written in a ladder language or a program written in another language. The execution program 21a may be any program that describes the content and sequence of the signal to be output to the FA system 22.

[0027] The FA system 22 is a system that operates based on a signal output from the programmable controller 21. The FA system 22 has one or more elements. When the FA system 22 has multiple elements, these multiple elements can be connected to each other. In detail, each element can be connected to other elements to perform at least one of receiving a signal output from other elements and sending a signal to other elements. In addition, each element has a state that changes based on the signal when receiving a signal from other elements.

[0028] exist Figure 1 In the case where the FA system 22 shown has elements 22a, 22b, 22c, and 22d, for example, the element 22a is a lamp or LED (Light Emitting Diode) that lights up when receiving an ON signal from the programmable controller 21 and turns off when receiving an OFF signal. In addition, the element 22b may be a servo amplifier that drives the elements 22c and 22d, which are servo motors, according to the control instructions from the programmable controller 21. The elements constituting the FA system 22 are not limited to the above examples, and may also be logic operation elements, display devices represented by LEDs and LCDs (Liquid Crystal Displays), gauges, sensors, switches, actuators, servo amplifiers, servo motors, other motors, valves, robots, machine tools, and other FA equipment. In addition, any element may be another programmable controller different from the programmable controller 21, and the FA system 22 may not include another programmable controller. The FA system 22 operates according to the output from the programmable controller 21, thereby realizing various processes in the factory represented by production processes, processing processes, inspection processes, and monitoring processes.

[0029] In addition, if Figure 1 As shown, the FA system 22 also includes elements 22b, 22c, and 22d connected to each other, and an element 22a not connected to other elements. The FA system 22 may include a plurality of elements not connected to other elements but connected to the programmable controller 21.

[0030] The simulation device 10 is a software for simulating the operation of the programmable controller 21 and the FA system 22 based on the execution program 21a without actually constructing the programmable controller 21 and the FA system 22. In order to execute the software, the simulation device 10 has Figure 2 Specifically, the simulation device 10 includes a processor 41, a main storage unit 42, an auxiliary storage unit 43, an input unit 44, an output unit 45, and a communication unit 46. The main storage unit 42, the auxiliary storage unit 43, the input unit 44, the output unit 45, and the communication unit 46 are connected to the processor 41 via an internal bus 47.

[0031] The processor 41 includes a CPU (Central Processing Unit) as a processing circuit. The processor 41 executes the program P1 stored in the auxiliary storage unit 43 to realize various functions of the simulation device 10 and execute the processing described below.

[0032] The main storage unit 42 includes a RAM (Random Access Memory). The program P1 is loaded from the auxiliary storage unit 43 into the main storage unit 42. The main storage unit 42 is used as a work area of ​​the processor 41. Figure 2 Although one program P1 is representatively shown in the figure, there may be a plurality of programs P1. For example, in addition to the program P1 corresponding to the software for simulation, there may be a program P1 corresponding to an engineering design tool for editing the execution program 21a. The program P1 for simulation is an example of a simulation program.

[0033] The auxiliary storage unit 43 includes a nonvolatile memory represented by an EEPROM (Electrically Erasable Programmable Read-Only Memory) and an HDD (Hard Disk Drive). In addition to the program P1, the auxiliary storage unit 43 also stores various data used in the processing of the processor 41. The auxiliary storage unit 43 supplies the data used by the processor 41 to the processor 41 according to the instruction of the processor 41, and stores the data supplied from the processor 41.

[0034] The input unit 44 includes input devices represented by a keyboard and a pointing device. The input unit 44 acquires information input by a user of the simulation device 10 and notifies the processor 41 of the acquired information.

[0035] The output unit 45 includes output devices represented by an LCD (Liquid Crystal Display) and a speaker. The output unit 45 presents various information to the user according to the instruction of the processor 41.

[0036] The communication unit 46 has a network interface circuit for communicating with an external device. The communication unit 46 receives a signal from the outside and outputs information represented by the signal to the processor 41. In addition, the communication unit 46 transmits a signal representing information output from the processor 41 to an external device.

[0037] The input unit 44 and the output unit 45 correspond to the UI (User Interface) of the simulation device 10. However, the simulation device 10 may be connected to an external UI device via the communication unit 46, obtain information from the user via the communication unit 46, and provide information to the user. When an external UI device is used as the UI of the simulation device 10 instead of the input unit 44 and the output unit 45, the input unit 44 and the output unit 45 may be omitted, and the communication unit 46 performs the function of sending and receiving information for the UI.

[0038] Back to Figure 1The simulation device 10 has a functional structure realized by the cooperative action of the above-mentioned hardware structure. In detail, the simulation device 10 has: an acquisition unit 11, which acquires various information; a display unit 12, which displays information related to the simulation to the user; a state data storage unit 13, which stores and saves state data representing a certain timed state of the simulation being performed; and a simulation unit 14, which simulates the action of the programmable controller 21 and the FA system 22 by making the virtual controller 31 and the virtual system 32 constructed virtually act in the same way as the programmable controller 21 and the FA system 22.

[0039] The acquisition unit 11 and the display unit 12 are implemented by the input unit 44 and the output unit 45 as UI and the processor 41 that executes the engineering design tool. The simulation unit 14 is implemented by the processor 41 that executes the software for simulation. The simulation device 10 is equivalent to an example of a simulation device that simulates the operation of the programmable controller and the system that operates according to the output from the programmable controller.

[0040] The acquisition unit 11 acquires the execution program 21a and the system configuration information indicating the configuration of the FA system 22. Specifically, the acquisition unit 11 may acquire the execution program 21a and the system configuration information directly input by the user, or may acquire the execution program 21a and the system configuration information by reading the execution program 21a and the system configuration information from the address of the auxiliary storage unit 43 specified by the user or from an external storage device. The execution program 21a is executed by the virtual controller 31, and the system configuration information is used to construct the virtual system 32. The acquisition unit 11 is an example of an acquisition unit that acquires the execution program executed by the programmable controller to generate an output from the programmable controller and the system configuration information indicating the configuration of the system.

[0041] exist Figure 3 An example of a screen for inputting system configuration information is shown in FIG. Figure 3 As shown in the column "Virtual System" on the upper right side of the , the user can configure objects corresponding to the elements constituting the FA system 22, and connect the objects with lines to input the elements constituting the FA system and the relationship between the elements. Thus, the virtual system 32 is configured so that the elements are connected in the same way as the FA system 22.

[0042] exist Figure 3In the example, the 2nd to 4th terminals of the "output unit block" corresponding to the output unit constituting the virtual controller 31 output signals to the three lamps respectively, and the signal of the uppermost lamp is further input to the 1st terminal of the "input unit block" corresponding to the input unit constituting the virtual controller 31 through the NOT element. In addition, the outputs of the two switches are respectively input to the 3rd and 5th terminals of the "input unit block". Furthermore, the signal is input to the cylinder from the 8th terminal of the "output unit block", and the signal from the cylinder is input to the 7th terminal of the "input unit block".

[0043] Here, the "output unit block" and the "input unit block" are actually components of the virtual controller 31 for sending and receiving signals to and from the outside, and are not components of the virtual system 32, but are shown to make the connection between the virtual controller 31 and the components of the virtual system 32 clear. Figure 3 It can be seen that the FA system 22 is usually the control target of the programmable controller 21. In addition, a signal output from the FA system 22 can be fed back to the programmable controller 21 to form a closed loop system.

[0044] about Figure 3 The detailed contents of the action of the "cylinder" exemplified can be input by the user using the subwindow displayed by selecting the block of "cylinder", or the user can specify a file describing the detailed contents of the action separately. The detailed contents of the action of the elements constituting the FA system are information indicating how the state of the elements changes based on the signals input to the elements, and are included in the system configuration information. For example, if an ON signal is input to the cylinder, the cylinder position increases at a speed of 1 mm per second, and when it reaches 100 mm, which is the MAX position, an ON signal is output, which becomes the detailed contents of the action of the cylinder.

[0045] pass Figure 3 The module diagram shown in the example, the acquisition unit 11 acquires Figure 4 In addition, instead of a block diagram, the user can Figure 4 The simulation device 10 may directly input the system configuration information in the table shown, or may obtain the system configuration information in other forms. The system configuration information may be information related to a plurality of elements, the connection relationship between the plurality of elements, and the status of each element.

[0046] In addition, in the programmable controller 21, Figure 3 In the case of a PLC (Programmable Logic Controller) in the form of a building block composed of a plurality of units, as shown in the virtual controller 31 of FIG. 1 , the acquisition unit 11 may also acquire controller configuration information indicating the configuration of the programmable controller 21. The controller configuration information may be as follows: Figure 3 The "Virtual Controller" column on the upper left side of the display can be input by the user in the form of a module diagram. Figure 5 The controller structure information is shown in tabular form.

[0047] Here, Figure 5 The controller configuration information indicates each unit mounted on the base unit and the mounting position of each unit on the base unit. Figure 5 The "execution unit" in the example is a unit that executes the execution program 21a, and Figure 3 In addition, Figure 5 The "input unit" in Figure 3 In the “IN”, Figure 5 The "output unit" in Figure 3 In addition, the programmable controller 21 and the virtual controller 31 may also have other units as units mounted on the basic unit. Other units are, for example, a motion unit connected to a servo amplifier for high-precision control of a servo system, a servo amplifier unit, a network unit for communicating via a network, an input / output unit having the functions of at least one of the above-mentioned input unit and output unit, and a remote input / output unit. When information related to the wiring of these units is required when configuring the programmable controller 21, the controller configuration information includes information related to the wiring.

[0048] The display unit 12 is, for example, Figure 6 As shown, the simulation results are displayed. In addition, the simulation results include the simulation process, that is, the results of the simulation until a certain timing. Figure 6 In the example of FIG. 5 , the breakpoint of the execution program 21a executed by the virtual controller 31 is represented by a triangular object 51, and the address in the memory of the virtual controller 31 and the value stored in the address are represented in association. The value of the memory changes with the execution of the execution program 21a, and the virtual controller 31 generates a virtual output for the virtual system 32 using the value. Therefore, by observing the value, the user can confirm whether the processing specified in the execution program 21a is correctly executed.

[0049] In addition, if Figure 6 As shown in the upper right part of , the states of the elements constituting the virtual system 32 that change as the simulation progresses are displayed on the display unit 12. For example, the lighting and extinguishing of a lamp and the ON and OFF states of a switch are displayed in a manner that can be distinguished and visually recognized by the user, and a character string representing the cylinder position is displayed.

[0050] During the simulation, instructions from the user related to the progress of the simulation are acquired by the acquisition unit 11 via a screen displayed by the display unit 12. Instructions related to the progress of the simulation include, for example, a stop instruction to temporarily stop the simulation, a resume instruction to resume a stopped simulation, an operation on the virtual controller 31, and an operation on an element in the virtual system 32 that receives user input. The stop instruction is an instruction from the user to temporarily stop the simulation, a resume instruction to resume a stopped simulation, an operation on the virtual controller 31, and an operation on an element in the virtual system 32 that receives user input. Figure 6 The operation of the virtual controller 31 can be input by selecting the button B2 shown in the example, and the recovery instruction is input by selecting the button B1. Figure 3 The components contained in the displayed object can be operated and input, or Figure 6 The values ​​shown are directly overwritten and thus input. Operations on the elements of the virtual system 32 can be performed by Figure 6 The displayed object is operated and inputted.

[0051] In addition, as an instruction related to the simulation, the acquisition unit 11 acquires Figure 6 The illustrated button B3 is selected to input a save instruction for saving the current state of the simulation, and the button B4 is selected to input a read instruction for reading the saved state of the simulation. The save instruction is input, for example, when the user is off duty, before leaving the seat, before the power supply of the simulation device 10 is cut off, or when it is determined that the current timing state of the ongoing simulation is needed for use in subsequent verification. The read instruction is input, for example, when the user is on duty, after taking a seat, after the power supply of the simulation device 10 is turned on, or during the verification of the past simulation, in order to restore the simulation state. If a start instruction is input after the read instruction, the simulation is resumed from the read state.

[0052] The state data storage unit 13 is mainly implemented by the auxiliary storage unit 43. In the state data storage unit 13, state data representing the state of the simulation when the save instruction is input is stored. The state data represents the execution program 21a, the breakpoints of the execution program 21a, the data stored in the memory of the virtual controller 31, the controller structure information, the system structure information, and the state of each element of the virtual system 32. In addition, when the read instruction is input, the state data is read from the state data storage unit 13. And the state data is used to resume the simulation from midway. The state data storage unit 13 is equivalent to an example of a state data storage unit, which stores state data representing the state of the virtual controller and the virtual system whose simulation of the action is stopped according to the stop instruction.

[0053] The simulation unit 14 simulates the execution of the execution program 21a by the programmable controller 21 by causing the virtual controller 31 to execute the execution program 21a. The simulation unit 14 configures the virtual controller 31 based on the execution program 21a and the controller configuration information, and configures the virtual system 32 based on the system configuration information.

[0054] The simulation unit 14 has a memory for storing the same data as the programmable controller 21, and executes the commands included in the execution program 21a one by one. In addition, the simulation unit 14 measures the simulation time that passes as the commands are executed. The simulation time is the same as the actual time that passes when the programmable controller 21 executes the execution program 21a, and is the virtual time that passes when the virtual controller 31 executes the execution program 21a. For example, the simulation unit 14 is based on Figure 7 The time setting data shown counts the simulation time. The time setting data indicates the instructions included in the execution program 21a and the length of time required to execute the instructions in association with each other. The time setting data can be acquired by the acquisition unit 11 together with the execution program 21a.

[0055] Furthermore, the simulation time may be linked to the actual time in the same manner as the execution of the command, or it may not correspond to the actual time. In addition, the timing of the simulation time and the simulation of the execution of the command may be performed simultaneously, or one may be used as the starting point to execute the other. For example, after advancing the simulation time, the simulation unit 14 may execute a command executable within the simulation time of the advancing length, and after executing the command, advance the simulation time by a length corresponding to the command.

[0056] In addition, the simulation unit 14 performs an operation simulation of the virtual system 32. Specifically, the simulation unit 14 changes by executing the execution program 21a, and simulates the state change of the elements of the virtual system 32 based on the virtual output from the virtual controller 31. The simulation unit 14 counts the simulation time of the virtual system 32 separately from the simulation time of the virtual controller 31. That is, the simulation unit 14 performs the simulation of the virtual controller 31 and the simulation of the virtual system 32 separately. However, the simulation unit 14 synchronizes the simulation time of the virtual controller 31 and the simulation time of the virtual system 32 for each predetermined cycle.

[0057] exist Figure 8 The synchronization of simulation time is schematically shown in Figure 8In the example, the simulation time of each virtual controller 31 and virtual system 32 is synchronized in units of 6μsec cycles. Specifically, when the simulation time equal to the cycle has passed since the last synchronization timing, the virtual controller 31 and virtual system 32 wait if the simulation time equal to the cycle has not passed in the other party, and start the simulation of the next cycle if it has passed.

[0058] In each cycle, the simulation times of the virtual controller 31 and the virtual system 32 are not necessarily synchronized. However, since the upper limit of the synchronization error of the simulation times of the virtual controller 31 and the virtual system 32 is equal to the length of the cycle, the simulation times are synchronized with a relatively small error.

[0059] Furthermore, the simulation unit 14 simulates the actions of each of the elements constituting the virtual system 32. However, when the elements are connected to each other, the order is determined by the influence of the virtual output from the virtual controller 31. Therefore, the simulation unit 14 determines the order of the elements based on the system structure information, and simulates the change of the state of the elements in the determined order. In detail, the simulation unit 14 generates a directed acyclic graph of multiple elements, performs a topological sorting of the generated directed acyclic graph, and thereby determines the order of the elements. The connection relationship between the elements that specify the input and output is essentially information equal to the directed acyclic graph, and the graph can be generated if a commonly known method is used. In addition, regarding the topological sorting of the assigned directed acyclic graph, a commonly known method can also be used, so its details are omitted.

[0060] exist Figure 8 In the example of , the actions of the elements H, I, and J constituting the virtual system 32 are simulated in this order. Figure 8 As shown in the cycle of 0 to 6 μsec in FIG. 1 , after simulating the action of element H in this cycle, the action of element I in this cycle can be simulated, and then the action of element J in this cycle can be simulated. Figure 8 As shown in the cycle of 6 to 12 μsec in FIG. 1 , if the order of these elements I and J is maintained, the simulation of the action of element I and the simulation of the action of element J can be partially executed in parallel. That is, when focusing on a certain simulation time, for example, 8 μsec, the simulation of element I that is first affected by the output from the virtual controller 31 can be performed earlier than the simulation of element J.

[0061] In addition, if Fig. 9As shown, when at least one of the input and output of the component constituting the virtual system 32 is greater than or equal to 2, a directed acyclic graph is created with each terminal of the component as a node, and the order of the terminals that should simulate the input and output signals is determined. In other words, the order can be determined with respect to the terminals of the component equivalent to the element. In addition, each terminal can also be treated as an element constituting the virtual system 32.

[0062] In addition, Fig. 9 In the example, a loop is generated in the relationship between the components, but if the dependency relationship of the terminals is considered, a directed acyclic graph can be created because no loop is generated. However, sometimes a loop is generated in the connection relationship between the elements or the dependency relationship between the terminals. In this case, a directed acyclic graph can be created by adding an order to each element or each terminal with the element or terminal connected to the virtual controller 31 as the starting point, and processing the node immediately before the connection relationship that generates the loop as the end point. For example, in Fig. 9 In the case where terminal J2 depends not only on terminal J3 but also on terminal J1, the dependency relationship between terminal J1 and terminal J2 may be omitted and a graph may be created.

[0063] The simulation time of the virtual controller 31 is equivalent to an example of the first simulation time, and the simulation time of the virtual system 32 is equivalent to an example of the second simulation time. The simulation unit 14 is equivalent to an example of a simulation unit, which synchronizes the second simulation time of the virtual system configured based on the first simulation time of the virtual controller corresponding to the programmable controller and the system configuration information in units of a predetermined cycle, and operates the virtual system by causing the virtual controller to execute the virtual output obtained by executing the execution program, thereby simulating the operation of the programmable controller and the system.

[0064] Next, regarding the processing executed by the simulation device 10, use Fig.10 , 11 For explanation. Fig.10 , the sequence of the virtual controller processing executed by the virtual controller 31 and the virtual system processing executed by the virtual system 32 is schematically shown.

[0065] In the virtual controller process, the virtual controller 31 simulates the execution of the execution program 21a in the current cycle (step S11). Specifically, the simulation unit 14 refers to the time setting data and sequentially executes the instructions executable in the cycle of the predetermined length in the process specified in the execution program 21a.

[0066] If the execution of the command in the cycle is completed, the virtual controller 31 notifies the virtual system 32 of the completion of the simulation of the action in the cycle (step S12). Fig.10 In FIG. 1 , the notification is represented by a dotted arrow.

[0067] Then, the virtual controller 31 determines whether the simulation time of the virtual system 32 is equal to the end time of the current cycle (step S13). Specifically, the virtual controller 31 determines whether a notification of the completion of the simulation is received from the virtual system 32.

[0068] If the determination of step S13 is negative (step S13; No), the determination of step S13 is repeated until the determination is positive, and the virtual controller 31 does not continue the execution of the program 21a, but waits. On the other hand, if the determination of step S13 is positive (step S13; Yes), the virtual controller 31 transfers to the next cycle (step S14), returns to step S11, and thus continues the execution of the program 21a.

[0069] In the virtual system process, the virtual system 32 simulates the operation of each element in the current cycle (step S21 ). Specifically, the simulation unit 14 refers to the system configuration information and simulates the state change of each element in a cycle of a predetermined length based on the output from the virtual controller 31 .

[0070] If the simulation is completed, the virtual system 32 notifies the virtual controller 31 of the completion of the simulation of the actions in the cycle (step S22). Fig.10 In FIG. 1 , the notification is represented by a dotted arrow.

[0071] Then, the virtual system 32 determines whether the simulation time of the virtual controller 31 is equal to the end time of the current cycle (step S23 ). Specifically, the virtual system 32 determines whether a notification to the effect that the simulation is completed is received from the virtual controller 31 .

[0072] If the determination in step S23 is negative (step S23; No), the determination in step S23 is repeated until the determination is positive, and the virtual system 32 does not continue the simulation but waits. On the other hand, if the determination in step S23 is positive (step S23; Yes), the virtual system 32 transfers to the next cycle (step S24), returns to step S21, and continues the simulation.

[0073] exist Fig.11 3 shows the sequence of processing performed by the virtual controller 31 and the virtual system 32 when an instruction indicating whether or not to execute the simulation is input. Specifically, the virtual controller 31 determines whether or not there is an instruction indicating whether or not to execute the simulation (step S31). Here, the instruction indicating whether or not to execute the simulation refers to an instruction to start, resume, or stop the simulation.

[0074] When it is determined that there is no instruction (step S31; No), the virtual controller 31 repeats the determination of step S31. On the other hand, when it is determined that there is an instruction (step S31; Yes), the virtual controller 31 determines whether the simulation time is synchronous timing (step S32). When it is determined that the simulation time is not synchronous timing (step S32; No), the virtual controller 31 repeats the determination of step S32 and waits until the simulation time becomes synchronous timing. On the other hand, when it is determined that the simulation time is synchronous timing (step S32; Yes), the virtual controller 31 executes the execution program 21a according to the instruction or stops the execution (step S33). Thus, when there is an instruction to stop in the state of executing simulation, the virtual controller 31 executes the simulation until the synchronous timing. In addition, when there is an instruction to start or resume the simulation in step S31 in the state where the virtual controller 31 has stopped the simulation, step S32 can be omitted.

[0075] Next, the virtual controller 31 transmits the instruction determined to be input in step S31 to the virtual system 32 (step S34 ).

[0076] The virtual system 32 receives the sent instruction (step S35), and executes or stops the simulation according to the instruction (step S36). Thus, when a stop instruction is issued, both the virtual controller 31 and the virtual system 32 stop the simulation at a timing synchronized with the simulation time. Fig.10 , 11 The illustrated process corresponds to an example of a simulation method executed by the simulation device.

[0077] As described above, the simulation unit 14 stops the simulation of the action at a timing that synchronizes the simulation time of the virtual controller 31 with the simulation time of the virtual system 32. As a result, the simulation can be resumed by assuming that the progress of the action simulation of the programmable controller 21 and the FA system 22 are equal. Therefore, accurate simulation of the programmable controller 21 and the FA system 32 can be performed.

[0078] In addition, the simulation unit 14 determines the order of the elements of the virtual system 32 based on the system configuration information, and simulates the change of the state of each element in the determined order. Thus, the simulation of the virtual system 32 can be accurately performed. In detail, the simulation unit 14 generates a directed acyclic graph of multiple elements, performs topological sorting of the generated directed acyclic graph, and thereby determines the order of each element. With respect to the generation and topological sorting of the directed acyclic graph, efficient algorithms are known, so the simulation unit 14 can determine the order of each element at a high speed.

[0079] In addition, the state data storage unit 13 involved in this embodiment stores the state data indicating the state of the virtual controller 31 and the virtual system 32. If the acquisition unit 11 acquires the read instruction of the state data, the simulation unit 14 restores the state of the virtual controller 31 and the virtual system 32 indicated by the state data. Here, the state of the virtual controller 31 refers to the value of the simulation time in a specific simulation time, the execution state of the execution program 21a, the controller configuration information, and the state of the virtual unit constituting the virtual controller 31. The execution state of the execution program 21a includes the execution program 21a, its breakpoints, and the data to be set in the execution program 21a. In addition, the state of the virtual system 32 refers to the system configuration information, the simulation time of the virtual system 32, and the state of each element. As a result, it is not necessary to execute the simulation again from the beginning, and it is possible to recover from the middle. For example, it is possible to start the simulation from the state where the device startup sequence of the programmable controller 21 and the FA system 22 is completed, thereby shortening the time spent on analyzing the simulation results.

[0080] As mentioned above, although embodiment of this invention was described, this invention is not limited to the said embodiment.

[0081] For example, the example of constructing the virtual controller 31 based on the controller structure information representing the structure of the building block type programmable controller 21 is described, but the present invention is not limited to this. For example, the virtual controller 31 can be constructed by providing information representing the model of the programmable controller 21 integrally constructed with the functions of the above-mentioned multiple units to the simulation device 10 instead of the controller structure information.

[0082] In addition, the example of the virtual controller 31 and the virtual system 32 notifying the completion of the simulation of the action within the cycle on the simulation time is described, but it is not limited to this. The virtual controller 31 and the virtual system 32 can also notify the other party of the timed simulation time, and determine whether the simulation time notified from the other party is equal to the end time of the cycle.

[0083] The functions of the simulation device 10 can be realized by dedicated hardware or by a general computer system.

[0084] For example, the program P1 executed by the processor 41 can be stored in a computer-readable non-volatile recording medium and released, and the program P1 can be installed in a computer, thereby forming a device that executes the above-mentioned processing. As the above-mentioned recording medium, for example, a floppy disk, a CD-ROM (Compact Disc Read-Only Memory), a DVD (Digital Versatile Disc), and an MO (Magneto-Optical Disc) can be considered.

[0085] Alternatively, the program P1 may be stored in a storage disk device of a server device on a communication network such as the Internet, and may be superimposed on a carrier wave and downloaded to a computer.

[0086] Furthermore, the above-described processing can also be realized by starting up the execution of the program P1 while transferring it via a communication network.

[0087] Furthermore, the above-described processing can also be realized by causing all or part of the program P1 to be executed on a server device, and causing a computer to execute the program while transmitting and receiving information related to the processing via a communication network.

[0088] Furthermore, when the above functions are realized by sharing the responsibility of the OS (Operating System) or by cooperation between the OS and the application, only the portion other than the OS may be stored in a medium and distributed, or may be downloaded to a computer.

[0089] In addition, the means for realizing the functions of the simulation device 10 are not limited to software, and a part or all of them may be realized by dedicated hardware including a circuit.

[0090] The present invention can be implemented in various embodiments and variations without departing from the broad spirit and scope of the present invention. In addition, the above-mentioned embodiments are used to illustrate the present invention and do not limit the scope of the present invention. That is, the scope of the present invention is not shown by the embodiments, but by the claims. Moreover, various variations implemented within the scope of the claims and the meaning of the invention equivalent thereto are regarded as being within the scope of the present invention.

[0091] Industrial Applicability

[0092] The invention is suitable for action simulation of a programmable controller and its peripheral equipment.

[0093] Description of the label

[0094] 10 simulation device, 11 acquisition unit, 12 display unit, 13 status data storage unit, 14 simulation unit, 21 programmable controller, 21a execution program, 22FA system, 22a, 22b, 22c, 22d elements, 31 virtual controller, 32 virtual system, 41 processor, 42 main storage unit, 43 auxiliary storage unit, 44 input unit, 45 output unit, 46 communication unit, 47 internal bus, 51 object, B1~B4 buttons, P1 program.

Claims

1. A simulation program that causes a computer that simulates the operation of a programmable controller and a system that operates according to an output from the programmable controller to function as the following means: an acquisition unit that acquires an execution program executed by the programmable controller to generate the output from the programmable controller and system configuration information indicating the configuration of the system; and a simulation unit that synchronizes a first simulation time of a virtual controller corresponding to the programmable controller and a second simulation time of a virtual system constructed based on the system configuration information in units of a predetermined cycle, and causes the virtual system to operate by causing the virtual controller to execute a virtual output obtained by executing the execution program, thereby simulating the operation of the programmable controller and the system, The acquiring unit acquires a stop instruction for stopping the simulation performed by the simulation unit. When the stop instruction is acquired by the acquisition unit, the simulation unit stops the simulation of the operation performed by the virtual controller and the virtual system at a timing that synchronizes the first simulation time with the second simulation time.

2. The simulation program according to claim 1, wherein: The virtual system has multiple elements. The elements are connected to other elements respectively, perform at least one of receiving a signal output from the other elements and transmitting a signal to the other elements, and have a state that changes based on a signal when receiving a signal from the other elements. The system configuration information represents the plurality of elements, the connection relationship between the plurality of elements, and information related to the status of each of the elements. The simulation unit determines the order of the elements based on the system configuration information, and simulates changes in the states of the elements in the determined order.

3. The simulation program according to claim 2, wherein: The simulation unit generates a directed acyclic graph of the plurality of elements based on the system configuration information, and performs topological sorting of the generated directed acyclic graph to thereby determine the order of the elements.

4. The simulation program according to any one of claims 1 to 3, wherein: The system is a control target of the programmable controller and does not have other programmable controllers.

5. The simulation program according to any one of claims 1 to 4, wherein: causing the computer to also function as a state data storage unit that stores state data indicating the states of the virtual controller and the virtual system after the simulation of the action is stopped in accordance with the stop instruction, The acquiring unit acquires a read instruction indicating to read the status data, When the acquisition unit acquires the read instruction, the simulation unit reads the status data from the status data storage unit and restores the status of the virtual controller and the virtual system indicated by the read status data.

6. The simulation program according to claim 5, wherein: The programmable controller includes at least one of a basic unit, an execution unit as a unit loaded on the basic unit and executing the execution program, a network unit for communicating via a network, a motion unit for controlling a servo system, and an input / output unit for transmitting and receiving signals to and from the outside. The acquisition unit acquires controller configuration information indicating the unit possessed by the programmable controller, The simulation unit constructs the virtual controller based on the controller structure information. The status data includes the controller structure information and the system structure information.

7. The simulation program according to claim 6, wherein: The status data indicates, as the status of the virtual controller, the execution status of the execution program and the status of the virtual unit corresponding to the unit indicated by the controller configuration information.

8. A simulation method, the method being performed by a simulation device for simulating the operation of a programmable controller and a system that operates according to an output from the programmable controller, In this simulation method, an acquisition unit that acquires an execution program executed by the programmable controller to generate the output from the programmable controller and system configuration information indicating the configuration of the system, The simulation unit synchronizes a first simulation time of a virtual controller corresponding to the programmable controller with a second simulation time of a virtual system configured based on the system configuration information in units of a predetermined cycle, and causes the virtual controller to execute a virtual output obtained by executing the execution program to cause the virtual system to operate, thereby simulating the operation of the programmable controller and the system. The acquiring unit acquires a stop instruction for stopping the simulation performed by the simulation unit. When the stop instruction is acquired by the acquisition unit, the simulation unit stops the simulation of the operation performed by the virtual controller and the virtual system at a timing that synchronizes the first simulation time with the second simulation time.

9. A simulation device for simulating the operation of a programmable controller and a system that operates according to an output from the programmable controller. The simulation device has: an acquisition unit that acquires an execution program executed by the programmable controller to generate the output from the programmable controller and system configuration information indicating the configuration of the system; and a simulation unit that synchronizes a first simulation time of a virtual controller corresponding to the programmable controller and a second simulation time of a virtual system constructed based on the system configuration information in units of a predetermined cycle, and causes the virtual system to operate by causing the virtual controller to execute a virtual output obtained by executing the execution program, thereby simulating the operation of the programmable controller and the system, The acquiring unit acquires a stop instruction for stopping the simulation performed by the simulation unit. When the stop instruction is acquired by the acquisition unit, the simulation unit stops the simulation of the operation performed by the virtual controller and the virtual system at a timing that synchronizes the first simulation time with the second simulation time.

Citation Information

Patent Citations

  • Virtual plant simulation system, command device, and virtual plant simulation method

    JP2017187947A

  • Simulation device

    CN109844659A

  • Simulation device and simulation program

    CN112119358A

  • PLC honeypot system based on industrial control service simulation, implementation method and simulation equipment

    CN112650077A

  • Distributed real-time co-simulation system and method based on windows system

    CN114625023A