JP3927042B2 - Control system - Google Patents

Control system Download PDF

Info

Publication number
JP3927042B2
JP3927042B2 JP2002028560A JP2002028560A JP3927042B2 JP 3927042 B2 JP3927042 B2 JP 3927042B2 JP 2002028560 A JP2002028560 A JP 2002028560A JP 2002028560 A JP2002028560 A JP 2002028560A JP 3927042 B2 JP3927042 B2 JP 3927042B2
Authority
JP
Japan
Prior art keywords
monitor
control program
control
program
execution
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.)
Expired - Fee Related
Application number
JP2002028560A
Other languages
Japanese (ja)
Other versions
JP2003228417A (en
Inventor
和英 芦田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2002028560A priority Critical patent/JP3927042B2/en
Publication of JP2003228417A publication Critical patent/JP2003228417A/en
Application granted granted Critical
Publication of JP3927042B2 publication Critical patent/JP3927042B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Testing And Monitoring For Control Systems (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は鉄鋼、製紙プラントや自動車産業などの組立作業を含むFA分野、化学プラントなどのPA分野および上下水道システム他の公共システムなど、産業用システムの制御に広く使用されている制御システムに関する。
【0002】
【従来の技術】
従来の制御システムのモニタ方式は、ユーザが指定したモニタ範囲において、制御プログラムの実行後に該制御プログラムで使用されている変数値を収集し、その値を制御プログラムと共に表示する方式が用いられる。
【0003】
【発明が解決しようとする課題】
ただし、この方式では複数の処理過程をもつ制御プログラムが、実際に実行された各処理過程における変数値の各々をモニタすることはできないので、モニタ範囲内で同一の変数を繰り返し使用していたり、モニタ範囲の後で再度その変数を使用していた場合にはモニタ値に矛盾が生じたりする可能性があった。この問題を改善するために制御プログラムの各処理過程が実際に実行された時点での変数値をモニタできるように構成した制御システムも存在するが、それらの制御システムでも制御プログラム内で一時的に使用される変数すなわち入力変数及び出力変数以外の値のモニタについては完全に対応しきれていなかった。また、用途によって適切なモニタ方式を選択できないという問題があった。
【0004】
本発明は前記課題に鑑みなされたもので、変数値の種別やプログラムの実行状態に応じて適切なモニタ方法を自動選択することが可能になる制御システムを提供することを目的とする。
【0005】
【課題を解決するための手段】
すなわち、本発明に係わる制御システムは、制御命令の種別を示すプログラム種別コードを含む制御プログラムを記憶する制御プログラム記憶手段と、制御プログラムの変数値を記憶する制御データ記憶手段と、制御プログラム記憶手段に記憶された制御プログラムを実行する制御プログラム実行手段と、制御プログラムによる制御動作及び変数値のモニタをモニタ範囲を指定して要求するモニタ要求手段とを備え、この要求にしたがって、制御プログラム実行手段による制御プログラム実行時の制御データを蓄積し、この蓄積された制御データのうち、モニタ手段により指定したモニタ範囲の制御プログラムで使用される制御データを出力し、モニタ要求手段によるモニタ要求および出力手段による制御データの出力にともないプログラム種別コードをもとに制御プログラム中の制御命令の種別を判別し、この判別した種別に従って制御プログラムの実行状態及び制御プログラム実行時の変数値、または制御プログラム実行後の変数値または制御プログラムが非実行時の変数値を選択してモニタを行うとともに、このモニタ結果である制御プログラムの実行状態及び変数値を表示することを特徴とする。
【0006】
つまり、本発明に係わる制御システムでは、制御命令の種別を示すプログラム種別コードを含む制御プログラムに対してモニタ要求手段によりモニタがモニタ範囲を指定して要求された際に、制御プログラム実行手段により制御プログラムが実行されると、この実行時の制御データを蓄積し、この蓄積された制御データのうち、モニタ範囲の制御プログラムで使用される制御データを出力し、モニタ要求および制御データの出力ともないプログラム種別コードをもとに制御プログラム中の制御命令の種別を判別し、この判別した種別に従って制御プログラムの実行状態及び制御プログラム実行時の変数値、制御プログラム実行後の変数値または制御プログラムが非実行時の変数値が選択されてモニタされ、このモニタ結果である制御プログラムの実行状態及び変数値が表示されることになる。
【0007】
【発明の実施の形態】
制御システムのモニタ方式は、制御プログラムの変数値を命令語処理装置(演算用の処理装置)から収集する方式と、データを格納するメモリから収集する方式の二つに分かれる。命令語処理装置から変数値を収集する方式は制御プログラム実行時の変数値をそのまま表示する方式であり、リアルタイムモニタと呼ぶこととする。つまりこの方式を用いると、制御プログラムの各過程が実行されるに従ってその都度使用されている変数が収集されてモニタ画面に順次更新されて表示される。
【0008】
そして、メモリから変数値を収集する方法は2通りあり、一つは制御プログラムにおいて使用される変数値が静的に割り付けられた記憶領域内の値をモニタする方式であり、メモリモニタと呼ぶこととする。もう一つは制御プログラム中で一時的に使用される変数値をモニタする方式であり、テンポラリ変数モニタと呼ぶこととする。通常の制御システムが使用している変数モニタ方式はメモリモニタ方式であり、リアルタイムモニタ方式を採用している制御システムは少ない。しかし、制御プログラムをデバッグする場合などのように制御プログラムの各処理過程の実行時における変数を随時知る必要がある場合にはリアルタイムモニタ方式が適している。従来、一時的に使用される変数(以下、一時変数と称する)をモニタできる制御システムは存在しなかった。そして効果的なモニタを行うには、これらの3つのモニタ方式を状況に応じて切り替えることが望ましい。
【0009】
以下、本発明の第1実施形態について図面を参照して説明する。
図1は、本発明の第1実施形態に係わる第1の制御システムの全体構成図である。
【0010】
図1に示すように、この第1の制御システムは、制御装置1及びモニタ装置2がデータ転送媒体3を介して接続されており、相互にデータを転送できる構成となっている。
【0011】
制御装置1は、例えばベルトコンベアーといった制御対象となるシステム(図示せず)に接続されており、制御システムの制御を行う。またモニタ装置2からの指示すなわちユーザによる操作に従って制御プログラムの実行を行うとともに制御プログラムの実行状態及び変数値のモニタを行う。
【0012】
モニタ装置2は、ユーザにより制御装置1に対してモニタ範囲の指定およびモニタ開始の指示をすることが可能であり、また制御装置1によって送信されたモニタ結果データを受信して表示することが可能である。
【0013】
図2は、前記第1実施形態に係わる第1の制御システムに備えられた制御装置1の構成を示す図である。
図2に示すように、この制御装置1は、制御装置1全体の制御を実行するCPU11、制御装置1自体の制御プログラムを格納するプログラムメモリ12、ワークメモリ13、制御対象となるシステムに対する制御プログラムを実行するシーケンス演算プロセッサ14、制御プログラムを格納する制御プログラムメモリ15、制御プログラムに使用する変数値データを格納するデータメモリ16、モニタ装置2とデータ転送媒体3を介して通信するための通信インタフェース17および制御対象との入出力を行う入出力モジュール18がシステムバス19を介して相互に接続される。
【0014】
図3は、前記第1実施形態に係わる第1の制御システムに備えられたモニタ装置2の構成を示す図である。
図3に示すように、このモニタ装置2はモニタ装置2全体の制御を実行するCPU201、モニタ装置2自体の制御プログラムを格納するプログラムメモリ202、ワークメモリ203、制御装置1に格納される制御プログラムと同一のプログラムを格納する制御プログラムメモリ204、変数値データを格納するデータメモリ205および通信インタフェース206がシステムバス207を介して相互に接続されるとともに、モニタ範囲を決定したり変数値データを指定したりするためのキーボード208がCPU201とキーボード208を接続するための入出力インタフェース209を介して、また、プログラムリストやデータを表示する表示器210が、表示器210をCPU201と接続するための表示インタフェース211を介してシステムバス207に接続される。
【0015】
通信インタフェース206は、データ転送媒体3を介して制御装置1とデータ通信する。
【0016】
このモニタ装置2は、制御装置1から送信された蓄積データを最新のデータとして表示できるように構成されるもので、制御プログラムの実行結果を正確に表示することが可能である。
【0017】
図4は、前記第1実施形態に係わる第1の制御システムに備えられた制御装置1内のシーケンス演算プロセッサ14の構成を示す図である。
このシーケンス演算プロセッサ14は、制御プログラム実行用の専用回路であり、これと同等の論理をソフトウェアで実現してCPU11で実行しても効果は同様である。
【0018】
制御プログラムはシーケンス命令と呼ばれる命令で記述され、制御装置1内の制御プログラムメモリ15に格納されて、システムバス19を介して制御プログラムメモリ15から読み出されてシーケンス演算プロセッサ14により実行される。
【0019】
図4に示すように、シーケンス演算プロセッサ14では、リアルタイムモニタ処理に用いられるシーケンス演算回路401を中心に、内部レジスタ402及びデータ蓄積制御回路403が接続され、このデータ蓄積制御回路403には、ステップモニタ指定フラグ404、蓄積データカウンタ405及びデータ蓄積メモリ406がそれぞれ接続される。加えて、データ蓄積制御回路403には比較回路407が接続される。
【0020】
シーケンス演算回路401は、制御装置1のCPU11とデータをやりとりするためにシステムバス19に接続される。
【0021】
データ蓄積制御回路403は、CPU11に対して割り込み信号を送信するためにシステムバス19に接続される。
【0022】
比較回路407には、シーケンス命令ポインタ408、シーケンス命令レジスタ409、オペランドデータレジスタ410、モニタ開始アドレスレジスタ411、モニタ終了アドレスレジスタ412およびモニタ命令アドレスレジスタ413がそれぞれ接続される。
【0023】
内部レジスタ402は、シーケンス演算実行に必要なデータを一時的に格納しておくレジスタである。
【0024】
データ蓄積制御回路403は、データ蓄積の開始および停止のタイミングを制御したり、蓄積すべきデータの形を実行中の命令種別によって判定したりするなどの動作を行い、データ蓄積動作全体の制御を行う。また、必要時にはシステムバス19を介してCPU11に割り込み信号を送信することが可能である。
【0025】
ステップモニタ指定フラグ404は、制御プログラムが1ステップ実行される毎に該制御プログラムの実行を中断して、モニタ装置2との同期を図るためのフラグである。
【0026】
蓄積データカウンタ405は、蓄積されたデータ数をカウントするカウンタであり、初期状態の値は“0”である。
【0027】
データ蓄積メモリ406は、モニタ処理により取り出されたモニタ範囲のデータ蓄積用のバッファとして使用されるメモリであり、ビットデータ、ワードデータおよび状態変化データなどを格納する。
【0028】
比較回路407は、モニタ開始アドレスレジスタ411及びモニタ終了アドレスレジスタ412の内容と、シーケンス命令ポインタ408、シーケンス命令レジスタ409およびオペランドデータレジスタ410の内容とを比較して双方の内容が一致した場合に、その旨を伝える信号をデータ蓄積制御回路403に出力する回路である。
【0029】
シーケンス命令ポインタ408は、実行する制御プログラムにおいて使用される命令が格納されているアドレスを指定するためのレジスタである。
【0030】
シーケンス命令レジスタ409は、現在実行中のシーケンス命令のコードを格納するレジスタである。
【0031】
オペランドデータレジスタ410は、シーケンス命令の演算対象となるデータを格納するレジスタである。
【0032】
モニタ開始アドレスレジスタ411は、モニタ装置2から指定されたモニタ開始アドレスすなわちモニタ範囲の先頭アドレスを格納するレジスタである。
【0033】
モニタ終了アドレスレジスタ412は、モニタ装置2から指定されたモニタ終了アドレスすなわちモニタ範囲の末尾アドレスを格納するレジスタである。
【0034】
モニタ命令アドレスレジスタ413は、モニタ対象となる命令が格納されているアドレスを格納するレジスタである。
【0035】
次に、前記構成による第1の制御システムにおけるモニタ処理について説明する。
まず、第1の制御システムによるリアルタイムモニタ処理について説明する。
図5は、前記第1実施形態に係わる第1の制御システムに備えられたモニタ装置2からのリアルタイムモニタ要求のための伝送テキストを示す図である。
【0036】
図6は、前記第1実施形態に係わる第1の制御システムによるリアルタイムモニタ処理において、初期状態のモニタ画面表示例を示す図である。
【0037】
図7は、前記第1実施形態に係わる第1の制御システムによるリアルタイムモニタ処理を示すフローチャートである。
【0038】
図8は、前記第1実施形態に係わる第1の制御システムによるリアルタイムモニタ処理におけるモニタ画面表示例を示す図である。
【0039】
図5に示すように、この伝送テキストは、ヘッダ、制御用コマンド、プログラム種別、プログラムナンバー、プログラムモニタ開始アドレス、モニタ終了アドレス及びトレーラで構成される。
【0040】
この第1の制御システムにおいて、リアルタイムモニタ処理すなわち制御プログラムの実行時における実行状態及び変数値のモニタを行う際には、ユーザがモニタ装置2のキーボード208よりモニタ範囲すなわちモニタ開始アドレス及びモニタ終了アドレスを入力すると、これらのアドレスが含まれた伝送テキストによるモニタ要求信号がモニタ装置2の通信インタフェース206よりデータ転送媒体3を介して制御装置1に送信される。
【0041】
次に、モニタ要求信号が制御装置1の通信インタフェース17により受信されると、この受信されたモニタ要求信号に含まれるモニタ開始アドレス及びモニタ終了アドレスが、シーケンス演算プロセッサ14内のモニタ開始アドレスレジスタ411およびモニタ終了アドレスレジスタ412にそれぞれセットされる(ステップA1)。
【0042】
すると、入力されたモニタ開始アドレス及びモニタ終了アドレスにより、モニタ開始から終了までの処理過程が判別されて、CPU11によりそれらの各処理過程に対応したイメージデータが生成され、そのイメージデータに基づいて、図6に示すようなモニタ初期画面がモニタ装置2の表示器210に表示される(ステップA2)。
【0043】
図6において、y1からy6までの各記号は、モニタ指定範囲の制御プログラムにおける各処理を示していて、各記号を結ぶ線分は隣接する各処理において前処理と後処理との関連を示している。また並列になっているy3とy4についてはそれぞれの出力の論理和が出力となる。つまりこの画面はy1からy6までの処理がどのように実行されたかを確認するための画面である。
【0044】
また、同じく図6におけるf1からf3までの各記号は、f1の出力により起動される関数f2とその関数f2の出力で制御されるf3の動作を示している。「f21→f22」の処理は「D=(A+B)/C」の演算処理である。
【0045】
その後、ユーザによりモニタ装置2から制御プログラムの実行が指示されると、制御装置1内の制御プログラムメモリ15に格納されている制御プログラムが読み出されて、制御プログラムの実行が開始される(ステップA3)。
【0046】
そして、指定されたモニタ対象範囲の制御プログラムが実行される際に、シーケンス演算プロセッサ内の比較回路407により、シーケンス命令ポインタ408の値すなわち現在実行中の制御プログラムのアドレスと、モニタ範囲の先頭すなわちモニタ開始アドレスレジスタ411に格納されるモニタ開始アドレスとが比較されて、双方が一致しているかどうかの判断がなされる(ステップA4,A5)。
【0047】
そして双方の一致が検出されると、シーケンス命令ポインタ408の値とモニタ開始アドレスレジスタ411の値との一致を示す一致信号が比較回路407からデータ蓄積回路に出力されて、データ蓄積制御回路403によりシステムバスを介してデータメモリへのアクセスがなされ、予め指定されたモニタ範囲における変数値データが順次データ蓄積メモリ406に格納される(ステップA6)。
【0048】
また、制御プログラムの1命令分の変数値データがデータ蓄積メモリ406に格納される毎に蓄積データカウンタ405の値が+1されて更新される。
【0049】
同時に、モニタ範囲における制御プログラムの各処理過程が実行されるに従って、その各処理過程が正常に動作したことが確認されると、y1からy6までの各記号がオン状態を示す記号(例えば太線による記号)に順次置き換えられ、また、隣接している各処理過程間の制御が正常に行われたと確認されると、各記号を結ぶ線分がオン状態を示す線分(例えば太線)に順次置き換えられて、モニタ装置2の表示器210に随時更新されて表示される(ステップA7)。
【0050】
そして、予め設定されたモニタ範囲の末尾すなわちシーケンス命令ポインタ408の値とモニタ終了アドレスレジスタ412に格納されたモニタ終了アドレスとが比較回路407により比較されて、双方が一致したと判断される、もしくは、蓄積データカウンタ405でカウントされるデータ数が予め設定された値に達したと判断されると、比較回路407による一致信号または蓄積データカウンタ405による規定値到達信号がデータ蓄積制御回路403を介してCPU11に送信されて、変数値データのデータ蓄積メモリ406への格納及びモニタ終了処理が要求される(ステップA8)。すると、モニタ装置2の表示器210に表示される画面は図8のようになる。
【0051】
そして、モニタ処理が終了すると蓄積データカウンタ405の値が“0”にクリアされる。
【0052】
つまり、シーケンス演算プロセッサ14は制御装置1の入出力モジュール18を介して外部の制御対象となるシステムの状態が入力された後、制御プログラムメモリ15から制御プログラムを読み出し、この制御プログラムを必要に応じてデータメモリ16内のデータをアクセスしながら実行し、モニタ結果を入出力モジュール18経由でモニタ装置2に出力する。
【0053】
以上のように、リアルタイムモニタ処理によりプログラム実行と並行して変数値データを収集する事によって、モニタ範囲で使用されている変数値データを使用された順に収集することが可能になる。
【0054】
次に、第1の制御システムによるメモリモニタ処理について説明する。
図9は、前記第1実施形態に係わる第1の制御システムに備えられたモニタ装置2からのメモリモニタ要求のための伝送テキストを示す図である。
【0055】
図10は、前記第1実施形態に係わる第1の制御システムによるメモリモニタ処理における実行状態のモニタ画面表示例を示す図である。
【0056】
図11は、前記第1実施形態に係わる第1の制御システムによるメモリモニタ処理における変数値のモニタ画面表示例を示す図である。
【0057】
このメモリモニタ処理は、制御プログラムで使用される変数値が格納されているメモリアドレスまたは変数名を指定して、その内容を収集するモニタ方式であり、収集された変数値から制御プログラムの各処理が正常に行われたかどうかを判断してその結果をイメージ画面として表示する。このメモリモニタ処理はリアルタイムモニタ処理と比較して、変数値はモニタできるが、実行状態つまり命令の出力をモニタすることはできないので、図8で示したように各処理間のシグナルフローを表示することはできない。また、このメモリモニタ処理は制御プログラム実行後の変数値だけをモニタするので、実際に制御プログラムの各処理が実行された時点とは状態が変化している場合もあり、モニタ画面に矛盾が生じることもあるので、正確なデバッグには使用できない。ただし、シーケンス演算プロセッサ14内のシーケンス演算回路401がなくても制御プログラムのモニタ処理が可能なので汎用性があり、単に制御プログラム実行後の変数だけをモニタしたい場合には有効である。
【0058】
図9に示すように、この伝送テキストは、ヘッダ、制御用コマンド、プログラム種別、プログラムナンバー、各変数値のデータ型とアドレスとデータサイズ及びトレーラで構成されている。
【0059】
この第1の制御システムにおいてメモリモニタ処理を行う場合、つまり制御プログラム実行後の変数値をモニタする場合には、まず図9に示す伝送テキストによるモニタ要求信号がモニタ装置2から制御装置1へ送信される。また、制御プログラムが非実行状態の際の変数値をモニタする場合にもモニタ要求信号がモニタ装置2から制御装置1に送信される。
【0060】
そして、制御プログラムが実行されて終了した後に、ユーザにより、モニタ装置2に表示させたい変数値が格納されているデータメモリ16上のアドレスまたは表示させたい変数名を指定する。すると、データメモリ16に対してアクセスがなされて、変数値がCPU11に読み出される。そして、この読み出された変数値から制御プログラムの各処理が行われたどうかが判断されて、各処理が実行されたと判断された場合には、図10に示すように、各処理のオン状態を示す記号を含んだイメージ画面がモニタ装置2に送信されてメモリモニタ結果として表示器210に表示される。これにより、ユーザはこの表示された変数値により各種処理が正常に行われているかどうかの判断をする。
【0061】
一方、メモリモニタ処理によるモニタ結果を図10のようなイメージ画面ではなく、変数値だけを表示器210に表示させたい場合は、メモリモニタ処理により変数モニタすなわちデータメモリ16より読み出した変数値のみを表示するモニタ方式を用いてもよい。
【0062】
この変数モニタ処理の表示例を図11に示す。変数モニタ処理は前述のメモリモニタ処理の機能そのものであり、図9に示す伝送テキストによるモニタ要求信号がモニタ装置2から制御装置1に入力されることによりモニタデータが収集される。
【0063】
また、対象とする制御プログラムに対してリアルタイムモニタ処理の要求がなされた場合でも、その制御プログラムが非実行状態であった場合には、制御装置1によりメモリモニタ要求信号に変換され、データメモリ16にアクセスがなされることでモニタすべきプログラム範囲で使用されている変数値が収集され、それらの変数データがメモリモニタ要求時の応答データとしてモニタ装置2へ送信されて、表示器210に表示される。
【0064】
したがって、前記構成の第1の制御システムによれば、リアルタイムモニタ処理すなわち制御プログラムの実行状態のモニタを行う場合、ユーザにより制御プログラムにおいてモニタしたい処理過程が指定されると、その処理過程に対応した初期モニタ画面がモニタ装置2に表示され、制御プログラムの実行が開始されると、各処理が実行されるごとに各処理の実行状態が判断されるともに、その実行時における変数値がデータメモリ16から読み出されて、モニタ装置2に表示される。また、変数値のみのモニタつまり変数モニタ処理を行う場合には、指定された変数値がデータメモリ16へのアクセスにより読み出されてモニタ装置2に表示されるので、制御プログラムの各処理の実行時における動作状態及び完了時の変数値のモニタリングが可能となる。
【0065】
なお、この第1の制御システムは、リアルタイムモニタ処理の実行時においてデータメモリ16から随時読み出された変数値データを図8に示すモニタ画面上に重ねて表示させることも可能である。この場合、制御プログラムの処理が進行するに従って変数値が変化した場合には表示画面上の変数値も随時更新されて表示されることになる。
【0066】
次に本発明の第2実施形態について説明する。
この第2実施形態は、第1実施形態に係わる第1の制御システムにおいて、テンポラリ変数つまり制御プログラムで一時的に使用される変数のモニタを可能にしたものであり、この第2実施形態に係わる第2の制御システムの全体構成は図1と同様であり、制御システム内の制御装置1の構成及びモニタ装置2の構成は図2〜図4と同様である。
【0067】
このテンポラリ変数は、制御プログラムの各過程つまりプログラム単位が実行される時点のみに存在し、そのプログラム単位の実行完了後には、変数を格納するデータメモリ16内のテンポラリ変数領域が他のプログラムのテンポラリ変数領域として使用されるので内容が変更されてしまう。したがってモニタ範囲の制御プログラムが全て実行された後でモニタを行ってもテンポラリ変数の値を読み出すことは出来ない。
【0068】
図12は、第2実施形態に係わる第2の制御システムの制御装置1で実行されるオブジェクトプログラムの命令語形式を示す図である。
【0069】
図13は、前記第2実施形態に係わる第2の制御システムの制御装置1内におけるデータメモリ16の割り付け状態を示す図である。
【0070】
図12に示すように、制御装置1で実行されるオブジェクトプログラムの命令語は、命令語コード、データ種別コードおよび変数アドレスで構成される。
【0071】
この命令語内のデータ種別コードはデータがローカル変数、グローバル変数またはテンポラリ変数のいずれかに対応するのかを示すコードである。
【0072】
図13に示すように、制御装置1内のデータメモリ16では、テンポラリ変数を格納するテンポラリ変数領域を複数のプログラム共通でもつものとし、このテンポラリ変数領域にスタック型式でテンポラリ変数が割り付けられる構成となっている。命令語の形式では、テンポラリ変数のアドレスとしてスタックベースからのポインタ値が使用される。したがって、メモリモニタ要求や変数モニタ要求としてテンポラリ変数が指定される場合つまり命令語のデータ種別コードにテンポラリ変数を示すコードが設定されている場合には、対象となる制御プログラムの各過程が実行される度に図12に示す命令語内のデータ種別コードが参照されて、テンポラリ変数のモニタが要求されているかが判断される。ここでテンポラリ変数のモニタが要求されていると判断されると、データメモリ16内のテンポラリ変数領域から要求されたテンポラリ変数の変数値が読み出されてモニタ装置2へ送信されると、変数値データがテンポラリ変数モニタ結果としてモニタ装置2の表示器210に表示される。
【0073】
したがって、前記構成の第2の制御システムによれば、ユーザによって変数モニタ処理が要求された場合には、制御プログラムの各過程が実行される度に命令語内のデータ種別コードから変数の種類が自動的に判別されて、指定された変数がテンポラリ変数であった場合には、その時点でデータメモリ16内のテンポラリ変数領域から該テンポラリ変数の変数値が読み出されてモニタ装置2に表示されるので、テンポラリ変数のモニタリングが可能となる。
【0074】
次に本発明の第3実施形態について説明する。
この第3実施形態は、第1実施形態に係わる第1の制御システムにおいて実行される制御プログラムのオブジェクトプログラムにおける制御命令の種類に応じてモニタ方法の変更を可能にしたものであり、この第3実施形態に係わる第3の制御システムの全体構成は図1と同様であり、制御システム内の制御装置1の構成及びモニタ装置2の構成は図2〜図4と同様である。
【0075】
図14は、第3実施形態に係わる第3の制御システムで実行される制御プログラムのオブジェクトプログラムの構成を示す図である。
【0076】
図14に示すように、制御プログラムメモリ15に記憶されている制御プログラムの各プログラムにおけるコードの先頭にプログラム種別を示すプログラム種別コードがあり、モニタ装置2はこのプログラム種別コードから制御プログラム中の制御命令の種別を判別することが可能である。
【0077】
この第1の制御システムでは制御プログラムのプログラミングにファンクションブロック及び関数並びにユーザ定義ファンクションブロック及びユーザ関数を使用できるように構成されている。ファンクションブロック及びユーザ定義ファンクションブロックにはそれらの内部に静的変数を含むことができる。一方、関数及びユーザ関数はテンポラリ変数だけを含むことができる。この静的変数及びテンポラリ変数ではメモリモニタ処理及びテンポラリ変数モニタ処理がそれぞれ適しているので随時切り替える必要がある。
【0078】
そこで、メモリモニタ処理もしくはメモリモニタの変数値のみのモニタである変数モニタ処理が要求された場合には、制御プログラムが動作してデータメモリ16内に対して指定された変数のアクセスがなされるときに、図14に示すオブジェクトプログラムに含まれているプログラム種別コードにより、制御命令がファンクションブロック及び関数並びにユーザ定義ファンクションブロック及びユーザ関数内部に含まれている演算命令であるかどうかの判断がなされ、さらにその演算命令の種別がファンクションブロック及びユーザ定義ファンクションブロックによる演算命令なのか、関数及びユーザ関数による演算命令のいずれに属しているかが判断される。
【0079】
この結果、種別がファンクションブロック及びユーザ定義ファンクションブロックであった場合には、メモリモニタ処理によりデータメモリ16から変数が読み出されてモニタ装置2に送信される。そして、その送信された変数値データがモニタ結果としてモニタ装置2の表示器210に表示される。
【0080】
一方、判別された種別が関数及びユーザ関数であった場合には、テンポラリ変数モニタ処理が実行されて、データメモリ16内のテンポラリ変数領域よりテンポラリ変数が読み出されてモニタ装置2に送信される。そして、その送信された変数データがモニタ装置2の表示器210に表示される。
【0081】
したがって、前記構成の第3の制御システムによれば、ファンクションブロック又は関数内部の変数をモニタする場合に、オブジェクトプログラムに含まれているプログラム種別コードから、種別がファンクションブロック及びユーザ定義ファンクションブロックに係わる命令なのか、関数及びユーザ関数に係わる命令なのかが判断され、ファンクションブロック及びユーザ定義ファンクションブロックであった場合には、メモリモニタ処理が行われ、関数及びユーザ関数であった場合には、テンポラリ変数モニタ処理が実行されるので、ユーザは変数の種別を意識することなく最適なモニタ結果を得ることが可能となる。
【0082】
次に、本発明の第4実施形態について説明する。
この第4実施形態は、第1実施形態に係わる第1の制御システムにおいて実行される制御プログラムのオブジェクトプログラムの種類に応じてモニタ方法の変更を可能にしたものであり、この第4実施形態に係わる第4の制御システムの全体構成は図1と同様であり、制御システム内の制御装置1の構成及びモニタ装置2の構成は図2〜図4と同様である。
【0083】
この第4の制御システムではプログラムの種類として定周期実行されるメインプログラムの他に、イベント発生時にだけ実行される割り込み処理プログラムを使用することができる。また、各プログラムはそれぞれ実行制御が可能であり、他のプログラムから実行や停止が可能である。この場合、割り込みプログラムは常に実行されているとは限らないので、リアルタイムモニタ処理を行った場合には、モニタ結果がすぐにモニタ装置2に表示されないことがある。つまり割り込み処理プログラムに対してリアルタイムモニタ処理が実行されたときに、該割り込み処理プログラムが実行されていない時にはモニタ装置2のモニタ結果表示画面は何ら変化しないことになるので、モニタ画面が有効活用されない。
【0084】
そこで、まず、ユーザにより特定の制御プログラムのリアルタイムモニタ処理が要求されると共に、その制御プログラムの実行がなされたら、モニタ装置2により制御装置1からのモニタ結果のデータが一定時間内にモニタ装置2に送信されたかどうかの判断がなされる。そして、モニタ装置2によりモニタデータが受信されていないと判断された場合には、そのモニタ装置2によりモニタ対象である制御プログラムが別のメインプログラムに対する割り込みプログラムであるかどうかの判断がなされ、割り込みプログラムであると判断された場合には、モニタ装置2から自動的にメモリモニタ処理を要求する信号が制御装置1に送信されて、制御装置1によりその信号が受信されると、割り込みプログラムに対してメモリモニタ処理が実行される。これにより、割り込みプログラムの前回の実行時における変数値が取得され、この取得された変数値データがモニタ装置2に送信されて、このモニタ装置2の表示器210においてモニタ画面上に変数が表示される。
【0085】
また、リアルタイムモニタ処理が要求されて一定時間モニタ結果が得られない場合に、モニタ対象のプログラムが割り込みプログラムでないと判断された場合においても、現時点でその制御プログラムが実行前であると判断された場合には、モニタ装置2側で自動的にリアルタイムモニタ要求に代わってメモリモニタを要求する信号が制御装置1に送信され、制御装置1側でそのメモリモニタ要求信号が受信されると、該制御プログラムに対してメモリモニタ処理が実行される。これにより、そのモニタ結果である変数つまり該制御プログラム実行前の変数値がデータメモリ16から読み出されて表示器210のモニタ結果画面上に表示される。
【0086】
そして、割り込み処理プログラムの動作が開始された場合には、当初指定されたリアルタイムモニタ処理に変換する旨を要求する信号がモニタ装置2から制御装置1に出力されて、該リアルタイムモニタ処理が実行されると、そのモニタ結果が順次モニタ装置2に送信されて、表示器210のモニタ結果表示画面の表示状態及び変数値が順次更新される。
【0087】
したがって、前記構成の第4の制御システムによれば、割り込み処理プログラムに対するリアルタイムモニタ処理が要求されて一定時間が経過してもモニタ結果表示画面が変化しない場合、つまりそれらの制御プログラムがまだ実行されずにモニタ処理が進行されない場合には、モニタ装置2から制御装置1にメモリモニタ処理を行うよう要求する信号が送信されて、該割り込みプログラムの前回の実行時における変数値データが読み出されてモニタ装置2に表示され、また、割り込みプログラム以外のプログラムに対するリアルタイムモニタ処理が要求された場合に、一定時間が経過してもモニタ結果表示画面が変化しない場合、つまりそれらのプログラムがまだ実行されていない場合には、同じくモニタ装置2から制御装置1にメモリモニタを要求する信号が出力されて、該割り込みプログラムの前回の実行時におけるモニタ結果が読み出されて、モニタ装置2に表示されるので、制御プログラムの種類に合わせてモニタ方式を自動的に選択させることが可能になり、モニタ操作者の負担を軽減して目的に沿ったモニタリングを実行することが可能となる。
【0088】
次に本発明の第5実施形態について説明する。
この第5実施形態は、第1実施形態に係わる第1の制御システムにおいて複数のモニタ装置2からのモニタ要求がなされた場合でも各モニタ処理を行うことを可能にしたものであり、この第5実施形態に係わる第5の制御システムの全体構成は図1と同様であり、この制御システム内の制御装置1の構成及びモニタ装置2の構成は図2〜図4と同様である。
【0089】
1つの制御装置1に対して複数のモニタ装置2から重複してモニタ要求信号が出力された場合で、例えば双方のモニタ要求信号により要求されるモニタがリアルタイムモニタ処理である場合には制御装置1でそれぞれのモニタ対象の制御プログラムが並列に動作させられれば問題ないが、テンポラリ変数モニタのように複数の制御プログラムで共有される領域、例えば制御装置1のデータメモリ16内のテンポラリ変数領域に対して異なる制御プログラムに対するテンポラリ変数モニタがそれぞれ要求された場合には、各モニタ装置2からモニタ要求された制御プログラムの実行に同期したテンポラリ変数モニタが必要となる。また、モニタ装置2では、ある制御プログラムのリアルタイムモニタ画面を見ながら、変数モニタ画面を同時に開いてその他の変数値を確認したい場合がある。このような場合にはリアルタイムモニタ要求されるの制御プログラム実行に同期して変数モニタのデータ収集を実行させて変数値を表示させる必要がある。
【0090】
例えば、第1のモニタ装置2から制御装置1に対して第1の制御プログラムにおけるテンポラリ変数モニタ処理が要求されると同時に、第2のモニタ装置2から制御装置1に対して第2の制御プログラムにおけるテンポラリ変数モニタ処理が要求された場合には、これらの2つの制御プログラムが同時に実行されないように、ユーザによる任意、または制御装置1により自動的に実行の順序が設定される。そして、順序付けによる第1の制御プログラムの実行が開始されるともに、第1のモニタ装置2から要求されたテンポラリ変数モニタ処理が実行されて、データメモリ16のテンポラリ変数領域によりテンポラリ変数の変数値が読み出されて、第1のモニタ装置2にモニタ結果が送信されて表示器210に表示される。そして制御装置1により第1の制御プログラムの実行が終了したかどうかの判断がなされ、終了したと判断された場合には、順序付けがなされた第2の制御プログラムの実行が開始されて、第2のモニタ装置2から要求されているテンポラリ変数モニタ処理が実行されて、データメモリ16のテンポラリ変数領域によりテンポラリ変数の変数値が読み出されて、第2のモニタ装置2にモニタ結果が送信されて表示器210に表示される。これによりデータメモリ16内に1つしかないテンポラリ変数領域に対する複数のモニタ要求がなされても互いに干渉することなくモニタリングが可能となる。
【0091】
また、同一の制御プログラムに対して第1のモニタ装置2からリアルタイムモニタ処理の要求がなされると同時に第2のモニタ装置2からメモリモニタ処理の要求がなされている場合には、該制御プログラムの実行が終了した時点で、その制御プログラムでリアルタイムモニタ用のデータ収集が実行されたか、またその制御プログラムで使用されている変数に対してメモリモニタ処理の要求あるいはテンポラリ変数モニタ処理の要求がなされているかどうかが判断され、その要求がなされていると判断された場合は、変数モニタ処理あるいはテンポラリ変数モニタ処理が実行されて、そのモニタ結果が、モニタ要求元のモニタ装置2に送信されて、モニタ結果画面上に表示される。
【0092】
したがって、前記構成の第5の制御システムによれば、第1のモニタ装置2から制御装置1に対して第1の制御プログラムにおけるテンポラリ変数モニタ処理が要求されると同時に、第2のモニタ装置2から制御装置1に対して第2の制御プログラムにおけるテンポラリ変数モニタ処理が要求された場合には、第1の制御プログラムの実行が開始されるともに、第1のモニタ装置2から要求されているテンポラリ変数モニタ処理が実行された後で第2の制御プログラムの実行が開始されて、第2のモニタ装置2から要求されているテンポラリ変数モニタ処理が実行される。また、同一の制御プログラムに対して第1のモニタ装置2からリアルタイムモニタ処理の要求がなされると同時に第2のモニタ装置2からメモリモニタ処理の要求がなされている場合においては、該制御プログラムの実行が終了した時点で、その制御プログラムに対してメモリモニタ処理の要求あるいはテンポラリ変数モニタ処理の要求がなされているかどうかが判断され、その要求がなされていると判断された場合は、メモリモニタ処理あるいはテンポラリ変数モニタ処理が実行されるので、複数のテンポラリ変数モニタ処理の要求に対する変数のモニタ及びリアルタイムモニタ画面に同期した変数のモニタが可能となり、複数のモニタ装置2から要求されたモニタリングを実行することが可能になる。
【0093】
次に本発明の第6実施形態について説明する。
この第6実施形態は、第1実施形態に係わる制御システムにおいて複数回のモニタが実行された際に、それぞれのモニタ結果を並列に表示させる機能を備えたものであり、この第6実施形態に係わる第6の制御システムの全体構成は図1と同様であり、制御システム内の制御装置1の構成及びモニタ装置2の構成は図2〜図4と同様である。
【0094】
制御プログラムのモニタに関して、その制御プログラムの実行時の変数値及び実行完了後の変数値の両方を表示させたい場合には、制御プログラムに対してリアルタイムモニタ処理の要求とメモリモニタ処理の要求の両方をモニタ装置2により指定する。そして制御プログラムが実行されるとともにリアルタイムモニタ処理が実行されるが、このとき任意の時点においての変数値を読み出してモニタ装置2に表示させたい場合は、モニタ装置2より変数値のキャプチャが指示されることにより、その時点での変数値が別途読み出されて要求元のモニタ装置2に送信されて、表示器210に表示される。そして、制御プログラムの実行完了後には要求されたメモリモニタ処理が実行されて、制御プログラム実行後における変数値が読み出されて、要求元のモニタ装置2に送信されて、表示された制御プログラム実行時の変数値ともに表示器210に表示される。
【0095】
したがって、前記構成の第6の制御システムによれば、制御プログラムの実行時の変数値及び実行完了後の変数値の両方を表示させたい場合には、任意の時点において変数値のキャプチャが指示されることにより、制御プログラムの実行時における任意の時点での変数値が別途読み出されて要求元のモニタ装置2に送信されて、表示器210に表示され、制御プログラムの実行完了後には要求されたメモリモニタが実行されて、制御プログラム実行後における変数値が読み出されるので、制御プログラムの実行時の変数値及び実行完了後の変数値との比較が容易になる。
【0096】
次に本発明の第7実施形態について説明する。
この第7実施形態は、第1実施形態に係わる制御システムにおいて複数回のモニタが実行された際に、それぞれのモニタ方法に応じて変数値の表示を区別する機能を備えたものであり、この第7実施形態に係わる第7の制御システムの全体構成は図1と同様であり、制御システム内の制御装置1の構成及びモニタ装置2の構成は図2〜図4と同様である。
【0097】
これまで説明してきたようにモニタ方式にはリアルタイムモニタやメモリモニタそれにテンポラリ変数モニタなどの種類がある。本発明の制御システムではそれらを組み合わせて使用することがあるので、複数のモニタが要求された場合に、それぞれ要求されたモニタのモニタ方法が異なっている場合などは、モニタ装置2に表示された変数値がどのようなモニタ方法で収集されたものかを明確にしておくことが望ましい。そこで、モニタ方式によって変数値の表示色などを変更する機能を設ける。
【0098】
例えば、モニタが実行された際に、リアルタイムモニタ処理により随時読み出された変数値には赤、メモリモニタ処理により読み出された変数値には青、そしてテンポラリ変数モニタ処理により読み出された変数値には緑というように色が区別されてモニタ装置2の表示器210に表示させる。
【0099】
つまり、非実行プログラムのモニタが行われて、変数値の表示色が青である場合には、このプログラムは現在実行されておらず、静的に変数値がモニタされていることが判別できる。また、メモリモニタが指定されている際は、静的変数をモニタする場合とテンポラリ変数をモニタする場合があるが、出力結果を同じく色により区別すれば、変数の種類を認識することが可能になる。
【0100】
したがって、前記構成の第7の制御システムによれば、リアルタイムモニタにより随時読み出された変数値には赤、メモリモニタにより取り出された変数値には青、そしてテンポラリ変数モニタにより取り出された変数値には緑というように色が区別されてモニタ装置2の表示器210に表示されるので、複数種類のモニタ方法により変数値のモニタが実行された場合でも、どのモニタ方法により読み出された変数値なのかをユーザ側で識別することが容易になる。
【0101】
【発明の効果】
以上のように、本発明の制御システムによれば、制御命令の種別を示すプログラム種別コードを含む制御プログラムに対してモニタ要求手段によりモニタがモニタ範囲を指定して要求された際に、制御プログラム実行手段により制御プログラムが実行されると、この実行時の制御データを蓄積し、この蓄積された制御データのうち、モニタ範囲の制御プログラムで使用される制御データを出力し、モニタ要求および制御データの出力ともないプログラム種別コードをもとに制御プログラム中の制御命令の種別を判別し、この判別した種別に従って制御プログラムの実行状態及び制御プログラム実行時の変数値、制御プログラム実行後の変数値または制御プログラムが非実行時の変数値が選択されてモニタされ、このモニタ結果である制御プログラムの実行状態及び変数値が表示されるので、変数値の種別やプログラムの実行状態に応じて適切なモニタ方法を自動選択することが可能になる。
【図面の簡単な説明】
【図1】本発明の第1実施形態に係わる第1の制御システムの全体構成図。
【図2】前記第1実施形態に係わる第1の制御システムに備えられた制御装置の構成を示す図。
【図3】前記第1実施形態に係わる第1の制御システムに備えられたモニタ装置の構成を示す図。
【図4】前記第1実施形態に係わる第1の制御システムに備えられた制御装置内のシーケンス演算プロセッサの構成を示す図。
【図5】前記第1実施形態に係わる第1の制御システムに備えられたモニタ装置からのリアルタイムモニタ要求のための伝送テキストを示す図。
【図6】前記第1実施形態に係わる第1の制御システムによるリアルタイムモニタ処理において、初期状態のモニタ画面表示例を示す図。
【図7】前記第1実施形態に係わる第1の制御システムによるリアルタイムモニタ処理を示すフローチャート。
【図8】前記第1実施形態に係わる第1の制御システムによるリアルタイムモニタ処理におけるモニタ画面表示例を示す図。
【図9】前記第1実施形態に係わる第1の制御システムに備えられたモニタ装置からのメモリモニタ要求のための伝送テキストを示す図。
【図10】前記第1実施形態に係わる第1の制御システムによるメモリモニタ処理における実行状態のモニタ画面表示例を示す図。
【図11】前記第1実施形態に係わる第1の制御システムによるメモリモニタ処理における変数値のモニタ画面表示例を示す図。
【図12】第2実施形態に係わる第2の制御システムの制御装置で実行されるオブジェクトプログラムの命令語形式を示す図。
【図13】前記第2実施形態に係わる第2の制御システムの制御装置内におけるデータメモリの割り付け状態を示す図。
【図14】第3実施形態に係わる第3の制御システムで実行される制御プログラムのオブジェクトプログラムの構成を示す図。
【符号の説明】
1…制御装置
2…モニタ装置
3…データ転送媒体
11…CPU
12…プログラムメモリ
13…ワークメモリ
14…シーケンス演算プロセッサ
15…制御プログラムメモリ
16…データメモリ
17…通信インタフェース
18…入出力モジュール
19…システムバス
201…CPU
202…プログラムメモリ
203…ワークメモリ
204…制御プログラムメモリ
205…データメモリ
206…通信インタフェース
207…システムバス
208…キーボード
209…入出力インタフェース
210…表示器
211…表示インタフェース
401…シーケンス演算回路
402…内部レジスタ
403…データ蓄積制御回路
404…ステップモニタ指定フラグ
405…蓄積データカウンタ
406…データ蓄積メモリ
407…比較回路
408…シーケンス命令ポインタ
409…シーケンス命令レジスタ
410…オペランドデータレジスタ
411…モニタ開始アドレスレジスタ
412…モニタ終了アドレスレジスタ
413…モニタ命令アドレスレジスタ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a control system that is widely used for controlling industrial systems such as the FA field including assembly operations in steel, papermaking plants, and the automobile industry, the PA field such as a chemical plant, and water and sewage systems and other public systems.
[0002]
[Prior art]
As a conventional monitoring method of the control system, a variable value used in the control program is collected after execution of the control program in a monitor range designated by the user, and the value is displayed together with the control program.
[0003]
[Problems to be solved by the invention]
However, in this method, a control program having a plurality of processing steps cannot monitor each variable value in each actually executed processing step, so the same variable is repeatedly used within the monitoring range, If the variable was used again after the monitor range, there was a possibility that the monitor value would be inconsistent. In order to remedy this problem, there are control systems configured to monitor the variable values at the time when each process of the control program is actually executed, but these control systems are also temporarily included in the control program. Monitoring of values other than used variables, ie, input variables and output variables, has not been fully supported. There is also a problem that an appropriate monitor method cannot be selected depending on the application.
[0004]
The present invention has been made in view of the above problems, and an object thereof is to provide a control system capable of automatically selecting an appropriate monitoring method according to the type of variable value and the execution state of a program.
[0005]
[Means for Solving the Problems]
That is, the control system according to the present invention is Contains a program type code indicating the type of control instruction Control program storage means for storing a control program, control data storage means for storing variable values of the control program, control program execution means for executing the control program stored in the control program storage means, control operations by the control program, and Monitor request means for requesting monitoring of a variable value by specifying a monitor range, and in accordance with this request, the control data at the time of execution of the control program by the control program execution means is accumulated, and among the accumulated control data, Outputs control data used by the control program in the monitor range specified by the monitor means, By output means Control data With the output of , The type of control instruction in the control program is determined based on the program type code, and according to the determined type The control program execution state and the variable value at the time of execution of the control program, the variable value after execution of the control program, or the variable value when the control program is not executed are selected and monitored, and the control program that is the monitoring result is executed. The status and variable values are displayed.
[0006]
In other words, in the control system according to the present invention, Contains a program type code indicating the type of control instruction When the monitor is requested by the monitor request means specifying the monitor range for the control program, when the control program is executed by the control program execution means, the control data at the time of execution is accumulated, and this accumulated Outputs control data used in the monitor range control program from among the control data, control Data output In With , The type of control instruction in the control program is determined based on the program type code, and according to the determined type The control program execution state and variable value when the control program is executed, the variable value after execution of the control program, or the variable value when the control program is not executed are selected and monitored. The value will be displayed.
[0007]
DETAILED DESCRIPTION OF THE INVENTION
There are two control system monitoring methods: a method of collecting variable values of a control program from an instruction word processing device (processing device for computation) and a method of collecting from a memory storing data. The method of collecting variable values from the instruction word processing device is a method of displaying the variable values at the time of executing the control program as they are, and is called a real time monitor. That is, when this method is used, as each process of the control program is executed, the variables that are used each time are collected and sequentially updated and displayed on the monitor screen.
[0008]
There are two methods for collecting variable values from memory. One is a method for monitoring values in a storage area in which variable values used in a control program are statically allocated, and is called a memory monitor. And The other is a method of monitoring a variable value temporarily used in the control program, which is called a temporary variable monitor. The variable monitoring method used by ordinary control systems is the memory monitoring method, and few control systems adopt the real-time monitoring method. However, the real-time monitoring method is suitable when it is necessary to know the variables at the time of execution of each processing process of the control program, such as when the control program is debugged. Conventionally, there has been no control system that can monitor a temporarily used variable (hereinafter referred to as a temporary variable). In order to perform effective monitoring, it is desirable to switch between these three monitoring methods according to the situation.
[0009]
Hereinafter, a first embodiment of the present invention will be described with reference to the drawings.
FIG. 1 is an overall configuration diagram of a first control system according to the first embodiment of the present invention.
[0010]
As shown in FIG. 1, the first control system has a configuration in which a control device 1 and a monitor device 2 are connected via a data transfer medium 3 and can transfer data to each other.
[0011]
The control device 1 is connected to a system (not shown) to be controlled, such as a belt conveyor, and controls the control system. The control program is executed in accordance with an instruction from the monitor device 2, that is, an operation by the user, and the control program execution state and variable values are monitored.
[0012]
The monitor device 2 can instruct the control device 1 to specify a monitor range and start monitoring by the user, and can receive and display the monitor result data transmitted by the control device 1. It is.
[0013]
FIG. 2 is a diagram illustrating a configuration of the control device 1 provided in the first control system according to the first embodiment.
As shown in FIG. 2, the control device 1 includes a CPU 11 that controls the entire control device 1, a program memory 12 that stores a control program for the control device 1 itself, a work memory 13, and a control program for a system to be controlled. A sequence arithmetic processor 14 for executing control, a control program memory 15 for storing a control program, a data memory 16 for storing variable value data used for the control program, and a communication interface for communicating with the monitor device 2 via the data transfer medium 3 17 and an input / output module 18 for performing input / output with a controlled object are connected to each other via a system bus 19.
[0014]
FIG. 3 is a diagram showing a configuration of the monitor device 2 provided in the first control system according to the first embodiment.
As shown in FIG. 3, the monitor device 2 includes a CPU 201 that controls the entire monitor device 2, a program memory 202 that stores a control program for the monitor device 2 itself, a work memory 203, and a control program that is stored in the control device 1. The control program memory 204 that stores the same program, the data memory 205 that stores variable value data, and the communication interface 206 are connected to each other via the system bus 207, determine the monitor range, and specify variable value data. The display 208 for displaying the program list and data is connected to the CPU 201 via the input / output interface 209 for connecting the keyboard 208 to the CPU 201 and the keyboard 208. Via interface 211 It is connected to the system bus 207 Te.
[0015]
The communication interface 206 performs data communication with the control device 1 via the data transfer medium 3.
[0016]
The monitor device 2 is configured to be able to display the accumulated data transmitted from the control device 1 as the latest data, and can accurately display the execution result of the control program.
[0017]
FIG. 4 is a diagram showing a configuration of the sequence arithmetic processor 14 in the control device 1 provided in the first control system according to the first embodiment.
This sequence arithmetic processor 14 is a dedicated circuit for executing a control program, and the same effect can be obtained by realizing the same logic by software and executing it by the CPU 11.
[0018]
The control program is described by an instruction called a sequence instruction, stored in the control program memory 15 in the control device 1, read from the control program memory 15 via the system bus 19, and executed by the sequence arithmetic processor 14.
[0019]
As shown in FIG. 4, in the sequence calculation processor 14, an internal register 402 and a data accumulation control circuit 403 are connected mainly to a sequence calculation circuit 401 used for real-time monitor processing. A monitor designation flag 404, an accumulated data counter 405, and a data accumulation memory 406 are connected to each other. In addition, a comparison circuit 407 is connected to the data accumulation control circuit 403.
[0020]
The sequence calculation circuit 401 is connected to the system bus 19 in order to exchange data with the CPU 11 of the control device 1.
[0021]
The data accumulation control circuit 403 is connected to the system bus 19 in order to transmit an interrupt signal to the CPU 11.
[0022]
A sequence instruction pointer 408, a sequence instruction register 409, an operand data register 410, a monitor start address register 411, a monitor end address register 412 and a monitor instruction address register 413 are connected to the comparison circuit 407, respectively.
[0023]
The internal register 402 is a register that temporarily stores data necessary for executing the sequence operation.
[0024]
The data accumulation control circuit 403 performs operations such as controlling the timing of starting and stopping data accumulation, and determining the form of data to be accumulated according to the type of instruction being executed, and controls the entire data accumulation operation. Do. Further, an interrupt signal can be transmitted to the CPU 11 via the system bus 19 when necessary.
[0025]
The step monitor designation flag 404 is a flag for interrupting the execution of the control program every time one step of the control program is executed and synchronizing with the monitor device 2.
[0026]
The accumulated data counter 405 is a counter that counts the number of accumulated data, and its initial value is “0”.
[0027]
The data storage memory 406 is a memory used as a data storage buffer in the monitor range extracted by the monitoring process, and stores bit data, word data, state change data, and the like.
[0028]
The comparison circuit 407 compares the contents of the monitor start address register 411 and the monitor end address register 412 with the contents of the sequence instruction pointer 408, the sequence instruction register 409, and the operand data register 410, and when both contents match, This circuit outputs a signal to that effect to the data accumulation control circuit 403.
[0029]
The sequence instruction pointer 408 is a register for designating an address in which an instruction used in the control program to be executed is stored.
[0030]
The sequence instruction register 409 is a register that stores a code of a sequence instruction that is currently being executed.
[0031]
The operand data register 410 is a register that stores data that is an operation target of a sequence instruction.
[0032]
The monitor start address register 411 is a register for storing the monitor start address designated by the monitor device 2, that is, the start address of the monitor range.
[0033]
The monitor end address register 412 is a register for storing the monitor end address designated by the monitor device 2, that is, the end address of the monitor range.
[0034]
The monitor instruction address register 413 is a register that stores an address where an instruction to be monitored is stored.
[0035]
Next, the monitoring process in the first control system having the above configuration will be described.
First, real-time monitoring processing by the first control system will be described.
FIG. 5 is a diagram showing a transmission text for a real-time monitor request from the monitor device 2 provided in the first control system according to the first embodiment.
[0036]
FIG. 6 is a diagram showing a monitor screen display example in an initial state in the real-time monitor process by the first control system according to the first embodiment.
[0037]
FIG. 7 is a flowchart showing real-time monitoring processing by the first control system according to the first embodiment.
[0038]
FIG. 8 is a diagram showing a monitor screen display example in the real-time monitor process by the first control system according to the first embodiment.
[0039]
As shown in FIG. 5, this transmission text includes a header, a control command, a program type, a program number, a program monitor start address, a monitor end address, and a trailer.
[0040]
In the first control system, when the real-time monitoring process, that is, the execution state and the variable value are monitored during the execution of the control program, the user can monitor the monitor range, that is, the monitor start address and the monitor end address from the keyboard 208 of the monitor device 2. Is input to the control device 1 via the data transfer medium 3 from the communication interface 206 of the monitor device 2.
[0041]
Next, when the monitor request signal is received by the communication interface 17 of the control device 1, the monitor start address and the monitor end address included in the received monitor request signal are the monitor start address register 411 in the sequence arithmetic processor 14. And the monitor end address register 412 are set (step A1).
[0042]
Then, based on the input monitor start address and monitor end address, the process from the start to the end of the monitor is determined, and the CPU 11 generates image data corresponding to each process, and based on the image data, A monitor initial screen as shown in FIG. 6 is displayed on the display 210 of the monitor device 2 (step A2).
[0043]
In FIG. 6, each symbol from y1 to y6 indicates each process in the monitor designated range control program, and a line segment connecting each symbol indicates the relationship between preprocessing and postprocessing in each adjacent process. Yes. For y3 and y4 that are in parallel, the logical sum of the outputs is the output. That is, this screen is a screen for confirming how the processes from y1 to y6 are executed.
[0044]
Similarly, each symbol from f1 to f3 in FIG. 6 indicates the function f2 activated by the output of f1 and the operation of f3 controlled by the output of the function f2. The process “f21 → f22” is a calculation process of “D = (A + B) / C”.
[0045]
Thereafter, when the user instructs the execution of the control program from the monitor device 2, the control program stored in the control program memory 15 in the control device 1 is read out and the execution of the control program is started (step A3).
[0046]
Then, when the control program for the designated monitor target range is executed, the comparison circuit 407 in the sequence arithmetic processor causes the value of the sequence instruction pointer 408, that is, the address of the control program currently being executed, and the head of the monitor range, The monitor start address stored in the monitor start address register 411 is compared with each other to determine whether or not they match (steps A4 and A5).
[0047]
When the coincidence is detected, a coincidence signal indicating the coincidence between the value of the sequence instruction pointer 408 and the value of the monitor start address register 411 is output from the comparison circuit 407 to the data accumulation circuit, and the data accumulation control circuit 403 The data memory is accessed via the system bus, and the variable value data in the monitor range designated in advance is sequentially stored in the data storage memory 406 (step A6).
[0048]
Each time the variable value data for one instruction of the control program is stored in the data storage memory 406, the value of the storage data counter 405 is incremented by one and updated.
[0049]
At the same time, when each processing process of the control program in the monitor range is executed, when it is confirmed that each processing process has been operated normally, each symbol from y1 to y6 is a symbol indicating an ON state (for example, a bold line) Symbol), and if it is confirmed that the control between adjacent processing steps has been performed normally, the line connecting each symbol is sequentially replaced with a line segment indicating the ON state (for example, a thick line). Then, it is updated and displayed as needed on the display 210 of the monitor device 2 (step A7).
[0050]
Then, the end of the preset monitor range, that is, the value of the sequence instruction pointer 408 and the monitor end address stored in the monitor end address register 412 are compared by the comparison circuit 407, and it is determined that both match or When it is determined that the number of data counted by the accumulated data counter 405 has reached a preset value, a coincidence signal from the comparison circuit 407 or a specified value arrival signal from the accumulated data counter 405 is passed through the data accumulation control circuit 403. Is sent to the CPU 11 to request storage of the variable value data in the data storage memory 406 and monitor end processing (step A8). Then, the screen displayed on the display 210 of the monitor device 2 is as shown in FIG.
[0051]
When the monitoring process is completed, the value of the accumulated data counter 405 is cleared to “0”.
[0052]
In other words, the sequence arithmetic processor 14 reads the control program from the control program memory 15 after the system state to be externally controlled is input via the input / output module 18 of the control device 1, and reads this control program as necessary. The data is executed while accessing the data in the data memory 16, and the monitor result is output to the monitor device 2 via the input / output module 18.
[0053]
As described above, by collecting variable value data in parallel with program execution by real-time monitor processing, it is possible to collect variable value data used in the monitor range in the order used.
[0054]
Next, the memory monitor process by the first control system will be described.
FIG. 9 is a diagram showing a transmission text for a memory monitor request from the monitor device 2 provided in the first control system according to the first embodiment.
[0055]
FIG. 10 is a diagram illustrating a monitor screen display example of an execution state in the memory monitor process by the first control system according to the first embodiment.
[0056]
FIG. 11 is a diagram showing a monitor screen display example of variable values in the memory monitor process by the first control system according to the first embodiment.
[0057]
This memory monitoring process is a monitoring method that specifies the memory address or variable name in which variable values used in the control program are stored, and collects the contents. It is determined whether or not has been successfully performed, and the result is displayed as an image screen. In this memory monitor process, the variable value can be monitored as compared with the real-time monitor process, but since the execution state, that is, the output of the instruction cannot be monitored, the signal flow between the processes is displayed as shown in FIG. It is not possible. In addition, since this memory monitoring process only monitors the variable value after execution of the control program, the state may change from the time when each process of the control program is actually executed, resulting in a contradiction in the monitor screen. Sometimes it cannot be used for accurate debugging. However, since the control program can be monitored without the sequence arithmetic circuit 401 in the sequence arithmetic processor 14, it is versatile, and is effective when only the variable after execution of the control program is to be monitored.
[0058]
As shown in FIG. 9, this transmission text includes a header, a control command, a program type, a program number, a data type of each variable value, an address, a data size, and a trailer.
[0059]
When the memory monitoring process is performed in the first control system, that is, when the variable value after execution of the control program is monitored, a monitor request signal based on the transmission text shown in FIG. 9 is first transmitted from the monitor device 2 to the control device 1. Is done. A monitor request signal is also transmitted from the monitor device 2 to the control device 1 when monitoring a variable value when the control program is in a non-executed state.
[0060]
After the control program is executed and terminated, the user designates the address on the data memory 16 in which the variable value to be displayed on the monitor device 2 is stored or the variable name to be displayed. Then, the data memory 16 is accessed and the variable value is read to the CPU 11. Then, it is determined from the read variable values whether each process of the control program has been performed, and when it is determined that each process has been executed, as shown in FIG. Is transmitted to the monitor device 2 and displayed on the display 210 as a memory monitor result. As a result, the user determines whether various processes are normally performed based on the displayed variable value.
[0061]
On the other hand, when it is desired to display only the variable value on the display unit 210 instead of the image screen as shown in FIG. 10, the monitor result by the memory monitor process is only the variable value read from the variable monitor, that is, the data memory 16 by the memory monitor process. A monitor method for displaying may be used.
[0062]
A display example of this variable monitoring process is shown in FIG. The variable monitor process is the same function as the memory monitor process described above, and monitor data is collected when a monitor request signal based on the transmission text shown in FIG. 9 is input from the monitor apparatus 2 to the control apparatus 1.
[0063]
Further, even when a request for real-time monitoring processing is made to the target control program, if the control program is in a non-executed state, it is converted into a memory monitor request signal by the control device 1, and the data memory 16 Are accessed, the variable values used in the program range to be monitored are collected, and the variable data is transmitted to the monitor device 2 as response data at the time of the memory monitor request and displayed on the display 210. The
[0064]
Therefore, according to the first control system having the above-described configuration, when the real-time monitoring process, that is, the monitoring of the execution state of the control program, is performed, if the user designates the process to be monitored in the control program, the process corresponds to the process When the initial monitor screen is displayed on the monitor device 2 and the execution of the control program is started, the execution state of each process is determined each time each process is executed, and the variable value at the time of execution is stored in the data memory 16. Is displayed on the monitor device 2. Further, when monitoring only variable values, that is, variable monitoring processing, the designated variable values are read out by accessing the data memory 16 and displayed on the monitor device 2, so that each processing of the control program is executed. It is possible to monitor the operation state at the time and the variable value at the time of completion.
[0065]
Note that the first control system can also display the variable value data read from the data memory 16 at any time during execution of the real-time monitoring process so as to be superimposed on the monitor screen shown in FIG. In this case, if the variable value changes as the processing of the control program proceeds, the variable value on the display screen is updated and displayed as needed.
[0066]
Next, a second embodiment of the present invention will be described.
The second embodiment enables monitoring of temporary variables, that is, variables temporarily used in the control program in the first control system according to the first embodiment. The overall configuration of the second control system is the same as that shown in FIG. 1, and the configuration of the control device 1 and the configuration of the monitor device 2 in the control system are the same as those shown in FIGS.
[0067]
The temporary variable exists only in each process of the control program, that is, only at the time when the program unit is executed. After the execution of the program unit is completed, the temporary variable area in the data memory 16 storing the variable becomes a temporary variable of another program. Since it is used as a variable area, its contents are changed. Therefore, even if monitoring is performed after all control programs in the monitor range are executed, the value of the temporary variable cannot be read.
[0068]
FIG. 12 is a diagram illustrating a command word format of an object program executed by the control device 1 of the second control system according to the second embodiment.
[0069]
FIG. 13 is a diagram showing an allocation state of the data memory 16 in the control device 1 of the second control system according to the second embodiment.
[0070]
As shown in FIG. 12, the instruction word of the object program executed by the control device 1 is composed of an instruction word code, a data type code, and a variable address.
[0071]
The data type code in this instruction word is a code indicating whether the data corresponds to a local variable, a global variable, or a temporary variable.
[0072]
As shown in FIG. 13, the data memory 16 in the control device 1 has a temporary variable area for storing a temporary variable common to a plurality of programs, and a temporary variable is assigned to the temporary variable area in a stack format. It has become. In the instruction word format, the pointer value from the stack base is used as the address of the temporary variable. Therefore, when a temporary variable is specified as a memory monitor request or a variable monitor request, that is, when a code indicating a temporary variable is set in the data type code of the instruction word, each process of the target control program is executed. Each time the data type code in the instruction word shown in FIG. 12 is referred to, it is determined whether or not monitoring of the temporary variable is requested. If it is determined here that monitoring of the temporary variable is requested, the variable value of the requested temporary variable is read from the temporary variable area in the data memory 16 and transmitted to the monitor device 2. The data is displayed on the display unit 210 of the monitor device 2 as a temporary variable monitoring result.
[0073]
Therefore, according to the second control system having the above-described configuration, when a variable monitoring process is requested by the user, the variable type is determined from the data type code in the instruction word every time each process of the control program is executed. If it is automatically determined and the designated variable is a temporary variable, the variable value of the temporary variable is read from the temporary variable area in the data memory 16 at that time and displayed on the monitor device 2. Thus, temporary variables can be monitored.
[0074]
Next, a third embodiment of the present invention will be described.
In the third embodiment, the monitoring method can be changed according to the type of control instruction in the object program of the control program executed in the first control system according to the first embodiment. The overall configuration of the third control system according to the embodiment is the same as that in FIG. 1, and the configuration of the control device 1 and the configuration of the monitor device 2 in the control system are the same as those in FIGS.
[0075]
FIG. 14 is a diagram illustrating a configuration of an object program of a control program executed by the third control system according to the third embodiment.
[0076]
As shown in FIG. 14, there is a program type code indicating the program type at the head of the code in each program of the control program stored in the control program memory 15, and the monitor device 2 controls the control program in the control program from this program type code. It is possible to determine the type of instruction.
[0077]
The first control system is configured so that function blocks and functions and user-defined function blocks and user functions can be used for programming the control program. Function blocks and user-defined function blocks can contain static variables within them. On the other hand, functions and user functions can only contain temporary variables. With the static variable and the temporary variable, the memory monitor process and the temporary variable monitor process are suitable, so it is necessary to switch them as needed.
[0078]
Therefore, when a memory monitor process or a variable monitor process that is a monitor of only the memory monitor variable value is requested, the control program operates to access the designated variable in the data memory 16. In addition, the program type code included in the object program shown in FIG. 14 determines whether the control instruction is an operation instruction included in the function block and the function, the user-defined function block and the user function, Further, it is determined whether the type of the operation instruction belongs to an operation instruction based on a function block or a user-defined function block, or to an operation instruction based on a function or a user function.
[0079]
As a result, when the type is a function block or a user-defined function block, the variable is read from the data memory 16 by the memory monitor process and transmitted to the monitor device 2. Then, the transmitted variable value data is displayed on the display 210 of the monitor device 2 as a monitor result.
[0080]
On the other hand, if the determined type is a function or a user function, a temporary variable monitor process is executed, and the temporary variable is read from the temporary variable area in the data memory 16 and transmitted to the monitor device 2. . Then, the transmitted variable data is displayed on the display 210 of the monitor device 2.
[0081]
Therefore, according to the third control system having the above configuration, when monitoring a function block or a variable inside a function, the type is related to the function block and the user-defined function block from the program type code included in the object program. Whether it is an instruction or an instruction related to a function and a user function, if it is a function block and a user-defined function block, a memory monitor process is performed. Since the variable monitoring process is executed, the user can obtain an optimal monitoring result without being aware of the type of variable.
[0082]
Next, a fourth embodiment of the present invention will be described.
In the fourth embodiment, the monitoring method can be changed according to the type of the object program of the control program executed in the first control system according to the first embodiment. The overall configuration of the fourth control system is the same as in FIG. 1, and the configuration of the control device 1 and the configuration of the monitor device 2 in the control system are the same as those in FIGS.
[0083]
In the fourth control system, an interrupt processing program that is executed only when an event occurs can be used in addition to the main program that is executed periodically as the type of program. Each program can be controlled for execution, and can be executed and stopped from other programs. In this case, since the interrupt program is not always executed, the monitor result may not be immediately displayed on the monitor device 2 when the real-time monitor process is performed. That is, when the real-time monitoring process is executed for the interrupt processing program, the monitor result display screen of the monitor device 2 does not change at all when the interrupt processing program is not executed, so the monitor screen is not effectively used. .
[0084]
Therefore, first, when the user requests real-time monitoring processing of a specific control program, and when the control program is executed, the monitor device 2 stores the monitoring result data from the control device 1 within a certain time. A determination is made as to whether or not When the monitor device 2 determines that the monitor data is not received, the monitor device 2 determines whether or not the control program to be monitored is an interrupt program for another main program. When it is determined that the program is a program, the monitor device 2 automatically transmits a signal requesting the memory monitoring process to the control device 1 and when the control device 1 receives the signal, The memory monitor process is executed. Thereby, the variable value at the time of the previous execution of the interrupt program is acquired, the acquired variable value data is transmitted to the monitor device 2, and the variable is displayed on the monitor screen in the display unit 210 of the monitor device 2. The
[0085]
In addition, when real-time monitor processing is requested and monitoring results cannot be obtained for a certain period of time, even if it is determined that the program to be monitored is not an interrupt program, it is determined that the control program is not currently executed. In this case, a signal requesting memory monitoring is automatically transmitted to the control device 1 instead of the real-time monitor request on the monitor device 2 side, and when the memory monitor request signal is received on the control device 1 side, the control is performed. Memory monitor processing is executed for the program. Thereby, the variable which is the monitoring result, that is, the variable value before the execution of the control program is read from the data memory 16 and displayed on the monitor result screen of the display unit 210.
[0086]
When the operation of the interrupt processing program is started, a signal requesting conversion to the originally designated real-time monitor process is output from the monitor device 2 to the control device 1, and the real-time monitor process is executed. Then, the monitor result is sequentially transmitted to the monitor device 2, and the display state and variable value of the monitor result display screen of the display 210 are sequentially updated.
[0087]
Therefore, according to the fourth control system having the above-described configuration, if the monitor result display screen does not change even after a predetermined time has elapsed since real-time monitoring processing is requested for the interrupt processing program, that is, those control programs are still executed. If the monitoring process is not progressed, the monitor device 2 sends a signal requesting the memory device to perform the memory monitoring process, and the variable value data at the previous execution of the interrupt program is read out. When a real-time monitor process is requested for a program other than the interrupt program displayed on the monitor device 2, if the monitor result display screen does not change even after a certain period of time, that is, those programs are still being executed. If not, the memory device is also transferred from the monitor device 2 to the control device 1. A monitor request signal is output, and the monitor result at the previous execution of the interrupt program is read and displayed on the monitor device 2, so the monitor method is automatically selected according to the type of control program. It is possible to reduce the burden on the monitor operator and to perform monitoring according to the purpose.
[0088]
Next, a fifth embodiment of the present invention will be described.
The fifth embodiment makes it possible to perform each monitor process even when monitor requests are made from a plurality of monitor devices 2 in the first control system according to the first embodiment. The overall configuration of the fifth control system according to the embodiment is the same as that in FIG. 1, and the configuration of the control device 1 and the configuration of the monitor device 2 in this control system are the same as those in FIGS.
[0089]
When monitor request signals are output from a plurality of monitor devices 2 to a single control device 1, for example, when the monitor requested by both monitor request signals is real-time monitor processing, the control device 1 In this case, there is no problem if the control programs to be monitored are operated in parallel. However, an area shared by a plurality of control programs such as a temporary variable monitor, for example, a temporary variable area in the data memory 16 of the control device 1 is used. When temporary variable monitoring for different control programs is requested, the temporary variable monitoring in synchronization with the execution of the control program requested to be monitored by each monitor device 2 is required. Further, in the monitor device 2, there is a case where it is desired to check other variable values by simultaneously opening the variable monitor screen while viewing a real-time monitor screen of a certain control program. In such a case, it is necessary to execute variable monitor data collection in synchronization with the execution of the control program requested for real-time monitoring to display the variable values.
[0090]
For example, when the first monitor device 2 requests the control device 1 to perform temporary variable monitoring processing in the first control program, the second monitor device 2 sends the second control program to the control device 1 at the same time. When the temporary variable monitoring process is requested, the execution order is automatically set by the user or automatically by the control device 1 so that these two control programs are not executed simultaneously. Then, the execution of the first control program by ordering is started, and the temporary variable monitoring process requested from the first monitor device 2 is executed, so that the variable value of the temporary variable is changed by the temporary variable area of the data memory 16. It is read out and the monitor result is transmitted to the first monitor device 2 and displayed on the display 210. Then, the control device 1 determines whether or not the execution of the first control program has ended. If it is determined that the execution has ended, the execution of the ordered second control program is started and the second control program is started. The temporary variable monitoring process requested by the monitor device 2 is executed, the variable value of the temporary variable is read from the temporary variable area of the data memory 16, and the monitor result is transmitted to the second monitor device 2. It is displayed on the display 210. As a result, even if a plurality of monitoring requests are made for only one temporary variable area in the data memory 16, monitoring is possible without interfering with each other.
[0091]
Further, when a request for real-time monitor processing is made from the first monitor device 2 to the same control program, and simultaneously, a request for memory monitor processing is made from the second monitor device 2, the control program When execution is complete, the control program has collected data for real-time monitoring, and a request for memory monitor processing or temporary variable monitoring processing has been made for the variable used in the control program. If it is determined that the request has been made, the variable monitor process or the temporary variable monitor process is executed, and the monitor result is transmitted to the monitor device 2 that is the monitor request source for monitoring. It is displayed on the result screen.
[0092]
Therefore, according to the fifth control system having the above-described configuration, the first monitor device 2 requests the control device 1 to perform the temporary variable monitoring process in the first control program, and at the same time, the second monitor device 2. When a temporary variable monitoring process in the second control program is requested from the control device 1 to the control device 1, the execution of the first control program is started and the temporary data requested from the first monitor device 2 is started. After the variable monitor process is executed, the execution of the second control program is started, and the temporary variable monitor process requested by the second monitor device 2 is executed. In addition, when a request for real-time monitoring processing is made from the first monitor device 2 to the same control program, at the same time, a request for memory monitoring processing is made from the second monitor device 2, the control program When the execution is completed, it is determined whether a request for a memory monitor process or a temporary variable monitor process is made for the control program. If it is determined that the request is made, the memory monitor process Alternatively, since the temporary variable monitoring process is executed, it becomes possible to monitor variables in response to a plurality of temporary variable monitor processing requests and monitor variables synchronized with the real-time monitor screen, and execute the monitoring requested from the plurality of monitoring devices 2. It becomes possible.
[0093]
Next, a sixth embodiment of the present invention will be described.
The sixth embodiment is provided with a function of displaying each monitor result in parallel when a plurality of monitors are executed in the control system according to the first embodiment. The overall configuration of the sixth control system is the same as in FIG. 1, and the configuration of the control device 1 and the configuration of the monitor device 2 in the control system are the same as those in FIGS.
[0094]
For monitoring a control program, if you want to display both the variable value at the time of execution of the control program and the variable value after execution of the control program, both the real-time monitor processing request and the memory monitor processing request are sent to the control program. Is specified by the monitor device 2. Then, the control program is executed and the real-time monitor process is executed. At this time, when the variable value at an arbitrary time point is read and displayed on the monitor device 2, the monitor device 2 instructs to capture the variable value. Thus, the variable value at that time is separately read out and transmitted to the requesting monitor device 2 and displayed on the display 210. Then, after the execution of the control program is completed, the requested memory monitoring process is executed, the variable value after the execution of the control program is read out, transmitted to the requesting monitor device 2 and displayed. The variable value of the hour is displayed on the display 210.
[0095]
Therefore, according to the sixth control system having the above-described configuration, when it is desired to display both the variable value at the time of execution of the control program and the variable value after completion of the execution, the capture of the variable value is instructed at an arbitrary time point. As a result, a variable value at an arbitrary point in time of execution of the control program is separately read out and transmitted to the requesting monitor device 2, displayed on the display 210, and requested after completion of execution of the control program. Since the memory monitor is executed and the variable value after execution of the control program is read out, it is easy to compare the variable value at the time of execution of the control program and the variable value after execution of the control program.
[0096]
Next, a seventh embodiment of the present invention will be described.
The seventh embodiment is provided with a function of distinguishing display of variable values according to each monitoring method when monitoring is performed a plurality of times in the control system according to the first embodiment. The overall configuration of the seventh control system according to the seventh embodiment is the same as that in FIG. 1, and the configuration of the control device 1 and the configuration of the monitor device 2 in the control system are the same as those in FIGS.
[0097]
As described above, there are various types of monitoring methods such as a real time monitor, a memory monitor, and a temporary variable monitor. Since the control system of the present invention may use them in combination, when a plurality of monitors are requested, if the monitoring method of each requested monitor is different, it is displayed on the monitor device 2. It is desirable to clarify how the variable values are collected. Therefore, a function for changing the display color of the variable value and the like by a monitor method is provided.
[0098]
For example, when the monitor is executed, the variable value read at any time by the real-time monitor process is red, the variable value read by the memory monitor process is blue, and the variable read by the temporary variable monitor process The value is displayed on the display unit 210 of the monitor device 2 with a color such as green.
[0099]
That is, when the non-executed program is monitored and the variable value display color is blue, it can be determined that the program is not currently executed and the variable value is statically monitored. In addition, when a memory monitor is specified, there are cases where a static variable is monitored and a temporary variable is monitored. If the output results are also distinguished by color, the type of variable can be recognized. Become.
[0100]
Therefore, according to the seventh control system having the above configuration, the variable value read out by the real time monitor is red, the variable value taken out by the memory monitor is blue, and the variable value taken out by the temporary variable monitor. Is displayed on the display unit 210 of the monitor device 2 in such a manner as to be green, so even if variable value monitoring is executed by a plurality of types of monitoring methods, the variable read by any monitoring method is used. It becomes easy for the user to identify the value.
[0101]
【The invention's effect】
As described above, according to the control system of the present invention, Contains a program type code indicating the type of control instruction When the monitor is requested by the monitor request means specifying the monitor range for the control program, when the control program is executed by the control program execution means, the control data at the time of execution is accumulated, and this accumulated Outputs control data used in the monitor range control program from among the control data, control Data output In With , The type of control instruction in the control program is determined based on the program type code, and according to the determined type The control program execution state and variable value when the control program is executed, the variable value after execution of the control program, or the variable value when the control program is not executed are selected and monitored. Since the value is displayed, it becomes possible to automatically select an appropriate monitoring method according to the type of the variable value and the execution state of the program.
[Brief description of the drawings]
FIG. 1 is an overall configuration diagram of a first control system according to a first embodiment of the present invention.
FIG. 2 is a diagram showing a configuration of a control device provided in the first control system according to the first embodiment.
FIG. 3 is a diagram showing a configuration of a monitor device provided in the first control system according to the first embodiment.
FIG. 4 is a diagram showing a configuration of a sequence arithmetic processor in a control device provided in the first control system according to the first embodiment.
FIG. 5 is a diagram showing a transmission text for a real-time monitor request from a monitor device provided in the first control system according to the first embodiment.
FIG. 6 is a diagram showing a monitor screen display example in an initial state in real-time monitor processing by the first control system according to the first embodiment.
FIG. 7 is a flowchart showing real-time monitoring processing by the first control system according to the first embodiment.
FIG. 8 is a view showing a monitor screen display example in real-time monitor processing by the first control system according to the first embodiment.
FIG. 9 is a diagram showing a transmission text for a memory monitor request from a monitor device provided in the first control system according to the first embodiment.
FIG. 10 is a diagram showing a monitor screen display example of an execution state in the memory monitor process by the first control system according to the first embodiment.
FIG. 11 is a diagram showing a monitor screen display example of variable values in the memory monitor process by the first control system according to the first embodiment.
FIG. 12 is a diagram showing an instruction word format of an object program executed by the control device of the second control system according to the second embodiment.
FIG. 13 is a view showing a data memory allocation state in the control device of the second control system according to the second embodiment;
FIG. 14 is a diagram showing a configuration of an object program of a control program executed by a third control system according to the third embodiment.
[Explanation of symbols]
1 ... Control device
2 ... Monitor device
3. Data transfer medium
11 ... CPU
12 ... Program memory
13 ... Work memory
14 Sequence processor
15 ... Control program memory
16: Data memory
17 ... Communication interface
18 ... I / O module
19 ... System bus
201 ... CPU
202 ... Program memory
203 ... Work memory
204 ... Control program memory
205: Data memory
206 ... Communication interface
207 ... System bus
208 ... Keyboard
209 ... I / O interface
210 ... Display
211 ... Display interface
401. Sequence operation circuit
402: Internal register
403 ... Data accumulation control circuit
404 ... Step monitor designation flag
405 ... Accumulated data counter
406 ... Data storage memory
407 ... Comparison circuit
408 ... Sequence instruction pointer
409 ... Sequence instruction register
410 ... Operand data register
411: Monitor start address register
412 ... Monitor end address register
413: Monitor instruction address register

Claims (5)

制御命令の種別を示すプログラム種別コードを含む制御プログラムを記憶する制御プログラム記憶手段と、
前記制御プログラムの変数値を記憶する制御データ記憶手段と、
前記制御プログラム記憶手段に記憶された制御プログラムを実行する制御プログラム実行手段と、
前記制御プログラムによる制御動作及び変数値のモニタをモニタ範囲を指定して要求するモニタ要求手段と、
前記モニタ要求手段によるモニタ要求にしたがって、前記制御プログラム実行手段による前記制御プログラム実行時の制御データを蓄積する蓄積手段と、
前記蓄積手段により蓄積された制御データのうち、前記モニタ手段により指定したモニタ範囲の制御プログラムで使用される制御データを出力する出力手段と、
前記モニタ要求手段によるモニタ要求および前記出力手段による制御データ出力にともない前記プログラム種別コードをもとに前記制御プログラム中の制御命令の種別を判別し、この判別した種別に従って前記制御プログラムの実行状態及び制御プログラム実行時の変数値、または制御プログラム実行後の変数値または制御プログラムが非実行時の変数値を選択してモニタを行うとともに、このモニタ結果である前記制御プログラムの実行状態及び変数値を表示するモニタ手段と
を備えたことを特徴とする制御システム。
Control program storage means for storing a control program including a program type code indicating the type of control instruction ;
Control data storage means for storing variable values of the control program;
Control program execution means for executing the control program stored in the control program storage means;
Monitor request means for requesting control operation and variable value monitoring by the control program by specifying a monitor range;
Accumulating means for accumulating control data at the time of execution of the control program by the control program execution means in accordance with a monitor request by the monitor request means;
Out of the control data stored by the storage means, output means for outputting control data used in a control program in a monitor range designated by the monitor means;
Execution of said monitor request Due to the output of the control data by the monitoring request and the output means by means, said program type code to determine the type of control instruction in the control program on the basis of the control program in accordance with the discriminated type The state and the variable value at the time of execution of the control program, or the variable value after the execution of the control program or the variable value when the control program is not executed are selected for monitoring, and the execution state and variable of the control program which is the monitoring result A control system comprising monitor means for displaying a value.
請求項1に記載の制御システムであって、
前記モニタ手段は、前記制御プログラムの種別を判別し、前記制御プログラム実行手段による前記制御プログラムの実行状態を監視し、前記判別したプログラム種別が、前記制御プログラム実行手段により常時実行される制御プログラムである場合には、前記制御プログラムの実行状態及び制御プログラム実行時の変数値をモニタし、前記判別したプログラム種別が、前記制御プログラム実行手段により常時実行手段により常時実行される制御プログラムでないプログラムである割込みプログラムや非実行状態の制御プログラムである場合には、前記制御プログラム実行後の変数値または制御プログラムが非実行時の変数値を選択してモニタを行うことを特徴とする制御システム。
The control system according to claim 1,
The monitor means determines the type of the control program, monitors the execution state of the control program by the control program execution means, and the determined program type is a control program that is always executed by the control program execution means. In some cases, the execution state of the control program and the variable value at the time of execution of the control program are monitored, and the determined program type is a program that is not a control program that is always executed by the control program execution unit by the constant execution unit. When the control program is an interrupt program or a non-executed control program, monitoring is performed by selecting a variable value after execution of the control program or a variable value when the control program is not executed .
請求項に記載の制御システムであって、
前記モニタ要求手段は、排他的に実行すべき複数のモニタ要求および同一プログラムに対して同時に実行すべきモニタ要求のいずれかを行い、
前記モニタ手段は、前記モニタ要求手段が排他的に実行すべき複数のモニタ要求を行った際に、それらのモニタ要求に処理優先度を付けることで順次処理し、前記モニタ要求手段が同一プログラムに対して同時に実行すべきモニタ要求を行った際に、各モニタ要求に対するモニタを同時に実行することを特徴とする制御システム。
The control system according to claim 1 ,
The monitor request means performs either a plurality of monitor requests to be executed exclusively and a monitor request to be executed simultaneously for the same program,
When the monitor request unit performs a plurality of monitor requests to be executed exclusively, the monitor request unit sequentially processes the monitor requests by assigning a processing priority to the monitor request unit. When a monitor request to be executed at the same time is made , a control system for simultaneously executing monitoring for each monitor request .
請求項1又は請求項2に記載の制御システムであって、
前記モニタ要求手段は、複数種類のモニタ要求を行い、
前記モニタ手段は、前記モニタ要求手段による複数種類のモニタ要求にしたがって複数種類のモニタを同一制御周期内に実行し、これらの各種モニタ結果を並列に表示することを特徴とする制御システム。
The control system according to claim 1 or 2,
The monitor request means performs a plurality of types of monitor requests,
The monitor means executes a plurality of types of monitors within the same control cycle in accordance with a plurality of types of monitor requests by the monitor request means, and displays these various monitor results in parallel .
請求項1又は請求項2に記載の制御システムであって、
前記モニタ要求手段は、複数種類のいずれかのモニタ要求を行い、
前記モニタ手段は、モニタ要求にしたがったモニタ方式の種類に従ってモニタ結果の表示方法を変更して表示することを特徴とする制御システム。
The control system according to claim 1 or 2,
The monitor request means performs any one of a plurality of types of monitor requests,
The control means is characterized in that the monitor means changes and displays the display method of the monitor result according to the type of the monitor method according to the monitor request .
JP2002028560A 2002-02-05 2002-02-05 Control system Expired - Fee Related JP3927042B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002028560A JP3927042B2 (en) 2002-02-05 2002-02-05 Control system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002028560A JP3927042B2 (en) 2002-02-05 2002-02-05 Control system

Publications (2)

Publication Number Publication Date
JP2003228417A JP2003228417A (en) 2003-08-15
JP3927042B2 true JP3927042B2 (en) 2007-06-06

Family

ID=27749727

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002028560A Expired - Fee Related JP3927042B2 (en) 2002-02-05 2002-02-05 Control system

Country Status (1)

Country Link
JP (1) JP3927042B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20120072012A (en) * 2010-12-23 2012-07-03 한국전자통신연구원 Apparatus for monitoring data parameter of robot software component and method thereof
JP6469330B1 (en) * 2018-04-25 2019-02-13 三菱電機株式会社 MONITOR SUPPORT DEVICE, MONITOR SUPPORT METHOD, AND MONITOR SUPPORT PROGRAM
DE102020119853B3 (en) * 2020-07-28 2021-07-08 Beckhoff Automation Gmbh Method for controlling an automation system with visualization of program objects of a control program of the automation system and automation system

Also Published As

Publication number Publication date
JP2003228417A (en) 2003-08-15

Similar Documents

Publication Publication Date Title
JP2006277115A (en) Abnormality detection program and abnormality detection method
JP2020061055A (en) Control system, control device and control method
JP3927042B2 (en) Control system
WO2015181921A1 (en) Programmable display device and rendering software
JP6849029B2 (en) Data collection systems, data collection methods, and programs
JPH07334211A (en) Data tracing method for programmable controller
EP3786750B1 (en) Data collection system, data collection method, and program
JP3852636B2 (en) Status data collection method and control device
JPH11202932A (en) Plant information collecting and display device
EP1999588A1 (en) An apparatus, method and computer program product for generating trace data
JP4267304B2 (en) Disk array controller
JP3167245B2 (en) Programmable controller operating state monitoring device
JPH02214904A (en) Working state monitor device for programmable controller
JP2005011169A (en) Process event occurrence history and display method
JPH1091477A (en) Control microcomputer device and maintenance tool for the same
JPS6358568A (en) Monitor system for execution of decentralized computer
CN115307668A (en) Vehicle instrument fault analysis method and device
JP2000003269A (en) Plant controller
JPH06295247A (en) Real time processing realizing method
JP4527419B2 (en) Program trace method and trace processing system
JPH08123718A (en) Buffer controller
JPH0125083B2 (en)
JPH0757004A (en) Method for processing production facility information
JPH0281141A (en) Trace control system
JPH05191867A (en) Process supervisory and controlling device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040528

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060724

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060801

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060920

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20061205

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070125

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20070227

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20070301

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100309

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110309

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120309

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130309

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130309

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140309

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees