WO2023119524A1 - シミュレーションプログラム、シミュレーション方法及びシミュレーション装置 - Google Patents

シミュレーションプログラム、シミュレーション方法及びシミュレーション装置 Download PDF

Info

Publication number
WO2023119524A1
WO2023119524A1 PCT/JP2021/047708 JP2021047708W WO2023119524A1 WO 2023119524 A1 WO2023119524 A1 WO 2023119524A1 JP 2021047708 W JP2021047708 W JP 2021047708W WO 2023119524 A1 WO2023119524 A1 WO 2023119524A1
Authority
WO
WIPO (PCT)
Prior art keywords
unit
virtual
simulation
control program
execution
Prior art date
Application number
PCT/JP2021/047708
Other languages
English (en)
French (fr)
Inventor
諒 久家
ヴィソール アハメド
Original Assignee
三菱電機株式会社
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 三菱電機株式会社 filed Critical 三菱電機株式会社
Priority to PCT/JP2021/047708 priority Critical patent/WO2023119524A1/ja
Priority to JP2022520194A priority patent/JPWO2023119524A1/ja
Publication of WO2023119524A1 publication Critical patent/WO2023119524A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software

Definitions

  • the present disclosure relates to a simulation program, a simulation method, and a simulation device.
  • a system is sometimes constructed that allows multiple controller units that control equipment to work together.
  • the contents of control by the controller units are defined by control programs, respectively, and each controller unit cooperates to realize various controls by executing the control programs.
  • Patent Literature 1 describes a technique for simulating the operation of a network system including a plurality of PLC systems.
  • a virtual PLC system is caused to execute a PLC program while synchronizing time within a virtual network system that simulates the configuration of the network system.
  • the operation of each PLC system based on the PLC program can be simulated while being synchronized.
  • the present disclosure has been made in view of the above circumstances, and aims to contribute to the smooth development of control programs executed by a plurality of controller units.
  • a simulation program of the present disclosure is a controller unit that controls equipment by repeatedly executing control processing defined in a control program, and simulates the operation of a plurality of controller units that are connected to each other.
  • a computer for obtaining a control program executed by each controller unit, and a virtual unit corresponding to each controller unit to execute a control program executed by the corresponding controller unit, thereby controlling each controller unit
  • the simulation means functions as simulation means for simulating the execution of the program, and the simulation means synchronizes the simulation time of each virtual unit that elapses with the execution of the control program at a predetermined cycle, and the first virtual unit among the plurality of virtual units.
  • One virtual unit includes receiving means for receiving a stop instruction indicating that execution of a control program by a plurality of virtual units is to be stopped; and a transmitting means for transmitting to the second virtual unit, stopping execution of the control program according to the stop instruction received by the receiving means, and the second virtual unit having receiving means for receiving the stop instruction transmitted by the transmitting means. , when the receiving means receives the stop instruction, the execution of the control program is stopped at the timing for synchronizing the simulation time.
  • the first virtual unit stops executing the control program according to the stop instruction
  • the second virtual unit stops executing the control program at the timing of synchronizing the simulation time when the stop instruction is received. do. Therefore, when stopping the execution of the control program by a plurality of virtual units, it is possible to avoid the occurrence of a large synchronization error in the simulation time. As a result, it is possible to accurately confirm the operating state when the simulation is temporarily stopped, which contributes to the smooth development of control programs to be executed by a plurality of controller units.
  • FIG. 1 is a diagram showing an outline of a simulation apparatus according to Embodiment 1;
  • FIG. FIG. 1 shows a hardware configuration of a simulation apparatus according to Embodiment 1;
  • FIG. 4 is a diagram showing an output example of the simulation device according to Embodiment 1;
  • FIG. 4 shows details of the virtual unit according to the first embodiment;
  • a diagram showing an example of time setting data according to Embodiment 1 FIG. 4 is a diagram for explaining simulation time synchronization according to the first embodiment;
  • 4 is a flowchart showing simulation processing according to the first embodiment;
  • FIG. 4 shows a processing procedure when an instruction indicating whether or not to execute a control program is input to the simulation apparatus according to the first embodiment;
  • FIG. 4 is a diagram showing timings when the virtual unit according to the first embodiment operates according to instructions;
  • FIG. 4 shows the configuration of a virtual unit according to the second embodiment;
  • FIG. 11 is a diagram showing timings when a virtual unit according to Embodiment 3 operates according to instructions;
  • FIG. 4 shows the configuration of a network system according to a fourth embodiment;
  • FIG. 11 is a diagram showing timings at which virtual units according to the fourth embodiment operate according to instructions;
  • a simulation apparatus 10 is a computer that simulates the operation of a programmable controller 20 having a plurality of controller units 21 and 22 on software, as shown in FIG. Personal Computer), tablet terminal, or server device on the network.
  • the programmable controller 20 includes a controller unit 21 that executes a control program 21a, a controller unit 22 that executes a control program 22a, and a base unit 23 that connects these controller units 21 and 22 via a system bus 231. .
  • the programmable controller 20 is a building block type PLC (Programmable Logic Controller) configured by attaching controller units 21 and 22 to a base unit 23 respectively.
  • a device 29 is connected to the programmable controller 20 via a communication line. Although one device 29 is representatively shown in FIG. 1, the number of devices 29 may be two or more.
  • a communication line that connects the device 29 and the programmable controller may be a wiring that transmits a current signal or a voltage signal, a signal line that transmits serial data, or an industrial network. .
  • the controller units 21 and 22 cooperatively control the device 29 by executing control programs 21a and 22a, respectively. For example, the controller unit 21 periodically acquires the sensing result of the device 29, which is a sensor, and the controller unit 22 controls the rotation angle of the device 29, which is an actuator, based on the sensing result.
  • the control programs 21a and 22a are, for example, ladder programs written in a ladder language, or programs in which control contents of the device 29 are written in another language.
  • the programmable controller 20 may have an input/output unit (not shown) connected to the device 29 .
  • the controller units 21 and 22 control the device 29 via the input/output unit.
  • the controller units 21 and 22 may be directly connected to the device 29 without the programmable controller 20 having an input/output unit.
  • the controller units 21 and 22 may cooperatively control a single device 29 or may operate different devices 29 in a coordinated manner.
  • the simulation device 10 executes software for simulating the operation of the programmable controller 20 based on the control programs 21a and 22a without actually building the programmable controller 20 as described above.
  • the simulation device 10 has a hardware configuration as shown in FIG. Specifically, the simulation device 10 has a processor 41 , a main storage section 42 , an auxiliary storage section 43 , an input section 44 , an output section 45 and a communication section 46 .
  • the main storage unit 42 , auxiliary storage unit 43 , input unit 44 , output unit 45 and communication unit 46 are all connected to the processor 41 via an internal bus 47 .
  • the processor 41 includes a CPU (Central Processing Unit) as a processing circuit.
  • the processor 41 implements various functions of the simulation apparatus 10 by executing the program P1 stored in the auxiliary storage unit 43, and executes the processes described later.
  • CPU Central Processing Unit
  • 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 working area for the processor 41 .
  • one program P1 is representatively shown in FIG. 2, there may be a plurality of programs P1.
  • the program P1 corresponding to software for simulation there may be a program P1 corresponding to an engineering tool for giving instructions to the virtual unit 31 described later.
  • a program P1 for simulation corresponds to an example of a simulation program.
  • the auxiliary storage unit 43 includes non-volatile memory represented by EEPROM (Electrically Erasable Programmable Read-Only Memory) and HDD (Hard Disk Drive).
  • the auxiliary storage unit 43 stores various data used for the processing of the processor 41 in addition to the program P1.
  • Auxiliary storage unit 43 supplies data used by processor 41 to processor 41 and stores the data supplied from processor 41 in accordance with instructions from processor 41 .
  • the input unit 44 includes input devices typified by a keyboard and pointing device.
  • the input unit 44 acquires information input by the user of the simulation apparatus 10 and notifies the processor 41 of the acquired information.
  • the output unit 45 includes output devices typified by an LCD (Liquid Crystal Display) and a speaker.
  • the output unit 45 presents various information to the user according to instructions from the processor 41 .
  • the communication unit 46 has a network interface circuit for communicating with external devices. Communication unit 46 receives a signal from the outside and outputs information indicated by this signal to processor 41 . The communication unit 46 also transmits a signal indicating information output from the processor 41 to an external device.
  • the input unit 44 and the output unit 45 correspond to the UI (User Interface) of the simulation device 10.
  • the simulation device 10 may be connected to an external UI device via the communication unit 46 to acquire information from the user and provide information to the user via the communication unit 46 .
  • 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.
  • the simulation device 10 has a functional configuration that is realized by cooperation of the hardware configurations described above.
  • the simulation apparatus 10 includes a program acquisition unit 11 that acquires the control programs 21a and 22a, a simulation result output unit 12 that provides the user with simulation results, and an instruction input from the user regarding the execution of the simulation.
  • Programmable by operating an input unit 13, a state data storage unit 14 that stores and saves state data indicating a state at a certain timing of the progressing simulation, and a virtually constructed virtual controller 30 in the same manner as the programmable controller 20.
  • a simulation unit 15 that simulates the operation of the controller 20 .
  • the program acquisition unit 11, the simulation result output unit 12, and the instruction input unit 13 are realized by the input unit 44 and the output unit 45 as UI, and the processor 41 that executes the engineering tool.
  • the simulation unit 15 is implemented by a processor 41 that executes software for simulation.
  • the simulation device 10 is a controller unit that controls equipment by repeatedly executing control processing defined by a control program, and corresponds to an example of a simulation device that simulates the operations of a plurality of controller units connected to each other.
  • the program acquisition unit 11 may acquire the control programs 21a and 22a input by the user, or read the control programs 21a and 22a from the address of the auxiliary storage unit 43 specified by the user or from an external storage device. may be obtained.
  • the program acquisition unit 11 corresponds to an example of acquisition means for acquiring control programs executed by each controller unit.
  • the simulation result output unit 12 displays an area A1 representing the simulation result, for example, as shown in FIG.
  • the results of the simulation include the progress of the simulation, that is, the results of progress up to a certain timing of the progressing simulation.
  • an address in the memory shared by the virtual units 31 and 32 and a value stored at that address are associated with each other in the area A1.
  • the values in the shared memory change as the control programs 21a and 22a are executed, and the controller units 21 and 22 use these values to control the device 29. Therefore, the user can observe these values to ensure that the control process is executed correctly. You can check whether it is
  • the instructions input to the instruction input unit 13 are, for example, a stop instruction to temporarily stop the simulation, a restart instruction to restart the stopped simulation, and a control process defined in the control programs 21a and 22a that is repeatedly executed once. or a one-step execution instruction to execute only one instruction included in the control programs 21a and 22a.
  • the stop instruction is input by the user selecting the button B2 illustrated in FIG. 3, and the restart instruction is input by selecting the button B1.
  • a one-scan execution instruction is input by selecting the button B11, and a one-step execution instruction is input by selecting the button B12.
  • Instructions input to the instruction input unit 13 are a save instruction to save the current simulation state, which is input by selecting the button B3 illustrated in FIG. and a read instruction for reading the saved state of the simulation.
  • the save instruction is issued, for example, when the user finishes work, before leaving the desk, before turning off the power of the simulation apparatus 10, or when it is determined that the state at the current timing of the simulation in progress is necessary for later verification. , is entered.
  • the readout instruction is input to restore the simulation state, for example, when the user starts work, after sitting down, after turning on the power of the simulation device 10, or when verifying the past simulation progress. When a start instruction is input following the read instruction, the simulation is restarted from the read state.
  • the state data storage unit 14 is mainly realized by the auxiliary storage unit 43.
  • the state data storage unit 14 stores state data indicating the state of the simulation when a save instruction is input to the instruction input unit 13 . Further, the state data is read from the state data storage unit 14 when a read instruction is input.
  • FIG. 4 A more detailed configuration of the virtual units 31 and 32 is shown in FIG.
  • the virtual unit 31 is provided with setting data 31 b indicating setting details for operating the virtual unit 31 together with the control program 21 a from the program acquisition unit 11 .
  • the setting contents indicated by the setting data 31b include, for example, processing conditions including the cycle of executing the control program 21a, and the communication cycle by the inter-unit communication section 313, which will be described later.
  • the virtual unit 32 is provided with the control program 22a and the setting data 32b indicating the setting contents for the virtual unit 32 to operate from the program acquisition unit 11.
  • FIG. 4 the virtual unit 31 is provided with setting data 31 b indicating setting details for operating the virtual unit 31 together with the control program 21 a from the program acquisition unit 11 .
  • the setting contents indicated by the setting data 31b include, for example, processing conditions including the cycle of executing the control program 21a, and the communication cycle by the inter-unit communication section 313, which will be described later.
  • the virtual unit 32 is provided with the control program 22a
  • the virtual unit 31 also includes a program execution unit 311 that executes the control program 21a according to the setting data 31b, a virtual clock 312 that measures the simulation time that progresses with the operation of the virtual unit 31, and an inter-unit clock for communicating with the virtual unit 32. It has a communication unit 313 and a reception unit 314 that receives instructions input to the instruction input unit 13 .
  • the virtual unit 32 has a program execution unit 321, a virtual clock 322, and an inter-unit communication unit 321 that perform the same functions as the program execution unit 311, the virtual clock 312, and the inter-unit communication unit 313 of the virtual unit 31 for the control program 22a and the setting data 32b. It has a communication unit 323 .
  • the inter-unit communication section 313 exchanges data with the inter-unit communication section 323 of the virtual unit 32, and exchanges information indicating the simulation time indicated by the virtual clocks 312 and 322. H.322 synchronization is achieved.
  • the receiving unit 314 receives an instruction indicating whether or not to execute the control programs 21a and 22a from the instruction input unit 13, and outputs an instruction indicating whether or not to execute the control program 21a to the program executing unit 311.
  • the program execution unit 311 executes or stops the control program 21a according to this instruction. Specifically, the program execution unit 311 stops executing the control program 21a when receiving a stop instruction, and starts executing the control program 21a when receiving a start instruction.
  • FIG. 8 shows a processing procedure executed by the virtual units 31 and 32 when an instruction indicating whether or not to execute the control programs 21a and 22a is input. Specifically, the virtual unit 31 determines whether or not there is an instruction indicating whether or not to execute the control programs 21a and 22a (step S11).
  • the virtual unit 32 receives the transmitted instruction (step S15), and executes or stops the control program 22a according to this instruction (step S16).
  • the processing shown in FIGS. 7 and 8 corresponds to an example of the simulation method executed by the simulation device.
  • the virtual unit 31 executes or stops the execution of the control program 21a according to the instruction, and the virtual unit 32 receives an instruction from the inter-unit communication unit 313 of the virtual unit 31.
  • the control program 22a is executed or stopped at the timing of synchronizing the simulation time.
  • the upper limit of the synchronization error is equal to the period length.
  • the virtual units 31 and 32 stop the execution of the control programs 21a and 22a when a stop instruction is input, but continue information processing different from the control processing defined in the control programs 21a and 22a.
  • the control programs 21a and 22a Easier to develop.
  • State data storage unit 14 stores state data indicating states of virtual units 31 and 32, and when instruction input unit 13 receives an instruction to read the state data, simulation unit 15 restores the state of the virtual units 31, 32 indicated by the state data.
  • the state of the virtual unit 31 means the state of the control program 21a, the setting data 31b, the program execution section 311, the virtual clock 312, and the inter-unit communication section 313 at a specific simulation time. It means the state of the control program 22a, the setting data 32b, the program execution section 321, the virtual clock 322, and the inter-unit communication section 323 at a specific simulation time.
  • the simulation can be restarted from the middle without having to start the simulation again from the beginning. For example, the simulation can be started from the state in which the device startup sequence of the controller units 21 and 22 has been completed, thereby shortening the time required to analyze the simulation results.
  • the state data storage unit 14 corresponds to an example of state data storage means for storing state data indicating the states of a plurality of virtual units whose execution of the control program has been stopped according to the stop instruction.
  • the instruction input unit 13 corresponds to an example of input means for inputting a read instruction indicating to read the state data.
  • the simulation unit 15 corresponds to an example of simulation means for reading out state data from the state data storage means and restoring the states of a plurality of virtual units indicated by the state data when a read instruction is input.
  • Embodiment 2 Next, the second embodiment will be described, focusing on differences from the first embodiment described above. It should be noted that the same or equivalent configurations as those of the first embodiment are denoted by the same reference numerals, and the explanations thereof are omitted or simplified.
  • the present embodiment differs from the first embodiment in that the virtual unit 32 stores the history of the state of the virtual unit 32 itself.
  • Embodiment 3 Next, the third embodiment will be described, focusing on differences from the first embodiment described above. It should be noted that the same or equivalent configurations as those of the first embodiment are denoted by the same reference numerals, and the explanations thereof are omitted or simplified.
  • the present embodiment differs from the first embodiment in that the timing at which the virtual unit 31 executes or stops the execution of the control program 21a according to the instruction is the same as the timing at which the simulation time is synchronized.
  • the simulation unit 15 virtually constructs virtual controllers 30 and 60 that simulate the operations of the programmable controllers 20 and 50 as described above.
  • the virtual controller 30 has a virtual unit 31 similar to that of the first embodiment, and a virtual network unit 34 that operates in the same manner as the network unit 24 .
  • the virtual unit 31 has the same configuration as in the first embodiment. However, the inter-unit communication section 313 of the virtual unit 31 communicates with the inter-unit communication section 343 of the virtual network unit 34 .
  • the virtual network units 34, 64 respectively have virtual clocks 342, 642 for timing the simulation time. Since virtual network units 34 and 64 do not execute control programs, these virtual clocks 342 and 642 do not advance virtual clocks 342 and 642 with the execution of control programs, and these virtual clocks 342 and 642 do not advance the simulation time from virtual units 31 and 32, respectively. Synchronize with the notified simulation time each time it is notified. Therefore, the simulation times are synchronized between the virtual unit 31 and the virtual network unit 34 and the simulation times are synchronized between the virtual unit 32 and the virtual network unit 64 .
  • the simulation times of the virtual units 31 and 32 and the virtual network units 34 and 64 are set in advance. Synchronization is performed every predetermined cycle.
  • the controller units 21, 22 configure different programmable controllers 20, 50 together with different network units 24, 54 connected via the industrial network 61.
  • the simulation unit 15 synchronizes the simulation times of the virtual units 31 and 32 and the simulation times of the virtual network units 34 and 64 corresponding to the network units 24 and 54 at predetermined intervals.
  • the stop instruction is transmitted from the inter-unit communication section 313 of the virtual unit 31 to the inter-unit communication section 323 of the virtual unit 32 via the virtual network units 34 and 64 at the timing of synchronizing the simulation time.
  • the operations of the controller units 21 and 22 connected via the network can be simulated in the same manner as in the first embodiment.
  • controller units 21 and 22 do not have to repeatedly execute the control processing specified in the control programs 21a and 22a.
  • the controller units 21 and 22 may execute the control process specified by the control programs 21a and 22a only once.
  • the control programs 21a and 22a may be partial processes corresponding to part of the control processes executed by devices other than the controller units 21 and 22 .
  • the control programs 21 a and 22 a may be any program that achieves control of the device 29 by being executed by the controller units 21 and 22 .
  • the functions of the simulation device 10 can be realized by dedicated hardware or by a normal computer system.
  • the program P1 to be executed by the processor 41 is stored in a computer-readable non-temporary recording medium, distributed, and the program P1 is installed in the computer to configure the device that executes the above process.
  • Examples of such recording media include flexible discs, CD-ROMs (Compact Disc Read-Only Memory), DVDs (Digital Versatile Discs), and MOs (Magneto-Optical Discs).

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

プログラムは、シミュレーション装置を、コントローラユニットそれぞれに対応する仮想ユニット(31,32)に、対応するコントローラユニットによって実行される制御プログラム(21a,22a)を実行させるシミュレーション部として機能させる。シミュレーション部は、仮想ユニット(31,32)それぞれのシミュレーション時間を予め定められた周期で同期させる。第1の仮想ユニット(31)は、制御プログラム(21a,22a)の実行を停止することを示す停止指示を受け付ける受付部(314)と、停止指示を第2の仮想ユニット(32)に送信するユニット間通信部(313)と、を有し、第2の仮想ユニット(32)は、停止指示を受信するユニット間通信部(323)を有し、停止指示が受信されると、シミュレーション時間を同期させるタイミングで制御プログラム(22a)の実行を停止する。

Description

シミュレーションプログラム、シミュレーション方法及びシミュレーション装置
 本開示は、シミュレーションプログラム、シミュレーション方法及びシミュレーション装置に関する。
 FA(Factory Automation)の現場では、機器を制御する複数のコントローラユニットを協働させるシステムを構築することがある。コントローラユニットによる制御の内容は、制御プログラムによりそれぞれ規定され、各コントローラユニットは、制御プログラムを実行することで連携して種々の制御を実現する。
 制御プログラムの開発においては、当該制御プログラムに基づくコントローラユニットの動作を模擬的に確認するためのシミュレーションを予め実行することが好ましい(例えば、特許文献1を参照)。特許文献1には、複数のPLCシステムを備えたネットワークシステムの動作を模擬する技術について記載されている。この技術では、ネットワークシステムの構成を模擬した仮想ネットワークシステム内で時刻を同期させながら仮想PLCシステムにPLCプログラムを実行させる。これにより、PLCプログラムに基づく各PLCシステムの動作を同期させながら模擬することができる。
