Simulation program product, simulation method and simulation device

By synchronizing the simulation time of the virtual controller and the virtual system in the simulation program, the time inconsistency problem of the programmable controller and the FA system simulation is solved, and accurate simulation and consistent recovery of the actions are achieved.

CN119365835BActive Publication Date: 2025-08-26MITSUBISHI ELECTRIC CORP
View PDF 3 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, when the programmable controller and the FA system are simulated, the time when the operation is stopped is inconsistent, resulting in the simulation results being out of synchronization and accurate simulation recovery cannot be achieved.

Method used

Through the simulation program, the simulation time of the virtual controller and the virtual system is synchronized in predetermined periods. The acquisition unit and the simulation unit are used to simulate the actions of the programmable controller and the FA system respectively, and the action is stopped at the synchronization timing to ensure the consistency of the simulation time.

Benefits of technology

Accurate simulation of programmable controller and FA system actions is realized, ensuring the consistency of simulation during simulation recovery and improving the accuracy of simulation results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119365835B_ABST
    Figure CN119365835B_ABST
Patent Text Reader

Abstract

The program causes the simulation device (10) to function as the following components: an acquisition unit (11) that acquires an execution program (21a) executed by a programmable controller (21) and system structure information representing the structure of an 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) constructed based on the system structure information in units of a predetermined cycle, and causes the virtual system (32) to operate based on a virtual output obtained by causing the virtual controller (31) to execute the execution program (21a), thereby simulating the operation of the programmable controller (21) and the FA system (22).
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] At FA (Factory Automation) sites, FA systems, including various FA devices such as sensors and servo motors, operate according to instructions from programmable controllers (PLCs), thereby completing various processes. It is desirable to perform simulations beforehand to verify the presence of problems in the FA system, the programs executed by the PLCs, and the parameters set in the FA devices (see, for example, Patent Document 1).

[0003] Patent Document 1 describes a virtual plant simulation system that includes a simulator that simulates a plant controlled by a controller. In the technology described in Patent Document 1, if an operator performs a "stop" operation, the controller's operations and the simulator's calculations cease and remain in their current state. If an operator performs a "start" or "execute" operation, the controller and simulator execute the instructions corresponding to the operation.

[0004] Patent Document 1: Japanese Patent Application Laid-Open 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 file of the actual programmable controller can be prepared, and the coordinated operation of the programmable controller and the FA system connected to the programmable controller can be verified earlier.

[0006] Here, rather than simulating the programmable controller and FA system as a single entity, it is preferable to simulate the programmable controller separately from the FA system. This is preferable from the perspective of reducing the burden of simulation software development and future scalability. However, even when the programmable controller and FA system simulations are executed in parallel, the timing of the two simulations may not necessarily be the same when a stop operation is performed. In other words, the simulation may stop while simulating operations up to different times. Therefore, when resuming the simulation from the stopped state, the progress of the simulation will differ, potentially preventing accurate simulation of the programmable controller and 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 enables a computer that simulates the respective actions of a programmable controller and a system that acts according to the output from the programmable controller to function as the following units: an acquisition unit that 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 that synchronizes the first simulation time of the virtual controller corresponding to the programmable controller and the second simulation time of the 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 simulating the operation at a timing that synchronizes the first simulation time with the second simulation time. This allows the simulation to resume, assuming the progress of the simulations of the programmable controller and the system are equal. Consequently, 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 configuration of a simulation device according to the embodiment.

[0012] Figure 2 This is a diagram showing the hardware configuration of a simulation device according to the 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 according to the embodiment.

[0015] Figure 5 This is a diagram showing an example of controller configuration information according to the 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 This is a diagram showing an example of time setting data according to the embodiment.

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

[0019] Figure 9 This is a diagram showing an example of creating a directed acyclic graph according to an embodiment of the present invention.

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

[0021] Figure 11 This is a diagram showing an example of how instructions for executing or stopping simulation of a virtual controller and a virtual system according to the embodiment are transmitted. DETAILED DESCRIPTION

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

