JP4492778B2 - Communication system in monitoring system - Google Patents
Communication system in monitoring system Download PDFInfo
- Publication number
- JP4492778B2 JP4492778B2 JP2001260660A JP2001260660A JP4492778B2 JP 4492778 B2 JP4492778 B2 JP 4492778B2 JP 2001260660 A JP2001260660 A JP 2001260660A JP 2001260660 A JP2001260660 A JP 2001260660A JP 4492778 B2 JP4492778 B2 JP 4492778B2
- Authority
- JP
- Japan
- Prior art keywords
- communication
- data
- application program
- program
- shared memory
- 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
Links
Images
Landscapes
- Programmable Controllers (AREA)
Description
【0001】
【発明の属する技術分野】
この発明は、複数のアプリケーションプログラムとターゲットシステムとの間で通信データを、通信手段を介して、送受信するモニタリングシステムにおける通信システムに関する。
【0002】
【従来の技術】
従来の通信システムとして、特開平11−327612号に開示のものが知られている。これは複数のモニタ装置がマルチタスクOS上で処理を行っており、あるモニタ装置がプログラマブルコントローラとの間で通信を行う際には、通信を行いたいモニタ装置は自らのモニタIDをモニタID格納手段に格納し、データ要求を送信データ格納手段に格納する。そして1つの通信手段によりデータ要求をプログラムコントローラに対して送信し、通信手段により受信データ格納手段にセットされたプログラムコントローラからのデータ応答をモニタ装置が受け取ると、そのモニタ装置は、モニタID格納手段に格納したモニタIDをリセットし、他のモニタ装置の通信処理を可能とする。あるモニタ装置が通信処理を行っている間、他のモニタ装置はモニタID格納手段を確認しモニタIDがセットされている場合、データ要求を送信データ格納手段に格納できないので、モニタIDがリセットされるまで、通信処理を次の機会まで待つ。これにより、複数のモニタ装置が非同期で通信を行い、複数のプログラマブルコントローラのデータ表示を実行する。
【0003】
【発明が解決しようとする課題】
前記従来の技術に記載のものでは、非同期に複数のモニタ装置(アプリケーションプログラム)が通信を行うことができるが、通信要求を行えるモニタ装置は1つであり、1つのモニタ装置が通信を行っているとき他のモニタ装置はデータ要求(通信データ)をセットすることができず、1つのモニタ装置によって通信処理が完全に占有されてしまう問題があった。また、通信を行いたいモニタ装置は先に通信データをセットしたモニタ装置の通信処理の完了の有無を確認しなければならず、確認処理のため時間がかかると共に通信データをセットしたモニタ手段の通信処理が完了するのを待ち、完了後に通信データをセットするので通信待ちの時間がかかり、通信効率が低い問題があった。また、1つの通信手段により通信が実行されるが、通信手段が複数の通信プロトコルに対応している記載はなく、夫々異なる通信プロトコルにより通信を行うプログラムコントローラ(ターゲットシステム)が混在している場合、通信手段は1つの通信プロトコルに対応しているので同じ種類の通信プロトコルのプログラマブルコントローラとしか通信が行えず、他の通信プロトコルのターゲットシステムと通信を行うことができない問題があった。
この発明の課題は、1つのアプリケーションプログラムの1回の通信要求で通信手段を占有することが無いと共に通信の効率が高く、また、複数の異なる通信プロトコルが混在していても通信可能なモニタリングシステムにおける通信システムを提供することである。
【0004】
【課題を解決するための手段】
前記課題解決のため本願発明は、ターゲットシステムとしてのプログラマブルコントローラとモニタ用のコンピュータとを接続し、コンピュータの複数のアプリケーションプログラムとターゲットシステムとの間で通信データを受け渡しする際に、通信データをコンピュータに備えた通信データ格納手段を介して通信手段によりコンピュータとプログラマブルコントローラ間で送受信するモニタリングシステムにおける通信システムにおいて、前記コンピュータは待ち行列を備えており、通信データ格納手段は、複数のアプリケーションプログラムに対して割当領域を2回以上の通信データを格納可能に複数割り当てることが可能な共有メモリであり、待ち行列は、アプリケーションプログラムによって通信データがセットされた夫々の割当領域を特定するメモリ番号が各アプリケーションプログラムの通信要求順にセットされ、その通信要求順により通信順序を制御するものであり、前記共有メモリに格納される通信データは、前記通信順序を制御する待ち行列に設定された順序に従って通信手段により送受信されることを特徴とする(請求項1)。これによれば、2回(2セット)以上の通信データを格納できる共有メモリを備えているので、1つのアプリケーションプログラムによる通信中にも別のアプリケーションプログラムのデータ要求を共有メモリにセットでき、1つのアプリケーションプログラムによって通信手段が完全に占有されない。また、待ち行列に通信要求順にセットされたメモリ番号に従って通信を行うので、通信時に共有メモリを全て調べ通信データにより通信の有無及び通信順序を確認する必要が無く、そのため通信処理時間が短くなり好ましい。
【0005】
前記通信手段は、各ターゲットシステムと各ターゲットシステムに対応する通信プロトコルとの対応表を備えており、その対応表を参照して、アプリケーションプログラムが通信を要求するターゲットシステムとそのターゲットシステムに対応する通信プロトコルにより通信データの送受信を実行することを特徴とする(請求項2)。通信手段は対応表に基づいて通信プロトコルが異なる複数のターゲットシステムと通信を行えるので好適である。また、アプリケーションプログラムは通信手段を介して各ターゲットシステムと通信を行うので異なるプロトコルのターゲットシステムでも同様に通信が行える。また、アプリケーションプログラムと通信手段とが独立しているので、アプリケーションプログラムを変更すること無く、通信手段のみを変更すれば対応していない通信プロトコルであっても通信可能となり、また、プログラム製作期間を短縮できて好ましい。
【0006】
前記通信手段はマスタの通信マネージャプログラムと各ターゲットシステムに対応する通信プロトコルを備えた複数のスレーブの通信マネージャプログラムとを含んでおり、マスタの通信マネージャプログラムが共有メモリにセットされた通信データに基づき対応表を参照し、通信を行うターゲットシステムに対応するスレーブの通信マネージャプログラムによって通信データを送受信させることを特徴とする(請求項3)。
【0007】
前記共有メモリの一部が共有メモリコントロールプログラムにより割当領域として通信を要求する夫々のアプリケーションプログラムに割り当てられ、アプリケーションプログラムとターゲットシステムの間で通信データの受け渡しが不要となると、そのアプリケーションプログラムの割当領域は共有メモリコントロールプログラムにより解除されることを特徴とする(請求項4)。これによれば、共有メモリの一部が、アプリケーションプログラムとターゲットシステムの間での通信データの受け渡しの要、不要(例えば、アプリケーションプログラムの起動、終了)によって割当領域として各アプリケーションプログラムに対して割り当て、解除されるので、あるアプリケーションプログラムが終了し割当領域が解除されると、通信を要求する他のアプリケーションプログラムにその解除された共有メモリの一部を新たな割当領域として割り当て通信要求をセットできるので、共有メモリを有効に利用でき効率が向上する。また、同一のアプリケーションプログラムが共有メモリに複数の割当領域を割り付けることもできる。
【0009】
共有メモリコントロールプログラムは各アプリケーションプログラムに夫々含まれていることを特徴とする(請求項6)。これによれば、同一の共有メモリコントロールプログラムを夫々のアプリケーションプログラムに組み込み可能なプログラムとしているので、アプリケーションプログラムを作成するごとに再利用でき、アプリケーションプログラムの作成の効率が向上する。
【0010】
アプリケーションプログラムは通信手段を介して、ターゲットシステムとしてのコンピュータのハードウェア内部の記憶装置と通信データの受け渡しを行うことを特徴とする(請求項7)。これによれば、通信手段を介して記憶装置とも通信データの受け渡しを行うので、アプリケーションプログラムに記憶装置のどの領域とデータの受け渡しを行えば良いかを設定する必要が無いと共に、記憶装置の特定のデータ領域を、特定のアプリケーションプログラムの専用のデータ領域とするのではなく、異なるアプリケーションプログラム夫々が利用可能なデータ領域とすることができる。
【0011】
【発明の実施の形態】
本願発明の実施の形態について図1から図8に基づいて説明する。モニタ用のパーソナルコンピュータ(以下PCと記載)とターゲットシステムとしての各プログラマブルコントローラ(以下PLC1〜PLCnと記載)とは、図1に示すように、PC及び各PLC1〜PLCnの夫々の通信インターフェイス(本願実施の形態ではシリアルインターフェイス)1,2を通信ケーブル3により接続してモニタリングシステムを構成している。各PLC1〜PLCnには夫々モニタ対象(例えば工作機械)4が汎用I/O5を介して接続されており、各PLC1〜PLCnはモニタ手段6を備え、夫々のモニタ対象4を制御監視すると共に監視により得られたモニタ情報としての収集データをPCにシリアルインターフェイス1,2経由で送るようになっている。また、PCからは、各PLC1〜PLCnへ、各PLC1〜PLCnに対する設定データをシリアルインターフェイス1,2経由で転送するようになっている。また、PLC1〜PLCm、PLCm+1〜PLCnは夫々異なる通信プロトコルpr1、pr2を備えており、夫々の通信プロトコルに従ってPCとの間で通信処理を行うようになっている。
【0012】
PCは、図1に示すように通信手段としての通信コントロール部7と、複数のアプリケーションプログラムA1〜Anから成るモニタプログラムと、ターゲットシステムの1つであるハードディスク8や作業用メモリ9等の記憶装置とを備えている。通信手段7は、共有メモリ10と待ち行列11とマスタの通信マネージャプログラム12とスレーブの通信マネージャプログラム13〜16と通信インターフェイス2と、図2に示す各ターゲットシステム8,9,PLC1〜PLCnと各ターゲットシステム8,9,PLC1〜PLCnに対応する通信プロトコルで実際の通信を行うスレーブの通信マネージャ13〜16との対応表17とを含んでいる。そして、通信手段7とモニタプログラムと通信インターフェイス1と通信ケーブル3とにより通信システムが構成されている。
【0013】
共有メモリ10は、後述の共有メモリコントロールプログラム18によって、マスタの通信マネージャプログラム12に対してPCに備えられたメモリの一部が割り当てられると共に、その共有メモリ10は、図3に示すように、通信要求をした夫々のアプリケーションプログラムA1〜Anに対して適宜に割当領域を2回以上の通信データを格納可能に複数割当ることができるようになっており、その各割当領域にはアプリケーションプログラムA1〜Anとターゲットシステム8,9,PLC1〜PLCn間で授受される通信データが設定される。通信データは、例えば図4に示すようにターゲットシステムとの通信の完了、未了を示す”1”、”0”が設定される通信フラグ、ターゲットシステムを指定するターゲット指定番号”PLC1”、ターゲットシステムのデバイス(ターゲットシステムの各種データ格納エリア)を指定するデバイス番号”d001”、データ数”12”、読み書き指定コマンド(RまたはW)、どのアプリケーションプログラムA1〜Anの通信要求か”A1”等からなるコマンドと、PCとターゲットシステム間で授受される授受データとを含んでいる。授受データは、異常情報や工程等の稼動状態を示す収集データ、PCからPLC1〜PLCnへの設定データ、HDD等との読書きデータ等を含んでいる。
【0014】
待ち行列11は、夫々のアプリケーションプログラムA1〜Anの通信依頼に対応して共有メモリ10に割り当てられた夫々の割当領域を特定するメモリ番号を割当領域に通信データがセットされた順に記憶し、割当順にマスタの通信マネージャプログラム12に渡す、先入れ先出しシステムであり、例えば順番にメモリ番号”1”、メモリ番号”2”の割当領域に通信データがセットされたとすると、図5(b)に示すように待ち行列11には、順番にメモリ番号”1”、メモリ番号”2”がセットされ、通信の際には、メモリ番号”1”の割当領域の通信データによる通信が行われた後、次にメモリ番号”2”の割当領域の通信データによって通信が行われる。
【0015】
マスタの通信マネージャプログラム12とスレーブの通信マネージャプログラム13〜16とは、アプリケーションプログラムA1〜AnとPLC1〜PLCn間及びアプリケーションプログラムA1〜AnとPCのハードウェア内部の記憶装置との通信を処理するものである。マスタの通信マネージャプログラム12は、後述の共有メモリコントロールプログラム18を含み、アプリケーションプログラムA1〜Anからの通信要求に応じ、共有メモリ10に格納されたアプリケーションプログラムA1〜Anからの通信データに基づいてどのターゲットシステム8,9,PLC1〜PLCnと通信を行いたいかを確認し、通信要求先となるターゲットシステム8,9,PLC1〜PLCnと対応する通信プロトコルを備えたスレーブの通信マネージャプログラム13〜16を対応表17を参照して選定し、そのスレーブの通信マネージャプログラム13〜16に通信の指示を出し、コマンドで指定されたターゲットシステム8,9,PLC1〜PLCnとの間で送受信が行われた通信データを共有メモリ10に読書きする。
【0016】
各スレーブの通信マネージャプログラム13〜16は、夫々のターゲットシステム8,9,PLC1〜PLCnの通信プロトコルpr1〜pr4に対応しており、マスタの通信マネージャプログラム12からの指令により、実際にコマンドで指定されたターゲットシステム8,9,PLC1〜PLCnとの間でデータ通信を行うものである。スレーブの通信マネージャプログラム13〜16は通信インターフェイス1,2としてシリアルインターフェイスが利用される場合にはシリアルインターフェイスに対応したものが、通信インターフェイス1,2としてLANが利用される場合にはLANに対応したものが夫々通信手段7に組み込まれ、また、同一の通信インターフェイス1,2であっても、例えば、メーカー毎にPLC1〜PLCnの通信プロトコルが異なれば、通信プロトコルの種類だけ通信手段7に組み込まれる。本願実施の形態では、通信手段7には、PLC1〜PLCmの通信プロトコルpr1とPLCm+1〜PLCnの通信プロトコルpr2とハードディスク8の通信プロトコルpr3と作業用メモリ9の通信プロトコルpr4の各通信プロトコルに夫々対応して4つのスレーブの通信マネージャ13〜16が組み込まれている。
【0017】
共有メモリコントロールプログラム18は、マスタの通信マネージャプログラム12に組み込まれた場合には、前記のようにマスタの通信マネージャプログラム12に共有メモリ10を割り当てる共有メモリ割当手段として、また、アプリケーションプログラムA1〜Anに組み込まれた場合には、その共有メモリ10を、図3に示すように、通信要求元のアプリケーションプログラムA1〜Anに割当領域として割り当てまたは開放する割当領域操作手段として機能し、更に、これら共有メモリ10と割当領域の位置と大きさを記憶すると共に夫々の割当領域と対応してメモリ番号を記憶し、そのメモリ番号を待ち行列11に格納する。また、共有メモリコントロールプログラム18は、マスタの通信マネージャプログラム12と夫々のアプリケーションプログラムA1〜Anとに組み込み可能なプログラムとして製作されており、マスタの通信マネージャプログラム12及びアプリケーションプログラムA1〜Anを製作する際に再利用でき、プログラム製作の効率を向上できる。
【0018】
図6は、マスタの通信マネージャプログラム12のフローチャートを示すものであり、各ステップは機能実現手段を示している。ステップS61は、初期設定として待ち行列11をPCのメモリに設定すると共に共有メモリコントロールプログラム18によって共有メモリ10を確保する初期設定手段である。ステップS63は、待ち行列11を調べ、メモリ番号が格納されているか判別し、メモリ番号が格納されている場合、メモリ番号の格納順によって共有メモリ10に格納された通信データの通信順序を確認する通信順確認手段である。ステップS64は、待ち行列11に格納された通信順序が最先となっているメモリ番号に対応した割当領域の通信データの内容を確認する通信データ確認手段である。ステップS65は、確認した通信データのターゲット指定番号から図2に示す対応表17を参照してターゲットシステム8,9,PLC1〜PLCnに対応するスレーブの通信マネージャプログラム13〜16を選択し、そのスレーブの通信マネージャプログラム13〜16に共有メモリ10から通信データを受け渡し、通信を行わせる通信指令手段である。ステップS66は、スレーブの通信マネージャの通信完了待ち手段であり、ステップS67は、スレーブの通信マネージャプログラム13〜16がターゲットシステム8,9,PLC1〜PLCnとの間で授受した通信データを受取り、通信フラグを通信の未了を示す”0”から通信の完了を示す”1”に変更し、その通信データを共有メモリ10の元の割当領域に再びセットするセット手段である。ステップS68は、ターゲットシステム8,9,PLC1〜PLCnとの間で通信データの送受信が完了すると、通信データに設定されているアプリケーションプログラムA1〜Anに通信完了メッセージを通知する通信完了通知手段である。
【0019】
ステップS69は、アプリケーションプログラムA1〜Anが共有メモリ10に割当領域を確保し、その割当領域に通信データをセットしたことを示す割当領域操作用のメッセージがアプリケーションプログラムA1〜Anから通知されると、そのメッセージを受け取りステップS63〜ステップS68の間で割り込みを行う割り込み手段であり、ステップS610は、割当領域操作用のメッセージにより、アプリケーションプログラムA1〜Anにより通信データがセットされた割当領域にメモリ番号を付与し、そのメモリ番号を待ち行列11にセットするメモリ番号セット手段であり、ステップS69、S610は、マスタの通信マネージャプログラム12に含まれる共有メモリコントロールプログラム18により実行される。
【0020】
図7は、各スレーブの通信マネージャプログラム13〜16のフローチャートを示すものであり、各ステップは機能実現手段を示している。ステップS71はマスタの通信マネージャプログラム12からの通信指令と共に通信データを受け取る通信データ受取手段であり、ステップS72は通信データに基づいてターゲットシステム8,9,PLC1〜PLCnと対応する通信プロトコルpr1〜pr4で通信を行い、通信データを送受信する通信処理手段であり、ステップS73はターゲットシステム8,9,PLC1〜PLCnとの間で通信データの送受信が完了すると、通信完了メッセージをマスタの通信マネージャプログラム12に送信すると共にその通信が完了した通信データをマスタの通信マネージャプログラム12に渡す通信完了通知手段である。
【0021】
図8は、モニタプログラムを構成する各アプリケーションプログラムA1〜Anの概要を示すフローチャートであり、ステップ81は、初期設定手段であり、アプリケーションプログラムがターゲットシステム8,9,PLC1〜PLCnとの間で通信が必要となると、アプリケーションプログラムA1〜Anに組み込まれた共有メモリコントロールプログラム18によって共有メモリ10に割当領域を確保し、その割当領域に通信フラグを”1”に設定した通信データを設定する。ステップS82は、ターゲットシステム8,9,PLC1〜PLCnの設定、収集データを適宜に表示または記録する等の適宜な通常動作を行う通常動作手段である。ステップS83は、アプリケーションプログラムの終了(PLCとの通信データの受け渡しの必要、不要)を判別する手段である。ステップS84は、マスタの通信マネージャプログラム12からの通信完了メッセージを受け取ったかを判断するメッセージ受取判別手段であり、ステップS85は、割当領域の通信データの通信フラグが”1”であるかを判別するフラグ判別手段であり、ステップS86は、割当領域に通信フラグを”0”とした通信データをセットし、割当領域操作用のメッセージ(通信データセットメッセージ)をマスタの通信マネージャプログラム12に通知する通信データセット手段である。ステップS87はステップS84でマスタの通信マネージャプログラム12から通信完了メッセージを受け取ると、割当領域にセットされている通信データを受け取る通信データ受取手段である。ステップS88はアプリケーションプログラムの終了設定手段であり、共有メモリコントロールプログラム18によって割当領域を開放して、そのメモリ開放を通知する割当領域操作用のメッセージ(割当領域開放メッセージ)をマスタの通信マネージャプログラム12に通知するメモリ開放手段である。
【0022】
次に作用について説明する。PCはマルチタスクオペレーティングシステムを搭載しており、複数のプログラムを常時並列処理することが可能となっている。PC及び各PLC1〜PLCnの起動動作の後、各PLC1〜PLCnではモニタ対象4のデータ収集等が行われ、また、PCでは、マスタ及びスレーブの通信マネージャプログラム12、13〜16と各アプリケーションプログラムA1〜Anが実行される。マスタの通信マネージャプログラム12は、ステップS61で初期設定を行い、共有メモリコントロールプログラム18によって共有メモリ10を確保すると共に待ち行列11を確保し、待ち行列11にメモリ番号を設定するまでステップS62、S63を繰り返し待機している。
【0023】
また、夫々のアプリケーションプログラムA1〜Anが実行されると、ステップS81〜S87を実行し、各アプリケーションプログラムA1〜Anが夫々ターゲットシステム8,9,PLC1〜PLCnと通信手段7を介して通信データの授受を行い、その通信データを用いて通常動作を行う。例えば、アプリケーションプログラムA1が実行されると、先ずステップS81で初期設定として共有メモリ10の適宜な範囲(共有メモリ10の空いている領域)に割当領域を確保し、その割当領域に通信フラグが”1”の通信データをセットする。次にステップS82で通常動作が行われ、ターゲットシステムとしてのPLC1との通信を要求すると、ステップS83を介して、ステップS84でマスタの通信マネージャ12から通信完了メッセージが通知されたかを確認し、「NO」なのでステップS85に進む。ステップS85では、通信フラグが”1”なのでステップS86に進み、ステップS81で確保された割当領域に図3のように通信フラグを”0”とした通信データをセットし通信データセットメッセージをマスタの通信マネージャプログラム12に通知する。そして、マスタの通信マネージャ12から通信完了メッセージが通知されるまでステップS82〜S85を繰り返す。
【0024】
ステップS86で通信データセットメッセージが出力されると、マスタの通信マネージャプログラム12ではステップS69,S610が実行され、アプリケーションプログラムA1の通信データがセットされた割当領域にマスタの通信マネージャプログラム12によりメモリ番号”1”が付与され、図5(a)のように待ち行列11にメモリ番号”1”がセットされる。マスタの通信マネージャプログラム12は、ステップS63で待ち行列11にメモリ番号がセットされていることを確認すると、ステップS64〜S68を実行する。待ち行列11にセットされたメモリ番号”1”が通信順の先頭となると(図5(b))、ステップS64、S65でメモリ番号”1”の割当領域にセットされた通信データを確認し、対応表17を参照してPLC1の通信プロトコルpr1を備えたスレーブの通信マネージャプログラム13に通信データを渡し、ステップS66でスレーブの通信マネージャプログラム13によるPLC1との通信の完了を待つ。スレーブの通信マネージャプログラム13は、ステップS71〜S73により、マスタの通信マネージャプログラム12から通信データを受け取るとPLC1と通信を行って通信データを送受信し、その通信データをマスタの通信マネージャプログラム12に渡す。マスタの通信マネージャプログラム12は、ステップS67、S68で、そのPLC1との間で授受された通信データの通信フラグを通信の未完を示す”0”から通信の完了を示す”1”に変更してメモリ番号”1”の割当領域にセットし、通信完了メッセージをアプリケーションプログラムA1に通知する。
【0025】
するとアプリケーションプログラムA1はステップS84で通信完了メッセージを受け取り、ステップS87に進んで通信データを割当領域から受け取り、ステップS82に戻って通信データを用いて通常動作を行い、再びステップS82〜S87を繰り返し、メモリ番号1の割当領域に新たな通信データをセットしてターゲットシステム8,9,PLC1〜PLCnの何れかと通信を行う。また、ステップS83で、例えばアプリケーションプログラムA1の終了により、アプリケーションプログラムA1とPLC1との間で通信データの受け渡しが不要となると、ステップS88に進み、終了設定を行い、割当領域を開放して割当領域開放メッセージをマスタの通信マネージャプログラム12に通知する。
【0026】
また、メモリ番号”1”が待ち行列11にセットされた後、アプリケーションプログラムA3が実行され作業メモリ9との通信を要求すると、前記アプリケーションプログラムA1とPLC1との通信のように、ステップS81で初期設定を行って割当領域を確保し、ステップS82〜S85を介してステップS86で共有メモリ10に割り当てられた割当領域に通信データをセットし、ステップS69、S610で待ち行列11にメモリ番号”2”がメモリ番号”1”の次にセットされる(図5(b))。通信順序が先のメモリ番号”1”の割当領域にセットされた通信データによる通信が行われ、メモリ番号”2”が待ち行列の先頭となると(図5(c))、ステップS64、S65で対応表17が参照され、作業用メモリ9との通信プロトコルpr4を備えたスレーブの通信マネージャプログラム16に通信データが渡され、ステップS71〜S73によりスレーブの通信マネージャプログラム16によって作業メモリ9との間で通信データの授受が行われる。そして、ステップS66を介して、ステップS67、S68及びステップS84、S87によりマスタの通信マネージャプログラム12によってメモリ番号”2”の割当領域にセットされた通信後の通信データをアプリケーションプログラムA3が受け取る。このように複数の通信データを通信手段7にセットできるので、1セットの通信によって通信手段7が占有されない。
【0027】
尚、このとき、先のメモリ番号”1”の通信データ、即ちPLC1との間の通信が行われていても、作業用メモリ9との通信はPLC1との通信プロトコルpr1と異なる通信プロトコルpr4のスレーブの通信マネージャプログラム16によって行われるので、同時に通信が実行されるようにしても良い。また、先に行われている通信と次に行われる通信が同じ通信プロトコルのスレーブの通信マネージャプログラムで実行される場合には、本願実施の形態では1つの通信プロトコルに1つのスレーブの通信マネージャプログラムが対応しているので、先の通信が終わった後、次の通信が行われる。また、各アプリケーションプログラムA1〜Anは、共有メモリ10に複数の割当領域を確保することもでき、例えば図3のようにアプリケーションプログラムA1はメモリ番号1,3の割当領域を確保することができ、夫々に通信データをセットすることが可能である。
【0028】
前記のように、アプリケーションプログラムとターゲットシステムの間で通信データの受け渡しが不要となると、共有メモリ10から割当領域を開放するので、共有メモリ10の一部が割当領域として割り当てられたアプリケーションプログラムに占有されることが無く、その共有メモリの空き部分にアプリケーションプログラムA1〜Anが新たな割当領域を確保して通信データをセットでき、通信の処理効率が向上する。また、PCとターゲットシステム8,9,PLC1〜PLCn間の通信は、マスタの通信マネージャプログラム12がスレーブの通信マネージャプログラム13〜16に実行させ、アプリケーションプログラムA1〜Anとの通信データの受け渡しは共有メモリ10を介して、マスタの通信マネージャプログラム12が処理するので、アプリケーションプログラムA1〜Anは通信プロトコルpr1〜pr4の違いを意識せずに通信プロトコルの異なるターゲットシステム8,9,PLC1〜PLCnと同じ操作で通信を行える。
【0029】
【発明の効果】
以上のように本願発明では、2回(2セット)以上の通信データを格納可能な共用メモリを備え、共用メモリに格納された通信データを通信順序を制御する待ち行列に設定された順序に従って通信手段により送受信するので、PCとPLC間で通信が行われていても共用メモリに通信データをセットできるので、1回の通信によって通信手段が占有されず、通信効率が向上する。また、通信手段は通信プロトコルに対応する対応表を備え、その対応表を参照して通信プロトコルが異なる複数のターゲットシステムとの間で通信データの送受信を実行できる。また、待ち行列にアプリケーションプログラムの通信要求順にセットされるメモリ番号に従って通信が行われるので、待ち行列が無い場合のように通信時に直接共有メモリを調べ、通信データの有無及び通信順序を確認するプロセスが不要となり、通信処理時間が短くなり効率が向上する。
【図面の簡単な説明】
【図1】全体構成を示すブロック図である。
【図2】対応表を示す図である。
【図3】共有メモリを示す図である。
【図4】通信データを示す説明図である。
【図5】待ち行列を示す説明図である。
【図6】マスタの通信マネージャプログラムのフローチャートである。
【図7】スレーブの通信マネージャプログラムのフローチャートである。
【図8】アプリケーションプログラムのフローチャートである。
【符号の説明】
7 通信手段
8、9 記憶装置(ターゲットシステム)
10 通信データ格納手段(共有メモリ)
11 待ち行列
12 マスタの通信マネージャプログラム
13〜16 スレーブの通信マネージャプログラム
17 対応表
18 共有メモリコントロールプログラム
A1〜An アプリケーションプログラム
PC コンピュータ
PLC1〜PLCn プログラマブルコントローラ(ターゲットシステム)[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a communication system in a monitoring system that transmits and receives communication data between a plurality of application programs and a target system via communication means.
[0002]
[Prior art]
As a conventional communication system, one disclosed in JP-A-11-327612 is known. This is because multiple monitor devices perform processing on the multitasking OS, and when a certain monitor device communicates with the programmable controller, the monitor device that wants to communicate stores its monitor ID in the monitor ID. The data request is stored in the transmission data storage unit. Then, when the monitor device receives a data response from the program controller set in the received data storage means by the communication means by one communication means, the monitor device receives the monitor ID storage means. The monitor ID stored in is reset to enable communication processing of other monitor devices. While one monitor device is performing communication processing, when another monitor device checks the monitor ID storage means and the monitor ID is set, the monitor ID is reset because the data request cannot be stored in the transmission data storage means. Until the next opportunity. Thereby, a some monitor apparatus communicates asynchronously and performs the data display of a some programmable controller.
[0003]
[Problems to be solved by the invention]
In the prior art described above, a plurality of monitor devices (application programs) can communicate asynchronously, but only one monitor device can make a communication request, and one monitor device communicates. The other monitor devices cannot set data requests (communication data), and there is a problem that the communication processing is completely occupied by one monitor device. In addition, the monitoring device that wants to communicate must confirm whether or not the communication processing of the monitoring device that has previously set the communication data is completed, and it takes time for the confirmation processing and the communication of the monitoring means that has set the communication data There is a problem in that the communication efficiency is low because it waits for the processing to complete and communication data is set after the processing is completed, so that it takes time to wait for communication. In addition, communication is executed by one communication means, but there is no description that the communication means supports a plurality of communication protocols, and there are mixed program controllers (target systems) that communicate by different communication protocols. Since the communication means corresponds to one communication protocol, it can communicate only with a programmable controller of the same type of communication protocol and cannot communicate with a target system of another communication protocol.
An object of the present invention is to provide a monitoring system that does not occupy a communication means with a single communication request of one application program, has high communication efficiency, and can communicate even when a plurality of different communication protocols coexist. A communication system is provided.
[0004]
[Means for Solving the Problems]
In order to solve the above-mentioned problems, the present invention connects a programmable controller as a target system and a monitor computer, and exchanges communication data between a plurality of application programs of the computer and the target system. In the communication system in the monitoring system that transmits and receives between the computer and the programmable controller by the communication means via the communication data storage means provided in theThe computer has a queue;The communication data storage meansAssign allocation areas for multiple application programsCan store communication data more than onceMultiple assignments toShared memory,The queue is a memory number for identifying each allocation area in which communication data is set by the application program is set in the communication request order of each application program, and controls the communication order according to the communication request order.Communication data stored in shared memory isSaidTransmission and reception are performed by the communication means in accordance with the order set in the queue for controlling the communication order (claim 1). According to this, since a shared memory capable of storing communication data twice (two sets) or more is provided, a data request of another application program can be set in the shared memory even during communication by one application program. One application program does not completely occupy the communication means.Further, since communication is performed according to the memory numbers set in the queue in the order of communication request, it is not necessary to check all shared memories during communication and to confirm the presence / absence of communication and the communication order with communication data, which is preferable because communication processing time is shortened. .
[0005]
The communication means includes a correspondence table between each target system and a communication protocol corresponding to each target system, and refers to the correspondence table and corresponds to the target system to which the application program requests communication and the target system. Transmission / reception of communication data is executed by a communication protocol (claim 2). The communication means is preferable because it can communicate with a plurality of target systems having different communication protocols based on the correspondence table. Further, since the application program communicates with each target system via the communication means, communication can be performed in the same manner even with target systems of different protocols. In addition, since the application program and the communication means are independent, it is possible to communicate even if the communication protocol is not supported by changing only the communication means without changing the application program. This is preferable because it can be shortened.
[0006]
The communication means includes a master communication manager program and a plurality of slave communication manager programs having a communication protocol corresponding to each target system. The master communication manager program is based on communication data set in a shared memory. Referring to the correspondence table, communication data is transmitted and received by a slave communication manager program corresponding to a target system for communication (claim 3).
[0007]
When a part of the shared memory is allocated to each application program that requests communication as an allocation area by the shared memory control program, and no communication data needs to be transferred between the application program and the target system, the allocation area of the application program Is released by the shared memory control program. According to this, a part of the shared memory is allocated to each application program as an allocation area depending on whether or not communication data needs to be transferred between the application program and the target system (for example, activation and termination of the application program). Therefore, when an application program is terminated and the allocation area is released, an allocation communication request can be set to another application program that requests communication by using a part of the released shared memory as a new allocation area. Therefore, the shared memory can be used effectively and the efficiency is improved. The same application program can also allocate a plurality of allocation areas to the shared memory.
[0009]
The shared memory control program is included in each application program (claim 6). According to this, since the same shared memory control program can be incorporated into each application program, it can be reused every time an application program is created, and the efficiency of creating the application program is improved.
[0010]
The application program exchanges communication data with a storage device in the hardware of the computer as the target system via the communication means (claim 7). According to this, since communication data is transferred to and from the storage device via the communication means, it is not necessary to set which area of the storage device and data should be transferred to the application program and specify the storage device. These data areas can be used as data areas that can be used by different application programs, rather than as dedicated data areas for specific application programs.
[0011]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described with reference to FIGS. As shown in FIG. 1, a personal computer for monitoring (hereinafter referred to as PC) and each programmable controller (hereinafter referred to as PLC1 to PLCn) as a target system are each a communication interface (this application) of the PC and each of PLC1 to PLCn. In the embodiment, the serial interface) 1 and 2 are connected by a
[0012]
As shown in FIG. 1, the PC includes a
[0013]
In the shared
[0014]
The queue 11 stores memory numbers for identifying the respective allocation areas allocated to the shared
[0015]
The master
[0016]
The communication manager programs 13 to 16 of each slave correspond to the communication protocols pr1 to pr4 of the
[0017]
When the shared memory control program 18 is incorporated in the master
[0018]
FIG. 6 shows a flowchart of the master
[0019]
In step S69, when the application program A1 to An secures an allocation area in the shared
[0020]
FIG. 7 shows a flowchart of the communication manager programs 13 to 16 of each slave, and each step shows a function realizing means. Step S71 is a communication data receiving means for receiving communication data together with a communication command from the master
[0021]
FIG. 8 is a flowchart showing an outline of each of the application programs A1 to An constituting the monitor program. Step 81 is an initial setting means, and the application program communicates with the
[0022]
Next, the operation will be described. The PC is equipped with a multitasking operating system and can always process a plurality of programs in parallel. After the start-up operation of the PC and each of the
[0023]
Further, when the respective application programs A1 to An are executed, steps S81 to S87 are executed, and the application programs A1 to An are transferred to the
[0024]
When the communication data set message is output in step S86, the master
[0025]
Then, the application program A1 receives a communication completion message in step S84, proceeds to step S87 to receive communication data from the allocation area, returns to step S82 to perform normal operation using the communication data, and repeats steps S82 to S87 again. New communication data is set in the allocation area of the
[0026]
Further, after the memory number “1” is set in the queue 11, when the application program A3 is executed and communication with the
[0027]
At this time, even if communication with the previous memory number “1”, that is, communication with the
[0028]
As described above, when it is not necessary to transfer communication data between the application program and the target system, the allocation area is released from the shared
[0029]
【The invention's effect】
As described above, the present invention includes a shared memory capable of storing communication data twice (two sets) or more, and communicates the communication data stored in the shared memory according to the order set in the queue for controlling the communication order. Since transmission / reception is performed by means, communication data can be set in the shared memory even if communication is performed between the PC and the PLC. Therefore, the communication means is not occupied by one communication, and communication efficiency is improved. Further, the communication means includes a correspondence table corresponding to the communication protocol, and communication data can be transmitted / received to / from a plurality of target systems having different communication protocols with reference to the correspondence table. Also, since communication is performed according to the memory number set in the queue in the order of the communication request of the application program, the process of directly checking the shared memory at the time of communication as if there is no queue and confirming the presence of communication data and the communication order Becomes unnecessary, the communication processing time is shortened, and the efficiency is improved.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an overall configuration.
FIG. 2 is a diagram showing a correspondence table.
FIG. 3 is a diagram illustrating a shared memory.
FIG. 4 is an explanatory diagram showing communication data.
FIG. 5 is an explanatory diagram showing a queue.
FIG. 6 is a flowchart of a master communication manager program.
FIG. 7 is a flowchart of a slave communication manager program.
FIG. 8 is a flowchart of an application program.
[Explanation of symbols]
7 Communication means
8, 9 Storage device (target system)
10 Communication data storage means (shared memory)
11 Queue
12 Master communication manager program
13-16 Slave communication manager program
17 Correspondence table
18 Shared memory control program
A1-An application program
PC computer
PLC1 to PLCn Programmable controller (target system)
Claims (6)
前記コンピュータは待ち行列を備えており、通信データ格納手段は、複数のアプリケーションプログラムに対して割当領域を2回以上の通信データを格納可能に複数割り当てることが可能な共有メモリであり、待ち行列は、アプリケーションプログラムによって通信データがセットされた夫々の割当領域を特定するメモリ番号が各アプリケーションプログラムの通信要求順にセットされ、その通信要求順により通信順序を制御するものであり、前記共有メモリに格納される通信データは、前記通信順序を制御する待ち行列に設定された順序に従って通信手段により送受信されることを特徴とするモニタリングシステムにおける通信システム。When a programmable controller as a target system is connected to a monitor computer and communication data is exchanged between a plurality of application programs of the computer and the target system, the communication data is stored via communication data storage means provided in the computer. In a communication system in a monitoring system that transmits and receives between a computer and a programmable controller by communication means,
The computer includes a queue, the communication data storage means is a shared memory that can be allocated a plurality of assigned areas for a plurality of application program capable of storing two or more communication data, queue A memory number for identifying each allocation area in which communication data is set by the application program is set in the order of communication requests of each application program, and the communication order is controlled according to the order of communication requests, and stored in the shared memory. communication data, the communication system in the monitoring system, characterized in that transmitted and received by the communication means in accordance with the set order in the queue for controlling the communication order that.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001260660A JP4492778B2 (en) | 2001-08-30 | 2001-08-30 | Communication system in monitoring system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2001260660A JP4492778B2 (en) | 2001-08-30 | 2001-08-30 | Communication system in monitoring system |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2003067014A JP2003067014A (en) | 2003-03-07 |
JP4492778B2 true JP4492778B2 (en) | 2010-06-30 |
Family
ID=19087829
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2001260660A Expired - Fee Related JP4492778B2 (en) | 2001-08-30 | 2001-08-30 | Communication system in monitoring system |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4492778B2 (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5217971B2 (en) * | 2008-11-28 | 2013-06-19 | 豊和工業株式会社 | Data communication system |
KR101419558B1 (en) * | 2009-09-02 | 2014-07-14 | 엘에스산전 주식회사 | Monitoring system of plc system and monitoring method of plc system using the same |
JP6717026B2 (en) * | 2016-04-19 | 2020-07-01 | オムロン株式会社 | Control device, relay device, control device control method, relay device control method, control program, and recording medium |
JP7013934B2 (en) * | 2018-02-26 | 2022-02-01 | オムロン株式会社 | controller |
KR102439610B1 (en) * | 2021-04-02 | 2022-09-01 | 엘에스일렉트릭(주) | Method for Data Communication with Programmable Logic Controller |
KR102543841B1 (en) * | 2021-04-06 | 2023-06-14 | 엘에스일렉트릭(주) | Efficient slave parameter management method of communication-based control system, and apparatus thereof |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS57161962A (en) * | 1981-03-31 | 1982-10-05 | Hitachi Ltd | Communicating method between processors |
JPH03252742A (en) * | 1990-03-01 | 1991-11-12 | Nec Corp | Inter-task data transmission/reception system for multitask os |
JPH0736370A (en) * | 1993-07-26 | 1995-02-07 | Mitsubishi Electric Corp | Data transmitting and receiving system, and method therefor |
JPH0773151A (en) * | 1993-06-29 | 1995-03-17 | Mitsubishi Electric Corp | Inter-processor communication method |
JPH08149103A (en) * | 1994-11-21 | 1996-06-07 | Oki Electric Ind Co Ltd | Data communication method using shared memory |
JPH09190375A (en) * | 1996-01-09 | 1997-07-22 | Toshiba Corp | Shared memory management method |
JPH11231924A (en) * | 1998-02-10 | 1999-08-27 | Yaskawa Electric Corp | Command generating and monitoring device for different controllers |
JPH11327612A (en) * | 1998-05-07 | 1999-11-26 | Toyo Electric Mfg Co Ltd | Programmable controller monitoring device |
JP2000148426A (en) * | 1998-11-06 | 2000-05-30 | Ricoh Co Ltd | Device and method for socket management |
-
2001
- 2001-08-30 JP JP2001260660A patent/JP4492778B2/en not_active Expired - Fee Related
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS57161962A (en) * | 1981-03-31 | 1982-10-05 | Hitachi Ltd | Communicating method between processors |
JPH03252742A (en) * | 1990-03-01 | 1991-11-12 | Nec Corp | Inter-task data transmission/reception system for multitask os |
JPH0773151A (en) * | 1993-06-29 | 1995-03-17 | Mitsubishi Electric Corp | Inter-processor communication method |
JPH0736370A (en) * | 1993-07-26 | 1995-02-07 | Mitsubishi Electric Corp | Data transmitting and receiving system, and method therefor |
JPH08149103A (en) * | 1994-11-21 | 1996-06-07 | Oki Electric Ind Co Ltd | Data communication method using shared memory |
JPH09190375A (en) * | 1996-01-09 | 1997-07-22 | Toshiba Corp | Shared memory management method |
JPH11231924A (en) * | 1998-02-10 | 1999-08-27 | Yaskawa Electric Corp | Command generating and monitoring device for different controllers |
JPH11327612A (en) * | 1998-05-07 | 1999-11-26 | Toyo Electric Mfg Co Ltd | Programmable controller monitoring device |
JP2000148426A (en) * | 1998-11-06 | 2000-05-30 | Ricoh Co Ltd | Device and method for socket management |
Also Published As
Publication number | Publication date |
---|---|
JP2003067014A (en) | 2003-03-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7984217B2 (en) | Data transmission method, serial bus system, and switch-on unit for a passive station | |
JP6717026B2 (en) | Control device, relay device, control device control method, relay device control method, control program, and recording medium | |
US6101425A (en) | Multiple connection networked man-machine interfaces for computer numerical controls | |
JPS6135586B2 (en) | ||
JP4492778B2 (en) | Communication system in monitoring system | |
JPH07143202A (en) | Method for constituting system, method for constituting device, controller and system | |
JP6662819B2 (en) | Control system | |
JP2577600B2 (en) | Flexible production system | |
KR920004061B1 (en) | A system for reconstructing i/o control system | |
JP3080827B2 (en) | Multiplexing interface for file device and control method therefor | |
JP3538155B2 (en) | USB connection port display method | |
WO2000072099A1 (en) | Peripheral device of programmable controller | |
JP7361669B2 (en) | Control device | |
JP5217971B2 (en) | Data communication system | |
JP3005379B2 (en) | Communication system between programmable controllers | |
JPH07131502A (en) | Communication controller | |
JPH0736370A (en) | Data transmitting and receiving system, and method therefor | |
JPH04144337A (en) | Communication system | |
JP3368626B2 (en) | Data processing device | |
JPS60263208A (en) | Factory automation system | |
JP2024107524A (en) | Multi-core systems | |
JPH0716162Y2 (en) | NC machine controller | |
JP3227273B2 (en) | Link processing method of programmable controller | |
JPH01296306A (en) | Network constitution for plural numerical controller | |
JPH08221106A (en) | Programmable controller |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20080609 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20091209 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20091214 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20100203 |
|
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: 20100317 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4492778 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100330 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130416 Year of fee payment: 3 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140416 Year of fee payment: 4 |
|
LAPS | Cancellation because of no payment of annual fees |