特許第6433635号公報
 制御プログラムに基づくコントローラユニットの動作のシミュレーションを一時的に停止して、停止した時点におけるコントローラユニットの状態を確認したいという要望がある。ここで、特許文献1の技術において仮想PLCシステムを個別に停止した際には、時刻を同期して動作している仮想PLCシステムそれぞれの停止するタイミングが大きく異なってしまうおそれがある。このため、シミュレーションを一時的に停止したときの動作状態を正確に確認することができず、複数のコントローラによって実行される制御プログラムの円滑な開発が困難になるおそれがある。
 本開示は、上記実情に鑑みてなされたものであり、複数のコントローラユニットによって実行される制御プログラムの円滑な開発に資することを目的とする。
 上記目的を達成するため、本開示のシミュレーションプログラムは、制御プログラムに規定される制御処理を繰り返し実行することにより機器を制御するコントローラユニットであって、互いに接続される複数のコントローラユニットの動作を模擬するコンピュータを、コントローラユニットそれぞれによって実行される制御プログラムを取得する取得手段、コントローラユニットそれぞれに対応する仮想ユニットに、対応するコントローラユニットによって実行される制御プログラムを実行させることで、コントローラユニットそれぞれによる制御プログラムの実行を模擬するシミュレーション手段、として機能させ、シミュレーション手段は、制御プログラムの実行に伴って経過する仮想ユニットそれぞれのシミュレーション時間を予め定められた周期で同期させ、複数の仮想ユニットのうちの第1仮想ユニットは、複数の仮想ユニットによる制御プログラムの実行を停止することを示す停止指示を受け付ける受付手段と、受付手段によって受け付けられた停止指示を、前記第1仮想ユニットとは異なる第2仮想ユニットに送信する送信手段と、を有し、受付手段によって受け付けられた停止指示に従って制御プログラムの実行を停止し、第2仮想ユニットは、送信手段によって送信された停止指示を受信する受信手段を有し、受信手段によって停止指示が受信されると、シミュレーション時間を同期させるタイミングで制御プログラムの実行を停止する。
 本開示によれば、第1仮想ユニットは、停止指示に従って制御プログラムの実行を停止し、第2仮想ユニットは、停止指示が受信されると、シミュレーション時間を同期させるタイミングで制御プログラムの実行を停止する。このため、複数の仮想ユニットによる制御プログラムの実行を停止する際に、シミュレーション時間の大きな同期誤差の発生を回避することができる。これにより、シミュレーションを一時的に停止したときの動作状態を正確に確認することができるため、複数のコントローラユニットによって実行される制御プログラムの円滑な開発に資することができる。