[0023] Implementation method.

[0024] The simulation device 10 according to this embodiment is as follows Figure 1 As shown, a computer that simulates the operations of the programmable controller 21 and the FA system 22 in software is a computer, 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 current or voltage signals, 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 signals to the FA system 22 by executing an execution program 21a. The execution program 21a is, for example, a ladder diagram program written in a ladder diagram language or a program written in another language. The execution program 21a can be any program that describes the content and sequence of signals to be output to the FA system 22.

[0027] The FA system 22 operates based on signals output from the programmable controller 21. The FA system 22 includes one or more components. If the FA system 22 includes multiple components, these components can be interconnected. Specifically, each component can connect to other components to at least one of receive signals from or transmit signals to other components. Furthermore, each component has a state that changes based on a signal received from another component.

[0028] exist Figure 1 In the illustrated FA system 22 having elements 22a, 22b, 22c, and 22d, for example, element 22a may be a lamp or LED (Light Emitting Diode) that turns on when it receives an ON signal from the programmable controller 21 and turns off when it receives an OFF signal. Alternatively, element 22b may be a servo amplifier that drives elements 22c and 22d, which are servo motors, according to control commands from the programmable controller 21. The elements that make up the FA system 22 are not limited to the examples above and may also include logic operation elements, display devices such as LEDs and LCDs (Liquid Crystal Displays), gauges, sensors, switches, actuators, servo amplifiers, servo motors, other motors, valves, robots, machine tools, and other FA equipment. Furthermore, any element may be a programmable controller other than the programmable controller 21, and the FA system 22 may not include another programmable controller. The FA system 22 operates according to outputs from the programmable controller 21, thereby implementing various factory processes, including production, machining, inspection, and monitoring.

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

[0030] The simulation device 10 does not actually construct the programmable controller 21 and the FA system 22 described above, but executes software for simulating the operation of the programmable controller 21 and the FA system 22 based on the execution program 21a. In order to execute the software described above, 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, multiple programs P1 may be provided. For example, in addition to the program P1 corresponding to the simulation software, there may also 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 nonvolatile memory, typically EEPROM (Electrically Erasable Programmable Read-Only Memory) and HDD (Hard Disk Drive). In addition to the program P1, the auxiliary storage unit 43 also stores various data used by the processor 41. Following instructions from the processor 41, the auxiliary storage unit 43 supplies data to be used by the processor 41 and also stores data supplied from the processor 41.

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

[0035] The output unit 45 includes output devices such as an LCD (Liquid Crystal Display) and a speaker, and presents various information to the user according to instructions from the processor 41 .

[0036] The communication unit 46 includes 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 the 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 also be connected to an external UI device via the communication unit 46, and may obtain information from the user and provide information to the user via the communication unit 46. If 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 transmitting and receiving information for the UI.

[0038] Back to Figure 1The simulation device 10 has a functional structure realized by the cooperation of the above-mentioned hardware structure. Specifically, the simulation device 10 includes: an acquisition unit 11 that acquires various information; a display unit 12 that displays information related to the simulation to the user; a state data storage unit 13 that stores and saves state data representing the state of the simulation at a certain time; and a simulation unit 14 that simulates the operation of the programmable controller 21 and the FA system 22 by making the virtual controller 31 and the virtual system 32 constructed virtually operate 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 serving as a UI, and the processor 41 executing the engineering design tool. The simulation unit 14 is implemented by the processor 41 executing simulation software. The simulation device 10 is an example of a simulation device that simulates the operation of a programmable controller and a system that operates according to output from the programmable controller.

[0040] The acquisition unit 11 acquires the execution program 21a and system configuration information indicating the configuration of the FA system 22. Specifically, the acquisition unit 11 can acquire the execution program 21a and system configuration information directly input by the user, or can acquire the execution program 21a and system configuration information by reading them from an address specified by the user in the auxiliary storage unit 43 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 configure 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 and the system configuration information indicating the system configuration to generate output from the programmable controller.

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

