Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP4500484B2 - Controller and information communication service method - Google Patents
[go: Go Back, main page]

JP4500484B2 - Controller and information communication service method - Google Patents

Controller and information communication service method Download PDF

Info

Publication number
JP4500484B2
JP4500484B2 JP2002211508A JP2002211508A JP4500484B2 JP 4500484 B2 JP4500484 B2 JP 4500484B2 JP 2002211508 A JP2002211508 A JP 2002211508A JP 2002211508 A JP2002211508 A JP 2002211508A JP 4500484 B2 JP4500484 B2 JP 4500484B2
Authority
JP
Japan
Prior art keywords
service
task
controller
priority
communication
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
JP2002211508A
Other languages
Japanese (ja)
Other versions
JP2004054622A (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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2002211508A priority Critical patent/JP4500484B2/en
Publication of JP2004054622A publication Critical patent/JP2004054622A/en
Application granted granted Critical
Publication of JP4500484B2 publication Critical patent/JP4500484B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、産業応用向けの製造ライン装置やロボットを監視制御するプログラマブルコントローラ、ビル内や家庭内の空調機器,セキュリティ機器,照明機器,エレベータなどの種々の装置を監視制御するプログラマブルコントローラ、電力,ガス,水道などのインフラストラクチャを支える機器を監視制御するプログラマブルコントローラに係り、特に、インターネットに代表される情報通信ネットワークに接続されWeb通信するコントローラまたはXMLを用いて通信するコントローラに関する。
【0002】
【従来の技術】
情報通信ネットワークに対応するWebサーバを搭載したコントローラの従来技術としては、例えば、特開平11-24716号公報に記載されたプログラマブルコントローラがある。
【0003】
図27は、従来のWebサーバ機能を搭載したプログラマブルコントローラの基本構成を示すブロック図である。プログラマブルコントローラ(本体)1は、プログラマブルコントローラのシーケンスプログラムを実行するシーケンス制御手段11と、図示しない入出力モジュールとの間でデータを入出力する入出力処理12と、プログラマブルコントローラの実行状態を制御しモニタする実行状態制御モニタ13と、従来のプログラミングツールとの通信を処理する通信処理14と、Webサーバ15と、プログラマブルコントローラ1が装備する監視制御機能をメニュー形式で表現したテキストを格納するHTMLテキスト格納手段16とからなる。
【0004】
プログラマブルコントローラ1とコンピュータ3とは、Ethernet(登録商標)などのネットワーク2で接続されている。コンピュータ3は、Webブラウザを搭載していれば、パーソナルコンピュータでも、ワークステーション3でもよい。
【0005】
コンピュータ3が、汎用Webブラウザを実行し、プログラマブルコントローラ1のHTMLテキストを指定すると、プログラマブルコントローラ1のWebサーバ15は、HTTPによる読み出し要求を実行し、HTMLテキスト格納手段16に格納されているHTMLテキストをコンピュータ3に返送する。
【0006】
より詳細に記述すると、HTMLテキストが、汎用Webブラウザに読み込まれ、プログラマブルコントローラ1がサポートする監視制御機能をWebサービスとしてメニュー形式で表示する。
【0007】
メニューにハイパーテキストで表示されているWebサービス項目を選択して、ハイパーテキストにリンクされているCGI(Common Gateway Interface)を呼び出せば、Webサーバ15は、従来のプログラミングツールと通信する通信処理14を呼び出す。
【0008】
通信処理14は、従来と同様のプログラマブルコントローラ専用のコマンドで実行状態制御モニタ13に要求を送る。通信処理14は、実行状態制御モニタ13からの応答をHTMLテキスト形式でWebサーバ15に返送する。
【0009】
Webサーバ15は、その応答をHTMLテキスト形式でコンピュータ3に返送し、実行中の汎用HTMLブラウザに表示させる。
【0010】
この種の従来技術には、特開2000-100810号公報,特開平11-161322号公報,特開平11-249717号公報,USP6,061,603に記載されたコントローラがある。
【0011】
【発明が解決しようとする課題】
上記従来のプログラマブルコントローラ1において、Webサーバ15に代表される情報通信サービスの問題は、人と機器との間の情報のやりとりを改善することを主目的としており、機器と機器との間の通信制御で重要なサービスのリアルタイム処理を保証する機能を備えていないことである。
【0012】
例えば、人がパーソナルコンピュータ3のWebブラウザを操作してプログラマブルコントローラ1の情報を監視しようとする時に、ある制御機器がプログラマブルコントローラ1の制御データを至急要求しているとする。
【0013】
もし、パーソナルコンピュータ3からプログラマブルコントローラ1への通信の方が、制御機器からプログラマブルコントローラ1への通信よりも少しでも先に実行されれば、プログラマブルコントローラ1のWebサーバは、外部からの通信を先着順に処理をするので、パーソナルコンピュータ3からの通信の処理が終了しないと、制御機器から至急要求されている通信は、処理されない。
【0014】
このように、制御機器からの通信は,例えばコンマ何秒といったリアルタイム処理が要求されているにもかかわらず、他の通信によりも、応答速度が悪化してしまう可能性がある。
【0015】
一方で、パーソナルコンピュータからの通信の処理は、人がWebブラウザを監視しているのであるから、応答速度はあまり要求されず、例えばプログラマブルコントローラ1からの応答が2〜3秒後と返されたとしても、大きな問題にはならない。
【0018】
本発明の目的は、Webサーバに代表される情報通信サービスのリアルタイム処理機能を強化し、機器と機器との間の通信制御への適用範囲を広げる手段を備えたプログラマブルコントローラを提供することである。
【0020】
【課題を解決するための手段】
本発明は、上記目的を達成するために、通信内容に優先度情報を持たせ、この優先度情報に基づいて対応する情報通信サービスの実行順序を制御するサービス実行優先度制御手段を設ける。
【0021】
すなわち、本発明のコントローラは、CPUにより実行されるプログラムとして、リアルタイムOSと、リアルタイムOSにより管理実行されるアプリケーションタスク群と、送られてくる通信内容をhttpプロトコルで通信するWebサーバの通信IFを実行することで受け取るとともに、該受け取った通信内容をXMLパーサを実行して解釈する手段を有する情報通信サービスタスクと、周期タイマ又はイベント割り込みにより起動されタスクの実行を制御するタスク実行制御タスクとを含み、ネットワークを介して機器を監視制御するサービスを実行するものである。そして、ネットワークを介してコントローラに送られる通信内容は、複数の起動サービスIDと、該複数の起動サービスIDによって起動されるサービスの優先度を表すサービス優先度とを含む情報である。この場合、情報通信サービスタスクが、コントローラに送られる通信内容のサービス優先度とコントローラ内のタスク優先度とを対応づけて作成されメモリに格納されているタスク優先度変換表を参照して、通信内容のサービス優先度をコントローラ内のタスク優先度に変換するとともに、コントローラに送られる通信内容の起動サービスIDとコントローラ内のタスクIDとを対応づけて作成されメモリに格納されているタスク変換表を参照して、通信内容の複数の起動サービスIDをそれぞれコントローラ内のタスクIDに変換するサービス実行優先度制御を備えて構成される。そして、CPUは、サービス実行優先度制御により変換されたコントローラ内の複数のタスクIDに対応するタスクを、変換されたコントローラ内のタスク優先度に基づいて実行する。
【0022】
また、ネットワークを介して前記コントローラに送られる通信内容が、さらに、タスクを実行すべき複数のコントローラの識別情報を含み、起動サービスIDは、複数のコントローラの識別情報の各々に対応づけて記録され、各コントローラにおいて起動すべきサービスを特定し、各コントローラにおいて、サービス実行優先度制御は、通信内容のサービス優先度をコントローラ内のタスク優先度に変換するとともに、複数のコントローラの識別情報のうち自コントローラの識別情報に対応して記録されている起動サービスIDをコントローラ内のタスクIDに変換する。そして、CPUは、サービス実行優先度制御により変換されたコントローラ内の複数のタスクIDに対応するタスクを、変換されたコントローラ内のタスク優先度に基づいて実行する。また、通信内容から、複数のコントローラの識別情報のうち自コントローラの識別情報及びこの自コントローラの識別情報に対応づけて記録されていた起動サービスIDを削除して他のコントローラに送る。
【0036】
また、本発明の情報通信サービス方法は、CPUで実行されるプログラムとして、タスクの実行順序を優先度に基づいて制御するリアルタイムOSとリアルタイムOSにより管理実行される複数個のタスクを含み、送られてくる通信内容をhttpプロトコルで通信するWebサーバの通信IFを実行することで受け取るとともに、該受け取った通信内容をXMLパーサを実行することで解釈する情報通信サービスタスクを有するとともにネットワークを介して機器を監視制御するサービスを実行するものである。ネットワーク上の通信内容は、複数の起動サービスIDと、複数の起動サービスIDによって起動されるサービスの優先度を表すサービス優先度とを含む情報である。この場合、CPUで実行されるサービス実行優先度制御が、通信内容のサービス優先度とコントローラ内のタスク優先度とを対応づけて作成されメモリに格納されているタスク優先度変換表を参照して、通信内容のサービス優先度をコントローラ内のタスク優先度に変換するとともに、通信内容の起動サービスIDとコントローラ内のタスクIDとを対応づけて作成されメモリに格納されているタスク変換表を参照して、通信内容の複数の起動サービスIDをそれぞれコントローラ内のタスクIDに変換する。そして、CPUが、サービス実行優先度制御により変換されたコントローラ内の複数のタスクIDに対応するタスクを、変換されたコントローラ内のタスク優先度に基づいて実行する。
【0046】
【発明の実施の形態】
次に、図1〜図26を用いて,本発明によるプログラマブルコントローラおよびこのコントローラを応用したプログラマブルな情報通信サービスの実施形態を説明する。
≪コントローラ1の実施形態≫
図1は、リアルタイム処理に優れた情報通信サービスを実現するための本発明によるコントローラの基本構成を示すブロック図である。
【0047】
コントローラ100は、メモリ81と、I/Oインタフェース83と、CPU84と、ネットワーク制御回路85とから構成され、メモリ81,I/Oインタフェース83,CPU84,ネットワーク制御回路85は、バス82に接続されている。
【0048】
I/Oインタフェース83は、機器31をプログラマブルコントローラ100に接続する。
【0049】
CPU84は、タイマ841と、割り込み制御回路INT842とを含む。
【0050】
ネットワーク制御回路85は、ネットワーク2をプログラマブルコントローラ100に接続する。
【0051】
ネットワーク2には、Webブラウザ90を内蔵するパーソナルコンピュータ3と機器32とが接続されている。パーソナルコンピュータ3は、PDAや携帯電話機でもよい。
【0052】
メモリ81には、CPU84で実行されるプログラムが格納されている。プログラムには、基本ソフトウェアであるオペレーティングシステムOSと、OSにより管理実行されるタスクとが含まれている。すなわち、CPU84で実行されるプログラムは、アプリケーションタスク群91と、情報通信サービス手段としての情報通信サービスタスク92と、タスク実行制御手段としてのタスク実行制御タスク93と、リアルタイムOS94とから構成される。
【0053】
アプリケーションタスク群91は、例えば、4個のタスク9101,9102,9103,9104からなる。
【0054】
情報通信サービスタスク92は、サービス実行優先度制御921と情報通信サービス922とからなる。情報通信サービス922は、WebサーバやXMLパーサなどである。
【0055】
特に、情報通信サービス922がWebサーバである場合は、情報通信サービス922とサービス実行優先度制御921とのインタフェースは、一般的にはCGIである。
【0056】
リアルタイムOS94は、I/Oドライバ941と、タスクスケジューラ942と、ネットワークドライバ943とを内部に含む。
【0057】
図1は、パーソナルコンピュータ3からプログラマブルコントローラ100に送られる通信内容21と、機器32からプログラマブルコントローラ100に送られる通信内容22とを併せて示している。
【0058】
通信内容21は、優先度211,起動サービスID212,データ213などの情報を内部に有し、通信内容22は、優先度221,起動サービスID222,データ223などの情報を内部に有する。
【0059】
次に、プログラマブルコントローラ100の基本動作を説明する。CPU84は、リアルタイムOS94内のタスクスケジューラ942に基づき、内部のタスク実行待ち行列に登録されている実行可能状態のタスクのうち、優先度の高いタスクから順番に実行していく。
【0060】
実行するタスクが、情報通信サービスタスク92のように、ネットワーク通信を実行するタスクであれば、そのタスクは、ネットワークドライバ943を経由して、ネットワーク制御回路85がネットワーク2から受信した通信内容を読み込み、対応する通信処理を実行する。そのネットワーク通信タスクは、通信処理で得られた送信すべき通信内容をネットワーク制御回路85に渡して、ネットワーク2に送信してもらう。
【0061】
一方、実行するタスクが機器31を制御するタスクであれば、その制御タスクは、I/Oドライバ941,I/Oインタフェース83を経由して、機器31からデータを入力し、対応する制御処理を実行する。その制御タスクは、制御処理で得られた結果を、I/Oドライバ941,I/Oインタフェース83を経由して、機器31に出力し、機器31を監視制御する。
【0062】
サービス実行優先度制御921は、ネットワークから受信した通信内容21,22内の優先度情報および起動サービス情報を参照して起動サービスを実行するタスクを見つけ出し、そのタスクを実行するために、タスク実行制御タスク93に通知する。
【0063】
サービス実行優先度制御921およびタスク実行制御タスク93の詳細は後述する。
【0064】
タスク実行制御タスク93は、周期タイマまたはイベント割り込みにより起動される。タスク実行制御タスク93は、サービス実行優先度制御921により予め通知されたタスクのうち、タスク実行制御タスク93を起動した割り込み要因に対応して起動すべきタスクを実行可能状態にして、そのタスクをタスクスケジューラ94が管理するタスク実行待ち行列に登録する。
【0065】
なお、タスク実行制御タスク93は、タスクではなく、割り込み処理ルーチンとして実装してもよい。
≪サービス実行優先度制御921および
タスク実行制御タスク93の実施形態1≫
図2〜図6を参照して、サービス実行優先度制御921およびタスク実行制御タスク93の実施形態1を説明する。
【0066】
図2は、パーソナルコンピュータ3または機器32からプログラマブルコントローラ100に送られる通信内容の一例を示す図である。通信内容201は、サービス優先度2011と、起動サービスID2012と、起動サービスに渡すデータ2013とからなる。サービス優先度の値および起動動サービスIDは、システム全体で一意に定義される。
【0067】
図3は、サービス実行優先制御921の基本構成および通信内容の推移を示すブロック図である。サービス実行優先度制御921は、サービス優先度→タスク優先度変換9211、起動サービスID→タスクID変換9212、情報変換9213、サービス優先度〜タスク優先度対応表9214、起動サービス〜タスク対応表9215からなる。
【0068】
サービス優先度〜タスク優先度対応表9214は、サービス優先度を各コントローラ内のタスク優先度に置き換えるための変換表である。この変換表により各コントローラ毎に適切な変換表を作成すると、コントローラ毎にタスクの優先度の扱いが異なっても、システム全体を通してタスクの優先度の重み付けを統一化できる。
【0069】
一方、起動サービス〜タスク対応表9215は、起動サービスIDを各コントローラ内で該当する起動サービスを実行するタスクIDに置き換えるための変換表である。
【0070】
通信内容200,2001,2002,2003は、通信内容が情報通信サービス922からタスク実行制御タスク93に渡る間の途中経過を含めた通信内容を示している。
【0071】
情報通信サービス922から取り出された通信内容200のサービス優先度が2であり、サービスIDが1である場合のサービス実行優先制御921の動作を説明する。
【0072】
サービス実行優先制御921は、サービス実行優先制御921内のサービス優先度→タスク優先度変換9211において、サービス優先度〜タスク優先度対応表9214を参照し、サービス優先度=2に対応するタスク優先度として9を見つけ出し、通信内容200のサービス優先度2をタスク優先度9に置き換える(2001)。
【0073】
サービス実行優先制御921は、起動サービスID→タスクID変換9212において、起動サービス〜タスク対応表9215を参照し、更新された通信内容2001内のサービスID=サービス1に対応するタスクIDとして3を見つけ出し、通信内容のサービスIDをタスクIDに置き換える(2002)。
【0074】
もし、ネットワークから送られてくる通信内容が、XMLまたはHTMLのような文字列情報である場合、最後に、情報変換9213において、文字列情報である通信内容2002をバイトコードの通信内容2003に変換し、タスク実行制御タスク93に渡す。
【0075】
もし、ネットワークから送られてくる通信内容が、最初からバイトコードである場合は、情報変換9213は、不要である。
【0076】
図4は、サービス実行優先制御921とタスク実行制御タスク93との連携動作を示すブロック図である。起動サービス登録待ち行列931は、サービス起動方法930のメンバである各サービス起動方法を含んでいる。
【0077】
図4のサービス起動方法930は、以下の13種類のサービス起動方法
10ms 一回:10ms周期タイマにより一回のみ起動
20ms 一回:20ms周期タイマにより一回のみ起動
40ms 一回:40ms周期タイマにより一回のみ起動
10ms 毎回:10ms周期タイマにより毎回起動
20ms 毎回:20ms周期タイマにより毎回起動
40ms 毎回:40ms周期タイマにより毎回起動
イベント1 一回:イベント1発生時に一回だけ起動
イベント2 一回:イベント2発生時に一回だけ起動
イベント3 一回:イベント3発生時に一回だけ起動
イベント1 毎回:イベント1発生時に毎回起動
イベント2 毎回:イベント2発生時に毎回起動
イベント3 毎回:イベント3発生時に毎回起動
即時起動 一回:サービス実行優先度制御が通信内容を登録次第、直ちにタスク実行制御タスクを起動し、登録した通信内容に対応するタスクを起動
からなる。
【0078】
起動サービス登録待ち行列931では、「10ms 毎回」の待ち行列に<優先度4,タスクA>の通信内容200D1が登録され、「イベント2 一回」の待ち行列に<優先度5,タスクB>の通信内容200C1が登録され、「即時起動 一回」の待ち行列に<優先度9,タスク3>の通信内容200A1が登録されている。
【0079】
図4では、サービス実行優先度制御921において更新された通信内容200X1は、「即時起動 一回」の待ち行列に登録されるとする。
【0080】
タスク実行制御タスク93は、各種割り込みにより起動される。図4の例において、タスク実行制御タスク93は、10msタイマ割り込み8411,20msタイマ割り込み8411,40msタイマ割り込み8411,イベント1割り込み8421,イベント2割り込み8422,イベント3割り込み8423,即時起動割り込み843の各種割り込みにより起動される。
【0081】
なお、サービス実行優先制御921は、通信内容200X1を起動サービス登録待ち行列931内の「即時起動 一回」の待ち行列に登録したら、直ちに即時起動割り込み843に割り込みイベントを発生させる。
【0082】
図5は、タスク実行制御タスク93の動作を示すフローチャートである。タスク実行制御タスク93は、各種割り込みにより起動されると、割り込みの原因を調べる。タスク実行制御タスク93は、起動サービス登録待ち行列931内のサービス起動方法930において、割り込みの原因に対応するサービス起動方法にからなり待ち行列に登録されている全ての通信内容について、通信内容に対応したタスクを起動する(701)。
【0083】
なお、割り込み原因と対応するサービス起動方法との関係は、
10msタイマ割り込み
→10ms 一回,10ms 毎回
20msタイマ割り込み
→20ms 一回,20ms 毎回
40msタイマ割り込み
→40ms 一回,40ms 毎回
イベント1割り込み
→イベント1 一回,イベント1 毎回
イベント2割り込み
→イベント2 一回,イベント2 毎回
イベント3割り込み
→イベント3 一回,イベント3 毎回
即時起動割り込み
→ 即時起動 一回
となる。
【0084】
タスクの起動とは、具体的には、リアルタイムOS94内のタスクスケジューラ942において、起動すべきタスクの優先度を通信内容に登録されている優先度の値に更新し、そのタスクを実行可能状態にすることである。
【0085】
その際、実行対象の通信内容が、「*** 一回」、すなわち、一回のみ起動のサービス起動方法に登録されているか否か調べ(702)、一回のみ起動のサービス起動方法に登録されているならば、その通信内容を待ち行列から削除する(703)。
【0086】
なお、702において一回のみ起動のサービス起動方法に登録されていない場合は、その通信内容は、待ち行列に登録したままとする。
【0087】
図4の場合、サービス実行優先度制御921において更新された通信内容200X1は、「即時起動 一回」の待ち行列に登録されるとしたが、通信内容200X1は、「即時起動 一回」ではない待ち行列に登録されてもよい。
【0088】
図6は、サービス実行優先制御921とタスク実行制御タスク93との連携動作の別の例を示すブロック図である。ここでは、通信内容200X1は、「10ms 一回」の待ち行列に登録されるとしている。
【0089】
この場合、10msタイマ割り込みが発生する度に、それまでにサービス実行優先度制御921により「10ms 一回」の待ち行列に登録された通信内容に登録されているタスクが起動されることになる。
【0090】
この場合、サービス実行優先度制御921は、通信内容を登録後、即時起動割り込み843に割り込みイベントを発生させる必要は無くなる。
≪サービス実行優先度制御921および
タスク実行制御タスク93の実施形態2≫
図7〜図9を参照して、サービス実行優先度制御921およびタスク実行制御タスク93の実施形態2を説明する。
【0091】
図7は、パーソナルコンピュータ3または機器32からプログラマブルコントローラ100に送られる通信内容の他の例を示す図である。通信内容201は、サービス優先度2011と、動サービスID2012と、起動サービスに渡すデータ2013とからなる。本実施形態2のサービス優先度2011は、サービス優先度20111とサービス起動方法20112とを含んでいる。サービス優先度の値および起動サービスIDは、図2の場合と同様に、システム全体で一意に定義される。
【0092】
図8は、サービス実行優先制御921における入力時と出力時の通信内容を示す図である。図8において、サービス実行優先度制御921は、図2の場合と同様である。
【0093】
通信内容201,2013は、通信内容が情報通信サービス922からタスク実行制御タスク93に渡る際のサービス実行優先制御921への入力時と出力時の通信内容を示している。通信内容201,2013は、図3の200,2003と比較して、サービス起動方法の情報(この場合「40ms 一回」)が増えている。
【0094】
図9は、本実施形態2におけるサービス実行優先制御921とタスク実行制御タスク93との連携動作を示すブロック図である。本構成は、起動サービス登録待ち行列931内に登録されている通信内容を除けば、図3と同じである。
【0095】
図3との違いは、サービス実行優先度制御921において更新された通信内容200X1が、通信内容の「サービス起動方法」に対応する待ち行列に登録されることである。
【0096】
例えば、図3の起動サービス登録待ち行列931において、サービス実行優先度制御921により、
「40ms 一回」の待ち行列:<優先度9,40ms 一回,タスク3>の通信内容200A1,<優先度23,40ms 一回,タスク1>の通信内容200B1
「イベント1 毎回」の待ち行列:<優先度17,イベント1 毎回,タスク4>の通信内容200C1、
「即時起動 一回」の待ち行列:<優先度4,即時起動 一回,タスク2>の通信内容200D1
という通信内容が、それぞれ登録される。
【0097】
タスク実行制御タスク93の動作は、上記実施形態と同じである。
【0098】
なお、通信内容のサービス起動方法として、今までに説明してきた方法の他に、新たに「起動停止」を設けると、サービス実行優先度制御921により、既に起動サービス待ち行列931に登録されている同一タスクIDを有する通信内容を削除できる。
【0099】
この方法により、サービス起動情報を参照すれば、周期タイマまたはイベント発生により毎回起動される通信内容のタスクを待ち行列から排除したり、待ち行列に登録された通信内容のタスクが起動される前に、そのタスクを待ち行列から排除し、そのタスクの実行を取り止めることが可能になる。
【0100】
以上の実施形態によれば、優先度情報を有する通信内容に基づいて動作するサービス実行優先度制御とが、対応する情報通信サービスの実行順序を制御するので、通信内容により起動される通信サービスのうち、優先して処理すべき通信サービスと、後回しにしてよい通信サービスとを判別でき、優先して処理すべき通信サービスを確実にリアルタイム処理できる。
≪複数サービスの連続起動≫
図10〜図13を参照して、複数のサービスを含む通信内容を受信した場合の実施形態を説明する。
【0101】
図10は、複数のサービスを連続起動する場合の通信内容を示す図である。図10の実施形態においては、機器1(301)を監視制御するコントローラ1(101)と、機器2(302)を監視制御するコントローラ2(102)とが、ネットワーク2により接続されている。
【0102】
図10では、コントローラ1(101)が、通信内容25の情報をコントローラ2(102)に送る。通信内容25には、コントローラ2(102)で実行される起動サービスが2つ存在する。通信内容25は、優先度251と、起動サービス1(2521)と、起動サービス1用のデータ1(2531)と、起動サービス2(2522)と、起動サービス2用のデータ2(2532)とからなる。
【0103】
図11は、起動サービス登録待ち行列への通信内容の一登録例を示す図である。図12は、起動サービス登録待ち行列への通信内容の一登録例を示す図である。すなわち、これらの図は、コントローラ2(102)における起動サービス登録待ち行列931を示す図である。
【0104】
図11は、通信内容が、サービス実行優先度制御921により、サービス起動方法930内の「即時起動 一回」の待ち行列に最初に登録された状態を示している。待ち行列に登録されている通信内容2503は、まだ起動サービスを実行していないので、起動サービス1(2521),起動サービス2(2522)に対応するタスク3,タスク1が、通信内容2503内に登録されている。
【0105】
一方、図12は、図11の状態から、タスク実行起動タスク93が通信内容2503内に登録されているタスクを頭から1つ実行した後の状況を示している。最初の起動サービス1(2521)に対応するタスク3が起動されたので、タスク3およびタスク3用のデータが、「即時起動 一回」の待ち行列に登録されている通信内容25031から削除され、次に起動する起動サービス2(2522)に対応するタスク1のみが通信内容2503内に登録されている。
【0106】
図13は、複数のサービスを連続起動する場合のタスク実行制御タスク93の動作を示すフローチャートである。タスク実行制御タスク93は、各種割り込みにより起動されると、割り込みの原因を調べる。タスク実行制御タスク93は、起動サービス登録待ち行列931内のサービス起動方法930において、割り込みの原因に対応して待ち行列に登録されている全ての通信内容について、通信内容に登録されているタスクを先頭から1個起動する(701)。
【0107】
実行対象の通信内容が「*** 一回」、すなわち、一回のみ起動のサービス起動方法に登録されているか否か調べ(702)、一回のみ起動のサービス起動方法に登録されているならば、その通信内容より、今回起動されたタスクを削除する(7021)。
【0108】
その際、通信内容内に未実行のタスクが存在するか否かを確認し(7022)、存在しないならば、その通信内容を待ち行列から削除する(703)。
【0109】
なお、702において一回のみ起動のサービス起動方法に登録されていない場合、および、7022において、未実行のタスクが存在する場合は、その通信内容は、待ち行列に登録したままとする。
【0110】
タスク実行起動タスク93の上記処理手順において、複数のサービスを有する通信内容が実行される場合、この通信内容内の各サービスは、一回のみ起動のサービス起動である。
【0111】
通信内容のサービス優先度を高く設定しておけば、これらの複数のサービスは、優先的に実行されるので、確実なリアルタイム処理を保証できるようになる。
【0112】
なお、図10では、通信内容に起動サービスが2つ存在する例を示したが、通信内容中の起動サービスの個数に制限はない。
≪複数コントローラ間の連動制御≫
図14〜図17を参照して、複数のコントローラが連動制御する実施形態を説明する。
【0113】
図14は、複数のコントローラ101〜103が連動制御する場合の通信内容を示す図である。図14の実施形態においては、機器1(301)を監視制御するコントローラ1(101)と、機器2(302)を監視制御するコントローラ2(102)と、機器3(303)を監視制御するコントローラ3(103)とが、ネットワーク2により接続されている。
【0114】
図14では、コントローラ1(101)からコントローラ2(102)に通信内容23を送る。コントローラ2(102)は、通信内容23に応じて起動されるサービスを実行した後、コントローラ3(103)に対して、通信内容23′を送信する。コントローラ3(103)は、通信内容23′に応じてサービスを起動する。
【0115】
コントローラ1(101)から送られる通信内容23には、これから一連の処理を複数のコントローラで連携して実行するための処理手順、すなわち、実行すべきコントローラおよびそのコントローラにおいて実行するサービスが記載されている。
【0116】
図14の通信内容23では、一連の処理を優先度231で実行しようとしており、最初にコントローラ2(2301)において、起動サービスA(2321)を実行し、続いて、コントローラ3(2302)において、起動サービスB(2322)を実行する。処理内容23は、コントローラ1→コントローラ2→コントローラ3と渡り歩くことになり、これらコントローラ間の連携制御を実現する。
【0117】
なお、起動サービスは、実行されると通信内容から削除されるので、コントローラ2からコントローラ3に送る通信内容23′では、もとの通信内容23から、コントローラ3で実行されたサービスに相当する部分2301,2321,2331が削除されている。
【0118】
また、通信内容23′内のコントローラ3で実行する起動サービスB用のデータは、コントローラ2において変更または追加される場合がある。その場合、通信内容23内の起動サービスB用のデータと比較して、情報が更新される。
【0119】
図15は、起動サービス登録待ち行列への通信内容の一登録例を示す図である。図16は、起動サービス登録待ち行列への通信内容の一登録例を示す図である。すなわち、図15および図16は、コントローラ2(102)およびコントローラ3(103)における起動サービス登録待ち行列931を示している。
【0120】
本実施形態では、通信内容のサービス起動方法が「10ms 一回」のため、図15,図16ともに、通信内容は、サービス実行優先度制御921により、サービス起動方法930内の「10ms 一回」の待ち行列に登録される。
【0121】
図17は、複数のコントローラ間で連動制御する場合のタスク実行制御タスク93の動作を示すフローチャートである。
【0122】
タスク実行制御タスク93は、各種割り込みにより起動されると、割り込みの原因を調べ、起動サービス登録待ち行列931内のサービス起動方法930において、割り込みの原因に対応するサービス起動方法により構成される待ち行列に登録されている全ての通信内容について、通信内容に登録されているタスクを先頭から1個起動する(701)。
【0123】
実行対象の通信内容が「*** 一回」、すなわち、一回のみ起動のサービス起動方法に登録されているか否か調べ(702)、一回のみ起動のサービス起動方法に登録されているならば、その通信内容から、今回起動されたタスクを削除する(7021)。
【0124】
その際、通信内容内に自コントローラで実行すべき未実行のタスクが存在するか否かを確認し(70221)、存在しないならば、その通信内容内で自コントローラで実行する起動サービス情報を削除し、通信内容を待ち行列から削除する(7031)。
【0125】
さらに、通信処理内で実行すべき起動サービスが空になったか否かを確認し(704)、空でないならば、通信内容を次に実行するコントローラに送る。
【0126】
一方、702において一回のみ起動のサービス起動方法に登録されていない場合、70221において、自コントローラで実行すべき未実行のタスクが存在する場合は、その通信内容を待ち行列に登録したままとする。
【0127】
704において通信内容内で実行すべき起動サービスが空になった場合は、その通信内容で実行すべきサービスを全て実行し、通信内容が完了したことを意味する。
【0128】
タスク実行起動タスク93の上記処理手順において、複数のコントローラ間で連動制御を実行する通信内容が実行される場合、この通信内容内の各サービスは、一回のみ起動のサービス起動である。
【0129】
通信内容のサービス優先度を高く設定しておけば、これら複数のサービスは、優先的に実行されるので、複数のコントローラ間の連動制御の確実なリアルタイム処理を保証できるようになる。
【0130】
なお、図14では、3つのコントローラ間の連動制御の例を示したが、連動制御するコントローラの個数に制限はない。
【0131】
また、説明を簡単にするため、各コントローラにおける起動サービスの個数を1個としたが、起動サービスの個数にも制限はない。
【0132】
さらに、本発明では、主に受信の場合を説明したが、通信内容を新規に送る場合は、基本的に送る通信サービスの中で、通信内容を定義することになる。
【0133】
また、通信内容を受信して返信する場合、返信の通信内容の優先度情報は、特に問題がない限り、受信した通信内容の優先度情報と同一とする。
≪通信内容のXML表記≫
図18は、通信内容をXMLで表現した場合の一例を示す図である。通信内容タグにより囲まれる部分が通信内容の中味を示している。
【0134】
優先度タグ内には、サービス優先度タグとサービス起動方法タグとの2種類が入り、サービス優先度とサービス起動方法とを示す。
【0135】
起動サービスタグは、ノードの起動サービスを表しており、実行ノードIDを示す実行ノードタグとサービス内容を示すサービスタグとからなる。
【0136】
サービスタグは、サービスIDを示すサービス名タグとサービス実行に必要なデータを格納するデータタグとからなる。
【0137】
データタグ内へのデータは、データの種類を示すタグとセットで格納する。
【0138】
図18の実施形態では、スイッチ状態タグにデータ“ON”が格納され、さらに、RPMタグに回転数200が格納されている。
【0139】
なお、データタグに格納されるデータの個数は、任意であり、起動サービスタグ内のサービスタグにより表されるサービスの個数も任意である。
【0140】
また、通信内容タグ内の起動サービスタグにより表されるノードの起動サービスの個数も任意である。
【0141】
さらに、サービス起動方法タグおよび実行ノードタグは、省略可能である。
【0142】
以上、XMLによる通信内容の一例を示したが、通信内容において、特に、上記複数のサービスの連続起動や複数のコントローラ間の連動制御など、複数のサービスを起動する複雑な処理手順の場合は、これらサービスの連続起動やコントローラ間の連動制御を管理するエージェントプログラムにおいて通信内容を実現する方法もある。
≪プログラマブルな情報通信サービス≫
≪スクリプト実行によるWebサービス≫
≪プログラマブルコントローラ10の全体構成≫
図19は、プログラマブルなWebサービスを実現するコントローラ10のソフトウェアモジュールの基本構成を示すブロック図である。
図19において、プログラマブルコントローラ10は、プログラマブルコントローラ基本ブロック110と、Webサーバ15と、HTMLメニュー16と、シーケンス制御連携Webサービス17と、プロファイル情報格納手段18とから構成されている。
【0143】
プログラマブルコントローラ基本ブロック110は、プログラマブルコントローラのシーケンスプログラムを実行処理するシーケンス制御手段11と、入出力モジュールとの間でデータを入出力する入出力処理12と、プログラマブルコントローラ基本ブロック110の実行状態を制御しモニタする実行状態制御モニタ13と、従来のプログラミングツールとの間の通信を処理する通信処理14とからなる。
【0144】
HTMLメニュー16は、HTMLで記述されたプログラマブルコントローラ10へのWebサービスをメニュー形式で表現したテキストを格納するHTMLテキスト格納手段である。
【0145】
シーケンス制御連携Webサービス17は、スクリプト言語で記載された命令列に従って対応する処理を逐次実行し、通信処理14を起動し、その結果をHTMLテキストにしてWebサーバ15に返送する。
【0146】
プロファイル情報格納手段18は、プログラマブルコントローラ基本ブロック110が参照しまたは更新するシステム情報やWebサービス情報などを格納する。
【0147】
通信処理14は、メモリライト処理141,メモリリード処理142,CPU制御処理143,I/O制御処理144などの従来と同様のプログラマブルコントローラ専用のコマンドを含んでいる。
【0148】
シーケンス制御連携Webサービス17は、Webサービスを記述したスクリプト群171と、Webサービススクリプトを実行するWebサービス実行エンジン172とを含んでいる。
【0149】
Webサービススクリプト群171は、一例として、Webサービス1(1711)、Webサービス2(1712)、Webサービス3(1713)、プロファイル表示1714、Webサービス追加1715を有する。
【0150】
Webサービス実行エンジン172は、Webサービススクリプトに記載されているスクリプト言語の各命令を逐次解釈して実行する命令解釈1722と、通信処理14内の各処理を起動する処理からなる通信処理起動ライブラリ1721と、算術演算や文字列演算などの汎用命令を実行する処理からなる汎用処理ライブラリ1723と、HTMLテキスト作成1724を含んでいる。
【0151】
通信処理起動ライブラリ1721は、通信処理14内のメモリライト処理141、メモリリード処理142、CPU制御処理143、I/O制御処理144をそれぞれ起動するメモリライト起動処理241、メモリリード起動処理242、CPU制御起動処理243、I/O制御起動処理244を有する。
【0152】
プロファイル情報格納手段18は、システム情報格納181、シーケンス制御プログラム情報182、I/O割り付け情報183、Webサービス情報184などを格納する。
【0153】
プログラマブルコントローラ10と、Webブラウザを搭載するパーソナルコンピュータまたはワークステーション3とは、例えばEthernet(登録商標)などのネットワーク2により接続されている。
≪プログラマブルコントローラ10の全体動作≫
図20は、プログラマブルコントローラ10のWebサービスの動作を説明するフローチャートである。
【0154】
パーソナルコンピュータまたはワークステーション3において、汎用Webブラウザを実行し、プログラマブルコントローラ10のHTMLテキストを指定すると(51)、HTTPでの読み出し要求が実行され、Webサーバ15からHTMLテキスト格納手段16に格納されているHTMLテキストが返送される(52)。
【0155】
HTMLテキストが汎用Webブラウザに読み込まれると、プログラマブルコントローラ10のサポートするWebサービス一覧がメニュー形式で表示される(511)。
【0156】
メニューにハイパーテキストで表示されているWebサービス項目を選択し、ハイパーテキストにリンクされているCGIを呼び出せば、Webサーバ15は、Webサービススクリプト群171内の対応するWebサービスを呼び出す(53)。呼び出されたWebサービスは、図20中のボックス540内の処理手順で実行される。
【0157】
命令解釈1722が、呼び出されたWebサービスを構成するスクリプト言語の命令列中の先頭から命令を取り出し(54)、そのサービスを構成する命令列中の命令を逐次解釈し、対応するライブラリ内の処理をコールする(55)。
【0158】
命令解釈1722が解釈した命令がプログラマブルコントローラ基本ブロック110の実行状態を制御したりモニタする命令であれば、通信制御起動ライブラリ1721を経由して、従来のプログラミングツールと通信する通信処理14を呼び出す。通信処理14は、従来と同様のプログラマブルコントローラ専用のコマンドで実行状態制御モニタ13に要求を送る。その応答は、通信処理14から通信処理起動ライブラリ1721を経由して、命令解釈1722に返される(57)。その際、必要に応じてプロファイル情報格納手段18内の情報が参照または更新される。
【0159】
命令解釈1722は、次の命令を取り出す(510)。
【0160】
解釈した命令が算術演算や文字列演算などの汎用命令であれば、命令解釈1722は、汎用処理ライブラリ1723内の対応する処理を動作させる。命令解釈1722は、その処理結果を受け取り(58)、次の命令を取り出す(510)。
【0161】
解釈した命令がHTMLテキスト生成であれば、命令解釈1722は、それまでの他の命令による処理結果をもとに、HTMLテキストを作成し(59)、次の命令を取り出す(510)。
【0162】
解釈した命令が、スクリプトの終了命令であれば、命令解釈1722は、Webサービス処理を終了し、作成したHTMLテキストをWebサーバ15に返す(56)。Webサーバ15は、そのHTMLテキストをパーソナルコンピュータまたはワークステーション3に返送し(52)、実行中の汎用HTMLブラウザに表示させる(511)。
≪通信処理≫
図21は、通信処理14が提供するプログラマブルコントローラ専用のコマンド一覧である。メモリライト処理としては、メモリの領域をゼロクリアするオールクリア処理、アドレス指定のプログラム転送処理、メモリ割り付け情報すなわちユーザプログラムがメモリのどこに割り付けられているかの情報の書き込み処理、パラメータ変更終了処理、タイマカウンタの設定値変更処理がある。
【0163】
メモリリード処理としては、アドレス指定プログラム読み出し処理、ユーザプログラムの最終回路検索処理、メモリ割り付け情報の読み出し処理がある。
【0164】
CPU制御処理としては、CPUステータスリード処理、CPU運転/停止指定処理、CPUの排他占有/解除処理、CPU占有の強制解除処理、カレンダ時計の設定、読み出し処理がある。
【0165】
I/O制御処理としては、I/O No.指定によるモニタ処理(指定No.から連続N点設定)、I/O No.指定による強制セット/リセット処理(指定No.から連続N点設定)、I/O No.指定によるモニタ処理(ランダムなN点を指定可)、I/O No.指定による強制セット/リセット処理(ランダムなN点を指定可)がある。
【0166】
一方、通信処理起動ライブラリ1721内には、これらの通信処理に1対1に対応して、各通信処理を起動する処理が用意されている。
【0167】
Webサービススクリプト群171内のWebサービススクリプトにおいて、これらの基本的な通信処理と汎用処理ライブラリ1723内の汎用処理とを組み合わせて実行すると、種々の応用的なWebサービスを実現できる。
≪プロファイル情報≫
図22は、プロファイル情報格納手段18に格納されているプロファイル情報の一例を示す図である。
【0168】
システム情報は、制御ソフトウェアのバージョン情報、シーケンスプログラム実行タスクの実行周期、割り込みプログラム実行タスクの割り込み要因、プログラマブルコントローラの実行状態を含んでいる。
【0169】
シーケンス制御プログラム情報は、実行される各プログラムのタイトル、各プログラムが割り付けられている実行タスク、メモリ割り付け情報、プログラム内で使用されている各変数へのコメント情報、データ型、サイズなどの各種属性情報、変数のメモリ割り付け情報を有する。
【0170】
I/O割り付け情報は、プログラマブルコントローラの各I/Oスロットへの実装I/Oモジュール情報、実装されている各I/Oへのコメント情報、データ型,サイズなどの各種属性情報を有する。
【0171】
Webサービス情報は、登録されている各Webサービスのタイトル、メモリ割り付け情報、サービス起動条件(呼び出し時起動、イベント起動、周期起動)、ライブラリに登録されている各処理のタイトル、I/O情報(引数、返り値のデータ型、サイズなどの属性情報)、メモリ割り付け情報を有する。
【0172】
プロファイル情報は、プログラマブルコントローラ基本ブロック110により参照されまたは更新される。
【0173】
プロファイル情報全体は、Webサービス群171内のプロファイル表示サービスに参照され、HTMLテキストとしてパーソナルコンピュータまたはワークステーション3に返送され、その汎用Webブラウザで、プロファイル情報の一覧を参照しまたは更新できる。
【0174】
なお、プロファイル情報は、構造体または配列の形において、プログラマブルコントローラのメモリに保管されるか、Webサービスとの連携効率をあげるために、XML(eXtensible Markup Language)を用いたテキスト形式で保管される。
≪Webサービス追加動作≫
以上説明したように、Webサービススクリプト群171内のWebサービスは、通信処理14や汎用処理1723を使用可能なスクリプト言語で記述でき、プログラマブルである。さらに、プロファイル情報18内のWebサービス情報を利用すると、プログラマブルコントローラ稼動中にWebサービスを更新(追加および削除)できる。
【0175】
図23は、Webサービス追加1715の動作を示すフローチャートである。すなわち、図23は、図20のWebサービス動作のボックス540内で実行されるサービススクリプトの内容を示す図である。
【0176】
まず、プロファイル情報18内に登録されている各Webサービスのタイトル、メモリ割り付け情報を参照して、追加する新しいWebサービスを格納できるだけの空き領域をメモリ上方に確保する(61)。
【0177】
次に、新しいWebサービススクリプトをプログラマブルコントローラの臨時メモリ領域にダウンロードする(62)。
【0178】
ダウンロードは、通信処理14内のメモリライト処理141を利用して実行する。TCP/IPで一般的なFTPサービスを使用してもよい。
【0179】
さらに、ダウンロードしたスクリプトの使用変数(63),使用I/O(64)とプロファイル情報に登録されている変数情報,I/O情報とを比較し、整合しているか否かを確認し、問題無ければ、確保した領域にダウンロードしたスクリプトを書き込む(65)。
【0180】
最後に、そのWebサービスの起動条件を設定し、プロファイル情報内のWebサービス起動条件を更新し(66)、成功表示のHTMLテキストを作成する(67)。一方、上記処理手順61,63,64,65において、エラーとなった場合には、そのエラー表示のHTMLテキストを作成する(68)。
【0181】
なお、プロファイル情報18を参照すると、既に登録済みのWebサービスを削除することも、容易である。ここでは、Webサービスの削除手順の説明は省略する。
【0182】
ここでは、Webサービスはスクリプトである場合において、実施形態を説明した。スクリプト言語としては、情報系のWebサーバでよく使われているPerl言語を使用できる。スクリプト言語は、自作のをスクリプト言語や他のスクリプト言語であってもよい。
【0183】
一方、図19において、スクリプト言語ではなく、JAVA(登録商標)のバイトコードのような標準的なコードでWebサービス群171内の各Webサービスを実現し、命令解釈1722をそのバイトコードを実行する仮想マシンとする構成に置き換えてもよい。
【0184】
この場合のプログラマブルコントローラ10の構成および動作は、スクリプトの場合とほとんど同じなので、説明を省略する。
≪マイコン命令コードの直接実行によるWebサービス≫
ここまでの実施形態では、Webサービスは、スクリプトまたはバイトコードで実現し、命令解釈1722においてスクリプト言語の各命令を逐次解釈して実行、または、バイトコードを仮想マシンとして実行する構成を採用していた。
【0185】
Webサービスは、マイコンの命令コードにコンパイルして実行することも可能である。
【0186】
図24は、Webサービスをマイコン命令コードで実現する場合のプログラマブルコントローラ10のソフトウェアモジュールの構成を示すブロック図である。
【0187】
図19のソフトウェアモジュールと図24のソフトウェアモジュールとの相違は、2つある。
【0188】
第1に、図19のWebサービススクリプト群171および内部のWebサービスが、図24のソフトウェアモジュールでは、スクリプトではなく、マイコン命令コードで構成されている。したがって、図24には、ブロック171をWebサービスマイコン命令コード群とラベル付けしてある。
【0189】
第2に、図24のソフトウェアモジュールには、図19の命令解釈1722が存在せず、Webサービスマイコン命令コード群171内部のWebサービスが、通信処理起動ライブラリ1721,汎用処理ライブラリ1723,HTMLテキスト作成1724を直接呼び出す。
【0190】
図24のプログラマブルコントローラ10の動作を説明する。図19のソフトウェアモジュールと図24のソフトウェアモジュールとの動作の相違は、図20のWebサービス実行540内に記載の処理を、図19の場合は、命令解釈1722が実行しているのに対し、図24の場合は、マイコン自体が実行している点である。
【0191】
それ以外の動作は、基本的に、図19のソフトウェアモジュールと図24のソフトウェアモジュールとおいて、同様である。
【0192】
図24のプログラマブルコントローラ10で動作するWebサービスをコンパイルして作成するには、事前にプロファイル情報18に登録されているライブラリ内の処理のメモリ割り付けなどの情報を取り出しておく。
【0193】
取り出した情報を利用して、ライブラリ内の処理へのジャンプ先アドレスなどの情報を、コンパイルして生成されるWebサービスのマイコン命令コード列中に挿入する。このようにマイコン命令コード列中に情報を挿入すると、通信処理起動ライブラリ1721,汎用処理ライブラリ1723,HTMLテキスト作成1724を直接呼び出すことが可能になる。
≪シーケンス制御活用によるWebサービス≫
≪プログラマブルコントローラ10の全体構成≫
以上の実施形態では、Webサービスは、プログラマブルコントローラ基本ブロック110の実行状態を制御したりモニタするためには、従来のプログラミングツールと通信処理する機能とを有する通信処理14を使用したが、ここでは、通信処理14を使用せず、Webサービス処理をシーケンス制御手段11で実行する別の実施形態を説明する。
【0194】
図25は、プログラマブルなWebサービスを実現するコントローラのソフトウェアモジュールの基本構成を示すブロック図である。
【0195】
図25において、プログラマブルコントローラ(本体)10は、プログラマブルコントローラのシーケンスプログラムを実行処理するシーケンス制御手段11と、入出力モジュールとの間でデータを入出力する入出力処理12と、Webサーバ15と、HTMLで記述されたプログラマブルコントローラ10へのWebサービスをメニュー形式で表現したテキストを格納するHTMLテキスト格納手段16とを含んでいる。
【0196】
シーケンス制御手段11は、通常のシーケンス制御処理111に加え、Webサービス処理群112と、シーケンス制御実行エンジン113とを備えている。シーケンス制御実行エンジン113は、シーケンス制御処理111およびWebサービス処理群112の命令コードを解釈して逐次実行する。
【0197】
Webサービス処理群112は、一例として、Webサービス1(1121)、Webサービス2(1122)、Webサービス3(1123)、プロファイル表示1124、Webサービス追加1125などのWebサービス処理を有する。
【0198】
HTMLテキスト作成11322は、Webサービスの処理結果をHTMLテキストにしてWebサーバ15に返送する。
【0199】
シーケンス制御実行エンジン113は、ラダー基本命令実行手段1131、応用命令実行手段1132から構成される。応用命令実行手段1132は、算術演算や文字列演算などの汎用命令を実行する汎用命令実行手段11321と、HTMLテキスト作成11322とからなる。
【0200】
シーケンス制御連携Webサービス170は、Webサービス処理群112内のサービスを起動する。
【0201】
シーケンス制御連携Webサービス170は、Webサービス処理群112内の各サービスを起動するための設定情報からなるWebサービス起動情報群1710と、Webサービス起動情報群1710内のWebサービス起動情報を参照して、対応するWebサービス処理群112内のWebサービスを起動する処理を実行するWebサービス起動処理実行手段1720から構成される。
【0202】
Webサービス起動情報群1710は、1121のWebサービス1、1122のWebサービス2、1123のWebサービス3、1124のプロファイル表示、1125のWebサービス追加をそれぞれ起動するための設定情報であるWebサービス1起動情報1701、Webサービス2起動情報1702、Webサービス3起動情報1703、プロファイル表示起動情報1704Webサービス追加起動情報1705に相当する。
【0203】
プロファイル情報18は、システム情報やWebサービス情報などを格納するプログラマブルコントローラ10のプロファイル情報格納手段であり、応用命令実行手段1132により参照されまたは更新される。
【0204】
プロファイル情報格納手段18は、システム情報格納181と、シーケンス制御プログラム情報182と、I/O割り付け情報183と、Webサービス情報184などを格納する。
【0205】
プログラマブルコントローラ10と、Webブラウザを搭載するパーソナルコンピュータまたはワークステーションとは、例えば、Ethernet(登録商標)などのネットワーク2により接続されている。
≪プログラマブルコントローラ10の全体動作≫
図26は、プログラマブルコントローラ10のWebサービスの動作を示すフローチャートである。
【0206】
パーソナルコンピュータまたはワークステーション3において、汎用Webブラウザを実行し、プログラマブルコントローラ10のHTMLテキストを指定すると(51)、HTTPでの読み出し要求が実行され、Webサーバ15からHTMLテキスト格納手段16に格納されているHTMLテキストが返送される(52)。
【0207】
HTMLテキストが汎用Webブラウザに読み込まれると、プログラマブルコントローラ10がサポートするWebサービス一覧をメニュー形式で表示する(511)。
【0208】
メニューにハイパーテキストで表示されているWebサービス項目を選択し、ハイパーテキストにリンクされているCGIを呼び出せば、Webサーバ15により、Webサービス起動処理実行手段1720に対して、Webサービス起動情報群1710内の対応するWebサービス起動情報を参照して、対応するWebサービス処理群112内のWebサービスを起動する(54)。
【0209】
シーケンス制御実行エンジン1132は、起動したWebサービスを実行し、Webサービス実行中に作成したHTMLテキストをWebサーバ15に返す(541)。
【0210】
Webサーバ15は、そのHTMLテキストをパーソナルコンピュータまたはワークステーション3に返送し(52)、実行中の汎用HTMLブラウザにおいて表示させる(511)。
【0211】
本実施形態では、Webサービス処理群112をプログラマブルなシーケンス制御手段11で実現したので、Webサービス処理群112がプログラマブルになる。
【0212】
以上の実施形態では、Webサーバ15が、対応するWebサービスを呼び出すために、CGI(Common Gateway Interface)を用いたが、CGIの代わりにSSI(Server Side Include)を用いてもよい。
【0213】
SSIでは、パーソナルコンピュータまたはワークステーション3のWebブラウザからHTMLテキストの読み出し要求が出される際、Webサーバ15は、返送すべきHTMLテキスト中に取り込まれているSSIの処理を見つけ出して実行し、その処理結果をHTMLテキストに置換して返送する。
【0214】
SSIでも、CGIと同様のサービスを実現できる。
【0215】
ここでは、SSIを用いた実施例の詳細な説明を省略する。
【0216】
【発明の効果】
本発明によれば、優先度情報を有する通信内容とこの優先度情報に基づき動作するサービス実行優先度制御手段とが、対応する情報通信サービスの実行順序を制御するので、通信内容により起動される通信サービスのうちで優先して処理すべき通信サービスと後回しにしてよい通信サービスとを判別でき、優先して処理すべき通信サービスを確実にリアルタイム処理できる。
【0217】
プログラマブルコントローラ内のWebサーバと通信処理との間にシーケンス制御連携Webサービスを設けると、Webサーバを搭載するプログラマブルコントローラにおいて、優先して処理すべき通信サービスを確実にリアルタイム処理する効果の他に、プログラマブルなWebサービスを提供できる効果が得られる。
【図面の簡単な説明】
【図1】リアルタイム処理に優れた情報通信サービスを実現するための本発明によるコントローラの基本構成を示すブロック図である。
【図2】パーソナルコンピュータ3または機器32からプログラマブルコントローラ100に送られる通信内容の一例を示す図である。
【図3】サービス実行優先制御921の基本構成および通信内容の推移を示すブロック図である。
【図4】サービス実行優先制御921とタスク実行制御タスク93との連携動作を示すブロック図である。
【図5】タスク実行制御タスク93の動作を示すフローチャートである。
【図6】サービス実行優先制御921とタスク実行制御タスク93との連携動作の他の例を示すブロック図である。
【図7】パーソナルコンピュータ3または機器32からプログラマブルコントローラ100に送られる通信内容の他の例を示す図である。
【図8】サービス実行優先制御921における入力時と出力時の通信内容を示す図である。
【図9】サービス実行優先制御921とタスク実行制御タスク93との連携動作を示すブロック図である。
【図10】複数のサービスを連続起動する場合の通信内容を示す図である。
【図11】起動サービス登録待ち行列への通信内容の一登録例を示す図である。
【図12】起動サービス登録待ち行列への通信内容の一登録例を示す図である。
【図13】複数のサービスを連続起動する場合のタスク実行制御タスク93の動作を示すフローチャートである。
【図14】複数のコントローラ101〜103の間で連動制御する場合の通信内容を示す図である。
【図15】起動サービス登録待ち行列への通信内容の一登録例を示す図である。
【図16】起動サービス登録待ち行列への通信内容の一登録例を示す図である。
【図17】複数のコントローラ間で連動制御するタスク実行制御タスク93の動作を示すフローチャートである。
【図18】通信内容をXMLで表現した場合の一例を示す図である。
【図19】プログラマブルなWebサービスを実現するコントローラのソフトウェアモジュールの基本構成を示すブロック図である。
【図20】プログラマブルコントローラ10のWebサービスの動作を説明するフローチャートである。
【図21】通信処理14が提供するプログラマブルコントローラ専用のコマンド一覧である。
【図22】プロファイル情報格納手段18に格納されているプロファイル情報の一例を示す図である。
【図23】Webサービス追加1715の動作を示すフローチャートである。
【図24】Webサービスをマイコン命令コードで実現する場合のプログラマブルコントローラ10のソフトウェアモジュールの構成を示すブロック図である。
【図25】プログラマブルなWebサービスを実現するコントローラのソフトウェアモジュールの基本構成を示すブロック図である。
【図26】プログラマブルコントローラ10のWebサービスの動作を示すフローチャートである。
【図27】従来のWebサーバ機能を搭載したプログラマブルコントローラの基本構成を示すブロック図である。
【符号の説明】
1,10,100 コントローラ
11 シーケンス制御手段
110 プログラマブルコントローラ基本ブロック
111 シーケンス制御処理
112 Webサービス処理群
1121,1122,1123,1124,1125 Webサービス
113 シーケンス制御実行エンジン
1131 ラダー基本命令手段
1132 応用命令手段
11321 汎用命令手段
11322 HTMLテキスト作成
12 データ入出力手段
13 実行状態制御モニタ
14 通信処理手段
141 メモリライト処理
142 メモリリード処理
143 CPU制御処理
144 I/O制御処理
15 Webサーバ
16 HTMLメニュー
17,170 シーケンス制御Webサービス
1701,1702,1703,1704,1705 Webサービス起動手段
171 Webサービススクリプト群,Webサービスマイコン命令コード群
1710 Webサービス起動情報群
1711,1712,1713,1714,1715 Webサービス
172 Webサービス実行エンジン
1721 通信処理起動ライブラリ
200,2001,2002,2003,200A1,200B1,200C1,200D1,200X1,200Y1,201,2013,21,22,23,23′,2303,23031,25,2503,25031 通信内容
211,221,231,251 優先度
2011,20111 サービス優先度
2012,212,222,2321,2322,2521,2522 起動サービス
2013,213,223,2331,2332,2332′,2531,2532 データ
2301,2302
241 メモリライト起動
242 メモリリード起動
243 CPU制御起動
244 I/O制御起動
1722 命令解釈
1723 汎用処理ライブラリ
1724 HTMLテキスト作成
18 プロファイル情報
181 システムプロファイル情報
182 シーケンス制御プログラムプロファイル情報
183 I/O割り付けプロファイル情報
184 Webサービスプロファイル情報
2 ネットワーク
3 パーソナルコンピュータ
31,32,301,302,303 機器
51,52,53,54,55,56,57,58,59,510,511,540,541 プログラマブルコントローラのWebサービスの動作を示すフローを構成するステップ
61,62,63,64,65,66,67,68 Webサービス追加処理の動作を示すフローを構成するステップ
701,702,7021,7022,70221,703,7031,704,705 タスク実行制御タスクの動作を示すフローを構成するステップ
81 メモリ
82 バス
83 I/Oインタフェース
84 CPU
841 タイマ
8411,8412,8413 タイマ割り込み
842 INT(割り込み)
8421,8422,8423,843 イベント割り込み
85 ネットワーク制御回路
90 Webブラウザ
91,911,912 アプリケーションタスク群
9101,9102,9103,9104,9111,9112,9121,9122 アプリケーションタスク
92 情報通信サービスタスク
921 サービス実行優先度制御
9211 サービス優先度→タスク優先度変換
9212 起動サービスID→タスクID変換
9213 情報変換
9214 サービス優先度〜タスク優先度対応表
9215 起動サービス〜タスク対応表
922 情報通信サービス
93 タスク実行制御タスク
930 サービス起動方法
931 起動サービス登録待ち行列
94 リアルタイムOS
941 I/Oドライバ
942 タスクスケジューラ
943 ネットワークドライバ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a programmable controller that monitors and controls production line devices and robots for industrial applications, a programmable controller that monitors and controls various devices such as air conditioners, security devices, lighting devices, and elevators in buildings and homes, electric power, The present invention relates to a programmable controller that monitors and controls equipment that supports infrastructure such as gas and water, and more particularly, to a controller that communicates with an information communication network represented by the Internet and communicates using Web or XML.
[0002]
[Prior art]
As a prior art of a controller equipped with a Web server corresponding to an information communication network, for example, there is a programmable controller described in JP-A-11-24716.
[0003]
FIG. 27 is a block diagram showing a basic configuration of a programmable controller equipped with a conventional Web server function. The programmable controller (main body) 1 controls sequence control means 11 for executing a sequence program of the programmable controller, input / output processing 12 for inputting / outputting data to / from an input / output module (not shown), and the execution state of the programmable controller. HTML text that stores text representing the monitor control function provided in the programmable controller 1 in a menu format, the communication processing 14 for processing communication with the execution state control monitor 13 to be monitored, the conventional programming tool, and the Web server 15 And storage means 16.
[0004]
The programmable controller 1 and the computer 3 are connected by a network 2 such as Ethernet (registered trademark). The computer 3 may be a personal computer or a workstation 3 as long as it is equipped with a Web browser.
[0005]
When the computer 3 executes a general-purpose Web browser and designates the HTML text of the programmable controller 1, the Web server 15 of the programmable controller 1 executes a read request by HTTP and stores the HTML text stored in the HTML text storage unit 16. Is returned to the computer 3.
[0006]
More specifically, the HTML text is read into a general-purpose web browser, and the monitoring control function supported by the programmable controller 1 is displayed as a web service in a menu format.
[0007]
If a Web service item displayed in hypertext on a menu is selected and a CGI (Common Gateway Interface) linked to the hypertext is called, the Web server 15 performs communication processing 14 for communicating with a conventional programming tool. call.
[0008]
The communication process 14 sends a request to the execution state control monitor 13 with a command dedicated to the programmable controller similar to the conventional one. The communication process 14 returns a response from the execution state control monitor 13 to the Web server 15 in the HTML text format.
[0009]
The Web server 15 returns the response to the computer 3 in the HTML text format and displays it on the general-purpose HTML browser being executed.
[0010]
As this type of prior art, there are controllers described in Japanese Patent Application Laid-Open No. 2000-100810, Japanese Patent Application Laid-Open No. 11-161322, Japanese Patent Application Laid-Open No. 11-249717, and USP 6,061,603.
[0011]
[Problems to be solved by the invention]
In the conventional programmable controller 1, the information communication service represented by the Web server 15 Questions The main objective is to improve the exchange of information between people and devices, and it does not have a function to guarantee real-time processing of important services in communication control between devices. .
[0012]
For example, it is assumed that when a person operates a Web browser of the personal computer 3 to monitor information on the programmable controller 1, a certain control device urgently requests control data of the programmable controller 1.
[0013]
If the communication from the personal computer 3 to the programmable controller 1 is executed even a little earlier than the communication from the control device to the programmable controller 1, the Web server of the programmable controller 1 receives the communication from the outside first. Since the processing is performed in order, the communication that is urgently requested from the control device is not processed unless the communication processing from the personal computer 3 is completed.
[0014]
As described above, in the communication from the control device, the response speed may be deteriorated by other communication even though real time processing such as a comma number of seconds is required.
[0015]
On the other hand, since the process of communication from the personal computer is because the person is monitoring the Web browser, the response speed is not so required, for example, the response from the programmable controller 1 is returned after 2 to 3 seconds. But it doesn't matter.
[0018]
The present invention Eyes The objective is to provide a programmable controller provided with means for enhancing the real-time processing function of an information communication service represented by a Web server and expanding the application range to communication control between devices.
[0020]
[Means for Solving the Problems]
The present invention Note In order to achieve this, service execution priority control means is provided for giving priority information to communication contents and controlling the execution order of corresponding information communication services based on this priority information.
[0021]
That is, the controller of the present invention includes, as programs executed by the CPU, a real-time OS, a group of application tasks managed and executed by the real-time OS, Means for receiving transmitted communication contents by executing a communication IF of a Web server that communicates using the http protocol, and interpreting the received communication contents by executing an XML parser And a task execution control task that is activated by a periodic timer or an event interrupt and controls the execution of the task, and executes a service for monitoring and controlling devices via the network. And the communication content sent to the controller via the network is , A plurality of activation service IDs, and a service priority indicating the priority of services activated by the plurality of activation service IDs It is information including. In this case, the information communication service task service Refer to the task priority conversion table created by associating the priority with the task priority in the controller and stored in the memory. service Converts the priority to the task priority in the controller and activates the communication contents sent to the controller service Multiple activation of communication contents by referring to the task conversion table created by associating the ID with the task ID in the controller and stored in the memory service Service execution priority control for converting each ID into a task ID in the controller is provided. Then, the CPU executes a task corresponding to a plurality of task IDs in the controller converted by the service execution priority control based on the converted task priority in the controller.
[0022]
In addition, the communication content sent to the controller via the network is Furthermore, it includes identification information of a plurality of controllers that are to execute the task, and the activation service ID is recorded in association with each of the identification information of the plurality of controllers, specifies the service to be activated in each controller, and in each controller , Service execution priority control service Priority Self As well as converting to task priority in the controller , Double Number of controllers Identification Of the controller's own controller identification Support information Is recorded Start-up service ID Self Convert to task ID in the controller. Then, the CPU is converted by the service execution priority control. Self Tasks corresponding to a plurality of task IDs in the controller are executed based on the converted task priority in the controller. Also, depending on the communication content, multiple controllers Identification Of the controller's own controller identification Information and this controller identification Support information It was recorded with Start-up service Delete the ID and send it to another controller.
[0036]
The information communication service method of the present invention includes, as a program executed by the CPU, a real-time OS that controls the execution order of tasks based on priority, and a plurality of tasks managed and executed by the real-time OS, Information that is received by executing the communication IF of the Web server that communicates with the HTTP protocol and interpreting the received communication content by executing the XML parser Communication service task Have At the same time, a service for monitoring and controlling devices via a network is executed. Communication contents on the network A plurality of activation service IDs, and a service priority indicating the priority of services activated by the plurality of activation service IDs; It is information including. In this case, the service execution priority control executed by the CPU service Refer to the task priority conversion table created by associating the priority with the task priority in the controller and stored in the memory. service Convert priority to task priority in the controller and start communication service Multiple activation of communication contents by referring to the task conversion table created by associating the ID with the task ID in the controller and stored in the memory service Each ID is converted into a task ID in the controller. Then, the CPU executes a task corresponding to a plurality of task IDs in the controller converted by the service execution priority control based on the converted task priority in the controller.
[0046]
DETAILED DESCRIPTION OF THE INVENTION
Next, an embodiment of a programmable controller according to the present invention and a programmable information communication service to which the controller is applied will be described with reference to FIGS.
<< Embodiment of Controller 1 >>
FIG. 1 is a block diagram showing a basic configuration of a controller according to the present invention for realizing an information communication service excellent in real-time processing.
[0047]
The controller 100 includes a memory 81, an I / O interface 83, a CPU 84, and a network control circuit 85. The memory 81, the I / O interface 83, the CPU 84, and the network control circuit 85 are connected to a bus 82. Yes.
[0048]
The I / O interface 83 connects the device 31 to the programmable controller 100.
[0049]
The CPU 84 includes a timer 841 and an interrupt control circuit INT842.
[0050]
The network control circuit 85 connects the network 2 to the programmable controller 100.
[0051]
A personal computer 3 incorporating a web browser 90 and a device 32 are connected to the network 2. The personal computer 3 may be a PDA or a mobile phone.
[0052]
The memory 81 stores a program executed by the CPU 84. The program includes an operating system OS that is basic software and tasks that are managed and executed by the OS. That is, the program executed by the CPU 84 includes an application task group 91, an information communication service task 92 as information communication service means, a task execution control task 93 as task execution control means, and a real-time OS 94.
[0053]
The application task group 91 includes, for example, four tasks 9101, 9102, 9103, and 9104.
[0054]
Information communication service task 92 executes service priority It consists of a control 921 and an information communication service 922. The information communication service 922 is a Web server, an XML parser, or the like.
[0055]
In particular, when the information communication service 922 is a Web server, the information communication service 922 and the service execution priority The interface with the control 921 is generally CGI.
[0056]
The real-time OS 94 includes an I / O driver 941, a task scheduler 942, and a network driver 943.
[0057]
FIG. 1 shows both the communication content 21 sent from the personal computer 3 to the programmable controller 100 and the communication content 22 sent from the device 32 to the programmable controller 100.
[0058]
The communication content 21 has information such as a priority 211, an activation service ID 212, and data 213 therein, and the communication content 22 includes information such as a priority 221, an activation service ID 222, and data 223 therein.
[0059]
Next, the basic operation of the programmable controller 100 will be described. Based on the task scheduler 942 in the real-time OS 94, the CPU 84 executes tasks in order from the task with the highest priority among the tasks in the executable state registered in the internal task execution queue.
[0060]
If the task to be executed is a task for executing network communication, such as the information communication service task 92, the task reads the communication content received from the network 2 by the network control circuit 85 via the network driver 943. The corresponding communication process is executed. The network communication task passes the communication content to be transmitted obtained in the communication process to the network control circuit 85 to be transmitted to the network 2.
[0061]
On the other hand, if the task to be executed is a task for controlling the device 31, the control task inputs data from the device 31 via the I / O driver 941 and the I / O interface 83 and performs a corresponding control process. Execute. The control task outputs the result obtained by the control processing to the device 31 via the I / O driver 941 and the I / O interface 83, and monitors and controls the device 31.
[0062]
The service execution priority control 921 refers to the priority information and the activation service information in the communication contents 21 and 22 received from the network, finds a task for executing the activation service, and executes the task in order to execute the task. The task 93 is notified.
[0063]
Details of the service execution priority control 921 and the task execution control task 93 will be described later.
[0064]
The task execution control task 93 is activated by a periodic timer or an event interrupt. The task execution control task 93 sets the task to be activated in response to the interrupt factor that activated the task execution control task 93 out of the tasks notified in advance by the service execution priority control 921 to the executable state. The task is registered in a task execution queue managed by the task scheduler 94.
[0065]
The task execution control task 93 may be implemented as an interrupt processing routine instead of a task.
<< Service execution priority control 921 and
Embodiment 1 of Task Execution Control Task 93 >>
A first embodiment of the service execution priority control 921 and the task execution control task 93 will be described with reference to FIGS.
[0066]
FIG. 2 is a diagram illustrating an example of communication contents sent from the personal computer 3 or the device 32 to the programmable controller 100. The communication content 201 includes a service priority 2011, an activation service ID 2012, and data 2013 passed to the activation service. The service priority value and the activation service ID are uniquely defined in the entire system.
[0067]
FIG. 3 is a block diagram showing the basic configuration of the service execution priority control 921 and the transition of communication contents. The service execution priority control 921 includes service priority → task priority conversion 9211, activation service ID → task ID conversion 9212, information conversion 9213, service priority-task priority correspondence table 9214, and activation service-task correspondence table 9215. Become.
[0068]
The service priority to task priority correspondence table 9214 is a conversion table for replacing the service priority with the task priority in each controller. If an appropriate conversion table is created for each controller using this conversion table, the task priority weights can be unified throughout the entire system even if the handling of the task priority differs for each controller.
[0069]
On the other hand, the activation service to task correspondence table 9215 is a conversion table for replacing the activation service ID with a task ID for executing the corresponding activation service in each controller.
[0070]
Communication contents 200, 2001, 2002, and 2003 indicate communication contents including an intermediate progress while the communication contents pass from the information communication service 922 to the task execution control task 93.
[0071]
An operation of the service execution priority control 921 when the service priority of the communication content 200 extracted from the information communication service 922 is 2 and the service ID is 1 will be described.
[0072]
The service execution priority control 921 refers to the service priority to task priority correspondence table 9214 in the service priority → task priority conversion 9211 in the service execution priority control 921, and the task priority corresponding to service priority = 2. 9 is found, and the service priority 2 of the communication content 200 is replaced with the task priority 9 (2001).
[0073]
The service execution priority control 921 refers to the activation service to task correspondence table 9215 in the activation service ID → task ID conversion 9212 and finds 3 as the service ID in the updated communication content 2001 = task ID corresponding to the service 1. The service ID of the communication content is replaced with a task ID (2002).
[0074]
If the communication content sent from the network is character string information such as XML or HTML, finally, in the information conversion 9213, the communication content 2002, which is character string information, is converted into the communication content 2003 of byte code. And passed to the task execution control task 93.
[0075]
If the communication content sent from the network is a byte code from the beginning, the information conversion 9213 is not necessary.
[0076]
FIG. 4 is a block diagram showing a cooperative operation between the service execution priority control 921 and the task execution control task 93. The activation service registration queue 931 includes each service activation method that is a member of the service activation method 930.
[0077]
The service activation method 930 in FIG. 4 includes the following 13 types of service activation methods:
10ms Once: Starts only once with a 10ms period timer
20ms once: Starts only once by 20ms period timer
40ms Once: Starts only once by 40ms period timer
10ms every time: It starts every time by 10ms period timer
20ms every time: Starts every time by 20ms periodic timer
40ms every time: Start every time by 40ms period timer
Event 1 Once: Starts only once when Event 1 occurs
Event 2 Once: Starts only once when Event 2 occurs
Event 3 Once: Starts only once when Event 3 occurs
Event 1 every time: Every time event 1 occurs
Event 2 every time: Every time event 2 occurs
Event 3 every time: Every time event 3 occurs
Immediate start Once: As soon as the service execution priority control registers the communication content, the task execution control task is started immediately and the task corresponding to the registered communication content is started.
Consists of.
[0078]
In the activation service registration queue 931, the communication content 200D1 of <priority 4, task A> is registered in the “10 ms every time” queue, and <priority 5, task B> in the “event 2 once” queue. Communication contents 200C1 are registered, and communication contents 200A1 of <priority 9, task 3> are registered in the "immediate activation once" queue.
[0079]
In FIG. 4, it is assumed that the communication content 200X1 updated in the service execution priority control 921 is registered in the “immediate activation once” queue.
[0080]
The task execution control task 93 is activated by various interrupts. In the example of FIG. 4, the task execution control task 93 includes various interrupts such as a 10 ms timer interrupt 8411, a 20 ms timer interrupt 8411, a 40 ms timer interrupt 8411, an event 1 interrupt 8421, an event 2 interrupt 8422, an event 3 interrupt 8423, and an immediate activation interrupt 843. It is started by.
[0081]
When the service execution priority control 921 registers the communication content 200X1 in the “immediate activation once” queue in the activation service registration queue 931, it immediately causes the immediate activation interrupt 843 to generate an interrupt event.
[0082]
FIG. 5 is a flowchart showing the operation of the task execution control task 93. When the task execution control task 93 is activated by various interrupts, it checks the cause of the interrupt. The task execution control task 93 corresponds to the communication contents for all the communication contents registered in the queue in the service activation method 930 in the activation service registration queue 931 according to the service activation method corresponding to the cause of the interruption. The started task is started (701).
[0083]
The relationship between the interrupt cause and the corresponding service activation method is as follows:
10ms timer interrupt
→ 10ms once, 10ms every time
20ms timer interrupt
→ 20ms once, 20ms every time
40ms timer interrupt
→ 40ms once, 40ms every time
Event 1 interrupt
Event 1 once, event 1 every time
Event 2 interrupt
Event 2 once, event 2 every time
Event 3 interrupt
Event 3 once, event 3 every time
Immediate start interrupt
→ Immediate start Once
It becomes.
[0084]
Specifically, the task activation means that the task scheduler 942 in the real-time OS 94 updates the priority of the task to be activated to the priority value registered in the communication content and makes the task executable. It is to be.
[0085]
At that time, it is checked whether or not the communication content to be executed is registered in “*** once”, ie, the service activation method that is activated only once (702), and is registered in the service activation method that is activated only once. If so, the communication content is deleted from the queue (703).
[0086]
If the service activation method that is activated only once is not registered in 702, the communication content remains registered in the queue.
[0087]
In the case of FIG. 4, the communication content 200X1 updated in the service execution priority control 921 is registered in the “immediate activation once” queue, but the communication content 200X1 is not “immediate activation once”. It may be registered in a queue.
[0088]
FIG. 6 is a block diagram illustrating another example of the cooperative operation between the service execution priority control 921 and the task execution control task 93. Here, the communication content 200X1 is registered in a queue of “10 ms once”.
[0089]
In this case, every time a 10 ms timer interrupt occurs, the task registered in the communication contents registered in the “10 ms once” queue by the service execution priority control 921 is activated.
[0090]
In this case, the service execution priority control 921 does not need to generate an interrupt event in the immediate start interrupt 843 after registering the communication contents.
<< Service execution priority control 921 and
Embodiment 2 of Task Execution Control Task 93 >>
A second embodiment of the service execution priority control 921 and the task execution control task 93 will be described with reference to FIGS.
[0091]
FIG. 7 is a diagram showing another example of communication contents sent from the personal computer 3 or the device 32 to the programmable controller 100. The communication content 201 includes a service priority 2011, a dynamic service ID 2012, and data 2013 to be transferred to the activation service. The service priority 2011 of the second embodiment includes a service priority 20111 and a service activation method 20112. The service priority value and the activation service ID are uniquely defined in the entire system as in the case of FIG.
[0092]
FIG. 8 is a diagram showing communication contents at the time of input and at the time of output in the service execution priority control 921. In FIG. 8, the service execution priority control 921 is the same as in FIG.
[0093]
Communication contents 201 and 2013 indicate communication contents at the time of input and output to the service execution priority control 921 when the communication contents are transferred from the information communication service 922 to the task execution control task 93. In the communication contents 201 and 2013, the service activation method information (in this case, “40 ms once”) is increased as compared with 200 and 2003 in FIG.
[0094]
FIG. 9 is a block diagram illustrating a cooperative operation between the service execution priority control 921 and the task execution control task 93 according to the second embodiment. This configuration is the same as that shown in FIG. 3 except for the communication contents registered in the activation service registration queue 931.
[0095]
The difference from FIG. 3 is that the communication content 200X1 updated in the service execution priority control 921 is registered in a queue corresponding to the “service activation method” of the communication content.
[0096]
For example, in the activation service registration queue 931 in FIG.
“40 ms once” queue: <priority 9, 40 ms once, task 3> communication content 200A1, <priority 23, 40 ms once, task 1> communication content 200B1
"Event 1 every time" queue: <priority 17, event 1 every time, task 4> communication content 200C1,
"Immediate activation once" queue: <priority 4, immediate activation once, task 2> communication content 200D1
The contents of communication are registered.
[0097]
The operation of the task execution control task 93 is the same as that in the above embodiment.
[0098]
In addition to the method described so far, as a service activation method for communication contents, if a new “activation stop” is provided, the service execution priority control 921 has already registered it in the activation service queue 931. Communication contents having the same task ID can be deleted.
[0099]
By referring to the service activation information by this method, the task of communication contents activated every time when a periodic timer or event occurs is excluded from the queue or before the task of communication contents registered in the queue is activated. The task can be removed from the queue and execution of the task can be stopped.
[0100]
According to the above embodiment, the service execution priority control that operates based on the communication content having priority information controls the execution order of the corresponding information communication service. Among these, it is possible to discriminate between communication services to be preferentially processed and communication services that can be postponed, and it is possible to reliably perform real-time processing of communication services to be preferentially processed.
≪Continuous start of multiple services≫
With reference to FIGS. 10 to 13, an embodiment in the case of receiving communication contents including a plurality of services will be described.
[0101]
FIG. 10 is a diagram illustrating communication contents when a plurality of services are continuously activated. In the embodiment of FIG. 10, a controller 1 (101) that monitors and controls the device 1 (301) and a controller 2 (102) that monitors and controls the device 2 (302) are connected by a network 2.
[0102]
In FIG. 10, the controller 1 (101) sends information on the communication content 25 to the controller 2 (102). The communication content 25 includes two activation services executed by the controller 2 (102). The communication content 25 includes priority 251, start service 1 (2521), start service 1 data 1 (2531), start service 2 (2522), and start service 2 data 2 (2532). Become.
[0103]
FIG. 11 is a diagram illustrating an example of registration of communication contents in the activation service registration queue. FIG. 12 is a diagram illustrating an example of registration of communication contents in the activation service registration queue. That is, these drawings are diagrams showing the activation service registration queue 931 in the controller 2 (102).
[0104]
FIG. 11 shows a state in which communication contents are first registered in the “immediate activation once” queue in the service activation method 930 by the service execution priority control 921. Since the communication content 2503 registered in the queue has not yet executed the activation service, task 3 and task 1 corresponding to the activation service 1 (2521) and the activation service 2 (2522) are included in the communication content 2503. It is registered.
[0105]
On the other hand, FIG. 12 shows a situation after the task execution start task 93 executes one task registered in the communication content 2503 from the head in the state of FIG. Since the task 3 corresponding to the first activation service 1 (2521) is activated, the data for the task 3 and the task 3 are deleted from the communication content 25031 registered in the “immediate activation once” queue, Only task 1 corresponding to activation service 2 (2522) to be activated next is registered in communication content 2503.
[0106]
FIG. 13 is a flowchart showing the operation of the task execution control task 93 when a plurality of services are continuously activated. When the task execution control task 93 is activated by various interrupts, it checks the cause of the interrupt. In the service activation method 930 in the activation service registration queue 931, the task execution control task 93 sets the tasks registered in the communication contents for all communication contents registered in the queue corresponding to the cause of the interruption. One is started from the top (701).
[0107]
It is checked whether or not the communication content to be executed is “*** Once”, that is, registered in the service activation method that is activated only once (702). If registered in the service activation method that is activated only once. For example, the task activated this time is deleted from the communication content (7021).
[0108]
At that time, it is confirmed whether or not there is an unexecuted task in the communication content (7022). If there is no task, the communication content is deleted from the queue (703).
[0109]
If the service activation method that is activated only once is not registered in 702, and if an unexecuted task exists in 7022, the communication content remains registered in the queue.
[0110]
In the above processing procedure of the task execution start task 93, when communication contents having a plurality of services are executed, each service in the communication contents is a service start that is started only once.
[0111]
If the service priority of the communication content is set high, these multiple services are executed preferentially, so that reliable real-time processing can be guaranteed.
[0112]
Although FIG. 10 shows an example in which there are two activation services in the communication content, the number of activation services in the communication content is not limited.
≪Interlocking control between multiple controllers≫
An embodiment in which a plurality of controllers perform interlock control will be described with reference to FIGS.
[0113]
FIG. 14 is a diagram illustrating communication contents when a plurality of controllers 101 to 103 perform interlock control. In the embodiment of FIG. 14, a controller 1 (101) that monitors and controls the device 1 (301), a controller 2 (102) that monitors and controls the device 2 (302), and a controller that monitors and controls the device 3 (303). 3 (103) is connected by the network 2.
[0114]
In FIG. 14, the communication contents 23 are sent from the controller 1 (101) to the controller 2 (102). The controller 2 (102) executes the service activated according to the communication content 23, and then transmits the communication content 23 'to the controller 3 (103). The controller 3 (103) activates the service according to the communication content 23 '.
[0115]
The communication contents 23 sent from the controller 1 (101) describe a processing procedure for executing a series of processes in cooperation with a plurality of controllers, that is, a controller to be executed and a service to be executed in the controller. Yes.
[0116]
In the communication content 23 of FIG. 14, a series of processing is going to be executed with the priority 231. First, the activation service A (2321) is executed in the controller 2 (2301), and then in the controller 3 (2302). The start service B (2322) is executed. The processing content 23 is a transition from the controller 1 to the controller 2 to the controller 3, and realizes cooperative control between these controllers.
[0117]
Since the activation service is deleted from the communication content when it is executed, the communication content 23 ′ sent from the controller 2 to the controller 3 is a portion corresponding to the service executed by the controller 3 from the original communication content 23. 2301, 2321 and 2331 are deleted.
[0118]
In addition, the data for the activation service B executed by the controller 3 in the communication content 23 ′ may be changed or added in the controller 2. In that case, the information is updated as compared with the data for the activation service B in the communication content 23.
[0119]
FIG. 15 is a diagram illustrating an example of registration of communication contents in the activation service registration queue. FIG. 16 is a diagram illustrating an example of registration of communication contents in the activation service registration queue. 15 and 16 show the activation service registration queue 931 in the controller 2 (102) and the controller 3 (103).
[0120]
In this embodiment, since the service activation method for communication contents is “10 ms once”, the communication contents are “10 ms once” in the service activation method 930 by the service execution priority control 921 in both FIGS. Registered in the queue.
[0121]
FIG. 17 is a flowchart showing the operation of the task execution control task 93 when interlocking control is performed between a plurality of controllers.
[0122]
When the task execution control task 93 is activated by various interruptions, the cause of the interruption is examined, and in the service activation method 930 in the activation service registration queue 931, a queue constituted by a service activation method corresponding to the cause of the interruption. For all the communication contents registered in (1), one task registered in the communication contents is started from the head (701).
[0123]
It is checked whether or not the communication content to be executed is “*** Once”, that is, registered in the service activation method that is activated only once (702). If registered in the service activation method that is activated only once. For example, the task activated this time is deleted from the communication content (7021).
[0124]
At that time, it is checked whether or not there is an unexecuted task to be executed by the own controller in the communication contents (70221), and if there is not, the activation service information executed by the own controller is deleted in the communication contents. Then, the communication contents are deleted from the queue (7031).
[0125]
Further, it is confirmed whether or not the activation service to be executed in the communication process has become empty (704), and if it is not empty, the communication content is sent to the next controller to be executed.
[0126]
On the other hand, if it is not registered in the service activation method that is activated only once in 702, if there is an unexecuted task that should be executed in its own controller in 70221, the communication content remains registered in the queue. .
[0127]
If the activation service to be executed in the communication content becomes empty in 704, it means that all the services to be executed in the communication content have been executed and the communication content has been completed.
[0128]
In the above processing procedure of the task execution start task 93, when the communication content for executing the interlock control between a plurality of controllers is executed, each service in the communication content is a service start that is started only once.
[0129]
If the service priority of communication contents is set high, these multiple services are executed preferentially, so that reliable real-time processing of interlocking control among multiple controllers can be guaranteed.
[0130]
Although FIG. 14 shows an example of interlock control between three controllers, there is no limit to the number of controllers that perform interlock control.
[0131]
For simplicity, the number of activation services in each controller is one, but the number of activation services is not limited.
[0132]
Furthermore, in the present invention, the case of reception is mainly described. However, when a communication content is newly transmitted, the communication content is basically defined in the communication service to be transmitted.
[0133]
In addition, when receiving and returning a communication content, the priority information of the communication content of the reply is the same as the priority information of the received communication content unless there is a particular problem.
≪XML description of communication contents≫
FIG. 18 is a diagram illustrating an example of communication contents expressed in XML. The portion surrounded by the communication content tag indicates the content of the communication content.
[0134]
Two types of service priority tags and service activation method tags are included in the priority tags, and indicate the service priority and the service activation method.
[0135]
The activation service tag represents an activation service of a node, and includes an execution node tag indicating an execution node ID and a service tag indicating service contents.
[0136]
The service tag includes a service name tag indicating a service ID and a data tag for storing data necessary for service execution.
[0137]
Data in the data tag is stored as a set with a tag indicating the type of data.
[0138]
In the embodiment of FIG. 18, data “ON” is stored in the switch status tag, and the rotation speed 200 is stored in the RPM tag.
[0139]
The number of data stored in the data tag is arbitrary, and the number of services represented by the service tag in the activation service tag is also arbitrary.
[0140]
Further, the number of activation services of the node represented by the activation service tag in the communication content tag is also arbitrary.
[0141]
Furthermore, the service activation method tag and the execution node tag can be omitted.
[0142]
In the above, an example of communication content by XML has been shown. In the case of a complicated processing procedure for starting a plurality of services, such as continuous activation of the plurality of services or interlocking control between a plurality of controllers, in the communication content, There is also a method for realizing communication contents in an agent program that manages continuous activation of these services and interlocking control between controllers.
≪Programmable information communication service≫
≪Web service by script execution≫
<< Overall Configuration of Programmable Controller 10 >>
FIG. 19 is a block diagram illustrating a basic configuration of a software module of the controller 10 that implements a programmable Web service.
In FIG. 19, the programmable controller 10 includes a programmable controller basic block 110, a Web server 15, an HTML menu 16, a sequence control linkage Web service 17, and profile information storage means 18.
[0143]
The programmable controller basic block 110 controls the execution state of the sequence control means 11 for executing the sequence program of the programmable controller, the input / output processing 12 for inputting / outputting data to / from the input / output module, and the programmable controller basic block 110. And an execution state control monitor 13 for monitoring and a communication process 14 for processing communication between the conventional programming tools.
[0144]
The HTML menu 16 is an HTML text storage unit that stores text representing a Web service to the programmable controller 10 described in HTML in a menu format.
[0145]
The sequence control cooperation Web service 17 sequentially executes corresponding processing according to the instruction sequence described in the script language, starts the communication processing 14, and returns the result to the Web server 15 as HTML text.
[0146]
The profile information storage unit 18 stores system information, Web service information, and the like that are referenced or updated by the programmable controller basic block 110.
[0147]
The communication process 14 includes commands dedicated to the programmable controller, such as a memory write process 141, a memory read process 142, a CPU control process 143, and an I / O control process 144, similar to the conventional one.
[0148]
The sequence control cooperation Web service 17 includes a script group 171 describing a Web service and a Web service execution engine 172 that executes the Web service script.
[0149]
As an example, the Web service script group 171 includes a Web service 1 (1711), a Web service 2 (1712), a Web service 3 (1713), a profile display 1714, and a Web service addition 1715.
[0150]
The Web service execution engine 172 includes a communication processing activation library 1721 including command interpretation 1722 that sequentially interprets and executes each command of the script language described in the Web service script, and processing that activates each processing in the communication processing 14. And a general-purpose processing library 1723 consisting of processing for executing general-purpose instructions such as arithmetic operations and character string operations, and HTML text creation 1724 are included.
[0151]
The communication process activation library 1721 includes a memory write activation process 241, a memory read activation process 242, and a CPU that activate the memory write process 141, the memory read process 142, the CPU control process 143, and the I / O control process 144 in the communication process 14, respectively. A control activation process 243 and an I / O control activation process 244;
[0152]
The profile information storage unit 18 stores system information storage 181, sequence control program information 182, I / O allocation information 183, Web service information 184, and the like.
[0153]
The programmable controller 10 and a personal computer or workstation 3 equipped with a Web browser are connected by a network 2 such as Ethernet (registered trademark).
<< Overall Operation of Programmable Controller 10 >>
FIG. 20 is a flowchart for explaining the operation of the Web service of the programmable controller 10.
[0154]
When a general-purpose Web browser is executed in the personal computer or workstation 3 and the HTML text of the programmable controller 10 is designated (51), a read request in HTTP is executed and stored in the HTML text storage means 16 from the Web server 15. The existing HTML text is returned (52).
[0155]
When the HTML text is read into the general-purpose Web browser, a list of Web services supported by the programmable controller 10 is displayed in a menu format (511).
[0156]
If the Web service item displayed in the hypertext on the menu is selected and the CGI linked to the hypertext is called, the Web server 15 calls the corresponding Web service in the Web service script group 171 (53). The called web service is executed according to the processing procedure in the box 540 in FIG.
[0157]
The instruction interpretation 1722 fetches an instruction from the head of the instruction sequence of the script language constituting the called Web service (54), sequentially interprets the instruction in the instruction string constituting the service, and processes in the corresponding library Is called (55).
[0158]
If the instruction interpreted by the instruction interpretation 1722 is an instruction for controlling or monitoring the execution state of the programmable controller basic block 110, the communication processing 14 communicating with the conventional programming tool is called via the communication control activation library 1721. The communication process 14 sends a request to the execution state control monitor 13 with a command dedicated to the programmable controller similar to the conventional one. The response is returned from the communication process 14 to the command interpretation 1722 via the communication process activation library 1721 (57). At that time, the information in the profile information storage means 18 is referred to or updated as necessary.
[0159]
Instruction interpretation 1722 retrieves the next instruction (510).
[0160]
If the interpreted instruction is a general-purpose instruction such as an arithmetic operation or a character string operation, the instruction interpretation 1722 operates a corresponding process in the general-purpose processing library 1723. The instruction interpretation 1722 receives the processing result (58) and takes out the next instruction (510).
[0161]
If the interpreted instruction is HTML text generation, the instruction interpretation 1722 creates an HTML text based on the processing results of other instructions so far (59) and takes out the next instruction (510).
[0162]
If the interpreted command is a script termination command, the command interpretation 1722 terminates the Web service process and returns the created HTML text to the Web server 15 (56). The Web server 15 returns the HTML text to the personal computer or workstation 3 (52), and displays it on the general-purpose HTML browser being executed (511).
≪Communication processing≫
FIG. 21 is a list of commands dedicated to the programmable controller provided by the communication process 14. Memory write processing includes all clear processing that clears the memory area to zero, addressed program transfer processing, memory allocation information, that is, information writing processing where the user program is allocated in the memory, parameter change end processing, timer counter There is a setting value change process.
[0163]
Memory read processing includes address designation program read processing, user program final circuit search processing, and memory allocation information read processing.
[0164]
CPU control processing includes CPU status read processing, CPU operation / stop designation processing, CPU exclusive occupation / cancellation processing, CPU occupation forced cancellation processing, calendar clock setting, and readout processing.
[0165]
As the I / O control processing, I / O No. Monitor processing by designation (continuous N point setting from designated No.), I / O No. Forced set / reset processing by designation (continuous N point setting from designated No.), I / O No. Monitor processing by designation (random N points can be designated), I / O No. There is forced set / reset processing by specification (random N points can be specified).
[0166]
On the other hand, in the communication processing activation library 1721, processing for starting each communication processing is prepared in a one-to-one correspondence with these communication processing.
[0167]
When the basic communication processing and the general-purpose processing in the general-purpose processing library 1723 are executed in combination in the Web service script in the Web service script group 171, various applied Web services can be realized.
≪Profile information≫
FIG. 22 is a diagram showing an example of profile information stored in the profile information storage unit 18.
[0168]
The system information includes version information of the control software, an execution cycle of the sequence program execution task, an interrupt factor of the interrupt program execution task, and an execution state of the programmable controller.
[0169]
Sequence control program information includes the title of each program to be executed, the execution task to which each program is assigned, memory allocation information, comment information for each variable used in the program, various attributes such as data type, size, etc. Information and variable memory allocation information.
[0170]
The I / O allocation information includes various attribute information such as information on the I / O module mounted on each I / O slot of the programmable controller, comment information on each mounted I / O, data type, and size.
[0171]
Web service information includes the title of each registered Web service, memory allocation information, service activation conditions (activation at call, event activation, cyclic activation), title of each process registered in the library, I / O information ( Attribute information such as arguments, return value data type, size), and memory allocation information.
[0172]
The profile information is referred to or updated by the programmable controller basic block 110.
[0173]
The entire profile information is referred to by the profile display service in the Web service group 171 and returned to the personal computer or workstation 3 as HTML text, and the list of profile information can be referred to or updated by the general-purpose Web browser.
[0174]
The profile information is stored in the memory of the programmable controller in the form of a structure or an array, or is stored in a text format using XML (eXtensible Markup Language) in order to increase the efficiency of cooperation with the Web service. .
≪Web service addition operation≫
As described above, the Web service in the Web service script group 171 can be described in a script language that can use the communication process 14 and the general-purpose process 1723, and is programmable. Further, by using the Web service information in the profile information 18, the Web service can be updated (added and deleted) while the programmable controller is operating.
[0175]
FIG. 23 is a flowchart showing the operation of the Web service addition 1715. That is, FIG. 23 is a diagram showing the contents of the service script executed in the Web service operation box 540 of FIG.
[0176]
First, referring to the title and memory allocation information of each Web service registered in the profile information 18, an empty area sufficient to store a new Web service to be added is secured above the memory (61).
[0177]
Next, a new Web service script is downloaded to the temporary memory area of the programmable controller (62).
[0178]
The download is executed using the memory write process 141 in the communication process 14. A general FTP service may be used in TCP / IP.
[0179]
Furthermore, the use variable (63) and use I / O (64) of the downloaded script are compared with the variable information and I / O information registered in the profile information to confirm whether or not they match, If not, the downloaded script is written in the secured area (65).
[0180]
Finally, the start condition of the Web service is set, the Web service start condition in the profile information is updated (66), and the HTML text of the success display is created (67). On the other hand, when an error occurs in the processing procedures 61, 63, 64, 65, an HTML text indicating the error is created (68).
[0181]
If the profile information 18 is referred to, it is easy to delete a registered Web service. Here, description of the Web service deletion procedure is omitted.
[0182]
Here, the embodiment has been described in the case where the Web service is a script. As the script language, Perl language often used in information-related Web servers can be used. The script language may be a self-made script language or another script language.
[0183]
On the other hand, in FIG. 19, each Web service in the Web service group 171 is realized by a standard code such as JAVA (registered trademark) byte code instead of the script language, and the instruction interpretation 1722 executes the byte code. The configuration may be replaced with a virtual machine.
[0184]
Since the configuration and operation of the programmable controller 10 in this case are almost the same as in the case of the script, description thereof is omitted.
≪Web service by direct execution of microcomputer instruction code≫
In the embodiments described so far, the Web service is realized by a script or byte code, and adopts a configuration in which each instruction of the script language is sequentially interpreted and executed in the instruction interpretation 1722, or the byte code is executed as a virtual machine. It was.
[0185]
The Web service can be executed after being compiled into an instruction code of a microcomputer.
[0186]
FIG. 24 is a block diagram illustrating a configuration of a software module of the programmable controller 10 when the Web service is realized by a microcomputer instruction code.
[0187]
There are two differences between the software module of FIG. 19 and the software module of FIG.
[0188]
First, the Web service script group 171 and the internal Web service in FIG. 19 are configured with microcomputer instruction codes instead of scripts in the software module in FIG. Therefore, in FIG. 24, the block 171 is labeled as a Web service microcomputer instruction code group.
[0189]
Secondly, the software module of FIG. 24 does not have the instruction interpretation 1722 of FIG. Call 1724 directly.
[0190]
The operation of the programmable controller 10 in FIG. 24 will be described. The difference in operation between the software module in FIG. 19 and the software module in FIG. 24 is that the processing described in the Web service execution 540 in FIG. 20 is executed by the instruction interpretation 1722 in FIG. In the case of FIG. 24, the microcomputer itself is executing.
[0191]
Other operations are basically the same in the software module of FIG. 19 and the software module of FIG.
[0192]
In order to compile and create a Web service that operates on the programmable controller 10 of FIG. 24, information such as memory allocation for processing in the library registered in the profile information 18 is extracted in advance.
[0193]
Using the extracted information, information such as a jump destination address to processing in the library is inserted into a microcomputer instruction code string of a Web service generated by compilation. When information is inserted into the microcomputer instruction code sequence in this way, the communication processing activation library 1721, the general-purpose processing library 1723, and the HTML text creation 1724 can be directly called.
≪Web service using sequence control≫
<< Overall Configuration of Programmable Controller 10 >>
In the above embodiment, the web service uses the communication processing 14 having the function of communicating with the conventional programming tool in order to control and monitor the execution state of the programmable controller basic block 110. Another embodiment in which the web service process is executed by the sequence control unit 11 without using the communication process 14 will be described.
[0194]
FIG. 25 is a block diagram illustrating a basic configuration of a software module of a controller that realizes a programmable Web service.
[0195]
In FIG. 25, the programmable controller (main body) 10 includes a sequence controller 11 that executes a sequence program of the programmable controller, an input / output process 12 that inputs and outputs data to and from the input / output module, HTML text storage means 16 for storing text representing a Web service to the programmable controller 10 described in HTML in a menu format.
[0196]
The sequence control unit 11 includes a Web service processing group 112 and a sequence control execution engine 113 in addition to the normal sequence control processing 111. The sequence control execution engine 113 interprets the instruction codes of the sequence control processing 111 and the web service processing group 112 and sequentially executes them.
[0197]
As an example, the Web service processing group 112 includes Web service processing such as Web service 1 (1121), Web service 2 (1122), Web service 3 (1123), profile display 1124, and Web service addition 1125.
[0198]
The HTML text creation 11322 converts the processing result of the Web service into HTML text and returns it to the Web server 15.
[0199]
The sequence control execution engine 113 includes ladder basic instruction execution means 1131 and application instruction execution means 1132. The applied instruction execution means 1132 includes general-purpose instruction execution means 11321 that executes general-purpose instructions such as arithmetic operations and character string operations, and HTML text creation 11322.
[0200]
The sequence control cooperative web service 170 activates a service in the web service processing group 112.
[0201]
The sequence control cooperation web service 170 refers to the web service activation information group 1710 including setting information for activating each service in the web service processing group 112 and the web service activation information in the web service activation information group 1710. , And a web service activation process execution means 1720 that executes a process for activating a web service in the corresponding web service processing group 112.
[0202]
The Web service activation information group 1710 is Web service 1 activation, which is setting information for activating the Web service 1, 1122, Web service 2, 1122, Web service 3, 1123, Profile display of 1124, Web service addition 1125 Information 1701, Web service 2 activation information 1702, Web service 3 activation information 1703, and profile display activation information 1704 correspond to Web service additional activation information 1705.
[0203]
The profile information 18 is profile information storage means of the programmable controller 10 that stores system information, Web service information, and the like, and is referred to or updated by the application instruction execution means 1132.
[0204]
The profile information storage unit 18 stores system information storage 181, sequence control program information 182, I / O allocation information 183, Web service information 184, and the like.
[0205]
The programmable controller 10 and a personal computer or workstation equipped with a Web browser are connected by a network 2 such as Ethernet (registered trademark), for example.
<< Overall Operation of Programmable Controller 10 >>
FIG. 26 is a flowchart showing the operation of the Web service of the programmable controller 10.
[0206]
When a general-purpose Web browser is executed in the personal computer or workstation 3 and the HTML text of the programmable controller 10 is designated (51), a read request in HTTP is executed and stored in the HTML text storage means 16 from the Web server 15. The existing HTML text is returned (52).
[0207]
When the HTML text is read into the general-purpose Web browser, a list of Web services supported by the programmable controller 10 is displayed in a menu format (511).
[0208]
When a Web service item displayed in hypertext on the menu is selected and CGI linked to the hypertext is called, the Web server 15 causes the Web service activation processing execution unit 1720 to execute the Web service activation information group 1710. The Web service in the corresponding Web service processing group 112 is started with reference to the corresponding Web service start information (54).
[0209]
The sequence control execution engine 1132 executes the activated web service, and returns the HTML text created during the web service execution to the web server 15 (541).
[0210]
The Web server 15 returns the HTML text to the personal computer or workstation 3 (52) and displays it on the general-purpose HTML browser being executed (511).
[0211]
In the present embodiment, since the web service processing group 112 is realized by the programmable sequence control means 11, the web service processing group 112 becomes programmable.
[0212]
In the above embodiment, the CGI (Common Gateway Interface) is used for the Web server 15 to call the corresponding Web service. However, SSI (Server Side Include) may be used instead of the CGI.
[0213]
In SSI, when an HTML text read request is issued from the personal computer or the Web browser of the workstation 3, the Web server 15 finds and executes the SSI processing included in the HTML text to be returned, and the processing. Replace the result with HTML text and send it back.
[0214]
Even with SSI, a service similar to CGI can be realized.
[0215]
Here, detailed description of the embodiment using SSI is omitted.
[0216]
【The invention's effect】
According to the present invention, the communication content having the priority information and the service execution priority control means operating based on the priority information control the execution order of the corresponding information communication service, so that the communication content is activated by the communication content. Among communication services, a communication service to be preferentially processed and a communication service to be postponed can be discriminated, and a communication service to be preferentially processed can be reliably processed in real time.
[0217]
In addition to the effect of ensuring real-time processing of communication services to be preferentially processed in a programmable controller equipped with a Web server, providing a sequence control cooperation Web service between the Web server in the programmable controller and communication processing, An effect of providing a programmable web service can be obtained.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a basic configuration of a controller according to the present invention for realizing an information communication service excellent in real-time processing.
FIG. 2 is a diagram showing an example of communication contents sent from the personal computer 3 or the device 32 to the programmable controller 100. FIG.
FIG. 3 is a block diagram showing the basic configuration of service execution priority control 921 and the transition of communication contents.
4 is a block diagram showing a cooperative operation between a service execution priority control 921 and a task execution control task 93. FIG.
5 is a flowchart showing the operation of a task execution control task 93. FIG.
FIG. 6 is a block diagram illustrating another example of a cooperative operation between a service execution priority control 921 and a task execution control task 93.
7 is a diagram showing another example of communication contents sent from the personal computer 3 or the device 32 to the programmable controller 100. FIG.
FIG. 8 is a diagram showing communication contents at the time of input and at the time of output in the service execution priority control 921.
9 is a block diagram showing a cooperative operation between a service execution priority control 921 and a task execution control task 93. FIG.
FIG. 10 is a diagram illustrating communication contents when a plurality of services are continuously activated.
FIG. 11 is a diagram showing an example of registration of communication contents in an activation service registration queue.
FIG. 12 is a diagram illustrating an example of registration of communication contents in an activation service registration queue.
FIG. 13 is a flowchart showing the operation of a task execution control task 93 when a plurality of services are continuously activated.
FIG. 14 is a diagram showing communication contents when interlocking control is performed between a plurality of controllers 101 to 103;
FIG. 15 is a diagram illustrating an example of registration of communication contents in an activation service registration queue.
FIG. 16 is a diagram illustrating an example of registration of communication contents in an activation service registration queue.
FIG. 17 is a flowchart showing the operation of a task execution control task 93 that performs interlock control between a plurality of controllers.
FIG. 18 is a diagram illustrating an example of communication contents expressed in XML.
FIG. 19 is a block diagram illustrating a basic configuration of a software module of a controller that realizes a programmable Web service.
FIG. 20 is a flowchart for explaining the operation of the Web service of the programmable controller 10;
FIG. 21 is a list of commands dedicated to the programmable controller provided by the communication process 14;
22 is a diagram showing an example of profile information stored in profile information storage means 18. FIG.
FIG. 23 is a flowchart showing the operation of Web service addition 1715;
FIG. 24 is a block diagram showing a configuration of a software module of the programmable controller 10 when a Web service is realized by a microcomputer instruction code.
FIG. 25 is a block diagram illustrating a basic configuration of a software module of a controller that realizes a programmable Web service.
FIG. 26 is a flowchart showing the operation of the Web service of the programmable controller 10;
FIG. 27 is a block diagram showing a basic configuration of a programmable controller equipped with a conventional Web server function.
[Explanation of symbols]
1,10,100 controller
11 Sequence control means
110 Programmable controller basic block
111 Sequence control processing
112 Web service processing group
1121, 1122, 1123, 1124, 1125 Web services
113 Sequence control execution engine
1131 Ladder basic instruction means
1132 Application instruction means
11321 General purpose command means
11322 Create HTML text
12 Data input / output means
13 Execution state control monitor
14 Communication processing means
141 Memory write processing
142 Memory read processing
143 CPU control processing
144 I / O control processing
15 Web server
16 HTML menu
17,170 Sequence control Web service
1701, 1702, 1703, 1704, 1705 Web service activation means
171 Web service script group, Web service microcomputer instruction code group
1710 Web service activation information group
1711, 1712, 1713, 1714, 1715 Web services
172 Web service execution engine
1721 Communication processing startup library
200, 2001, 2002, 2003, 200A1, 200B1, 200C1, 200D1, 200X1, 200Y1, 201, 2013, 21, 22, 23, 23 ', 2303, 23031, 25, 2503, 25031
211, 221, 231, 251 Priority
2011, 20111 Service priority
2012, 212, 222, 2321, 2322, 2521, 2522 Startup service
2013, 213, 223, 2331, 2332, 2332 ', 2531, 2532 data
2301,3022
241 Memory write start
242 Memory read start
243 CPU control start
244 I / O control start
1722 Instruction Interpretation
1723 General-purpose processing library
1724 HTML text creation
18 Profile information
181 System profile information
182 Sequence control program profile information
183 I / O allocation profile information
184 Web service profile information
2 network
3 Personal computer
31, 32, 301, 302, 303
51, 52, 53, 54, 55, 56, 57, 58, 59, 510, 511, 540, 541 Configuring the flow showing the operation of the programmable controller Web service
61, 62, 63, 64, 65, 66, 67, 68 Steps for configuring a flow showing the operation of the Web service addition processing
701, 702, 7021, 7022, 70221, 703, 7031, 704, 705 Steps constituting a flow showing the operation of the task execution control task
81 memory
82 bus
83 I / O interface
84 CPU
841 Timer
8411, 8412, 8413 Timer interrupt
842 INT (interrupt)
8421, 8422, 8423, 843 Event interrupt
85 Network control circuit
90 Web browser
91,911,912 Application task group
9101, 9102, 9103, 9104, 9111, 9112, 9121, 9122 Application task
92 Information Communication Service Task
921 Service execution priority control
9211 Service priority → Task priority conversion
9212 Activation service ID → Task ID conversion
9213 Information conversion
9214 Service Priority to Task Priority Correspondence Table
9215 Startup Service-Task Correspondence Table
922 Information and communication services
93 Task execution control task
930 Service activation method
931 Activation service registration queue
94 Real-time OS
941 I / O driver
942 Task Scheduler
943 Network Driver

Claims (3)

CPUにより実行されるプログラムとして、リアルタイムOSと、前記リアルタイムOSにより管理実行されるアプリケーションタスク群と、送られてくる通信内容をhttpプロトコルで通信するWebサーバの通信IFを実行することで受け取るとともに、該受け取った通信内容をXMLパーサを実行して解釈する手段を有する情報通信サービスタスクと、周期タイマ又はイベント割り込みにより起動されタスクの実行を制御するタスク実行制御タスクとを含み、ネットワークを介して機器を監視制御するサービスを実行するコントローラにおいて、
前記ネットワークを介して前記コントローラに送られる通信内容が、複数の起動サービスIDと、該複数の起動サービスIDによって起動されるサービスの優先度を表すサービス優先度とを含む情報であり、
前記情報通信サービスタスクが、前記コントローラに送られる通信内容の前記サービス優先度とコントローラ内のタスク優先度とを対応づけて作成されメモリに格納されているタスク優先度変換表を参照して、前記通信内容の前記サービス優先度をコントローラ内の前記タスク優先度に変換するとともに、前記コントローラに送られる通信内容の前記起動サービスIDとコントローラ内のタスクIDとを対応づけて作成されメモリに格納されているタスク変換表を参照して、前記通信内容の複数の前記起動サービスIDをそれぞれコントローラ内の前記タスクIDに変換するサービス実行優先度制御を備え、
前記CPUが、前記サービス実行優先度制御により変換されたコントローラ内の複数の前記タスクIDに対応するタスクを、前記変換されたコントローラ内の前記タスク優先度に基づいて実行することを特徴とするコントローラ。
As a program executed by the CPU, a real-time OS, an application task group that is managed and executed by the real-time OS, and a communication content of a Web server that communicates the communication contents transmitted by the http protocol are received, and An information communication service task having means for interpreting the received communication content by executing an XML parser, and a task execution control task that is activated by a periodic timer or event interrupt and controls the execution of the task, In the controller that executes the service to monitor and control
Communication contents to be sent to the controller via the network is information including a start service ID of multiple, and a service priority indicating the priority of the service that is activated by the activation service ID of said plurality of,
The information communication service task is created by associating the service priority of the communication content sent to the controller with the task priority in the controller and stored in a memory, with reference to the task priority conversion table, converts the service priority of the communication content on the task priority in the controller, is stored in the memory is created and the task ID of the starting service ID and the controller of the communication content to be sent to said controller in correspondence Referring to task conversion table are provided with a service execution priority control for converting a plurality of said start service ID to the task ID of each in the controller of the communication content,
Controller the CPU is a task corresponding to a plurality of the task ID in the controller which is converted by the service execution priority control, and executes, based on the task priority of the converted in the controller .
請求項1に記載のコントローラにおいて、
前記ネットワークを介して前記コントローラに送られる前記通信内容が、さらに、タスクを実行すべき複数のコントローラの識別情報を含み、前記起動サービスIDは、前記複数のコントローラの前記識別情報の各々に対応づけて記録され、各コントローラにおいて起動すべきサービスを特定し、
各コントローラにおいて、前記サービス実行優先度制御は、前記通信内容の前記サービス優先度をコントローラ内の前記タスク優先度に変換するとともに、前記複数のコントローラの識別情報のうち自コントローラの識別情報に対応して前記記録されている前記起動サービスIDをコントローラ内の前記タスクIDに変換し、
前記CPUは、前記サービス実行優先度制御により変換されたコントローラ内の複数の前記タスクIDに対応するタスクを、前記変換されたコントローラ内の前記タスク優先度に基づいて実行し、
前記通信内容から、前記複数のコントローラの識別情報のうち自コントローラの識別情報及び該自コントローラの識別情報に対応づけて前記記録されていた前記起動サービスIDを削除して他のコントローラに送ることを特徴とするコントローラ。
The controller of claim 1, wherein
The communication content to be sent to said controller via said network further includes identification information of a plurality of controllers to execute the task, the activation service ID, correspondence to each of said identification information of said plurality of controllers Identify the services that should be activated on each controller,
In each controller, the service execution priority control, the converts the service priority to the task priority of the own controller, the self controller identification information of the previous Kifuku number of controller identification information of the communication content converting said start service ID that is the recording in correspondence to the task ID in its own controller,
Wherein the CPU, the tasks corresponding to the plurality of the task ID in its own controller, which is converted by the service execution priority control, executed on the basis of the task priority of the converted in the controller,
From the communication content, sending and deleting the activation service ID that had been said recorded in association with the identification information and the free-controller identification information of the controller of the identification information of the plurality of controllers to other controllers A featured controller.
CPUで実行されるプログラムとして、タスクの実行順序を優先度に基づいて制御するリアルタイムOSと前記リアルタイムOSにより管理実行される複数個のタスクを含み、送られてくる通信内容をhttpプロトコルで通信するWebサーバの通信IFを実行することで受け取るとともに、該受け取った通信内容をXMLパーサを実行することで解釈する情報通信サービスタスクを有するとともにネットワークを介して機器を監視制御するサービスを実行するコントローラの情報通信サービス方法において、
ネットワーク上の通信内容が、複数の起動サービスIDと、該複数の起動サービスIDによって起動されるサービスの優先度を表すサービス優先度とを含む情報であり、
CPUで実行されるサービス実行優先度制御が、前記通信内容の前記サービス優先度とコントローラ内のタスク優先度とを対応づけて作成されメモリに格納されているタスク優先度変換表を参照して、前記通信内容の前記サービス優先度をコントローラ内の前記タスク優先度に変換するとともに、前記通信内容の前記起動サービスIDとコントローラ内のタスクIDとを対応づけて作成されメモリに格納されているタスク変換表を参照して、前記通信内容の複数の前記起動サービスIDをそれぞれコントローラ内の前記タスクIDに変換し、
CPUが、前記サービス実行優先度制御により変換されたコントローラ内の複数の前記タスクIDに対応するタスクを、前記変換されたコントローラ内の前記タスク優先度に基づいて実行することを特徴とする情報通信サービス方法。
As a program to be executed by a CPU, a includes a plurality of tasks are managed performed by real-time OS and the real time OS is controlled on the basis of the execution order of tasks in the priority, communicating the communication contents sent by http protocol A controller that executes a communication IF of a Web server and has an information communication service task that interprets the received communication content by executing an XML parser and also executes a service for monitoring and controlling devices via a network In the information communication service method,
Communication contents on the network is information including a start service ID of multiple, and a service priority indicating the priority of the service that is activated by the activation service ID of said plurality of,
The service execution priority control executed by the CPU is created by associating the service priority of the communication content with the task priority in the controller and stored in the memory, with reference to the task priority conversion table. It converts the service priority of the communication content on the task priority in the controller, wherein the activation service ID and association tasks stored in the memory is created convert the task ID in the controller of the communication content Referring to Table, to convert a plurality of said start service ID of the communication content on the task ID of each controller and
Information communication by the CPU, a task corresponding to a plurality of the task ID of the service execution priority controlled by the transformed controller, and executes, based on the task priority of the converted in the controller Service method.
JP2002211508A 2002-07-19 2002-07-19 Controller and information communication service method Expired - Fee Related JP4500484B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002211508A JP4500484B2 (en) 2002-07-19 2002-07-19 Controller and information communication service method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002211508A JP4500484B2 (en) 2002-07-19 2002-07-19 Controller and information communication service method

Publications (2)

Publication Number Publication Date
JP2004054622A JP2004054622A (en) 2004-02-19
JP4500484B2 true JP4500484B2 (en) 2010-07-14

Family

ID=31934727

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002211508A Expired - Fee Related JP4500484B2 (en) 2002-07-19 2002-07-19 Controller and information communication service method

Country Status (1)

Country Link
JP (1) JP4500484B2 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7568198B2 (en) * 2006-01-10 2009-07-28 National Instruments Corporation Control of tasks in a programmable logic controller
US7565654B2 (en) * 2006-01-10 2009-07-21 National Instruments Corporation Programmatic control of tasks in a programmable logic controller
JP4876138B2 (en) * 2009-03-24 2012-02-15 株式会社日立産機システム Control computer and control system
JP5414909B2 (en) * 2010-10-27 2014-02-12 三菱電機株式会社 Programmable controller
WO2012056537A1 (en) * 2010-10-27 2012-05-03 三菱電機株式会社 Programmable controller
JP6138375B2 (en) * 2015-05-27 2017-05-31 三菱電機株式会社 controller
EP3318938A4 (en) 2015-06-30 2019-02-20 Lynkros Technology (Beijing) Co. Ltd. DISTRIBUTED COMPUTER NETWORK SYSTEM AND COMPUTER NODE USED THEREFOR
JP6501694B2 (en) * 2015-11-13 2019-04-17 株式会社日立製作所 Computer system and task execution method of computer system
CN114860321B (en) * 2022-04-06 2023-07-18 网易(杭州)网络有限公司 External device control method, device, equipment and medium based on raspberry pie

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS62212763A (en) * 1986-03-13 1987-09-18 Fujitsu Ltd Job executing system for computer network
JPH0240723A (en) * 1988-07-30 1990-02-09 Nec Corp Message transmission/reception control system
JP3310229B2 (en) * 1989-01-25 2002-08-05 株式会社日立製作所 Program generation method and apparatus
JPH06301655A (en) * 1993-04-14 1994-10-28 Hitachi Ltd Distributed processing system
JP3739897B2 (en) * 1997-07-07 2006-01-25 株式会社東芝 Programmable controller
JPH11249717A (en) * 1998-03-04 1999-09-17 Omron Corp Production equipment control device
JPH11312007A (en) * 1998-04-28 1999-11-09 Hitachi Ltd Programmable controller
JP3841137B2 (en) * 1999-03-03 2006-11-01 株式会社日立製作所 Distributed control system and information processing apparatus

Also Published As

Publication number Publication date
JP2004054622A (en) 2004-02-19

Similar Documents

Publication Publication Date Title
US8302081B2 (en) Data format conversion method and equipment, and controller management system using data format conversion equipment
US7146408B1 (en) Method and system for monitoring a controller and displaying data from the controller in a format provided by the controller
CA2288782C (en) Distributed interface architecture for programmable industrial control systems
JP5167589B2 (en) Application server device and virtual machine program
JP2006504156A (en) Component model for real-time system control
JP2004516540A (en) Web interface to programmable controller
JP4500484B2 (en) Controller and information communication service method
JP2004510231A (en) How to retrieve data from server
JP2024503168A (en) Multi-threaded controller for parallel robots
JP2014085732A (en) Method and device for generating conversion module linking between robot middleware of different types
US7398527B2 (en) Dispatching application steps of an application running on an application server in a client/server environment
JP2521652B2 (en) Application management method using standard protocol
JP2014099061A (en) Controller and program
JP2005108082A (en) Device driver interface method
WO2000023876A2 (en) Enterprise communication protocol
JP4776602B2 (en) Programming device for controller, controller and controller management system
CN115543348A (en) A method of deploying an application
JP2009009444A (en) Programmable controller, programmable controller support apparatus, and programmable controller system
JP2007221364A (en) Expansion method of controller, control system, and control device
CN117032118A (en) Soft PLC system based on industrial Internet of Things
Rajbharti The microchip tcp/ip stack
CN100547967C (en) Grid job manager and grid job management method
CN114356348A (en) Running engine system and application thereof
EP4300295B1 (en) Method and apparatus for executing workflow task across control objects
JP2002041128A (en) Production navigation system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20040420

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20060425

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20060509

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060710

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20061031

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20091026

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100118

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100308

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100419

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

Free format text: PAYMENT UNTIL: 20130423

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20130423

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20140423

Year of fee payment: 4

LAPS Cancellation because of no payment of annual fees