実施の形態1に係るシミュレーション装置の概要を示す図 実施の形態1に係るシミュレーション装置のハードウェア構成を示す図 実施の形態1に係るシミュレーション装置の出力例を示す図 実施の形態1に係る仮想ユニットの詳細を示す図 実施の形態1に係る時間設定データの一例を示す図 実施の形態1に係るシミュレーション時間の同期について説明するための図 実施の形態1に係るシミュレーション処理を示すフローチャート 実施の形態1に係るシミュレーション装置に制御プログラムの実行の有無を示す指示が入力されたときの処理手順を示す図 実施の形態1に係る仮想ユニットが指示に従って動作するタイミングを示す図 実施の形態2に係る仮想ユニットの構成を示す図 実施の形態3に係る仮想ユニットが指示に従って動作するタイミングを示す図 実施の形態4に係るネットワークシステムの構成を示す図 実施の形態4に係る仮想コントローラの詳細を示す図 実施の形態4に係る仮想ユニットが指示に従って動作するタイミングを示す図
 以下、本開示の実施の形態に係るシミュレーションプログラムを実行するシミュレーション装置について、図面を参照しつつ詳細に説明する。
 実施の形態1.
 本実施の形態に係るシミュレーション装置10は、図1に示されるように、複数のコントローラユニット21,22を有するプログラマブルコントローラ20の動作をソフトウェア上で模擬するコンピュータであって、例えば、産業用PC(Personal Computer)、タブレット端末、又は、ネットワーク上のサーバ装置である。
 プログラマブルコントローラ20は、制御プログラム21aを実行するコントローラユニット21と、制御プログラム22aを実行するコントローラユニット22と、システムバス231を介してこれらのコントローラユニット21,22を接続するベースユニット23と、を備える。プログラマブルコントローラ20は、コントローラユニット21,22がそれぞれベースユニット23に装着されることで構成されるビルディングブロック形のPLC(Programmable Logic Controller)である。
 プログラマブルコントローラ20には、通信線を介して機器29が接続される。なお、図1では1つの機器29が代表的に示されているが、機器29の数は2つ以上でもよい。機器29とプログラマブルコントローラを接続する通信線は、電流信号又は電圧信号を伝送する配線であってもよいし、シリアルデータを伝送する信号線であってもよいし、産業用ネットワークであってもよい。コントローラユニット21,22はそれぞれ、制御プログラム21a,22aを実行することで機器29を連携制御する。例えば、コントローラユニット21が、センサである機器29のセンシング結果を定期的に取得し、コントローラユニット22が、当該センシング結果に基づいてアクチュエータである機器29の回転角度を制御する。制御プログラム21a,22aは、例えば、ラダー言語で記述されたラダープログラム、又は、その他の言語で機器29の制御内容が記述されるプログラムである。
 なお、プログラマブルコントローラ20は、機器29と接続される不図示の入出力ユニットを有してもよい。入出力ユニットが機器29と接続される場合には、コントローラユニット21,22は、入出力ユニットを介して機器29を制御する。また、プログラマブルコントローラ20が入出力ユニットを有することなく、コントローラユニット21,22が機器29に直接的に接続されてもよい。また、コントローラユニット21,22は、単一の機器29を協調制御してもよいし、異なる機器29を連係動作させてもよい。
 シミュレーション装置10は、上述のようなプログラマブルコントローラ20を実際に構築することなく、制御プログラム21a,22aに基づくプログラマブルコントローラ20の動作を模擬するためのソフトウェアを実行する。このようなソフトウェアを実行するために、シミュレーション装置10は、図2に示されるようなハードウェア構成を有する。詳細には、シミュレーション装置10は、プロセッサ41と、主記憶部42と、補助記憶部43と、入力部44と、出力部45と、通信部46と、を有する。主記憶部42、補助記憶部43、入力部44、出力部45及び通信部46はいずれも、内部バス47を介してプロセッサ41に接続される。
 プロセッサ41は、処理回路としてのCPU(Central Processing Unit)を含む。プロセッサ41は、補助記憶部43に記憶されるプログラムP1を実行することにより、シミュレーション装置10の種々の機能を実現して、後述の処理を実行する。
 主記憶部42は、RAM(Random Access Memory)を含む。主記憶部42には、補助記憶部43からプログラムP1がロードされる。そして、主記憶部42は、プロセッサ41の作業領域として用いられる。図2では1つのプログラムP1が代表的に示されているが、複数のプログラムP1があってもよい。例えば、シミュレーションのためのソフトウェアに相当するプログラムP1に加えて、後述の仮想ユニット31に指示を与えるためのエンジニアリングツールに相当するプログラムP1があってもよい。シミュレーションのためのプログラムP1は、シミュレーションプログラムの一例に相当する。
 補助記憶部43は、EEPROM(Electrically Erasable Programmable Read-Only Memory)及びHDD(Hard Disk Drive)に代表される不揮発性メモリを含む。補助記憶部43は、プログラムP1の他に、プロセッサ41の処理に用いられる種々のデータを記憶する。補助記憶部43は、プロセッサ41の指示に従って、プロセッサ41によって利用されるデータをプロセッサ41に供給し、プロセッサ41から供給されたデータを記憶する。
 入力部44は、キーボード及びポインティングデバイスに代表される入力デバイスを含む。入力部44は、シミュレーション装置10のユーザによって入力された情報を取得して、取得した情報をプロセッサ41に通知する。
 出力部45は、LCD(Liquid Crystal Display)及びスピーカに代表される出力デバイスを含む。出力部45は、プロセッサ41の指示に従って、種々の情報をユーザに提示する。
 通信部46は、外部の装置と通信するためのネットワークインタフェース回路を有する。通信部46は、外部から信号を受信して、この信号により示される情報をプロセッサ41へ出力する。また、通信部46は、プロセッサ41から出力された情報を示す信号を外部の装置へ送信する。
 なお、入力部44及び出力部45は、シミュレーション装置10のUI(User Interface)に相当する。ただし、シミュレーション装置10は、通信部46を介して外部のUI装置と接続されて、通信部46を介してユーザからの情報を取得するとともにユーザに情報を提供してもよい。入力部44及び出力部45に代えて外部のUI装置がシミュレーション装置10のUIとして用いられる場合には、入力部44及び出力部45が省略されてもよい。
 図1に戻り、シミュレーション装置10は、上述のハードウェア構成が協働することで実現される機能的な構成を有する。詳細には、シミュレーション装置10は、制御プログラム21a,22aを取得するプログラム取得部11と、シミュレーションの結果をユーザに提供するシミュレーション結果出力部12と、ユーザからシミュレーションの実行に関する指示が入力される指示入力部13と、進行するシミュレーションのあるタイミングにおける状態を示す状態データを記憶して保存する状態データ記憶部14と、仮想的に構築した仮想コントローラ30をプログラマブルコントローラ20と同様に動作させることでプログラマブルコントローラ20の動作を模擬するシミュレーション部15と、を有する。
 プログラム取得部11、シミュレーション結果出力部12及び指示入力部13は、UIとしての入力部44及び出力部45と、エンジニアリングツールを実行するプロセッサ41と、によって実現される。シミュレーション部15は、シミュレーションのためのソフトウェアを実行するプロセッサ41によって実現される。シミュレーション装置10は、制御プログラムに規定される制御処理を繰り返し実行することにより機器を制御するコントローラユニットであって、互いに接続される複数のコントローラユニットの動作を模擬するシミュレーション装置の一例に相当する。
 プログラム取得部11は、ユーザによって入力される制御プログラム21a,22aを取得してもよいし、ユーザによって指定された補助記憶部43のアドレス又は外部の記憶装置から制御プログラム21a,22aを読み出すことで取得してもよい。プログラム取得部11は、コントローラユニットそれぞれによって実行される制御プログラムを取得する取得手段の一例に相当する。
 シミュレーション結果出力部12は、例えば、図3に示されるように、シミュレーションの結果を表す領域A1を表示する。なお、シミュレーションの結果は、シミュレーションの経過、すなわち進行するシミュレーションのあるタイミングまでの進行結果を含む。図3の例では、領域A1には、仮想ユニット31,32が共有するメモリ内のアドレスとそのアドレスに格納される値とが対応づけられて示されている。共有メモリの値は制御プログラム21a,22aの実行に伴って変化し、コントローラユニット21,22はこの値を用いて機器29を制御するため、ユーザはこの値を観察することで制御処理が正しく実行されているか否かを確認することができる。
 指示入力部13に入力される指示は、例えば、シミュレーションを一時的に停止する停止指示、停止したシミュレーションを再開する再開指示、制御プログラム21a,22aに規定されて繰り返し実行される制御処理を1回だけ実行する1スキャン実行指示、又は、制御プログラム21a,22aに含まれる命令を1つだけ実行する1ステップ実行指示である。停止指示は、図3に例示されるボタンB2をユーザが選択することで入力され、再開指示は、ボタンB1を選択することで入力される。また、1スキャン実行指示は、ボタンB11を選択することで入力され、1ステップ実行指示は、ボタンB12を選択することで入力される。
 また、指示入力部13に入力される指示は、図3に例示されるボタンB3を選択することで入力される、現在のシミュレーションの状態を保存する保存指示と、ボタンB4を選択することで入力される、保存されたシミュレーションの状態を読み出す読出し指示と、を含む。保存指示は、例えば、ユーザの終業時、離席前、シミュレーション装置10の電源の切断前、又は、進行中のシミュレーションの現在のタイミングにおける状態が後の検証に必要であると判断された場合に、入力される。読出し指示は、例えば、ユーザの始業時、着席後、シミュレーション装置10の電源投入後、又は、過去のシミュレーション経過の検証時に、シミュレーション状態を復元するために入力される。読出し指示に続いて開始指示が入力されると、読み出された状態からシミュレーションが再開されることとなる。
 状態データ記憶部14は、主として補助記憶部43によって実現される。状態データ記憶部14には、指示入力部13に保存指示が入力されたときのシミュレーションの状態を示す状態データが格納される。また、状態データ記憶部14からは、読出し指示が入力されたときに状態データが読み出される。
 シミュレーション部15は、仮想ユニット31に制御プログラム21aを実行させ、仮想ユニット32に制御プログラム22aを実行させることで、コントローラユニット21,22による制御プログラム21a,22aの実行を模擬する。仮想ユニット31,32は、仮想コントローラ30を構成する。仮想ユニット31は、コントローラユニット21と同様に制御プログラム21aを実行することでコントローラユニット21の動作を模擬する。また、仮想ユニット32は、コントローラユニット22と同様に制御プログラム22aを実行することでコントローラユニット22の動作を模擬する。以下では、仮想ユニット31を第1の仮想ユニット31と表記し、仮想ユニット32を第2の仮想ユニットと表記することがある。シミュレーション部15は、コントローラユニットそれぞれに対応する仮想ユニットに、対応するコントローラユニットによって実行される制御プログラムを実行させることで、コントローラユニットそれぞれによる制御プログラムの実行を模擬するシミュレーション手段の一例に相当する。
 図4には、仮想ユニット31,32のより詳細な構成が示されている。図4に示されるように、仮想ユニット31には、制御プログラム21aとともに仮想ユニット31が動作するための設定内容を示す設定データ31bがプログラム取得部11から提供される。設定データ31bにより示される設定内容は、例えば、制御プログラム21aを実行する周期を含む処理条件、及び、後述のユニット間通信部313による通信周期を含む。同様に、仮想ユニット32には、制御プログラム22aとともに仮想ユニット32が動作するための設定内容を示す設定データ32bがプログラム取得部11から提供される。
 また、仮想ユニット31は、制御プログラム21aを設定データ31bに従って実行するプログラム実行部311と、仮想ユニット31の動作とともに進むシミュレーション時間を計時する仮想時計312と、仮想ユニット32と通信するためのユニット間通信部313と、指示入力部13に入力された指示を受け付ける受付部314と、を有する。仮想ユニット32は、仮想ユニット31のプログラム実行部311、仮想時計312及びユニット間通信部313と同様の機能を、制御プログラム22a及び設定データ32bについて発揮するプログラム実行部321、仮想時計322及びユニット間通信部323を有する。
 プログラム実行部311は、仮想ユニット31,32の間で共有されるデータが格納される共有メモリを有し、制御プログラム21aに含まれる命令を逐次実行する。仮想時計312は、プログラム実行部311による命令の実行とともに経過するシミュレーション時間を計時する。仮想時計312によって計時されるシミュレーション時間は、コントローラユニット21が制御プログラム21aを実行するときに経過する実時間と同様に、仮想ユニット31が制御プログラム21aを実行するときに経過する仮想的な時間である。例えば、仮想時計312は、図5に示されるような時間設定データに基づいてシミュレーション時間を計時する。時間設定データは、制御プログラム21aに含まれる命令と当該命令の実行にかかる時間長とを対応づけて示す。時間設定データは、設定データ31bに含まれてもよい。
 なお、シミュレーション時間は、命令の実行に対して実時間と同様に連動していればよく、実時間に対応していなくてもよい。また、シミュレーション時間の計時と命令の実行シミュレーションとは、同時になされてもよく、一方を起点として他方がなされてもよい。例えば、仮想時計312がシミュレーション時間を進めた後に、進められた長さのシミュレーション時間内で実行可能な命令をプログラム実行部311が実行してもよいし、プログラム実行部311が命令を実行した後に、当該命令に対応する長さだけ仮想時計312がシミュレーション時間を進めてもよい。シミュレーション部15は、制御プログラムの実行に伴って経過する仮想ユニットそれぞれのシミュレーション時間を予め定められた周期で同期させるシミュレーション手段の一例に相当する。
 ユニット間通信部313は、仮想ユニット32のユニット間通信部323との間で、データを交換するとともに、仮想時計312,322により示されるシミュレーション時間を示す情報を交換することにより、仮想時計312,322の同期を実現する。
 仮想時計312,322の同期は、図6に示されるように、シミュレーション時間における周期毎になされる。図6の例では、第1の仮想ユニット31及び第2の仮想ユニット32それぞれのシミュレーション時間が6μsecの周期毎に同期されている。詳細には、仮想ユニット31,32はそれぞれ、前回の同期のタイミングから周期に等しい長さのシミュレーション時間が経過したときに、他の仮想ユニットにおいても同等の長さのシミュレーション時間が経過していなければ待機し、経過している場合には次の周期におけるシミュレーションを開始する。
 各周期内においては、仮想ユニット31,32それぞれのシミュレーション時間は同期しているとは限らない。しかしながら、仮想ユニット31,32のシミュレーション時間の同期誤差の上限値がこの周期の長さに等しくなるため、ある程度小さい誤差でシミュレーション時間が同期し、制御プログラム21a,22aの実行が同期する。なお、ユニット間通信部313,323は、シミュレーション時間を同期するための待機状態であるか否かに関わらず、データを交換する。
 受付部314は、制御プログラム21a,22aの実行の有無を示す指示を指示入力部13から受け付けて、制御プログラム21aの実行の有無を示す指示をプログラム実行部311に出力する。プログラム実行部311は、この指示に従って制御プログラム21aを実行し又は停止する。詳細には、プログラム実行部311は、停止指示を受けた場合に制御プログラム21aの実行を停止し、開始指示を受けた場合に制御プログラム21aの実行を開始する。
 また、プログラム実行部311は、1スキャン実行指示を受けた場合に制御プログラム21aに規定される制御処理を1回だけ実行し、1ステップ実行指示を受けた場合に制御プログラム21a中の命令を1つ実行する。1スキャン実行指示に基づいて制御処理が完了した場合、及び、1ステップ実行指示に基づく1つの命令の実行が完了した場合には、プログラム実行部311は、停止指示を受けたときと同様に制御プログラム21aの実行を停止する。
 また、受付部314は、制御プログラム22aの実行の有無を示す指示をユニット間通信部313に出力する。シミュレーション時間を同期させるタイミングにおいて、ユニット間通信部313は、この指示を仮想ユニット32のユニット間通信部323に送信し、ユニット間通信部323は、この指示を受信してプログラム実行部321に出力し、プログラム実行部321は、この指示に従って制御プログラム22aを実行し又は停止する。
 受付部314は、複数の仮想ユニットによる制御プログラムの実行を停止することを示す停止指示を受け付ける受付手段の一例に相当する。また、仮想ユニット31は、受付手段によって受け付けられた停止指示に従って制御プログラムの実行を停止する第1仮想ユニットの一例に相当する。仮想ユニット31のユニット間通信部313は、受付手段によって受け付けられた停止指示を第2仮想ユニットに送信する送信手段の一例に相当する。仮想ユニット32のユニット間通信部323は、送信手段によって送信された停止指示を受信する受信手段の一例に相当する。仮想ユニット32は、受信手段によって停止指示が受信されると、シミュレーション時間を同期させるタイミングで制御プログラムの実行を停止する第2仮想ユニットの一例に相当する。
 続いて、仮想ユニット31,32において実行される処理について、図7,8を用いて説明する。図7には、仮想ユニット31,32それぞれによって実行されるシミュレーション処理の手順が模式的に示されている。以下では、このシミュレーション処理を仮想ユニット31が実行する例を中心に説明する。なお、仮想ユニット31と同様に、仮想ユニット32は、制御プログラム22aについてシミュレーション処理を実行する。
 シミュレーション処理では、仮想ユニット31は、現在の周期内における制御プログラム21aの実行を模擬する(ステップS1)。具体的には、プログラム実行部311が、時間設定データを参照して、制御プログラム21aに規定される制御処理のうちの、予め指定された長さの周期内において実行可能な命令を逐次実行する。
 周期内における命令の実行が完了すると、仮想ユニット31は、他の仮想ユニットのシミュレーション時間が現在の周期の終了時刻に等しいか否かを判定する(ステップS2)。具体的には、プログラム実行部311が、ユニット間通信部313を介して、仮想ユニット32の現在のシミュレーション時間を示す情報を取得し、仮想時計312のシミュレーション時間と比較することで、周期内における仮想ユニット32の制御プログラム22aの実行が完了しているか否かを判定する。
 ステップS2の判定が否定された場合(ステップS2;No)、ステップS2の判定が繰り返され、当該判定が肯定されるまで、仮想ユニット31は制御プログラム21aの実行を継続することなく待機する。一方、ステップS2の判定が肯定された場合(ステップS2;Yes)、仮想ユニット31は、次の周期に移行して(ステップS3)、ステップS1に戻ることにより、制御プログラム21aの実行を継続する。
 図8には、制御プログラム21a,22aの実行の有無を示す指示が入力された場合において仮想ユニット31,32が実行する処理手順が示されている。具体的には、仮想ユニット31は、制御プログラム21a,22aの実行の有無を示す指示があるか否かを判定する(ステップS11)。
 指示がないと判定した場合(ステップS11;No)、仮想ユニット31は、ステップS11の判定を繰り返す。一方、指示があると判定した場合(ステップS11;Yes)、仮想ユニット31は、指示に従って制御プログラム21aを実行し又は当該実行を停止する(ステップS12)。
 次に、仮想ユニット31は、仮想時計312によって計時されているシミュレーション時間が同期タイミングであるか否かを判定する(ステップS13)。シミュレーション時間が同期タイミングでないと判定した場合(ステップS13;No)、仮想ユニット31は、ステップS13の判定を繰り返して、シミュレーション時間が同期タイミングになるまで待機する。一方、シミュレーション時間が同期タイミングであると判定した場合(ステップS13;Yes)、仮想ユニット31は、ステップS11で入力されたと判定された指示を仮想ユニット32に送信する(ステップS14)。
 仮想ユニット32は、送信された指示を受信し(ステップS15)、この指示に従って制御プログラム22aを実行し又は停止する(ステップS16)。図7,8に示される処理は、シミュレーション装置によって実行されるシミュレーション方法の一例に相当する。
 図9には、仮想ユニット31に指示が与えられるタイミングと、仮想ユニット31,32がそれぞれ指示に従って動作するタイミングと、が示されている。図7に示されるように、第1の仮想ユニット31は、指示が与えられると即座に、当該指示に従って制御プログラム21aを実行し又は当該実行を停止する。仮想ユニット32には、シミュレーション時間を同期するタイミングで伝送される指示を受けて、このタイミングで指示に従って制御プログラム22aを実行し又は当該実行を停止する。
 以上、説明したように、本実施の形態に係る仮想ユニット31は、指示に従って制御プログラム21aを実行し又は当該実行を停止し、仮想ユニット32は、仮想ユニット31のユニット間通信部313から送信された指示がユニット間通信部323によって受信されると、シミュレーション時間を同期させるタイミングで制御プログラム22aを実行し又は当該実行を停止する。特に、2つの仮想ユニット31,32による制御プログラム21a,22aの実行を停止する際に、シミュレーション時間の大きな同期誤差の発生を回避することができる。具体的には、同期誤差の上限が周期の長さに等しくなる。これにより、シミュレーションを一時的に停止したときの動作状態を正確に確認することができるため、複数のコントローラユニット21,22によって実行される制御プログラム21a,22aの円滑な開発に資することができる。
 なお、仮想ユニット31,32のシミュレーション時間の同期を常に保ちながらそれぞれの制御プログラムの実行を模擬する手法を採用することも考えられる。ここで、FAの現場ではプログラムを実行する装置が多数配置されるケースが多く、そのようなケースでは仮想ユニットの数を3つ以上に増やしてシミュレーションを行う必要がある。しかしながら同期を常に保つ手法では、仮想ユニットの数が増えるにつれてシミュレーションの実行速度が低下するおそれがある。これに対して、本実施の形態のように、シミュレーション時間を示す情報及びデータを交換する仮想ユニット31,32を構築すれば、例えば並列化によりシミュレーションの実行速度をある程度速くすることできる。
 また、仮想ユニット31,32は、停止指示が入力された場合に制御プログラム21a,22aの実行を停止するが、制御プログラム21a,22aに規定される制御処理とは異なる情報処理を続行する。仮想ユニット31,32による情報処理のシミュレーションを継続しつつ、制御プログラム21a,22aの実行を一時的に停止して、仮想ユニット31,32の動作状態を観察することにより、制御プログラム21a,22aの開発が容易になる。
 また、本実施の形態に係る状態データ記憶部14は、仮想ユニット31,32の状態を示す状態データを記憶し、指示入力部13に、状態データの読出し指示が入力されると、シミュレーション部15は、状態データにより示される仮想ユニット31,32の状態を復元する。ここで、仮想ユニット31の状態は、特定のシミュレーション時間における制御プログラム21a、設定データ31b、プログラム実行部311、仮想時計312、ユニット間通信部313の状態を意味し、仮想ユニット32の状態は、特定のシミュレーション時間における制御プログラム22a、設定データ32b、プログラム実行部321、仮想時計322、ユニット間通信部323の状態を意味する。これにより、シミュレーションを再び最初から実行する必要が無く、その途中から再開することができる。例えば、コントローラユニット21,22の装置始動シーケンスが完了した状態からシミュレーションを開始して、シミュレーション結果の分析にかかる時間を短縮することができる。
 状態データ記憶部14は、停止指示に従って制御プログラムの実行を停止した複数の仮想ユニットの状態を示す状態データを記憶する状態データ記憶手段の一例に相当する。また、指示入力部13は、状態データを読み出すことを示す読出し指示が入力される入力手段の一例に相当する。シミュレーション部15は、読出し指示が入力されると、状態データ記憶手段から状態データを読み出して、該状態データにより示される複数の仮想ユニットの状態を復元するシミュレーション手段の一例に相当する。
 実施の形態2.
 続いて、実施の形態2について、上述の実施の形態1との相違点を中心に説明する。なお、上記実施の形態1と同一又は同等の構成については、同等の符号を用いるとともに、その説明を省略又は簡略する。本実施の形態は、仮想ユニット32が、仮想ユニット32自体の状態の履歴を記憶する点で、上記実施の形態1とは異なる。
 本実施の形態に係る仮想ユニット32は、図10に示されるように、履歴記憶部325を有する。履歴記憶部325は、リングバッファに相当し、プログラム実行部321、仮想時計322及びユニット間通信部323の状態の履歴を、シミュレーション時間の同期のための周期に相当する長さだけ過去に遡って記憶する。履歴記憶部325に記憶された履歴は、状態データ記憶部14に出力されて、状態データとともに保存され、シミュレーション結果出力部12によってユーザからの要求に応じてユーザに提供される。
 以上、説明したように、仮想ユニット32は、仮想ユニット32の状態の履歴を記憶する履歴記憶部325を有する。この履歴を参照することにより、ユーザは、図9に示されたような同期誤差を加味して仮想ユニット31,32の状態を観察することができる。履歴記憶部325は、第2仮想ユニットの状態の履歴を記憶する履歴記憶手段の一例に相当する。
 実施の形態3.
 続いて、実施の形態3について、上述の実施の形態1との相違点を中心に説明する。なお、上記実施の形態1と同一又は同等の構成については、同等の符号を用いるとともに、その説明を省略又は簡略する。本実施の形態は、仮想ユニット31が指示に従って制御プログラム21aを実行し又は当該実行を停止するタイミングがシミュレーション時間を同期させるタイミングに等しい点で、上記実施の形態1とは異なる。
 本実施の形態に係る仮想ユニット31は、図11に示されるように、制御プログラム21aの実行の有無を示す指示を受けると、その後の最初のシミュレーション時間の同期タイミングで、指示に従って制御プログラム21aを実行し又は当該実行を停止する。
 これにより、仮想ユニット31,32はいずれも、シミュレーション時間を同期させるタイミングで制御プログラム21a,22aを実行し又は当該実行を停止する。特に、停止指示が入力された際に、同期誤差が実施の形態1よりも大幅に小さい状態で仮想ユニット31,32が処理を停止する。このため、シミュレーション装置10のユーザは、同期した状態の仮想ユニット31,32を分析することができる。
 実施の形態4.
 続いて、実施の形態4について、上述の実施の形態1との相違点を中心に説明する。なお、上記実施の形態1と同一又は同等の構成については、同等の符号を用いるとともに、その説明を省略又は簡略する。本実施の形態は、仮想ユニット31,32がそれぞれ、ネットワークを介して接続されるコントローラユニット21,22に対応する点で、上記実施の形態1とは異なる。
 図12には、本実施の形態に係るシミュレーション装置10によって動作が模擬されるネットワークシステムの構成が示されている。図12に示されるように、このネットワークシステムは、産業用ネットワーク61を介して接続された2つのプログラマブルコントローラ20,50を有する。プログラマブルコントローラ20は、実施の形態1と同様のコントローラユニット21と、産業用ネットワーク61を介して通信するためのネットワークユニット24と、システムバス231を介してコントローラユニット21とネットワークユニット24とを接続するベースユニット23と、を有する。プログラマブルコントローラ50は、実施の形態1と同様のコントローラユニット22と、産業用ネットワーク61を介して通信するためのネットワークユニット54と、システムバス531を介してコントローラユニット22とネットワークユニット54とを接続するベースユニット53と、を有する。コントローラユニット21,22は、ネットワークユニット24,54を介して通信することにより連携して動作する。
 シミュレーション部15は、図13に示されるように、上述のようなプログラマブルコントローラ20,50の動作を模擬する仮想コントローラ30,60を仮想的に構築する。仮想コントローラ30は、実施の形態1と同様の仮想ユニット31と、ネットワークユニット24と同等に動作する仮想ネットワークユニット34と、を有する。
 仮想ユニット31は、実施の形態1と同様の構成を有する。ただし、仮想ユニット31のユニット間通信部313は、仮想ネットワークユニット34のユニット間通信部343と通信する。
 仮想ネットワークユニット34は、仮想ネットワークユニット34のシミュレーション時間を計時する仮想時計342と、ユニット間通信部343と、仮想コントローラ60の仮想ネットワークユニット64と通信するネットワーク通信部346と、仮想コントローラ30,60の間で共有されるデータを記憶するバッファメモリ347と、を有する。また、仮想ネットワークユニット34には、仮想ネットワークユニット34を動作させるための設定内容を示す設定データ34bがプログラム取得部11から提供される。この設定内容は、例えば、ユニット間通信部343が仮想ユニット31とデータを交換する周期、及び、ネットワーク通信部346が仮想コントローラ60とデータを交換する周期を示す。
 仮想コントローラ60は、実施の形態1と同様の仮想ユニット32と、仮想ネットワークユニット64と、を有する。仮想ネットワークユニット64は、仮想ネットワークユニット34と同等の構成要素として、仮想時計642、ユニット間通信部643、ネットワーク通信部646及びバッファメモリ647を有する。また、仮想ネットワークユニット64には、設定データ64bがプログラム取得部11から提供される。
 上述したように、仮想ネットワークユニット34,64はそれぞれ、シミュレーション時間を計時する仮想時計342,642を有する。仮想ネットワークユニット34,64は制御プログラムを実行しないため、制御プログラムの実行に伴って仮想時計342,642を進めることなく、これらの仮想時計342,642はそれぞれ、仮想ユニット31,32からシミュレーション時間が通知されるたびに通知されたシミュレーション時間に同期する。このため、仮想ユニット31と仮想ネットワークユニット34との間でシミュレーション時間が同期し、仮想ユニット32と仮想ネットワークユニット64との間でシミュレーション時間が同期する。仮想ユニット31,32は、仮想ネットワークユニット34,64を介して実施の形態1と同様にシミュレーション時間を同期させるため、結局、仮想ユニット31,32及び仮想ネットワークユニット34,64のシミュレーション時間が、予め定められた周期毎に同期することとなる。
 図14には、制御プログラム21a,22aの実行の有無を示す指示が仮想ユニット31入力されてから、この指示が仮想ネットワークユニット34,64を介して仮想ユニット32へ伝送されて、仮想ユニット31,32が制御プログラム21a,22aを実行し又は当該実行を停止するタイミングが示されている。図14に示されるように、第1の仮想ユニット31に指示が入力されると、この指示は、シミュレーション時間を同期させるタイミングにおいて、仮想ネットワークユニット34,64を介して仮想ユニット32へ伝送され、仮想ユニット32は、このタイミングで指示に従って制御プログラム22aを実行し又は停止する。詳細には、仮想ネットワークユニット34のユニット間通信部343が指示を受信し、この指示は、ネットワーク通信部346によって送信されて仮想ネットワークユニット64のネットワーク通信部646によって受信されてから、ユニット間通信部643から仮想ユニット32へ出力される。
 以上、説明したように、コントローラユニット21,22はそれぞれ、産業用ネットワーク61を介して接続される異なるネットワークユニット24,54とともに異なるプログラマブルコントローラ20,50を構成する。また、シミュレーション部15は、仮想ユニット31,32それぞれのシミュレーション時間、及び、ネットワークユニット24、54それぞれに対応する仮想ネットワークユニット34,64のシミュレーション時間を予め定められた周期で同期させる。そして、停止指示は、シミュレーション時間を同期させるタイミングで、仮想ユニット31のユニット間通信部313から仮想ネットワークユニット34,64を介して仮想ユニット32のユニット間通信部323に伝送される。これにより、ネットワークを介して接続されるコントローラユニット21,22の動作について、実施の形態1と同様に模擬することができる。
 以上、本開示の実施の形態について説明したが、本開示は上記実施の形態によって限定されるものではない。
 例えば、動作が模擬されるコントローラユニットの数が2つである例を中心に説明したが、コントローラユニットの数を3つ以上に変更してもよい。シミュレーション部15は、コントローラユニットの数に応じて仮想ユニットの数を変更すればよい。3つ以上の仮想ユニットが構築される場合には、1つの仮想ユニットが受付部314を有していればよく、他の仮想ユニットがすべて、上述の実施形態に係る仮想ユニット32と同様に動作すればよい。
 また、コントローラユニット21,22は、制御プログラム21a,22aに規定される制御処理を繰り返し実行するものでなくともよい。例えば、コントローラユニット21,22は、制御プログラム21a,22aに規定される制御処理を1回だけ実行してもよい。また、制御プログラム21a,22aは、コントローラユニット21,22以外の装置によって実行される制御処理の一部に相当する部分処理であってもよい。制御プログラム21a,22aは、コントローラユニット21,22によって実行されることにより機器29の制御を達成するものであればよい。
 また、上述の各実施の形態を任意に組み合わせてもよい。例えば、実施の形態1から実施の形態2,3への変形を実施の形態4に対して施してもよい。
 また、シミュレーション装置10の機能は、専用のハードウェアによっても、また、通常のコンピュータシステムによっても実現することができる。
 例えば、プロセッサ41によって実行されるプログラムP1を、コンピュータ読み取り可能な非一時的な記録媒体に格納して配布し、そのプログラムP1をコンピュータにインストールすることにより、上述の処理を実行する装置を構成することができる。このような記録媒体としては、例えばフレキシブルディスク、CD-ROM(Compact Disc Read-Only Memory)、DVD(Digital Versatile Disc)、MO(Magneto-Optical Disc)が考えられる。
 また、プログラムP1をインターネットに代表される通信ネットワーク上のサーバ装置が有するディスク装置に格納しておき、例えば、搬送波に重畳させて、コンピュータにダウンロードするようにしてもよい。
 また、通信ネットワークを介してプログラムP1を転送しながら起動実行することによっても、上述の処理を達成することができる。
 さらに、プログラムP1の全部又は一部をサーバ装置上で実行させ、その処理に関する情報をコンピュータが通信ネットワークを介して送受信しながらプログラムを実行することによっても、上述の処理を達成することができる。
 なお、上述の機能を、OS(Operating System)が分担して実現する場合又はOSとアプリケーションとの協働により実現する場合等には、OS以外の部分のみを媒体に格納して配布してもよく、また、コンピュータにダウンロードしてもよい。
 また、シミュレーション装置10の機能を実現する手段は、ソフトウェアに限られず、その一部又は全部を、回路を含む専用のハードウェアによって実現してもよい。
 本開示は、本開示の広義の精神と範囲を逸脱することなく、様々な実施の形態及び変形が可能とされるものである。また、上述した実施の形態は、本開示を説明するためのものであり、本開示の範囲を限定するものではない。つまり、本開示の範囲は、実施の形態ではなく、請求の範囲によって示される。そして、請求の範囲内及びそれと同等の開示の意義の範囲内で施される様々な変形が、本開示の範囲内とみなされる。
 本開示は、機器を制御するための制御プログラムの開発に適している。
 10 シミュレーション装置、 11 プログラム取得部、 12 シミュレーション結果出力部、 13 指示入力部、 14 状態データ記憶部、 15 シミュレーション部、 20,50 プログラマブルコントローラ、 21,22 コントローラユニット、 21a,22a 制御プログラム、 23,53 ベースユニット、 231,531 システムバス、 24,54 ネットワークユニット、 29 機器、 30,60 仮想コントローラ、 31,32 仮想ユニット、 311,321 プログラム実行部、 312,322、342,642 仮想時計、 313,323、343,643 ユニット間通信部、 314 受付部、 325 履歴記憶部、 346、646 ネットワーク通信部、 347,647 バッファメモリ、 31b、32b、34b、64b 設定データ、 34,64 仮想ネットワークユニット、 41 プロセッサ、 42 主記憶部、 43 補助記憶部、 44 入力部、 45 出力部、 46 通信部、 47 内部バス、 60 仮想コントローラ 61 産業用ネットワーク、 A1 領域、 B1~B4,B11,B12 ボタン、 P1 プログラム。