[0042] exist Figure 3In the example, signals are output from terminals 2 through 4 of the "output unit block," corresponding to the output unit of virtual controller 31, to three lamps. The signal from the top lamp then passes through a NOT element and is input to terminal 1 of the "input unit block," corresponding to the input unit of virtual controller 31. Furthermore, the outputs of two switches are input to terminals 3 and 5 of the "input unit block," respectively. Furthermore, a signal is input to the cylinder from terminal 8 of the "output unit block," and the signal from the cylinder is input to terminal 7 of the "input unit block."

[0043] Here, the "output unit block" and "input unit block" are actually components of the virtual controller 31 for transmitting and receiving signals to and from the outside, and are not components of the virtual system 32. However, they 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 operation details of the "Cylinder" example can be entered by the user using the subwindow displayed by selecting the "Cylinder" block, or the user can specify a separate file describing the detailed operation details. The detailed operation details of the elements that make up the FA system are information indicating how the element's state changes based on the signals input to the element, and are included in the system configuration information. For example, if an ON signal is input to a cylinder, the cylinder position increases at a rate of 1 mm per second. When it reaches the maximum position of 100 mm, an ON signal is output, which provides the detailed operation details 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 the block diagram, the user can Figure 4 The simulation device 10 may directly input the system configuration information in the table shown, or obtain the system configuration information in another format. The system configuration information may be any information that indicates 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 module can be input by the user in the form of a module diagram. Figure 5 The controller structure information is shown in table format.

[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. Figure 3 In addition, Figure 5 The "input unit" in Figure 3 In the “IN”, Figure 5 The "output unit" in Figure 3 . The programmable controller 21 and virtual controller 31 may also include other units as units mounted on the base unit. Examples of these other units include a motion unit connected to a servo amplifier for high-precision servo system control, a servo amplifier unit, a network unit for communicating via a network, an input / output unit having at least one of the functions of the aforementioned input and output units, and a remote input / output unit. If information related to the wiring of these units is required when configuring the programmable controller 21, the controller configuration information includes this information.

[0048] The display unit 12 is, for example, Figure 6 As shown in the figure, the simulation results are displayed. In addition, the simulation results include the simulation process, that is, the results until a certain timing of the simulation. Figure 6 In the example, a breakpoint in execution program 21a executed by virtual controller 31 is represented by a triangular object 51. The address in the memory of virtual controller 31 is associated with the value stored at that address. The memory value changes as execution program 21a executes. Virtual controller 31 uses this value to generate virtual output for virtual system 32. Therefore, by observing this value, the user can confirm whether the processing specified in execution program 21a is being executed correctly.

[0049] In addition, if Figure 6 As shown in the upper right portion of , the status of each element constituting the virtual system 32, which changes as the simulation progresses, is 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, the instructions from the user related to the progress of the simulation are acquired by the acquisition unit 11 via the screen displayed by the display unit 12. The 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 Figure 6 The operation of the virtual controller 31 can be input by selecting the button B2 shown in the example, and the restoration 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 leaving get off work, before leaving their seat, before the power supply of the simulation device 10 is cut off, or when it is determined that the current timed state of the ongoing simulation is needed for subsequent verification. The read instruction is input, for example, when the user is at work, after taking their seat, after the power supply of the simulation device 10 is turned on, or when verifying the past simulation process, 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 primarily implemented by the auxiliary storage unit 43. The state data storage unit 13 stores state data representing the state of the simulation when a save instruction is input. The state data represents the execution program 21a, breakpoints in the execution program 21a, data stored in the memory of the virtual controller 31, controller configuration information, system configuration information, and the state of each element of the virtual system 32. Furthermore, when a read instruction is input, the state data is read from the state data storage unit 13. Furthermore, the state data is used to resume the simulation midway. The state data storage unit 13 is an example of a state data storage unit that stores state data representing the state of the virtual controller and virtual system when the simulation of the operation is stopped in accordance with a stop instruction.

[0053] The simulation unit 14 simulates 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] Furthermore, the simulation unit 14 has a memory for storing the same data as the programmable controller 21, and sequentially executes the commands included in the execution program 21a. In addition, the simulation unit 14 counts the simulation time that passes as the commands are executed. This 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 measures the simulation time. The time setting data associates the instructions included in the execution program 21a with the length of time required to execute the instructions. 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 synchronized with the actual time for the execution of the command, or it may not correspond to the actual time. Furthermore, 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 for the other. For example, the simulation unit 14 may advance the simulation time and then execute a command that is executable within the simulation time by the length of the advance. After executing the command, the simulation time may be advanced by the length corresponding to the command.

