JP2013029914A - Control program test apparatus, control program test system and testing method of control program - Google Patents
Control program test apparatus, control program test system and testing method of control program Download PDFInfo
- Publication number
- JP2013029914A JP2013029914A JP2011164073A JP2011164073A JP2013029914A JP 2013029914 A JP2013029914 A JP 2013029914A JP 2011164073 A JP2011164073 A JP 2011164073A JP 2011164073 A JP2011164073 A JP 2011164073A JP 2013029914 A JP2013029914 A JP 2013029914A
- Authority
- JP
- Japan
- Prior art keywords
- command
- control program
- unit
- device simulation
- interface unit
- Prior art date
- Legal status (The legal status 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 status listed.)
- Withdrawn
Links
Images
Landscapes
- Testing And Monitoring For Control Systems (AREA)
- Test And Diagnosis Of Digital Computers (AREA)
- Programmable Controllers (AREA)
Abstract
Description
本発明は、デジタル入出力を有する制御装置に用いられる制御プログラムを試験する試験装置、試験システム、及び方法に関するものである。 The present invention relates to a test apparatus, a test system, and a method for testing a control program used in a control apparatus having a digital input / output.
FA(Factory Automation)等の分野では、制御プログラムに従い自動制御を行う制御装置が用いられている。このような制御装置において制御プログラムの動作確認を行うには、実際の入出力機器である被制御装置を接続しなければならない。 In fields such as FA (Factory Automation), a control device that performs automatic control according to a control program is used. In order to check the operation of the control program in such a control device, it is necessary to connect a controlled device that is an actual input / output device.
制御装置に被制御装置が接続されていない状態で制御プログラムの試験を行う装置として、従来、制御装置と被制御装置間で実際のデータ入出力を行う実I/Oに割当てた実I/Oアドレス、制御装置内部のメモリに仮想的に設けられたデータ入出力機器の仮想I/Oアドレス、仮想I/Oアドレスの有効性を示すフラグ、並びに実I/Oアドレス及び仮想I/Oアドレスに対応するメモリアドレスを記憶するマッピングテーブルを備え、有効フラグにより仮想I/Oアドレスの無効が示されている場合は実I/Oとメモリアドレスとの間でデータ入出力を行い、仮想I/Oアドレスの有効が示されている場合は仮想I/Oアドレスとメモリアドレスとの間でデータ入出力を行うシーケンスコントローラがある(例えば、特許文献1参照)。 As a device for testing a control program in a state where the controlled device is not connected to the control device, a real I / O that has been assigned to a real I / O that performs actual data input / output between the control device and the controlled device is conventionally used The address, the virtual I / O address of the data input / output device virtually provided in the memory inside the control device, the flag indicating the validity of the virtual I / O address, the real I / O address and the virtual I / O address A mapping table for storing the corresponding memory address is provided. When the virtual I / O address is invalid by the valid flag, data is input / output between the real I / O and the memory address, and the virtual I / O When the validity of the address is indicated, there is a sequence controller that performs data input / output between a virtual I / O address and a memory address (see, for example, Patent Document 1).
しかしながら、上記のシーケンスコントローラにおいては、制御プログラムの制御対象である装置模擬プログラムを外部のパソコン等で作成し、コントローラにダウンロードした後に制御プログラムの試験を行うため、装置模擬プログラムを変更するたびにコントローラにダウンロードしなければならないという課題があった。 However, in the above sequence controller, the device simulation program to be controlled by the control program is created on an external personal computer or the like and downloaded to the controller to test the control program. There was a problem that had to be downloaded.
本発明はこのような課題を解決するためになされたもので、装置模擬プログラムをダウンロードせず制御プログラムの試験をすることができる制御プログラム試験装置、制御プログラム試験システム、及び制御プログラムの試験方法を得ることを目的とする。 The present invention has been made to solve such a problem, and provides a control program test apparatus, a control program test system, and a control program test method capable of testing a control program without downloading a device simulation program. The purpose is to obtain.
本発明に係る制御プログラム試験装置は、被制御装置を模擬した装置模擬プログラムを有する端末装置に接続され、被制御装置を制御する制御プログラム、被制御装置に対するデータの入出力を実際に行う実インタフェース部、被制御装置に対するデータの入出力を仮想的に行う仮想インタフェース部、装置模擬プログラム及び制御プログラムのいずれか一方からの指令に応じて実インタフェース部と仮想インタフェース部とを切替える切替部、を備え、仮想インタフェース部から指令を実行して値変化が発生した場合に切替部が装置模擬プログラムに値変化に関する情報を送信するものである。 A control program test apparatus according to the present invention is connected to a terminal device having an apparatus simulation program that simulates a controlled apparatus, and a control program for controlling the controlled apparatus and an actual interface that actually inputs and outputs data to the controlled apparatus A virtual interface unit that virtually inputs / outputs data to / from the controlled device, and a switching unit that switches between the real interface unit and the virtual interface unit in response to a command from either the device simulation program or the control program. When a value change occurs by executing a command from the virtual interface unit, the switching unit transmits information related to the value change to the device simulation program.
本発明に係る制御プログラム試験システムは、被制御装置を模擬した装置模擬プログラムを有する端末装置と、被制御装置を制御する制御プログラム、被制御装置に対するデータの入出力を実際に行う実インタフェース部、被制御装置に対するデータの入出力を仮想的に行う仮想インタフェース部、装置模擬プログラム及び制御プログラムのいずれか一方からの指令に応じて実インタフェース部と仮想インタフェース部とを切替える切替部、を有し、端末装置に接続されたコントローラと、を備え、仮想インタフェース部が指令を実行して値変化が発生した場合に、切替部が装置模擬プログラムに値変化に関する情報を送信するものである。 A control program test system according to the present invention includes a terminal device having a device simulation program that simulates a controlled device, a control program that controls the controlled device, an actual interface unit that actually inputs and outputs data to the controlled device, A virtual interface unit that virtually inputs and outputs data to the controlled device, a switching unit that switches between the real interface unit and the virtual interface unit in response to a command from either the device simulation program or the control program, A controller connected to the terminal device, and when the virtual interface unit executes a command and a value change occurs, the switching unit transmits information about the value change to the device simulation program.
本発明に係る制御プログラムの試験方法は、被制御装置を制御する制御プログラム、被制御装置に対するデータの入出力を実際に行う実インタフェース部、被制御装置に対するデータの入出力を仮想的に行う仮想インタフェース部、装置模擬プログラム及び制御プログラムのいずれか一方からの指令に応じて実インタフェース部と仮想インタフェース部とを切替える切替部、を有するコントローラと、コントローラに接続され、被制御装置を模擬した装置模擬プログラムを有する端末装置と、を備えた制御プログラム試験システムにおいて、制御プログラムまたは装置模擬プログラムが切替部に向けてデータ入出力に関する指令を送信する指令送信ステップと、指令送信ステップにより送信された指令に基づき、切替部が実インタフェース部と仮想インタフェース部とを切替えて実インタフェース部または仮想インタフェース部に指令を実行させる切替ステップと、切替ステップにより仮想インタフェース部が指令を実行した後、実行された指令により値変化が発生したか否かを切替部が判断する判断ステップと、判断ステップにより切替部が値変化が発生したと判断した場合に、切替部が装置模擬プログラムに対して値変化に関する情報を送信する値変化情報送信ステップと、値変化情報送信ステップにより送信された値変化に関する情報を受信した装置模擬プログラムが、被制御装置を模擬した装置模擬の処理を実行する装置模擬処理ステップと、を備えたものである。 The control program testing method according to the present invention includes a control program for controlling a controlled device, a real interface unit that actually inputs and outputs data to the controlled device, and a virtual that virtually inputs and outputs data to the controlled device. A device simulation that simulates a controlled device connected to the controller and a controller having a switching unit that switches between the real interface unit and the virtual interface unit in response to a command from one of the interface unit, the device simulation program, and the control program In a control program test system comprising a terminal device having a program, a command transmission step in which the control program or device simulation program transmits a command related to data input / output to the switching unit, and a command transmitted by the command transmission step. Based on the actual interface part A switching step for switching the virtual interface unit to cause the real interface unit or the virtual interface unit to execute a command, and whether or not a value change has occurred due to the executed command after the virtual interface unit executes the command in the switching step. A determination step determined by the switching unit, a value change information transmission step in which the switching unit transmits information about the value change to the device simulation program when the switching unit determines that a value change has occurred in the determination step; The apparatus simulation program that has received the information regarding the value change transmitted in the change information transmission step includes an apparatus simulation processing step that executes an apparatus simulation process that simulates the controlled apparatus.
本発明によれば、上記構成を備えたことにより、コントローラに装置模擬プログラムをダウンロードすることなく制御プログラムの試験を行うことができる。 According to the present invention, since the above configuration is provided, it is possible to test the control program without downloading the device simulation program to the controller.
実施の形態1.
本発明を実施するための実施の形態1に係る制御プログラム試験システムを図1〜図8を用いて説明する。図1において、制御プログラム試験システム1は、制御対象の被制御装置(図示しない)に接続され、これを制御するコントローラ2と、被制御装置を模擬した装置模擬プログラム30の開発・生成に用いられるパソコン3とで構成されている。
なお、コントローラ2は被制御装置に接続されない場合もある。
A control program test system according to Embodiment 1 for carrying out the present invention will be described with reference to FIGS. In FIG. 1, a control
The
コントローラ2には、記憶媒体200、RAM201、CPU202、被制御装置と接続され被制御装置に対するデータの入出力を実際に行う実インタフェース(以下、実I/Oと称する)25、パソコン3と接続するコントローラ側I/F部203、が設けられている。
RAM201には、被制御装置に対するデータの入出力を仮想的に行う仮想インタフェース(以下、仮想I/Oと称する)24が設けられ、記憶媒体200には、被制御装置を制御するための制御プログラム20、パソコン3の装置模擬プログラム30にアクセスする際に用いる装置模擬I/F部21、指令(Read/Write)に応じて仮想I/O24と実I/O25を切替る際に用いるI/O切替設定データ部22、I/O切替部23が保持されている。なお、制御プログラム20、装置模擬I/F部21、及びI/O切替部23はプログラムであり、I/O切替設定データ部22はデータベースである。記憶媒体200に保持されたプログラムは、コントローラ2で起動するOS(図示しない)によってRAM201に展開され、CPU202で実行される。また、I/O切替設定データ部22のデータはI/O切替部26によってRAM201に展開され使用される。
The
The
パソコン3には、RAM301、開発・生成した装置模擬プログラム30やその他のデータを記憶する記憶媒体300、装置模擬プログラム30を読み出して動作させるCPU302、コントローラと接続するパソコン側I/F部303が設けられている。記憶媒体300に保持されたプログラムは、パソコン3上で起動するOS(図示しない)によってRAM301に展開され、CPU302で実行される。
コントローラ側I/F部203やパソコン側I/F部303としては、例えば、シリアル、USB、Ethernet(登録商標)に対応するインタフェースがある。
The
As the controller side I /
図2は、制御プログラム試験システム1を機能ブロックで示す図である。
コントローラ2には制御プログラム20、装置模擬I/F部21、I/O切替設定データ部22、I/O切替部23、仮想I/O24、及び実I/O25が設けられ、パソコン3には装置模擬プログラム30が設けられている。
FIG. 2 is a functional block diagram of the control
The
・全体の動作 ・ Overall operation
ここで、制御プログラム試験システム1の動作について説明する。
図3は、制御プログラム試験システム1全体の動作シーケンスを示し、実線は実際の処理を伴う動作を、破線は繰り返し同じ動作に戻る場合を表している。
まず、制御プログラム試験システム1はI/O切替部23と装置模擬I/F部21を起動する。このとき、どちらを先に起動しても良い。次に、装置模擬プログラム30と制御プログラム20を起動する。装置模擬プログラム30と制御プログラム20の起動順序は、試験対象によって決まる。
Here, the operation of the control
FIG. 3 shows an operation sequence of the control
First, the control
各機能ブロックを起動させると、制御プログラム試験システム1は、次の3つのケースいずれかにより試験を開始する。
ケース1:装置模擬プログラム30が装置模擬I/F部21へ指令(ReadまたはWrite)を送信する。
ケース2:制御プログラム20がI/O切替部23へ指令(ReadまたはWrite)を送信する。
When each functional block is activated, the control
Case 1: The
Case 2: The
ケース1の場合、装置模擬プログラム30が装置模擬処理を行い(ステップS01)装置模擬I/F部21へ指令を送信すると(ステップS02)、装置模擬I/F部21はI/O切替部23へ転送する(ステップS03)。ケース2の場合は制御プログラム20が制御処理を行い(ステップS04)、I/O切替部23へReadやWriteの指令を送信する(ステップS05)。
In
なお、図3の例ではケース1の動作(ステップS01〜ステップS03)を行った後、ケース2のステップS04、ステップS05を順次行っているが、制御プログラム20の制御処理(ステップS04)から始めても良い。
In the example of FIG. 3, after performing the operation of case 1 (step S01 to step S03), step S04 and step S05 of
ステップS04及びステップS05による指令の送信を終えると、制御プログラム20は制御が終了したか否かを判断し、処理が終了していないと判断した場合はステップS04及びステップS05より前の状態に戻る。
When the transmission of the command in step S04 and step S05 is completed, the
I/O切替部23は、装置模擬I/F部21または/および制御プログラム20から指令を受信すると実I/O25と仮想I/O24のどちらに入力すべきかI/O切替設定データ部22を参照して判断し、判断結果に基づいて実I/O25および仮想I/O24の切替制御を行う(ステップS06)。そして、実I/O25または仮想I/O24のデータをReadしたり、Writeしたりする(ステップS07)。このとき、制御プログラム20からの指令に従いReadしたデータは、制御プログラム20へ送信する。
When the I /
I/O切替部23は、指令が被制御装置へのWriteであり、かつ、仮想I/O24を介してデータをWriteした結果により値が変化したか否かを判断し(ステップS08)、値が変化している場合は値変化イベントを装置模擬I/F部21へ送信する(ステップS09)。装置模擬I/F部21は、この値変化イベントを装置模擬プログラム30へ転送し(ステップS10)、その後、処理が終了したか否かを判断し、処理が終了していないと判断した場合はステップS01で指令を受信するより前の状態に戻る。
The I /
装置模擬プログラム30は、装置模擬I/F部21から受信した値変化イベントにより起動条件が満たされた装置模擬処理があるか否かを判断し、起動条件が満たされた装置模擬処理がある場合はこれを起動し、別スレッドで実行する(ステップS11)。このステップS11の処理は、上記ステップS01と同じである。そして、この処理において装置模擬I/F部21へ指令を送信する(ステップS12)。指令の送信後、装置模擬プログラム30は実行すべき装置模擬処理が実行されたか否かを判断し、処理が終了していないと判断した場合はステップS10による値変化イベントを受信するより前の状態に戻る。
The
装置模擬I/F部21がステップS12による指令を受信するとI/O切替部23に転送し(ステップS13)、コントローラ2の各機能ブロックは装置模擬I/F部21がステップS01で指令を受信した場合と同様の動作を繰り返す。
When the device simulation I /
このように、制御プログラム試験システム1は、上記の動作を繰り返し行うことで装置模擬プログラム30をコントローラ2へダウンロードすることなく、制御プログラム20の試験を、装置模擬プログラム30の開発に用いたパソコン3上で容易に実行できる。また、装置模擬プログラム30のダウンロード時間を削減することで、デバッグが何回も必要となる装置模擬プログラム30の開発工期を短縮することもできる。
As described above, the control
ここで、各機能ブロックそれぞれの動作の詳細を、フローチャートを用いて説明する。 Here, details of the operation of each functional block will be described using a flowchart.
・制御プログラムの動作 ・ Control program operation
図4は制御プログラム20のフローチャートである。
制御プログラム20は、予めプログラム上に設定されたロジックに従いI/O切替部23へRead指令を送信し、実I/O25または仮想I/O24からデータの読み出しを行う(ステップS101、図3のステップS04、S05、S07に対応)。Read指令が無い場合、ステップS101の処理は省略できる。
FIG. 4 is a flowchart of the
The
制御プログラム20はまた、予めプログラム上に設定されたロジックに従いI/O切替部23へ指令を出して実I/O25又は仮想I/O24に値のWriteを行う(ステップS102)。Readの場合と同様に、Write指令が無い場合はステップS102の処理を省略できる。
そして、Write及びReadの制御が終了したか否かを判断し(ステップS103)、制御処理が終了していない場合はステップS101の処理へ戻り、処理が終了している場合はこのフローを終了する。
The
Then, it is determined whether or not the write and read controls are finished (step S103). If the control process is not finished, the process returns to step S101, and if the process is finished, this flow is finished. .
・I/O切替部の動作 ・ Operation of I / O switching unit
次に、図5を用いてI/O切替部23のフローを説明する。
I/O切替部23は、装置模擬I/F部21または制御プログラム20から指令(ReadまたはWrite)を受信すると(ステップS201、図3のステップS03、S05に対応)、この指令は実I/O25と仮想I/O24のどちらに対する指令かを判断する(ステップS202)。
Next, the flow of the I /
When the I /
実I/O25への指令の場合はこの指令に従ってデータのReadまたはWriteを行い(ステップS203、図3のステップS07に対応)、仮想I/O24への指令の場合はこの指令に従ってReadまたはWriteを行う(ステップS204、図3のステップS07に対応)。
In the case of a command to the real I /
仮想I/O24へWriteを行う場合、その指令が出力へのWrite指令であって、かつ、この指令によりWriteをした結果、値が変化したか否かを判断し(ステップS205、図3のステップS08に対応)、値変化している場合は装置模擬I/F部21へ値変化イベントを送信する(ステップS206、図3のステップS09に対応)。その後、処理が終了したかを判断し(ステップS207)、終了していなければステップS201の前の状態に戻り、処理が終了していればこのフローを終了する。
When writing to the virtual I /
一方、仮想I/O24への出力へのWrite指令であって値変化していない場合、及び仮想I/O24へのRead指令の場合は、ステップS206を行わずに上記ステップS207を行う。また、上記ステップS202で実I/O25への指令(ReadまたはWrite)と判断した場合も同様に、ステップS203の後、ステップS207で処理が終了したか否かを判断する。
On the other hand, when the command is a write command to the output to the virtual I /
・装置模擬I/F部の動作 ・ Operation of device simulation I / F section
次に、図6及び図7を用いて装置模擬I/F部21のフローを説明する。図6は1タスクで処理する場合を、図7は2タスクで処理する場合をそれぞれ示している。
図6において、装置模擬I/F部21は装置模擬プログラム30からの指令またはI/O切替部23からの値変化イベントを受信すると(ステップS301、図3のステップS02、S09、S12に対応)、装置模擬プログラム30からの指令かI/O切替部23からの値変化イベントかを判断する(ステップS302)。I/O切替部23からの値変化イベントの場合は装置模擬プログラム30へこれを転送し(ステップS303、図3のステップS10に対応)、装置模擬プログラム30からの指令の場合はI/O切替部23へこの指令を転送する(ステップS304、図3のステップS03、S13に対応)。そして、処理が終了したか否かを判断し(ステップS305)、終了していない場合はステップS301に戻り、処理が終了している場合はこのフローを終了する。
Next, the flow of the apparatus simulation I /
In FIG. 6, when the device simulation I /
装置模擬I/F部21のフローを2タスクで行う場合、図7のフロー1では装置模擬プログラム30からの指令を受信し(ステップS311、図3のステップS02、S12に対応)、受信した指令をI/O切替部23へ転送する(ステップS312、図3のステップS03、S13に対応)。そして、処理が終了したか否かを判断し(ステップS313)、処理が終了していない場合はステップS311に戻り、処理が終了している場合はフロー1を終了する。図7のフロー2では、装置模擬I/F部21はI/O切替部23からの値変化イベントを受信し(ステップS321、図3のステップS09に対応)、受信した値変化イベントを装置模擬プログラム30へ転送する(ステップS322、図3のステップS10に対応)。そして、処理が終了したか否かを判断し(ステップS323)、処理が終了していない場合はステップS321に戻り、処理が終了している場合はフロー2を終了する。
When the flow of the device simulation I /
・装置模擬プログラムの動作 ・ Operation of device simulation program
次に、図8を用いて装置模擬プログラム30のフローを説明する。
装置模擬プログラム30は、指令がある場合に装置模擬I/F部21へ送信し(ステップS401、図3のステップS02に対応)、装置模擬I/F部21から値変化イベントを受信する(ステップS402、図3のステップS10に対応)。そして、受信した値変化イベントによって起動条件が満たされた装置模擬処理があるか否かを判断し(ステップS403)、該当する装置模擬処理がある場合にはこれを起動して別スレッドで実行し、この処理の中で新たな指令を装置模擬I/F部21へ送信する(ステップS404、図3のステップS11、S12に対応)。その後、装置模擬プログラム30は装置模擬が終了したか否かを判断し(ステップS405)、終了していない場合はステップS402に戻り、処理が終了している場合はこのフローを終了する。なお、送信する指令が無い場合はステップS401の送信処理を省略できる。
Next, the flow of the
The
本実施の形態によれば、制御プログラム試験システム1は、コントローラ2に制御プログラム20、I/O切替部23、装置模擬I/F部21、実I/O25、及び仮想I/O24を備え、パソコン3に装置模擬プログラム30を備え、制御プログラム20または装置模擬プログラム30からの指令に基づき仮想I/O24に値変化が生じると装置模擬プログラム30が装置模擬処理を行う構成としたことにより、装置模擬プログラム30をパソコン3からコントローラ2にダウンロードすることなく制御プログラム20の制御プログラム試験(制御プログラム20による装置模擬プログラム30の装置模擬処理の実行)を行うことが可能となる。また、開発中にデバッグが何回も必要となる装置模擬プログラム30をコントローラ2にダウンロードする時間を削減できるため、開発工期を短縮できる。
また、装置模擬プログラム30に時間管理の機能を設けることにより、指令を所定の時刻に実行するよう自動制御することもできる。
According to the present embodiment, the control
Further, by providing a time management function in the
実施の形態2.
本発明を実施するための実施の形態2に係る制御プログラム試験システム1Aを図9〜図12を用いて説明する。構成は実施の形態1と同じで、装置模擬プログラム30Aと装置模擬I/F部21Aの機能が異なる。具体的には、装置模擬プログラム30Aは時間に関する情報を指令(ReadおよびWrite)に付与する機能を有し、装置模擬I/F部21Aはこの指令のリストを受信すると付与された時間情報に基づいて指令をI/O切替部23へ転送する機能を有する。
A control program test system 1A according to
・全体の動作 ・ Overall operation
ここで、制御プログラム試験システム1Aの動作について説明する。
図9は、制御プログラム試験システム1A全体の動作シーケンスを示し、実線は実際の処理を伴う動作を、破線は繰り返し同じ動作に戻る場合を表している。
まず、制御プログラム試験システム1AはI/O切替部23と装置模擬I/F部21Aを起動する。このとき、どちらを先に起動しても良い。次に、装置模擬プログラム30A、制御プログラム20の順に起動する。
Here, the operation of the control program test system 1A will be described.
FIG. 9 shows an operation sequence of the entire control program test system 1A. A solid line represents an operation involving actual processing, and a broken line represents a case where the operation returns repeatedly to the same operation.
First, the control program test system 1A activates the I /
各機能ブロックを起動させると、制御プログラム試験システム1Aは、コントローラ2Aの装置模擬I/F部21Aからパソコン3Aの装置模擬プログラム30Aへ期間情報をつけて指令リスト取得要求を送信する(ステップS21)。この処理は予め定めた時刻に定期的あるいは不定期に行われる。
When each functional block is activated, the control program test system 1A sends a command list acquisition request with period information from the device simulation I / F unit 21A of the controller 2A to the
装置模擬プログラム30Aは、指令リスト取得要求を受信すると指定された期間における指令の実行時刻を決定し、この時刻情報付きの指令リストを作成し(ステップS22)、その結果を装置模擬I/F部21Aへ送信する(ステップS23)。装置模擬I/F部21Aは、受信した指令リストの時刻情報を参照し、指定された時刻になるとI/O切替部23へ指令を送信する(ステップS24)。なお、時刻の計測はコントローラ2A内に設けられたタイマ(図示しない)等を用いて行う。
制御プログラム20は、制御処理(ステップS25)において、データのRead及びWriteの指令をI/O切替部23に送信する(ステップS26)。
なお、制御プログラム20からの指令と装置模擬I/F部21Aからの指令のどちらが先に行われるかは試験対象によって決まる。
When the
In the control process (step S25), the
Note that which of the command from the
I/O切替部23は、装置模擬I/F部21Aや制御プログラム20から指令を受信すると実I/O25と仮想I/O24のどちらに入力すべきかI/O切替設定データ部22を参照して判断し、判断結果に基づいて実I/O25または仮想I/O24へ指令を入力する(ステップS27)。そして、実I/O25または仮想I/O24のデータRead及びWriteを行い、Readしたデータを制御プログラム20へ送信する(ステップS28)。
When receiving an instruction from the device simulation I / F unit 21A or the
I/O切替部23は、また、仮想I/O24を介してデータの読み書きをした結果、この指令が出力指令であって、かつ、この出力指令により値が変化したか否かを判断し(ステップS29)、値が変化している場合は値変化イベントを装置模擬I/F部21Aへ送信する(ステップS30)。
The I /
装置模擬I/F部21Aは、この値変化イベントを装置模擬プログラム30Aへ転送する(ステップS31)。
装置模擬プログラム30Aは、値変化イベントを受信すると値変化イベントにより起動条件が満たされた新しい装置模擬処理があるか否かを判断し、起動条件が満たされた装置模擬処理がある場合はこれを起動して別スレッドで実行する(ステップS32)。
The device simulation I / F unit 21A transfers this value change event to the
Upon receiving the value change event, the
装置模擬I/F部21Aは、装置模擬プログラム30Aに対してステップS21で要求した期間の指令リストの取得要求を再度送信し(ステップS33)、装置模擬プログラム30Aは受信した指令リストの取得要求に応答して指定期間における指令リストを指令に時刻を付けて作成し(ステップS34)、装置模擬I/F部21Aへ送信する(ステップS35)。その後、装置模擬プログラム30Aは指令リストにある処理が終了したか否かを判断し、処理が終了していないと判断した場合はステップS31の値変化イベントを受信するより前の状態に戻る。
The device simulation I / F unit 21A transmits again a command list acquisition request for the period requested in step S21 to the
装置模擬I/F部21AはステップS35により指令リストを受信すると、保有していた指令リストを上書きし(ステップS36)、その後、指令リストにある処理が終了したか否かを判断し、処理が終了していないと判断した場合はステップS21の前の状態に戻り、予め設定された所定時刻になると再び指令リストの取得要求を送信し、以後、同様の動作を繰り返す。 Upon receiving the command list in step S35, device simulation I / F unit 21A overwrites the stored command list (step S36), and then determines whether or not the processing in the command list has been completed. When it is determined that the process has not been completed, the process returns to the state before step S21. When a predetermined time set in advance is reached, a command list acquisition request is transmitted again, and thereafter the same operation is repeated.
制御プログラム試験システム1Aは、上記の動作を繰り返し行うことで、装置模擬プログラム30Aが開発に用いたパソコン3Aからコントローラ2Aへのダウンロードすることなく、制御プログラム20の制御プログラム試験を行うことができる。また、指令に時刻情報を付与することにより、タイミング調整が必要な指令の実行時刻を自動制御することもできる。
The control program test system 1A can perform the control program test of the
ここで、各機能ブロックそれぞれの動作を、フローチャートを用いて説明する。 Here, the operation of each functional block will be described using a flowchart.
・装置模擬I/F部の動作 ・ Operation of device simulation I / F section
図10は、装置模擬I/F部21Aの動作を示すフローチャートであり、3つのタスクフローで構成されている。 FIG. 10 is a flowchart showing the operation of the apparatus simulation I / F unit 21A, and is composed of three task flows.
フロー1は、パソコン3Aの装置模擬プログラム30Aから定期的に(不定期であってもよい)指定時刻つきの指令を取得するためのフローである。
フロー2は、装置模擬プログラム30Aから取得した指令リストに従い、付与された(指定された)時刻に指令をI/O切替部23へ送信するためのフローである。
フロー3は、I/O切替部23から値変化イベントを受信して装置模擬プログラム30Aへ転送し、次に指令リストの取得要求を送信するまでの期間の指令リストを取得しなおすためのフローである。
フロー1において、装置模擬I/F部21Aは装置模擬プログラム30Aに対し、所定の期間情報を付して指令リストの取得要求を送信し、装置模擬プログラム30Aから指令リストを受信すると自装置に設けられた保有リストに新たに取得した指令リストを追加する(ステップS501、図9のステップS23に対応)。
In
そして装置模擬I/F部21Aのフロー2がスリープ状態であればこれを解除し(ステップS502)、ステップS501で取得した指令リストの最後の指令で指定された時刻より所定時間前までの間、フロー1をスリープ状態にさせる(S503)。ステップS501で取得した指令リストの最後の指令で指定された時刻より所定時間前になるとフロー1のスリープ状態を解除して処理が終了したか否かを判断し(ステップS504)、処理が終了していなければステップS501の前の状態に戻り、処理が終了していればこのフローを終了する。
Then, if the
フロー2では、装置模擬I/F部21Aは保有している指令リストに現在の時刻が指定時刻とされた指令があるか否かを判断し(ステップS511)、現在の時刻が指定時刻とされた指令がある場合はこの指令をI/O切替部23へ送信し、この指令を実行させる(ステップS512、図9のステップS24に対応)。
In the
現在の時刻が指定時刻とされた指令が無い場合、あるいはステップS512が終了すると、指令リストをチェックして次の指令で指定された時刻までこのフロー2をスリープ状態とする(ステップS513)。次の指令で指定された時刻になるとフロー2のスリープ状態を解除し、処理が終了したか否かを判断し(ステップS514)、処理が終了していなければステップS511の前の状態に戻り、処理が終了していればこのフローを終了する。
When there is no command whose current time is the designated time, or when step S512 ends, the command list is checked and this
フロー3では、装置模擬I/F部21AはI/O切替部23からの値変化イベントを受信し(ステップS521、図9のステップS30に対応)、装置模擬プログラム30Aへこれを転送する(ステップS522、図9のステップS31に対応)。そして、次に指令リスト取得要求を送信する所定時間までの間における指令リストを更新するために、装置模擬プログラム30Aへ指令リスト取得要求を送信して新たな指令リストを取得し、保有している指令リストを上書きする(ステップS523、図9のステップS36に対応)。
In
装置模擬I/F部21Aは、その後、フロー2がスリープ状態にあればこれを解除し(ステップS524)、処理が終了したか否かを判断し(ステップS525)、終了していない場合はステップS521の前の状態に戻り、処理が終了している場合はこのフローを終了する。
Thereafter, if the
・装置模擬プログラムの動作 ・ Operation of device simulation program
次に、図11及び図12を用いて装置模擬プログラム30Aのフローを説明する。図11は1タスクで処理する場合を、図12は2タスクで処理する場合をそれぞれ示している。
図11において、装置模擬プログラム30Aは装置模擬I/F部21Aから指令リストの取得要求または値変化イベントを受信すると(ステップS601、図9のステップS21、S31、S33に対応)、受信したデータは値変化イベントか指令リストの取得要求かを判断し(ステップS602)、値変化イベントの場合はこの値変化イベントにより起動条件が満たされた装置模擬処理があるか否かを判断する(ステップS603)。
Next, the flow of the
In FIG. 11, when the
該当する装置模擬処理がある場合にはこれを起動して別スレッドで実行し、この処理の中でこれより後の指令を時刻つきで計算する(ステップS604、図9のステップS32に対応)。ステップS601で受信したデータが指令リストの取得要求である場合、指令リスト取得要求で要求した所定期間分の指令リストを装置模擬プログラム30Aの各装置模擬処理から取得し、装置模擬I/F部21Aに送信する(ステップS605、図9のステップS23、S35に対応)。
If there is a corresponding device simulation process, it is activated and executed in a separate thread, and a later command is calculated with time in this process (corresponding to step S604, step S32 in FIG. 9). When the data received in step S601 is a command list acquisition request, a command list for a predetermined period requested by the command list acquisition request is acquired from each device simulation process of the
値変化イベントによって起動条件が満たされた装置模擬処理が無い場合や装置模擬処理の別スレッドで指令を実行した後、あるいは装置模擬I/F部21Aへ指令を送信した後、装置模擬プログラム30Aは装置模擬処理が終了したか否かを判断し(ステップS606)、装置模擬処理が終了していない場合はステップS601の前の状態に戻り、処理が終了している場合はこのフローを終了する。
When there is no device simulation process in which the activation condition is satisfied by the value change event, or after executing a command in another thread of the device simulation process, or after sending a command to the device simulation I / F unit 21A, the
一方、図12に示すように2タスクで処理する場合、装置模擬プログラム30Aはフロー1において装置模擬I/F部21Aから値変化イベントを受信し(ステップS611、図9のステップS31に対応)、この値変化イベントにより起動条件が満たされた装置模擬処理があるか否かを判断する(ステップS612)。該当する装置模擬処理がある場合はこれを起動して別スレッドで実行し、この処理の中でこれより後の指令を時刻つきで計算する(ステップS613、図9のステップS32に対応)。
On the other hand, when processing with two tasks as shown in FIG. 12, the
その後、装置模擬処理が終了したか否かを判断し(ステップS614)、終了していない場合はステップS611の前の状態に戻り、処理が終了している場合はこのフローを終了する。 Thereafter, it is determined whether or not the apparatus simulation process has ended (step S614). If the apparatus simulation process has not ended, the process returns to the state before step S611. If the process has ended, this flow ends.
装置模擬プログラム30Aは、また、図12のフロー2において、装置模擬I/F部21Aから所定期間分の指令リストの取得要求を受信し(ステップS621、図9のステップS21、S33に対応)、要求された指令リストを装置模擬プログラム30Aの各装置模擬処理から取得し、装置模擬I/F部21Aに送信する(ステップS622、図9のステップS23、S35に対応)。装置模擬I/F部21Aへ指令を送信した後、装置模擬プログラム30Aは装置模擬処理が終了したか否かを判断し(ステップS623)、終了していない場合はステップS621の前の状態に戻り、処理が終了している場合はこのフローを終了する。
The
なお、制御プログラム20及びI/O切替部23は実施の形態1と同じであるため、説明を省略する。
Since the
本実施の形態によれば、制御プログラム試験システム1Aは、装置模擬プログラム30Aと装置模擬I/F部21Aの機能を拡張して指令に指定時刻に実行する時刻情報を付与することにより、実施の形態1に記載の効果に加えて、指令を所定の時刻に自動制御で実行させることが可能となる。これは、実施の形態1における制御プログラム30に時間管理の機能を備えた場合と同様の効果を奏するものである。
According to the present embodiment, the control program test system 1A expands the functions of the
実施の形態3.
本発明を実施するための実施の形態3に係る制御プログラム試験システム1Bを図13〜図18を用いて説明する。図13に示すように、本実施の形態に係る制御プログラム試験システム1Bは、実施の形態2の構成に加えて、装置模擬I/F部21B、I/O切替部23、制御プログラム20それぞれに接続された連携動作タイミング調整部26を備えている。また、その他の構成については、装置模擬I/F部21Bは実施の形態2と機能が一部異なるものの、それ以外は同じであるため説明を省略する。
A control
・全体の動作 ・ Overall operation
ここで、制御プログラム試験システム1Bの動作について説明する。
図14は、制御プログラム試験システム1B全体の動作シーケンスを示し、実線は実際の処理を伴う動作を、破線は繰り返し同じ動作に戻る場合を表している。
まず、制御プログラム試験システム1BはI/O切替部23、装置模擬I/F部21B、連携動作タイミング調整部26を任意の順に起動する。次に、装置模擬プログラム30Aを起動し、制御プログラム20を起動する。
Here, the operation of the control
FIG. 14 shows an operation sequence of the entire control
First, the control
各機能ブロックを起動させると、制御プログラム試験システム1Bは、コントローラ2Bの装置模擬I/F部21Bから連携動作タイミング調整部26へ制御プログラム20の停止指令を送信し(ステップS41)、連携動作タイミング調整部26は制御プログラム20を停止するAPI(Application Program Interface)を読んで制御プログラム20を停止する(ステップS42)。なお、連携動作タイミング調整部26は制御プログラムリストを有し、制御プログラム20を止める際にはこれを参照する。
When each functional block is activated, the control
その後、連携動作タイミング調整部26は装置模擬I/F部21Bに装置模擬入力時刻停止指令を送信し(ステップS43)、装置模擬I/F部21Bはパソコン3Aの装置模擬プログラム30Aへ所定期間における指令リストを要求する指令リスト取得要求を送信する(ステップS44)。この処理は予め定めた時刻に定期的あるいは不定期に行われる。なお、この装置模擬入力時刻停止指令とは、装置模擬I/F部21B内の内部時刻を停止させる指令である。
Thereafter, the cooperative operation timing
装置模擬プログラム30Aは、指令リスト取得要求を受信すると所定期間における指令の実行時刻を決定し、この時刻情報を付けた指令リストを作成して(ステップS45)装置模擬I/F部21Bへ送信する(ステップS46)。
Upon receiving the command list acquisition request,
装置模擬I/F部21Bは、指令リストを受信すると連携動作タイミング調整部26へ制御プログラム20の再開指令を送信し(ステップS47)、連携動作タイミング調整部26は制御プログラム20を再開(もしくは開始)するAPIを読んで制御プログラム20を再開(もしくは開始)する(ステップS48)。
When the device simulation I /
連携動作タイミング調整部26は、ステップS48にて制御プログラム20を再開させた後、装置模擬I/F部21Bからの入力が行われるように、装置模擬I/F部21Bに装置模擬入力時刻進行指令を送信する(ステップS49)。なお、この装置模擬入力時刻進行指令とは、装置模擬I/F部21B内の内部時刻を進行させる指令である。
The cooperative operation timing
制御プログラム20が再開し、制御処理(ステップS50)により制御プログラム20からI/O切替部23へ指令が送信されると(ステップS51)、I/O切替部23はI/Oを切替える(ステップS52)。連携動作タイミング調整部26へ制御プログラム20の停止指令を送信し(ステップS53)、連携動作タイミング調整部26は制御プログラム20を停止するAPIを読み制御プログラムリストを参照して制御プログラム20を停止し(ステップS54)、制御プログラム20が停止した後にI/O切替部23はデータのReadまたはWriteを行う(ステップS55)。
When the
例えば実I/O25への指令の場合、I/O切替部23はこの指令に従って実I/O25を介してデータのReadまたはWriteを行う。仮想I/O24へのWrite指令であれば実I/O25へ書き込んだ後に連携動作タイミング調整部26へ制御プログラム20の停止指令を送信し(ステップS53)、制御プログラム20の停止が完了した後、仮想I/O24にWriteを行う(ステップS55)。また、仮想I/O24へのRead指令であれば、仮想I/O24に対してReadを行う(ステップS55)。
For example, in the case of a command to the real I /
指令が仮想I/O24へのWrite指令であって、その指令の実行により値変化が発生した場合、I/O切替部23は値変化イベントを装置模擬I/F部21Bに送信する(ステップS57)。
If the command is a write command to the virtual I /
また、図示はしていないが、指令が仮想I/O24に対する出力へのWrite指令であって値変化イベントを送信しない場合は、I/O切替部23は連携動作タイミング調整部26に制御プログラム20の再開指令を送信し、連携動作タイミング調整部26は制御プログラム20を再開するAPIを読んでこれを再開する。
その後、連携動作タイミング調整部26は、装置模擬I/F部21Bに装置模擬入力時刻進行指令を送って、装置模擬I/F部21Bの内部時刻を進行させる。
Although not shown, when the command is a write command to output to the virtual I /
Thereafter, the cooperative operation timing
ステップS57により装置模擬I/F部21Bが値変化イベントを受信した場合、装置模擬I/F部21Bは装置模擬プログラム30Aへこれを転送する(ステップS58)。
装置模擬プログラム30Aは、値変化イベントを受信すると値変化イベントにより起動条件が満たされた新しい装置模擬処理があるか否かを判断し、起動条件が満たされた装置模擬処理がある場合はこれを起動し、指定期間における指令を時刻付きで作成する(ステップS59)。
When the device simulation I /
Upon receiving the value change event, the
装置模擬I/F部21Bはその後、ステップS44で要求した期間の指令リストの取得要求を再度送信し(ステップS60)、装置模擬プログラム30Aはこの要求に応答して指令リストを作成し(ステップS61)、装置模擬I/F部21Bへ送信する(ステップS62)。そして、再び指令リストの取得要求や値変化イベントを受信する前の状態に戻る。
Thereafter, the device simulation I /
装置模擬I/F部21BはステップS62にて指令リストを受信すると、保有していた指令リストを上書きする(ステップS63)。装置模擬I/F部21Bは、ステップS63にて指令リストを上書きする。その後、制御プログラム20の再開指令を装置模擬I/F部21Bから連携動作タイミング調整部26に送信する(ステップS47)。また、連携動作タイミング調整部26は制御プログラム20を再開し(ステップS48)、装置模擬入力時刻進行指令を装置模擬I/F部21Bに送信する(ステップS49)。そして、ステップS41以降の動作を繰り返す。
その後、装置模擬I/F部21Bは、装置模擬入力時刻進行指令を受信すると、内部時刻を進行させ、ステップS47以降の処理を繰り返す。
Upon receiving the command list in step S62, device simulation I /
Thereafter, upon receiving the device simulation input time advance command, device simulation I /
装置模擬I/F部21Bは、また、内部時刻が進行している期間は装置模擬プログラム30Aの装置模擬処理を実行する。具体的には、ステップS46やステップS62にて受信した指令リストに従い、指定時刻より所定時間前になると連携動作タイミング調整部26へ制御プログラム20の再開指令を送信し、連携動作タイミング調整部26が制御プログラム20を再開するAPIを読んで制御プログラム20を再開させる(ステップS48)。なお、ここでいう所定時間とは、装置模擬I/F部21Bから連携動作タイミング調整部26を介して制御プログラム20へ停止指令が到達するのに要する時間である。
The device simulation I /
制御プログラム20を再開させた後、装置模擬I/F部21Bは指定時刻になるとI/O切替部23に指令を送信し(図示しない)、I/O切替部23はステップS51にて制御プログラム20から指令を受信したときと同様に以降の処理を繰り返す。
After resuming the
ここで、各機能ブロックそれぞれの動作を、フローチャートを用いて説明する。 Here, the operation of each functional block will be described using a flowchart.
・装置模擬I/F部の動作 ・ Operation of device simulation I / F section
装置模擬I/F部21Bの動作を4つのタスクフローで実施する場合を図15、図16を用いて説明する。図15はフロー1およびフロー2を、図16はフロー3およびフロー4を示している。
A case where the operation of the apparatus simulation I /
フロー1は、パソコン3Aの装置模擬プログラム30Aから定期的に(不定期であってもい)指定時刻つきの指令を取得するためのフローである。このフローの処理前後において、制御プログラム20の停止指令や再開指令を連携動作タイミング調整部26へ送信する。
フロー2は、装置模擬プログラム30Aから取得した指令リストに従い、付与された(指定された)時刻に指令をI/O切替部23へ送信するためのフローである。指令を送る前に、制御プログラム20の停止指令を連携動作タイミング調整部26へ送信する。
フロー3は、I/O切替部23から値変化イベントを受信して装置模擬プログラム30Aへ転送し、次に指令リストの取得要求を送信するまでの期間の指令リストを取得しなおすためのフローである。この処理後に、制御プログラム20の再開指令を連携動作タイミング調整部26へ送信する。
フロー4は、連携動作タイミング調整部26から装置模擬入力時刻の停止指令または進行指令を受信して装置模擬I/F部21Bの内部時刻を停止または進行再開させるためのフローである。
The flow 4 is a flow for receiving a stop command or a progress command of the device simulation input time from the cooperative operation timing
フロー1において、装置模擬I/F部21Bは管理する内部時刻の進行状態を示す装置模擬入力時刻停止中フラグがONかOFFかを確認し(ステップS701)、OFFであれば連携動作タイミング調整部26に制御プログラム20の停止指令を送信する(ステップS702、図14のステップS41に対応)。
In
装置模擬I/F部21Bは、その後、装置模擬プログラム30Aに対して所定の期間情報を付して指令リストの取得要求を送信し(図14のステップS44に対応)、装置模擬プログラム30Aから指令リストを受信すると自装置に設けられた保有リストに新たに取得した指令リストを追加する(ステップS703、図14のステップS46に対応)。そして、制御プログラム20の再開指令を連携動作タイミング調整部26に送信し、完了を待つ(ステップS704、図14のステップS47に対応)。
Thereafter, the device simulation I /
装置模擬I/F部21Bのフロー2がスリープ状態であればこれを解除し(ステップS705)、ステップS703で取得した指令リストの最後の指令で指定された時刻より所定時間前までの間、フロー1をスリープ状態にさせる(ステップS706)。また、上述のステップS701において装置模擬入力時刻停止中フラグがONの場合、ステップS706において、フロー1を所定時間(例えば100ms程度)スリープ状態にさせる。
このとき、装置模擬I/F部21Bが管理する内部時刻は、タイマの現時刻から内部時刻の進行を停止させていた累積時間である累積時刻停止時間を差し引いて計算するものとする。
If the
At this time, the internal time managed by the apparatus simulation I /
装置模擬I/F部21Bは、最後の指令で指定された時刻より所定時間前になるとフロー1のスリープ状態を解除して処理が終了したか否かを判断し(ステップS707)、処理が終了していなければステップS701の前の状態に戻り、処理が終了していればこのフローを終了する。なお、ここでいう所定時間とは、装置模擬I/F部21Bから連携動作タイミング調整部26を介して制御プログラム20へ停止指令が到達するのに要する時間である。
The device simulation I /
フロー2では、装置模擬I/F部21Bはタイマの値から算出される内部時刻から算出される装置模擬入力時刻の進行を停止する装置模擬入力時刻停止中フラグがONかOFFかを確認し(ステップS711)、OFFであれば保有している指令リストに現時刻が指定時刻よりも所定時間前の指令があるか否かを判断する(ステップS712)。
In the
現時刻が指令により指定された時刻よりも所定時間前であると判断した場合は制御プログラム20の停止指令を連携動作タイミング調整部26へ送信する(ステップS713)。そして、時間が経過し、現時刻が指定時刻になるとこの指令をI/O切替部23に送信し、この入力を実行させる(ステップS714)。なお、ここでいう所定時間とは、装置模擬I/F部21Bから連携動作タイミング調整部26を介して制御プログラム20へ停止指令を伝達するのに要する時間である。
If it is determined that the current time is a predetermined time before the time specified by the command, a stop command for the
装置模擬I/F部21Bは、その後、指令リストをチェックし、現時刻が指定時刻より所定時間前の指令が無い場合、次の指令で指定された時刻より所定時間前までこのフロー2をスリープ状態とする(ステップS715)。また、上述のステップS711において装置模擬入力時刻停止中フラグがONの場合、ステップS715では、フロー2を所定時間(例えば100ms程度)スリープ状態にさせる。
このとき、装置模擬I/F部21Bが管理する内部時刻は、タイマの現時刻から内部時刻の進行を停止させていた累積時間である累積時刻停止時間を差し引いて計算するものとする。
The device simulation I /
At this time, the internal time managed by the apparatus simulation I /
装置模擬I/F部21Bは、次の指令で指定された時刻より所定時間前になるとフロー2のスリープ状態を解除して処理が終了したか否かを判断し(ステップS716)、処理が終了していなければステップS711の前の状態に戻り、処理が終了していればこのフローを終了する。
The apparatus simulation I /
フロー3では、装置模擬I/F部21BはI/O切替部23からの値変化イベントを受信し(ステップS721、図14のステップS57に対応)、装置模擬プログラム30Aへこれを転送する(ステップS722、図14のステップS58に対応)。そして、次に指令リスト取得要求を送信する所定時間までの間の指令リストを更新するために、装置模擬プログラム30Aへ指令リスト取得要求を送信して新たな指令リストを取得し、保有している指令リストを上書きする(ステップS723)。
In
装置模擬I/F部21Bは、指令リストが更新されると(図14のステップS46、ステップS62)、制御プログラム20の再開指令を連携動作タイミング調整部26へ送信し(ステップS724、図14のステップS47に対応)、フロー2がスリープ状態にあればこれを解除する(ステップS725)。そして、処理が終了したか否かを判断し(ステップS726)、終了していない場合はステップS721の前の状態に戻り、処理が終了している場合はこのフローを終了する。
When the command list is updated (steps S46 and S62 in FIG. 14), the device simulation I /
フロー4では、装置模擬I/F部21Bは連携動作タイミング調整部26から装置模擬入力時刻停止指令を受信し(ステップS731、図14のステップS43に対応)、装置模擬入力時刻停止中フラグをONにし、応答を返す(ステップS732)。
In flow 4, the device simulation I /
装置模擬I/F部21Bは、連携動作タイミング調整部26から装置模擬入力時刻進行指令を受信すると(ステップS733、図14のステップS49に対応)、装置模擬入力時刻停止中フラグをOFFにし、装置模擬I/F部21Bのフロー1、フロー2のスリープ状態を解除し、その後、応答を返す(ステップS734)。
When the apparatus simulation I /
装置模擬I/F部21Bは、装置模擬入力時刻停止指令受信から装置模擬入力時刻進行指令処理完了までの時間を累積時刻停止時間に加算し(ステップS735)、処理が終了したか否かを判断し(ステップS736)、終了していない場合はステップS731の前の状態に戻り、処理が終了している場合はこのフローを終了する。
The device simulation I /
・I/O切替部の動作 ・ Operation of I / O switching unit
次に、図17を用いてI/O切替部23のフローを説明する。
I/O切替部23は、制御プログラム20または装置模擬I/F部21Bから指令を受信すると(ステップS801)、この指令は実I/O25と仮想I/O24のどちらに対する指令かを判断する(ステップS802)。
Next, the flow of the I /
When the I /
実I/O25への指令の場合は指令に従ってデータのReadまたはWriteを行い(ステップS803)、仮想I/O24への指令の場合はWrite指令か否かを判断する(ステップS804)。仮想I/O24へのWrite指令の場合は一旦実I/O25へWriteを行い(ステップS805)、次に、装置模擬I/F部21B以外からの指令で、Write指令か否かを判断する(ステップS806)。
In the case of a command to the real I /
ステップS806の判断の結果、指令が仮想I/O24へのWrite指令の場合、制御プログラム20の停止指令を連携動作タイミング調整部26へ送信して制御プログラム20を停止させ(ステップS807)、ステップS806の判断の結果、指令が仮想I/O24へのWrite指令でない場合はそのまま、指令に従って仮想I/O27にWriteやReadを行う(ステップS808)。
If the result of determination in step S806 is that the command is a write command to the virtual I /
その後、指令がWrite指令であり、かつ、このWrite指令により値が変化したか否かを判断し(ステップS809、図14のステップS56に対応)、値変化している場合は装置模擬I/F部21Bへ値変化イベントを送信し(ステップS810、図14のステップS57に対応)このフローを終了する。
Thereafter, it is determined whether or not the command is a Write command and the value is changed by this Write command (corresponding to Step S809 and Step S56 in FIG. 14). If the value is changed, the device simulation I / F The value change event is transmitted to the
ステップS809にて、仮想I/O24のWrite指令であって値変化していない場合、あるいは仮想I/O24へのRead指令の場合、この指令がWrite指令か否かを判断し(ステップS811)、Write指令の場合は制御プログラム20の再開指令を連携動作タイミング調整部26へ送信し、制御プログラム20を再開させて完了を待つ(ステップS812)。ステップS810又はステップS812の後、処理が終了したか否かを判断し(ステップS813)、処理が終了していると判断すればこのフローを終了し、処理が終了していないと判断すればステップS801の前の状態に戻る。
In step S809, if it is a write command for virtual I /
・連携動作タイミング調整部の動作 ・ Operation of coordinated operation timing adjustment unit
続いて、図18を用いて連携動作タイミング調整部26のフローを説明する。
連携動作タイミング調整部26は、コントローラ2B内に備えられた受信停止指令リストが空でなければ受信停止指令リストから、空であれば連携動作タイミング調整部26以外の他のプログラムから制御プログラム20の停止指令を受信する(ステップS901、図14のステップS41に対応)。停止指令を受信すると装置内に設けられた制御プログラムリストを参照して制御プログラム20の処理を停止し(ステップS902)、装置模擬I/F部21Bに装置模擬入力時刻停止指令を送信し、応答が返ってくるのを待つ(ステップS903、図14のステップS43に対応)。そして、停止指令の送り元に停止完了の返信をする(ステップS904)。
Next, the flow of the cooperative operation timing
The cooperative operation timing
連携動作タイミング調整部26はその後、他のプログラムから制御プログラム20の再開指令または停止指令を受信すると(ステップS905)、再開指令を受信したか否かを判断する(ステップS906)。再開指令を受信していない場合は受信停止指令リストに停止指令を追加し(ステップS907)、ステップS905の前の状態に戻る。
Thereafter, when the cooperative operation timing
ステップS906で再開指令を受信したと判断した場合、制御プログラムリストを参照して制御プログラム20を再開し(ステップS908)、装置模擬I/F部21Bに装置模擬入力時刻進行指令を送信し、応答が返ってくるのを待つ(ステップS909、図14のステップS49に対応)。その後、再開指令の送り元に再開完了を返信し(ステップS910)、処理が終了したか否かを判断し(ステップS911)、処理が終了していなければステップS901の前の状態に戻り、処理が終了していればこのフローを終了する。
If it is determined in step S906 that the restart command has been received, the
本実施の形態によれば、制御プログラム試験システム1Bは、連携動作タイミング調整部26を備え、装置模擬をするために必要な動作、例えば装置模擬プログラム30が装置模擬処理を実行する間は制御プログラム20を停止して装置模擬入力時刻を一時停止することにより、実施の形態2に記載の効果に加えて、装置模擬プログラム30Aからの装置模擬入力とコントローラ2上の制御プログラム20の連携動作のタイミングが変わらないようにすることができる。装置模擬プログラム30Aと制御プログラム20の連携動作のタイミングへの影響を回避することができる。これにより、装置模擬プログラム30Aの代わりに実際の被制御装置をコントローラ2Bに接続した場合と同じタイミングで制御プログラムの動作試験を行うことができる。
According to the present embodiment, the control
なお、上記実施の形態1ないし実施の形態3の説明において「〜部」と説明したものは、「〜手段」、「〜回路」、「〜機器」としても良い。すなわち、ソフトウェア、ファームウェア、素子・デバイス・基板・配線などのハードウェア、あるいはこれらの組合せによって実施することができる。
また、上記実施の形態のコントローラ2は、制御プログラム20を試験するための制御プログラム試験装置と言い換えても良い。
また、上記指令はReadとWriteの指令を総称するものである。
In addition, what was described as “to part” in the description of the first to third embodiments may be “to means”, “to circuit”, and “to device”. That is, it can be implemented by software, firmware, hardware such as an element / device / board / wiring, or a combination thereof.
In addition, the
The above command is a general term for Read and Write commands.
1、1A、1B 制御プログラム試験システム
2、2A、2B コントローラ
20 制御プログラム
21、21A、21B 装置模擬I/F部
22 I/O切替設定データ部
23 I/O切替部
24 仮想I/O
25 実I/O
26 連携動作タイミング調整部
200 記憶媒体
201 RAM
202 CPU
203 コントローラ側I/F部
3、3A、3B パソコン
30、30A 装置模擬プログラム
300 記憶媒体
301 RAM
302 CPU
303 パソコン側I/F部
1, 1A, 1B control
20 Control program
21, 21A, 21B Device simulation I / F section
22 I / O switching setting data section
23 I / O switching part
24 Virtual I / O
25 Real I / O
26 Coordinated operation timing adjustment section
200 storage media
201 RAM
202 CPU
203 Controller side I /
30, 30A device simulation program
300 storage media
301 RAM
302 CPU
303 PC side I / F section
Claims (7)
前記被制御装置を制御する制御プログラム、
前記被制御装置に対するデータの入出力を実際に行う実インタフェース部、
前記被制御装置に対するデータの入出力を仮想的に行う仮想インタフェース部、
前記装置模擬プログラム及び前記制御プログラムのいずれか一方からの指令に応じて前記実インタフェース部と前記仮想インタフェース部とを切替える切替部、を備え、
前記切替部は、前記仮想インタフェース部から前記指令を実行し値変化が発生した場合に前記装置模擬プログラムに値変化に関する情報を送信することを特徴とする制御プログラム試験装置。 Connected to a terminal device having a device simulation program that simulates a controlled device;
A control program for controlling the controlled device;
An actual interface unit that actually inputs and outputs data to and from the controlled device;
A virtual interface unit that virtually inputs and outputs data to and from the controlled device;
A switching unit that switches between the real interface unit and the virtual interface unit in response to a command from either the device simulation program or the control program;
The control section test apparatus characterized in that the switching section transmits information related to a value change to the apparatus simulation program when a value change occurs when the command is executed from the virtual interface section.
前記装置模擬プログラムは、前記指令に該指令を実行する時刻情報を付して前記装置模擬インタフェース部に送信し、
前記装置模擬インタフェース部は前記時刻情報に基づき前記指令を送信し、
前記切替部は前記指令を受信し、該指令に応じて前記実インタフェース部と前記仮想インタフェース部とを切替えることを特徴とする請求項1に記載の制御プログラム試験装置。 A device simulation interface unit that receives the command from the device simulation program and transmits the command to the switching unit;
The device simulation program attaches time information for executing the command to the command and transmits it to the device simulation interface unit,
The device simulation interface unit transmits the command based on the time information,
The control program test apparatus according to claim 1, wherein the switching unit receives the command and switches the real interface unit and the virtual interface unit according to the command.
前記被制御装置を制御する制御プログラム、
前記被制御装置に対するデータの入出力を実際に行う実インタフェース部、
前記被制御装置に対するデータの入出力を仮想的に行う仮想インタフェース部、
前記装置模擬プログラム及び前記制御プログラムのいずれか一方からの指令に応じて前記実インタフェース部と前記仮想インタフェース部とを切替える切替部、を有し、前記端末装置に接続されたコントローラと、を備え、
前記仮想インタフェース部から前記指令を実行して値変化が発生した場合に、前記切替部が前記装置模擬プログラムに値変化に関する情報を送信することを特徴とする制御プログラム試験システム。 A terminal device having a device simulation program that simulates a controlled device;
A control program for controlling the controlled device;
An actual interface unit that actually inputs and outputs data to and from the controlled device;
A virtual interface unit that virtually inputs and outputs data to and from the controlled device;
A switching unit that switches between the real interface unit and the virtual interface unit in response to a command from one of the device simulation program and the control program, and a controller connected to the terminal device,
The control program test system, wherein when the command is executed from the virtual interface unit and a value change occurs, the switching unit transmits information on the value change to the device simulation program.
前記装置模擬プログラムは、前記指令に該指令を実行する時刻情報を付して前記装置模擬インタフェース部に送信し、
前記装置模擬インタフェース部は前記時刻情報に基づき前記指令を送信し、
前記切替部は前記指令を受信し、該指令に応じて前記実インタフェース部と前記仮想インタフェース部とを切替えることを特徴とする請求項4に記載の制御プログラム試験システム。 A device simulation interface unit that receives the command from the device simulation program and transmits the command to the switching unit;
The device simulation program attaches time information for executing the command to the command and transmits it to the device simulation interface unit,
The device simulation interface unit transmits the command based on the time information,
The control program test system according to claim 4, wherein the switching unit receives the command and switches the real interface unit and the virtual interface unit according to the command.
前記被制御装置に対するデータの入出力を実際に行う実インタフェース部、
前記被制御装置に対するデータの入出力を仮想的に行う仮想インタフェース部、
前記装置模擬プログラム及び前記制御プログラムのいずれか一方からの指令に応じて前記実インタフェース部と前記仮想インタフェース部とを切替える切替部、を有するコントローラと、
前記コントローラに接続され、前記被制御装置を模擬した装置模擬プログラムを有する端末装置と、を備えた制御プログラム試験システムにおいて、
前記制御プログラムまたは前記装置模擬プログラムが前記切替部に向けてデータ入出力に関する指令を送信する指令送信ステップと、
前記指令送信ステップにより送信された前記指令に基づき、前記切替部が前記実インタフェース部と前記仮想インタフェース部とを切替えて前記実インタフェース部または前記仮想インタフェース部に前記指令を実行させる切替ステップと、
前記切替ステップにより前記仮想インタフェース部が前記指令を実行した後、実行された前記指令により値変化が発生したか否かを前記切替部が判断する判断ステップと、
前記判断ステップにより前記切替部が前記値変化が発生したと判断した場合に、前記切替部が前記装置模擬プログラムに対して値変化に関する情報を送信する値変化情報送信ステップと、
前記値変化情報送信ステップにより送信された前記値変化に関する情報を受信した前記装置模擬プログラムが、前記被制御装置を模擬した装置模擬の処理を実行する装置模擬処理ステップと、を備えたことを特徴とする制御プログラムの試験方法。 A control program for controlling the controlled device,
An actual interface unit that actually inputs and outputs data to and from the controlled device;
A virtual interface unit that virtually inputs and outputs data to and from the controlled device;
A controller having a switching unit that switches between the real interface unit and the virtual interface unit in response to a command from one of the device simulation program and the control program;
In a control program test system comprising: a terminal device connected to the controller and having a device simulation program that simulates the controlled device;
A command transmission step in which the control program or the apparatus simulation program transmits a command regarding data input / output to the switching unit;
Based on the command transmitted by the command transmission step, the switching unit switches the real interface unit and the virtual interface unit to cause the real interface unit or the virtual interface unit to execute the command,
A determination step in which the switching unit determines whether or not a value change has occurred due to the executed command after the virtual interface unit has executed the command in the switching step;
A value change information transmitting step in which, when the switching unit determines that the value change has occurred in the determining step, the switching unit transmits information on the value change to the device simulation program;
The apparatus simulation program that has received the information on the value change transmitted in the value change information transmission step includes an apparatus simulation process step of executing an apparatus simulation process that simulates the controlled apparatus. The control program test method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011164073A JP2013029914A (en) | 2011-07-27 | 2011-07-27 | Control program test apparatus, control program test system and testing method of control program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011164073A JP2013029914A (en) | 2011-07-27 | 2011-07-27 | Control program test apparatus, control program test system and testing method of control program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2013029914A true JP2013029914A (en) | 2013-02-07 |
Family
ID=47786920
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011164073A Withdrawn JP2013029914A (en) | 2011-07-27 | 2011-07-27 | Control program test apparatus, control program test system and testing method of control program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2013029914A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5673892B1 (en) * | 2014-03-20 | 2015-02-18 | 株式会社安川電機 | Iron making device, iron making method, control system, control method, weighing device and automatic device |
JP2017142639A (en) * | 2016-02-10 | 2017-08-17 | 富士電機株式会社 | Network equipment |
-
2011
- 2011-07-27 JP JP2011164073A patent/JP2013029914A/en not_active Withdrawn
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5673892B1 (en) * | 2014-03-20 | 2015-02-18 | 株式会社安川電機 | Iron making device, iron making method, control system, control method, weighing device and automatic device |
WO2015141001A1 (en) * | 2014-03-20 | 2015-09-24 | 株式会社安川電機 | Ironmaking apparatus, ironmaking method, control system, control method, weighing apparatus and automated apparatus |
JP2017142639A (en) * | 2016-02-10 | 2017-08-17 | 富士電機株式会社 | Network equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6247320B2 (en) | System and method for testing a distributed control system of an industrial plant | |
US10082777B2 (en) | CPU unit for PLC, PLC-use system program, recording medium in which PLC-use system program is stored, PLC system, PLC support device, PLC support program, and recording medium in which PLC support program is stored | |
JP5218585B2 (en) | Control device and system program | |
US20140005805A1 (en) | Cpu of plc, system program for plc, and recording medium storing system program for plc | |
JP4752983B1 (en) | PLC CPU unit, PLC system program, and recording medium storing PLC system program | |
JP7103303B2 (en) | Devices, communication modules, application modules and methods | |
CN110456707B (en) | Control device | |
JP5747584B2 (en) | Control device and system program | |
CN101539866A (en) | Information processing device, and method of starting information processing device | |
JP6433635B1 (en) | Simulation apparatus and simulation method | |
US20170075335A1 (en) | Controller and control system | |
JP5190796B2 (en) | Field device and field device software update system using the same | |
JP2005173747A (en) | Memory update system for field apparatus | |
JP2018055583A (en) | Control apparatus, control method and program | |
US20200278662A1 (en) | Communication system, communication method, and information storage medium | |
JP2013029914A (en) | Control program test apparatus, control program test system and testing method of control program | |
JP6874706B2 (en) | How to generate application programs, devices, programs | |
JP2019079256A (en) | Control device, control device control method, information processing program, and recording medium | |
JP5314959B2 (en) | Information processing apparatus, control method therefor, computer program, and storage medium | |
JP5845629B2 (en) | PLC CPU unit, PLC system program, and recording medium storing PLC system program | |
JP2015141648A (en) | programmable controller | |
JP2015191606A (en) | Information processing apparatus, information processing apparatus control method, and information processing apparatus control program | |
JP7230989B2 (en) | Communication system, communication method, and program | |
JP2014134989A (en) | Computer system and computer management method | |
JP2010009193A (en) | Electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A300 | Withdrawal of application because of no request for examination |
Free format text: JAPANESE INTERMEDIATE CODE: A300 Effective date: 20141007 |