Claims (9)

  1.  制御プログラムに規定される制御処理を繰り返し実行することにより機器を制御するコントローラユニットであって、互いに接続される複数の前記コントローラユニットの動作を模擬するコンピュータを、
     前記コントローラユニットそれぞれによって実行される前記制御プログラムを取得する取得手段、
     前記コントローラユニットそれぞれに対応する仮想ユニットに、対応する前記コントローラユニットによって実行される前記制御プログラムを実行させることで、前記コントローラユニットそれぞれによる前記制御プログラムの実行を模擬するシミュレーション手段、
     として機能させ、
     前記シミュレーション手段は、前記制御プログラムの実行に伴って経過する前記仮想ユニットそれぞれのシミュレーション時間を予め定められた周期で同期させ、
     複数の前記仮想ユニットのうちの第1仮想ユニットは、
     複数の前記仮想ユニットによる前記制御プログラムの実行を停止することを示す停止指示を受け付ける受付手段と、
     前記受付手段によって受け付けられた前記停止指示を、前記第1仮想ユニットとは異なる第2仮想ユニットに送信する送信手段と、を有し、
     前記受付手段によって受け付けられた前記停止指示に従って前記制御プログラムの実行を停止し、
     前記第2仮想ユニットは、
     前記送信手段によって送信された前記停止指示を受信する受信手段を有し、
     前記受信手段によって前記停止指示が受信されると、シミュレーション時間を同期させるタイミングで前記制御プログラムの実行を停止する、
     シミュレーションプログラム。
  2.  複数の前記コントローラユニットはそれぞれ、ネットワークを介して接続される異なるネットワークユニットとともに異なるプログラマブルコントローラを構成し、
     前記シミュレーション手段は、前記仮想ユニットそれぞれのシミュレーション時間、及び、前記ネットワークユニットそれぞれに対応する仮想ネットワークユニットのシミュレーション時間を前記予め定められた周期で同期させ、
     前記停止指示は、シミュレーション時間を同期させるタイミングで、前記送信手段から前記仮想ネットワークユニットそれぞれを介して前記受信手段に伝送される、
     請求項1に記載のシミュレーションプログラム。
  3.  前記コンピュータを、
     前記停止指示に従って前記制御プログラムの実行を停止した複数の前記仮想ユニットの状態を示す状態データを記憶する状態データ記憶手段、
     前記状態データを読み出すことを示す読出し指示が入力される入力手段、としてさらに機能させ、
     前記シミュレーション手段は、前記読出し指示が入力されると、前記状態データ記憶手段から前記状態データを読み出して、該状態データにより示される複数の前記仮想ユニットの状態を復元する、
     請求項1又は2に記載のシミュレーションプログラム。
  4.  前記受付手段は、複数の前記仮想ユニットによる停止された前記制御プログラムの実行を再開することを示す再開指示、前記制御処理を1回実行することを示す1スキャン実行指示、又は、前記制御処理に含まれる1つの命令を実行することを示す1ステップ実行指示である実行指示を受け付け、
     前記送信手段は、前記受付手段によって受け付けられた前記実行指示を前記第2仮想ユニットに送信し、
     前記第1仮想ユニットは、前記受付手段によって受け付けられた前記実行指示に従って前記制御プログラムを実行し、
     前記受信手段は、前記送信手段によって送信された前記実行指示を受信し、
     前記第2仮想ユニットは、前記受信手段によって受信された前記実行指示に従って前記制御プログラムを実行する、
     請求項1から3のいずれか一項に記載のシミュレーションプログラム。
  5.  前記仮想ユニットはそれぞれ、前記停止指示に従って前記制御プログラムの実行を停止した場合に、前記制御プログラムの実行とは異なる処理を続行する、
     請求項1から4のいずれか一項に記載のシミュレーションプログラム。
  6.  前記第1仮想ユニットは、前記受付手段によって前記停止指示が受け付けられると、シミュレーション時間を同期させるタイミングで前記制御プログラムの実行を停止する、
     請求項1から5のいずれか一項に記載のシミュレーションプログラム。
  7.  前記第2仮想ユニットは、前記予め定められた周期における前記第2仮想ユニットの状態の履歴を記憶する履歴記憶手段をさらに有する、
     請求項1から6のいずれか一項に記載のシミュレーションプログラム。
  8.  制御プログラムを実行することにより機器を制御し互いに接続される複数のコントローラユニットの動作を模擬するシミュレーション方法であって、
     シミュレーション手段が、前記コントローラユニットそれぞれに対応する仮想ユニットに、対応する前記コントローラユニットによって実行される前記制御プログラムを実行させることで、前記コントローラユニットそれぞれによる前記制御プログラムの実行を模擬するステップと、
     前記シミュレーション手段が、前記制御プログラムの実行に伴って経過する前記仮想ユニットそれぞれのシミュレーション時間を予め定められた周期で同期させるステップと、
     複数の前記仮想ユニットのうちの第1仮想ユニットの受付手段が、複数の前記仮想ユニットによる前記制御プログラムの実行を停止することを示す停止指示を受け付けるステップと、
     前記第1仮想ユニットの送信手段が、受け付けられた前記停止指示を、前記第1仮想ユニットとは異なる第2仮想ユニットに送信するステップと、
     前記第1仮想ユニットが、受け付けられた前記停止指示に従って前記制御プログラムの実行を停止するステップと、
     前記第2仮想ユニットの受信手段が、前記送信手段によって送信された前記停止指示を受信するステップと、
     前記第2仮想ユニットが、前記受信手段によって前記停止指示が受信されると、シミュレーション時間を同期させるタイミングで前記制御プログラムの実行を停止するステップと、
     を含むシミュレーション方法。
  9.  制御プログラムを実行することにより機器を制御し互いに接続される複数のコントローラユニットの動作を模擬するシミュレーション装置であって、
     前記コントローラユニットそれぞれによって実行される前記制御プログラムを取得する取得手段と、
     前記コントローラユニットそれぞれに対応する仮想ユニットに、対応する前記コントローラユニットによって実行される前記制御プログラムを実行させることで、前記コントローラユニットそれぞれによる前記制御プログラムの実行を模擬するシミュレーション手段と、
     を備え、
     前記シミュレーション手段は、前記制御プログラムの実行に伴って経過する前記仮想ユニットそれぞれのシミュレーション時間を予め定められた周期で同期させ、
     複数の前記仮想ユニットのうちの第1仮想ユニットは、
     複数の前記仮想ユニットによる前記制御プログラムの実行を停止することを示す停止指示を受け付ける受付手段と、
     前記受付手段によって受け付けられた前記停止指示を、前記第1仮想ユニットとは異なる第2前記仮想ユニットに送信する送信手段と、を有し、
     前記受付手段によって受け付けられた前記停止指示に従って前記制御プログラムの実行を停止し、
     前記第2仮想ユニットは、
     前記送信手段によって送信された前記停止指示を受信する受信手段を有し、
     前記受信手段によって前記停止指示が受信されると、シミュレーション時間を同期させるタイミングで前記制御プログラムの実行を停止する、
     シミュレーション装置。