[0056] Furthermore, the simulation unit 14 simulates the operation of the virtual system 32. Specifically, the simulation unit 14 changes with the execution of the execution program 21a and simulates the state changes of the elements of the virtual system 32 based on the virtual output from the virtual controller 31. The simulation unit 14 keeps track of the simulation time of the virtual system 32 separately from the simulation time of the virtual controller 31. In other words, 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 with the simulation time of the virtual system 32 for each predetermined cycle.

[0057] exist Figure 8 The synchronization of simulation time is shown schematically in Figure 8In the example, the simulation times of virtual controller 31 and virtual system 32 are synchronized in 6-μsec cycles. Specifically, when a simulation time equal to the cycle has elapsed since the last synchronization, virtual controller 31 and virtual system 32 wait until the simulation time has elapsed on the other side. If the simulation time has elapsed, the next simulation cycle begins.

[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 between 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 changes in 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 a directed acyclic graph, and the graph can be generated by using a commonly known method. 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, 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 0 to 6 μsec period in FIG, the action of element H in this period can be simulated, the action of element I in this period can be simulated, and then the action of element J in this period can be simulated. Figure 8 As shown by the 6-12 μsec period in FIG, if the order of elements I and J is maintained, the simulation of the operation of element I and the simulation of the operation of element J can be partially executed in parallel. In other words, when focusing on a certain simulation time, for example, 8 μsec, the simulation of element I, which is first affected by the output from virtual controller 31, can be performed before the simulation of element J.

[0061] In addition, if Figure 9As shown, if a component constituting virtual system 32 has two or more inputs or outputs, a directed acyclic graph can be created using each component terminal as a node to determine the order in which the input and output signals should be simulated. In other words, the order can be determined for the terminals of the component equivalent to the element. Alternatively, each terminal can be treated as an element constituting virtual system 32.

[0062] In addition, Figure 9 In the example, a loop is generated in the relationship between the components, but if the dependency relationship of the terminals is considered, no loop is generated, so a directed acyclic graph can be created. 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 generated the loop as the end point. For example, in Figure 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 an example of the first simulation time, and the simulation time of the virtual system 32 is an example of the second simulation time. The simulation unit 14 is an example of a simulation unit that synchronizes the second simulation time of the virtual system, which is configured based on the first simulation time of the virtual controller corresponding to the programmable controller and the system configuration information, in predetermined cycle units, and operates the virtual system using virtual outputs obtained by executing the program in the virtual controller, thereby simulating the operation of the programmable controller and the system.

[0064] Next, regarding the processing executed by the simulation device 10, the Figure 10 、 11 In Figure 10 , the sequence of the virtual controller process executed by the virtual controller 31 and the virtual system process 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 within a pre-specified cycle 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). Figure 10 In FIG, 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 that the simulation is complete is received from the virtual system 32.

[0068] If the determination in step S13 is negative (step S13: No), the determination in step S13 is repeated until it becomes positive, and the virtual controller 31 does not continue to execute program 21a but waits. On the other hand, if the determination in step S13 is positive (step S13: Yes), the virtual controller 31 transitions to the next cycle (step S14) and returns to step S11, thereby continuing to execute 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 changes 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). Figure 10 In FIG, 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 that the simulation is complete 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 transitions to the next cycle (step S24) and returns to step S21 to continue the simulation.

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

[0074] If 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, if it is determined that there is an instruction (step S31; Yes), the virtual controller 31 determines whether the simulation time is the synchronization timing (step S32). If it is determined that the simulation time is not the synchronization timing (step S32; No), the virtual controller 31 repeats the determination of step S32 and waits until the simulation time becomes the synchronization timing. On the other hand, if it is determined that the simulation time is the synchronization 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 while the virtual controller 31 is executing the simulation, the simulation is executed until the synchronization timing is reached. In addition, when there is an instruction to start or resume the simulation in step S31 while 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. Figure 10 、 11 The illustrated processing corresponds to an example of a simulation method executed by the simulation device.

[0077] As described above, the simulation unit 14 stops the operation simulation at a timing that synchronizes the simulation time of the virtual controller 31 with the simulation time of the virtual system 32. This allows the simulation to resume, assuming the progress of the operation simulations of the programmable controller 21 and the FA system 22 are equal. Consequently, accurate simulation of the programmable controller 21 and the FA system 32 can be performed.

[0078] Furthermore, the simulation unit 14 determines the order of the elements of the virtual system 32 based on the system configuration information and simulates the state changes of each element according to the determined order. This allows accurate simulation of the virtual system 32. Specifically, the simulation unit 14 generates a directed acyclic graph of multiple elements and performs a topological sort on the generated directed acyclic graph to determine the order of the elements. Efficient algorithms are known for generating and topologically sorting directed acyclic graphs, enabling the simulation unit 14 to quickly determine the order of the elements.

[0079] Furthermore, the state data storage unit 13 according to this embodiment stores state data indicating the states of the virtual controller 31 and virtual system 32. When the acquisition unit 11 receives an instruction to read the state data, the simulation unit 14 restores the states of the virtual controller 31 and virtual system 32 indicated by the state data. Here, the state of the virtual controller 31 refers to the value of the simulation time at a specific simulation time, the execution status of the execution program 21a, controller configuration information, and the states of the virtual units that constitute the virtual controller 31. The execution status of the execution program 21a includes the execution program 21a, its breakpoints, and data to be set in the execution program 21a. Furthermore, the state of the virtual system 32 refers to the system configuration information, the simulation time, and the states of various elements of the virtual system 32. This eliminates the need to restart the simulation from the beginning and allows for recovery midway. For example, simulation can be resumed from the state where the device startup sequence of the programmable controller 21 and the FA system 22 has completed, shortening the time required to analyze 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 description focuses on an example in which the virtual controller 31 is constructed based on controller configuration information representing the configuration of a building block type programmable controller 21, but the present invention is not limited thereto. For example, the virtual controller 31 may be constructed by providing information representing the model of an integrally constructed programmable controller 21 having the functions of the aforementioned multiple units to the simulation device 10 in place of the controller configuration information.

[0082] In addition, although the example in which the virtual controller 31 and the virtual system 32 notify each other of the completion of the simulation of the operation within the simulation time cycle has been described, the present invention is not limited to this. The virtual controller 31 and the virtual system 32 may also notify each other of the measured simulation time and determine whether the simulation time notified by 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 nonvolatile recording medium and distributed, and the program P1 can be installed in a computer, thereby forming a device that executes the above-mentioned processing. Examples of such recording media include floppy disks, CD-ROMs (Compact Disc Read-Only Memory), DVDs (Digital Versatile Discs), and MOs (Magneto-Optical Discs).