PCT/JP2021/047708 2021-12-22 2021-12-22 シミュレーションプログラム、シミュレーション方法及びシミュレーション装置 WO2023119524A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/JP2021/047708 WO2023119524A1 (ja) 2021-12-22 2021-12-22 シミュレーションプログラム、シミュレーション方法及びシミュレーション装置
JP2022520194A JPWO2023119524A1 (ja) 2021-12-22 2021-12-22

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/047708 WO2023119524A1 (ja) 2021-12-22 2021-12-22 シミュレーションプログラム、シミュレーション方法及びシミュレーション装置

Publications (1)

Publication Number Publication Date
WO2023119524A1 true WO2023119524A1 (ja) 2023-06-29

Family

ID=86901597

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2021/047708 WO2023119524A1 (ja) 2021-12-22 2021-12-22 シミュレーションプログラム、シミュレーション方法及びシミュレーション装置

Country Status (2)

Country Link
JP (1) JPWO2023119524A1 (ja)
WO (1) WO2023119524A1 (ja)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008027225A (ja) * 2006-07-21 2008-02-07 Fujitsu Ten Ltd シミュレーション装置
JP2015530656A (ja) * 2012-10-05 2015-10-15 株式会社日立製作所 ジョブ管理システム及びジョブ制御方法
JP2017041201A (ja) * 2015-08-21 2017-02-23 三菱重工業株式会社 分散シミュレーションシステム、シミュレーション実行方法及び制御システム
WO2019049195A1 (ja) * 2017-09-05 2019-03-14 三菱電機株式会社 シミュレーション装置およびシミュレーション方法
JP2019121068A (ja) * 2017-12-28 2019-07-22 キヤノン株式会社 ソフトウェア検証装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008027225A (ja) * 2006-07-21 2008-02-07 Fujitsu Ten Ltd シミュレーション装置
JP2015530656A (ja) * 2012-10-05 2015-10-15 株式会社日立製作所 ジョブ管理システム及びジョブ制御方法
JP2017041201A (ja) * 2015-08-21 2017-02-23 三菱重工業株式会社 分散シミュレーションシステム、シミュレーション実行方法及び制御システム
WO2019049195A1 (ja) * 2017-09-05 2019-03-14 三菱電機株式会社 シミュレーション装置およびシミュレーション方法
JP2019121068A (ja) * 2017-12-28 2019-07-22 キヤノン株式会社 ソフトウェア検証装置