[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 and executing 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 having the computer 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 applications, only the parts other than the OS may be stored in a medium and distributed, or may be downloaded to a computer.

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

[0090] The present invention is capable of various embodiments and variations without departing from the broad spirit and scope of the present invention. Furthermore, the aforementioned embodiments are intended 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 defined by the embodiments but by the claims. Furthermore, any variations implemented within the meaning of the claims and their equivalents are considered to be within the scope of the present invention.

[0091] Industrial Applicability

[0092] The present invention is applicable to the 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, 22 FA 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 to B4 buttons, P1 program.

Claims

1. A simulation program product 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 with a second simulation time of a virtual system configured based on the system configuration information in units of predetermined cycles, and causes the virtual controller to operate the virtual system by executing a virtual output obtained by executing the execution program, thereby simulating the operation of the programmable controller and the system. The virtual system includes a plurality of components including a component having at least one of two input terminals and two output terminals, The elements of the virtual system corresponding to the input terminals or the output terminals of each of the plurality of components are connected to other elements, 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 received from the other elements. The system configuration information represents information related to the state of each of the elements, including a plurality of the elements, a connection relationship between the plurality of the elements, and a dependency relationship indicating that the state of the output terminal of each component depends on the state of the input terminal. The simulation unit generates a directed acyclic graph of the plurality of elements based on the system structure information, performs topological sorting on the generated directed acyclic graph, thereby determining the order of the elements, and simulates changes in the states of the elements according to the determined order. The acquiring unit acquires a stop instruction for stopping the simulation performed by the simulation unit. When the acquisition unit acquires the stop instruction, the simulation unit stops the simulation of the operation by the virtual controller and the virtual system at the timing of the predetermined cycle in which the first simulation time and the second simulation time are synchronized.

2. The simulation program product according to claim 1, wherein The system is a control target of the programmable controller and does not include other programmable controllers.

3. The simulation program product according to claim 1 or 2, wherein: The computer further functions 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 operation 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.

4. The simulation program product according to claim 3, wherein: The programmable controller includes at least one of a basic unit, an execution unit that is a unit loaded on the basic unit and executes 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 acquiring unit acquires controller configuration information indicating the unit included in the programmable controller. The simulation unit constructs the virtual controller based on the controller structure information, The status data includes the controller configuration information and the system configuration information.

5. The simulation program product according to claim 4, 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.

6. 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 predetermined cycles, and causes the virtual controller to operate by executing the execution program to obtain a virtual output, 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. If the acquisition unit acquires the stop instruction, the simulation unit stops the simulation of the operation performed by the virtual controller and the virtual system at the timing of the predetermined cycle in which the first simulation time and the second simulation time are synchronized. The virtual system includes a plurality of components including a component having at least one of two input terminals and two output terminals, The elements of the virtual system corresponding to the input terminals or the output terminals of each of the plurality of components are connected to other elements, 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 received from the other elements. The system configuration information represents information related to the state of each of the elements, including a plurality of the elements, a connection relationship between the plurality of the elements, and a dependency relationship indicating that the state of the output terminal of each component depends on the state of the input terminal. The simulation unit generates a directed acyclic graph of the plurality of elements based on the system structure information, performs topological sorting of the generated directed acyclic graph, thereby determining the order of the elements, and simulates the change of the state of the elements according to the determined order.

7. A simulation device for simulating the operation of a programmable controller and a system that operates according to 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 with a second simulation time of a virtual system configured based on the system configuration information in units of predetermined cycles, and causes the virtual controller to operate the virtual system by executing a virtual output obtained by executing the execution program, thereby simulating the operation of the programmable controller and the system. The virtual system includes a plurality of components including a component having at least one of two input terminals and two output terminals, The elements of the virtual system corresponding to the input terminals or the output terminals of each of the plurality of components are connected to other elements, 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 received from the other elements. The system configuration information represents information related to the state of each of the elements, including a plurality of the elements, a connection relationship between the plurality of the elements, and a dependency relationship indicating that the state of the output terminal of each component depends on the state of the input terminal. The simulation unit generates a directed acyclic graph of the plurality of elements based on the system structure information, performs topological sorting on the generated directed acyclic graph, thereby determining the order of the elements, and simulates changes in the states of the elements according to the determined order. The acquiring unit acquires a stop instruction for stopping the simulation performed by the simulation unit. When the acquisition unit acquires the stop instruction, the simulation unit stops the simulation of the operation 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 system and simulator and management server and recording medium

    JP2001282327A

  • Simulation system, simulation method and program

    JP2010128722A