Also Published As

Publication number Publication date
JPWO2023119524A1 (ja) 2023-06-29

Similar Documents

Publication Publication Date Title
WO2012117556A1 (ja) 情報処理装置及び情報処理装置制御方法
JP6433635B1 (ja) シミュレーション装置およびシミュレーション方法
CN110456707B (zh) 控制装置
JP5653568B1 (ja) ネットワークシステム
JP2008310727A (ja) シミュレーション装置及びシミュレーション方法
TWI661358B (zh) 模擬裝置
WO2013145940A1 (ja) 情報処理装置、情報処理方法、およびプログラム
WO2023119524A1 (ja) シミュレーションプログラム、シミュレーション方法及びシミュレーション装置
JP4600601B1 (ja) デバッグ支援装置、デバッグ支援方法及びデバッグ支援プログラム
JP5314959B2 (ja) 情報処理装置、及びその制御方法、コンピュータプログラム、記憶媒体
WO2020071435A1 (ja) 開発支援プログラム、開発支援装置、および開発支援方法
JP2006172128A (ja) プログラム連携システムの処理方法および情報処理装置
CN110442074B (zh) 可编程逻辑控制器程序的处理装置
JP2016024798A (ja) 冗長化コントローラシステム、その待機系コントローラ
WO2024084602A1 (ja) シミュレーションプログラム、シミュレーション方法及びシミュレーション装置
JP2002300226A (ja) 通信プログラム作成装置、通信プログラムの作成プログラム、およびこれを記録したコンピュータ読み取り可能な記録媒体
US20050234695A1 (en) Timing control method of hardware-simulating program and application of the same
JP2009163423A (ja) プログラム連携システム及びそのシミュレーション制御方法
JPH09259004A (ja) デバッグ方法
JP2000276502A (ja) ソフトウエアシミュレータ
JP2005157791A (ja) プリンタシミュレータおよびプリンタのシミュレーション方法
EP3792710A1 (en) Control system, support device, and support program
JP2006293515A (ja) Osエミュレータ時間経過制御装置
JP5921449B2 (ja) コントローラ
JP6620653B2 (ja) プラント監視制御システム用エミュレータ

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 2022520194

Country of ref document: JP

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21968961

Country of ref document: EP

Kind code of ref document: A1