JP4024603B2 - Programmable controller - Google Patents

Programmable controller Download PDF

Info

Publication number
JP4024603B2
JP4024603B2 JP2002194665A JP2002194665A JP4024603B2 JP 4024603 B2 JP4024603 B2 JP 4024603B2 JP 2002194665 A JP2002194665 A JP 2002194665A JP 2002194665 A JP2002194665 A JP 2002194665A JP 4024603 B2 JP4024603 B2 JP 4024603B2
Authority
JP
Japan
Prior art keywords
execution
control
processor
programmable controller
scan
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 - Lifetime
Application number
JP2002194665A
Other languages
Japanese (ja)
Other versions
JP2004038555A (en
Inventor
宏之 日下部
斉 大畑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2002194665A priority Critical patent/JP4024603B2/en
Publication of JP2004038555A publication Critical patent/JP2004038555A/en
Application granted granted Critical
Publication of JP4024603B2 publication Critical patent/JP4024603B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は鉄鋼、製紙プラントや上下水道などの公共システム、自動車産業など産業用システムの制御に広く使用されているプログラマブルコントローラに関する。
【0002】
【従来の技術】
図16は管理プロセッサ及び制御用専用プロセッサ(以下、専用プロセッサと呼ぶ)を有する従来のプログラマブルコントローラの1スキャンの動作を示している図である。ここで、1スキャンとは、シーケンスプログラムの実行及びシーケンスプログラム実行に関連した一連の処理行程を意味し、具体的には、プログラマブルコントローラに接続されている入出力モジュールと入出力データのやりとりを行うI/O入出力、シーケンスプログラム中のタイマ演算において使われるタイマ値を更新するタイマ更新、及びシーケンスプログラム実行で構成されている。
【0003】
この図においては、管理プロセッサは、I/O入出力およびタイマ更新を行い、これらの処理が完了した後にシーケンスプログラム実行用の専用プロセッサへ起動要求を行い、起動要求を受け付けた専用プロセッサは、シーケンスプログラムを実行し、実行が完了すると管理プロセッサへ完了通知を発行する。一方、専用プロセッサがシーケンスプログラムを実行している間は、管理プロセッサは並列処理として、上位監視装置との伝送処理を行っている。そして、専用プロセッサからの完了通知を受け付けた管理プロセッサは、再びI/O入出力から始まる1スキャンの動作を繰り返す。
【0004】
【発明が解決しようとする課題】
ところで、このような管理プロセッサの動作においては、管理プロセッサがスキャン全体の管理を行っているため、I/O入出力、タイマ更新及び専用プロセッサのための起動によるオーバーヘッド時間が発生する。また、現在の制御システムにおいては、上位監視装置とプログラムコントローラとの接続は必須となってきているため、管理プロセッサの伝送処理による負荷は増大する傾向がある。
【0005】
このため、これらの要因から、より高速なスキャン周期の制御を必要とする分野においては、プログラマブルコントローラを適用できないという課題がある。即ち、低速なスキャン周期の場合には、上述した管理用プロセッサがI/O入出力およびタイマ更新を行い、これらの処理が完了した後にシーケンスプログラム実行用の制御用専用プロセッサがシーケンスプログラム実行を実施するという方式で問題はないが、より高速なスキャン周期の場合においては、管理プロセッサへの負荷が大きいため、現状方式のプログラマブルコントローラを適用することができないという課題がある。
【0006】
本発明は、上記の課題を解決するためになされたものであり、高速なスキャン周期を実現可能とするプログラマブルコントローラを提供することを目的とする。
【0007】
【課題を解決するための手段】
上記目的を達成するため、請求項1に記載の本発明は、全体の制御を行う管理プロセッサと、シーケンスプログラムを格納するためのプログラムメモリと、シーケンスプログラム演算結果と実行回数と実行完了回数および制御周期を格納するためのデータメモリと、シーケンスプログラム実行用の制御処理専用プロセッサとを備えて、入出力処理とタイマ更新処理とシーケンスプログラム実行処理からなるスキャン処理を一定周期で行うプログラマブルコントローラにおいて、前記シーケンスプログラムの実行回数を記憶する実行回数記憶手段と、前記シーケンスプログラムの実行完了回数を記憶する実行完了回数記憶手段と、前記一定周期を制御周期として記憶する制御周期記憶手段と、前記制御処理専用プロセッサが前記実行回数記憶手段、実行完了回数記憶手段及び制御周期記憶手段に記憶された値に基づいてスキャン制御動作するために必要なデータである前記制御周期を設定した後に、スキャンの開始を表すための前記実行回数を更新し、前記制御処理専用プロセッサは前記実行回数と前記実行完了回数の差異を監視することで前記スキャン処理を一定周期で実行するように制御するスキャン制御手段と、を有することを要旨とする。
【0008】
請求項1記載の本発明にあっては、管理プロセッサと制御処理専用プロセッサを備えたプログラマブルコントローラにおいて、実行回数記憶手段、実行完了回数記憶手段、及び制御周期記憶手段を設けることにより、制御処理専用プロセッサが、入出力処理、タイマ更新処理、及びシーケンスプログラム実行処理からなる一定周期のスキャン処理を実行する。これにより、一定周期のスキャン処理において、従来、管理プロセッサが実行していた入出力処理及びタイマ更新処理を、制御処理専用プロセッサが実行するので、管理プロセッサの負荷が軽減され、高速なスキャン周期の制御が可能となる。
【0009】
請求項2記載の本発明は、請求項1記載の本発明において、前記実行回数記憶手段は、前記管理プロセッサによって前記一定周期ごとに実行回数値が更新され、前記実行完了回数記憶手段は、前記制御処理専用プロセッサによってシーケンスプログラム実行完了後に実行完了回数値が更新され、前記スキャン制御手段は、前記実行回数値と前記実行完了回数値との間に差異が生じた場合に前記制御処理専用プロセッサが前記入出力処理を開始し、前記制御周期記憶手段に記憶している制御周期を差分タイマ値として用いてタイマ更新処理を行う前記タイマ更新処理を実行するように制御することを要旨とする。
【0010】
請求項2記載の本発明にあっては、管理プロセッサが一定周期で実行回数値を更新し、制御処理専用プロセッサがシーケンスプログラム実行完了後に実行完了回数値を更新する。そして、制御処理専用プロセッサが実行回数値と実行完了回数値との差に基づき入出力処理を開始し、制御周期を用いてタイマ更新処理を実行する。これにより、専用制御プロセッサは、実行回数値と実行完了回数値を監視していれば、制御周期を把握できるので、入出力処理から始まる一連のスキャン処理を開始することができる。また、制御周期記憶手段に記憶している制御周期を差分タイマ値としてタイマ更新処理をすることができる。
【0011】
請求項3記載の本発明は、請求項記載の発明において、前記スキャン制御手段は、前記実行回数値と前記実行完了回数値との間に差異が生じた場合に、前記制御処理専用プロセッサが前記管理プロセッサに異常状態の旨を通知するように制御することを要旨とする。
【0012】
請求項3記載の本発明にあっては、実行回数値と実行完了回数値に基づいて、制御処理専用プロセッサが、スキャン動作の異常状態を検知し、その旨を管理プロセッサに通知する。これにより、管理プロセッサは、制御処理専用プロセッサのスキャン動作の異常状態を把握できるので、異常状態の場合はユーザに通知することができる。
【0013】
請求項4記載の本発明は、請求項1記載の発明において、前記実行回数記憶手段、実行完了回数記憶手段及び制御周期記憶手段は、制御周期を計測するカウンタ回路に設けられていることを要旨とする。
【0014】
請求項4記載の本発明にあっては、実行回数記憶手段、実行完了回数記憶手段、制御周期記憶手段を有するカウンタ回路を付加することにより、制御処理専用プロセッサが、カウンタ入出力処理、タイマ更新処理、及びシーケンスプログラム実行処理からなるスキャン処理を実行する。これにより、従来、管理プロセッサが実行していた入出力処理及びタイマ更新処理を、ハードウェアとしてのカウンタ回路を利用することで、制御処理専用プロセッサが実行するので、管理プロセッサの負荷が軽減され、高速なスキャン周期の制御が可能となる。
【0015】
請求項5記載の本発明は、請求項4記載の発明において、前記実行回数記憶手段は、前記カウンタ回路によって前記一定周期ごとに実行回数値が更新され、前記実行完了回数記憶手段は、前記制御処理専用プロセッサによってシーケンスプログラム実行完了後に実行完了回数値が更新され、前記スキャン制御手段は、前記実行回数値と前記実行完了回数値との間に差異が生じた場合に前記制御処理専用プロセッサが前記入出力処理を開始し、前記制御周期記憶手段に記憶している制御周期を差分タイマ値として用いて前記タイマ更新処理を実行するように制御することを要旨とする。
【0016】
請求項5記載の本発明にあっては、カウンタ回路が一定周期で実行回数値を更新し、制御処理専用プロセッサがシーケンスプログラム実行完了後に実行完了回数値を更新する。そして、制御処理専用プロセッサが実行回数値と実行完了回数値との差に基づき入出力処理を開始し、制御周期を用いてタイマ更新処理を実行する。これにより、専用制御プロセッサは、実行回数値と実行完了回数値を監視していれば、制御周期を把握できるので、入出力処理から始まる一連のスキャン処理を開始することができる。また、制御周期記憶手段に記憶している制御周期を差分タイマ値としてタイマ更新処理をすることができる。
【0024】
【発明の実施の形態】
以下、本発明の実施の形態を図面を用いて説明する。
【0025】
<第1の実施の形態>
図1は、本発明の第1の実施の形態に係るプログラマブルコントローラ1の構成を示している。このプログラマブルコントローラ1は、管理プロセッサ11、プログラムメモリ(第1のメモリ)12、データメモリ(第2のメモリ)13、I/O装置14、専用プロセッサ15、ワークメモリ18、通信インタフェース19、バス16及び17、及びモニタ装置10を備えている。
【0026】
管理プロセッサ11は、プログラマブルコントローラの中枢部分であり、プログラマブルコントローラ全体の管理を行うCPUである。専用プロセッサ15は、シーケンスプログラム実行用のプロセッサであるが、本発明においては、I/O入出力、タイマ更新およびシーケンスプログラム実行を行うCPUとなっている。
【0027】
プログラムメモリ(第1メモリ)12はユーザが作成したシーケンスプログラムを格納するメモリであり、データメモリ(第2メモリ)13はユーザが使用する変数や専用プロセッサが動作するためのデータを格納するメモリである。図2に示すように、データメモリ13には、実行カウンタ131、完了カウンタ132及び制御周期133が設けられており、これにより、後述するように管理プロセッサ11と専用プロセッサ15の動作に同期がとられるようになっている。
【0028】
実行カウンタ131は、シーケンスプログラムの実行回数を記憶する記憶域であり、管理プロセッサ11が、一定周期で実行カウンタ131をインクリメントするようになっている。完了カウンタ132は、シーケンスプログラムの実行完了回数を記憶する記憶域であり、専用プロセッサ15がシーケンスプログラム実行終了後に完了カウンタ132をインクリメントするようになっている。制御周期133は、1スキャンの周期を記憶する記憶域であり、一定周期を制御周期として記憶している。
【0029】
I/O装置14はプログラマブルコントローラ1と外部の制御対象機器を接続するための入出力装置であり、これを介して制御対象機器と入出力データのやりとりを行うようになっている装置である。バス16は管理プロセッサ11および専用プロセッサ15とがプログラマブルコントローラ1内の各要素を接続するバスであり、このバス16により、アドレス信号、データ信号、制御信号をやりとりする。バス17は管理プロセッサ11と管理プロセッサ11だけが管理する各要素を接続するバスであり、アドレス信号、データ信号、制御信号をやりとりする。
【0030】
ワークメモリ18は管理プロセッサ11の作業領域用のメモリである。モニタ装置10は、シーケンスプログラムの動作をモニタしたり、ユーザからプログラマブルコントローラ1へ制御指令を行う装置であり、通信インターフェース19はプログラマブルコントローラ1とモニタ装置10などを通信媒体を介して接続するためのインターフェース回路である。
【0031】
次に、本実施の形態のプログラマブルコントローラ1の動作を、図3及び図4を用いて説明する。図3は、実行カウンタ値、完了カウンタ値と専用プロセッサ15のスキャン動作を対比させたものであり、図4は、管理プロセッサ11及び専用プロセッサ15の動作をフローチャートとして表したものである。
【0032】
まず、プログラマブルコントローラ1の起動により、管理プロセッサ11は専用プロセッサ15を起動させる(ステップS11、S21)。
【0033】
管理プロセッサ11は、一定周期(制御周期)ごとに実行カウンタ131をインクリメントする(ステップS12、S13、図3(1))。
【0034】
一方、専用プロセッサ15は実行カウンタ131及び専用カウンタ132のカウンタ値を参照し、両値を比較して、実行カウンタ131が更新されていれば(実行カウンタ値=完了カウンタ値+1)、スキャン処理を開始してよいものと判断して、I/O入出力処理を行う(ステップS22〜S24)。次に、データメモリ13に記憶された制御周期133の値を差分タイマ値としてタイマ更新処理を行う(ステップS25)。そして、シーケンスプログラムを実行し、シーケンスプログラムの実行が終了すると、完了カウンタ132の値をインクリメントする(ステップS26、S27)。
【0035】
これにより、1スキャンの処理が終了するが、再び制御周期が経過すれば、管理プロセッサ11は、次スキャンを開始し、上述したスキャン処理を繰り返す(図3(2))。
【0036】
また、管理プロセッサ11は、I/O入出力からシーケンスプログラム実行までの一連のスキャン処理が正常に動作しているかどうかを判断するため、完了カウンタレジスタ132を監視している。これは、予め決められた時間、完了カウンタ132が更新されなければ、専用プロセッサ15の動作を異常と判断して、この事象をユーザに通知するものである。
【0037】
尚、異常事態の検知に関しては、専用プロセッサ15がスキャン開始時において、実行カウンタレジスタ131及び完了カウンタレジスタ132の値を比較して、実行カウンタと完了カウンタの値の差が1より大きい場合には、スキャン渋滞が発生したものと判断して、管理プロセッサ11に通知するようにしても良い(図3(3))。
【0038】
従って、本実施の形態のプログラマブルコントローラ1によれば、実行カウンタ131、完了カウンタ132及び制御周期133をデータメモリ13上を設けることにより、管理プロセッサ11は実行カウンタ131の更新という最小限の処理をするだけで、専用プロセッサ15が一定周期におけるI/O入出力、タイマ更新、シーケンスプログラムの実行を行うことが可能となるので、プログラマブルコントローラ1は高速なスキャン周期を実現することができる。
【0039】
また、スキャン動作の渋滞などの異常事態も検知して、この事態をユーザに通知することができる。
【0040】
<第2の実施の形態>
図5は、本発明の第2の実施の形態に係るプログラマブルコントローラ2の構成を示している。本実施の形態のプログラマブルコントローラ2は、第1の実施の形態で有していた実行カウンタ131、完了カウンタ132及び制御周期133をデータメモリ13上から独立させて、これらの機能をカウンタ回路26として加えたものである。従って、このプログラマブルコントローラ2は、管理プロセッサ21、プログラムメモリ(第1のメモリ)22、データメモリ(第2のメモリ)23、I/O装置14、専用プロセッサ25、カウンタ回路26、ワークメモリ18、通信インタフェース19、バス16及び17、モニタ装置10を備えている。尚、第1の実施の形態のプログラマブルコントローラ1の構成と同一部分には同一符号を付して説明を省略する。
【0041】
第1の実施の形態と同様に、管理プロセッサ21は、プログラマブルコントローラ2の中枢部分であり、プログラマブルコントローラ2全体の管理を行うCPUとなっている。専用プロセッサ25は、シーケンスプログラム実行用のプロセッサであるが、本発明においては、I/O入出力、タイマ更新およびシーケンスプログラム実行を行うCPUとなっている。また、プログラムメモリ(第1メモリ)22はユーザが作成したシーケンスプログラムを格納するメモリであり、データメモリ(第2メモリ)23はユーザが使用する変数や専用プロセッサが動作するためのデータを格納するメモリである。
【0042】
カウンタ回路26は、図6に示すような構成となっている。制御周期設定レジスタ261、基準パルス発生部262、基準パルス計数カウンタ263及び比較部264は、一定周期で実行カウンタレジスタ265をインクリメントするためのものである。制御周期設定レジスタ261は、第1の実施の形態における制御周期133に相当するものであり、管理プロセッサ21が起動時に一定周期である制御周期値(基準パルス数に換算)を設定する。そして、基準パルス発生部262は、基準パルスを発生させるものであり、基準パルス計数カウンタ263は、この基準パルスの数を計測するものである。そして、比較部264は、制御周期設定レジスタ261の値と基準パルス計数カウンタ263の値を比較するものであり、一致する場合には、制御周期が経過したものと判断して実行カウンタレジスタ265をインクリメントするようになっている。
【0043】
実行カウンタレジスタ265は、第1の実施の形態における実行カウンタ131に相当し、シーケンスプログラムの実行回数を記憶する記憶域であり、上述したように制御周期ごとにインクリメントされるようになっている。完了カウンタレジスタ266は、第1の実施の形態における完了カウンタ132に相当し、シーケンスプログラムの実行完了回数を記憶する記憶域であり、専用プロセッサ25がシーケンスプログラム実行終了後に完了カウンタレジスタ266をインクリメントするようになっている。また、監視部267は、実行カウンタレジスタ265及び完了カウンタレジスタ266のカウンタ値に基づき、専用プロセッサ25の異常事態を管理プロセッサ21に通知するものである。
【0044】
次に、本実施の形態のプログラマブルコントローラ2の動作を、図7及び図8を用いて説明する。図7は、専用プロセッサ25のスキャン動作を各カウンタ値及び各種信号と対比させたものであり、図8は、管理プロセッサ21、専用プロセッサ25及びカウンタ回路26の動作をフローチャートとして表したものである。
【0045】
まず、プログラマブルコントローラ2の起動により、まず管理プロセッサ21は専用プロセッサ25を起動させる(ステップS31、ステップS41)。
【0046】
次に、管理プロセッサ21は、カウンタ回路26の制御周期設定レジスタ261に制御周期(一定周期)を書き込む(ステップS32)。
【0047】
一方、制御周期が書き込まれたカウンタ回路26は、基準パルス計数カウンタ263により、基準パルス発生部262から発生された基準パルスの数を計測する(ステップS51)。そして、比較部264が、制御周期設定レジスタ261に設定された制御周期設定値と基準パルス計数カウンタ263のカウンタ値を比較し、等しい場合には、実行カウンタレジスタ265をインクリメントする(ステップS52〜S54、図7(1))。これにより、カウンタ回路26は、基準パルスを利用して制御周期を正確に把握することができる。尚、実行カウンタレジスタ265をインクリメントした後は、基準パルス計数カウンタ263の値はクリアーされる(ステップS55)。
【0048】
専用プロセッサ25は、実行カウンタレジスタ265及び専用カウンタレジスタ266の値を参照し、両値を比較して、実行カウンタレジスタ265が更新されていれば(実行カウンタ値=完了カウンタ値+1)、スキャン処理を開始してよいものと判断して、I/O入出力処理を行う(ステップS42〜S44)。次に、制御周期設定レジスタ261に記憶された制御周期の値を差分タイマ値としてタイマ更新処理を行う(ステップS45)。そして、シーケンスプログラムを実行し、シーケンスプログラムの実行が終了すると、完了カウンタレジスタ266のカウンタ値をインクリメントする(ステップS46、S47)。
【0049】
そして、専用プロセッサ26は、上述したスキャン処理を一定周期で繰り返す(図7(2))。
【0050】
また、監視部267は、実行カウンタレジスタ265及び完了カウンタレジスタ266を監視している。具体的には、実行カウンタレジスタ265の値が更新されてから、完了カウンタレジスタ266の値が更新されるまでの間に、再度実行カウンタレジスタ265の更新が発生したか否かを監視する。これは、完了カウンタ266の更新前に実行カウンタ265が再度更新されたならば、スキャン渋滞が発生していると判断して、スキャン渋滞が発生していることを割り込み信号として管理プロセッサ21に通知し、管理プロセッサ21は、この事象をユーザに通知するものである(図7(3))。
【0051】
従って、本実施の形態のプログラマブルコントローラ2によれば、カウンタ回路26を設けることにより、管理プロセッサ21はカウンタ回路26内の制御周期を設定するだけで、専用プロセッサ25が一定周期でのI/O入出力、タイマ更新、シーケンスプログラムの実行を行うことが可能となるので、プログラマブルコントローラ2は高速なスキャン周期を実現することができる。
【0052】
また、スキャン動作の渋滞などの異常事態も検知し、この事態をユーザに通知することができる。
【0053】
<第3の実施の形態>
図9は、本発明の第3の実施の形態に係るプログラマブルコントローラ3の構成を示している。本実施の形態のプログラマブルコントローラ3は、タイマ回路36を設けることにより、フローティング周期のスキャン処理を行うものである。従って、このプログラマブルコントローラ3は、管理プロセッサ31、プログラムメモリ(第1のメモリ)32、データメモリ(第2のメモリ)33、I/O装置14、専用プロセッサ35、タイマ回路36、ワークメモリ18、通信インタフェース19、バス17及び18、及びモニタ装置10を備えている。尚、第1の実施の形態のプログラマブルコントローラ1の構成と同一部分には同一符号を付して説明を省略する。
【0054】
第1の実施の形態と同様に、管理プロセッサ31は、プログラマブルコントローラ3の中枢部分であり、プログラマブルコントローラ全体の管理を行うCPUとなっている。専用プロセッサ35は、シーケンスプログラム実行用のプロセッサであるが、本発明においては、I/O入出力、タイマ更新およびシーケンスプログラム実行を行うCPUとなっている。また、プログラムメモリ(第1メモリ)32はユーザが作成したシーケンスプログラムを格納するメモリであり、データメモリ(第2メモリ)33はユーザが使用する変数や専用プロセッサが動作するためのデータを格納するメモリである。ここで、データメモリ(第2メモリ)33は図10に示すように、完了カウンタ331及び差分基準パルス計数カウンタ332が設けられており、これにより、フローティング周期でのスキャン処理及び異常時の検出が可能となっている。
【0055】
完了カウンタ331は、シーケンスプログラムの実行完了回数を記憶する記憶域であり、専用プロセッサ35がシーケンスプログラム実行終了後に完了カウンタ331をインクリメントするようになっている。差分基準パルス計数カウンタ332は、スキャン処理のI/O入出力後の基準パルス計数カウンタ361のカウンタ値を記憶する記憶域である。
【0056】
タイマ回路36は、基準パルスを発生させる基準パルス発生部361と、この基準パルスの数を計測する基準パルス計数カウンタ363で構成されており、このタイマ回路36により、後述するように専用プロセッサ35はフローティング周期を把握できるようになっている。
【0057】
次に、本実施の形態のプログラマブルコントローラ3の動作を、図12及び図13を用いて説明する。図12は、専用プロセッサ35のスキャン動作を各カウンタ値及び各種信号と対比させたものであり、図13は、管理プロセッサ31、専用プロセッサ35及びタイマ回路36の動作をフローチャートとして表したものである。
【0058】
まず、プログラマブルコントローラ3の起動により、まず管理プロセッサ31は専用プロセッサ35を起動させる(ステップS61、ステップS71)。また、プログラマブルコントローラ3の起動により、タイマ回路36の基準パルス計数カウンタ362は、基準パルスの数を計測する(ステップS81)。
【0059】
これにより、専用プロセッサ35は、I/O入出力から始まる一連のスキャン処理を開始する(ステップS72)。I/O入出力後、基準パルス計数カウンタ362のカウンタ値を参照して、このときのカウンタ値を差分基準パルス計数カウンタ332に書き込む(ステップS73、S74)。そして、更新前と更新後の差分基準パルス計数カウンタ332のカウンタ値の差を差分タイマ値として、タイマ更新処理を行う(ステップS75)。これにより、フローティング周期における制御周期が、シーケンスプログラムの実行に取り込むことができる。次に、シーケンスプログラムを実行し、シーケンスプログラムの実行が終了すると、完了カウンタ331の値をインクリメントする(ステップS76、S77)。
【0060】
以上で1スキャンの処理が終了するが、フローティング周期でのスキャン処理においては、スキャン処理の終了すると次スキャンが即座に開始される(図12(1)、(2))。
【0061】
また、管理プロセッサ31は、I/O入出力からシーケンスプログラム実行までの一連のスキャン処理が正常に動作しているかどうかを判断するため、完了カウンタ331を監視している。これは、予め定められた時間、完了カウンタ331が更新されなければ、専用プロセッサ35の動作を異常と判断して、この事象をユーザに通知するものである。
【0062】
従って、本実施の形態のプログラマブルコントローラ3によれば、タイマ回路36を設けることにより、管理プロセッサ31は専用プロセッサ35の起動をするのみで、専用プロセッサ35がフローティング周期でのI/O入出力、タイマ更新、シーケンスプログラムの実行を行うことが可能となるので、プログラマブルコントローラ3は高速なスキャン周期を実現することができる。
【0063】
また、スキャン動作の渋滞などの異常事態も検知し、この事態をユーザに通知することができる。
【0064】
<第4の実施の形態>
図14は、本発明の第4の実施の形態に係るプログラマブルコントローラ4の構成を示している。本実施の形態のプログラマブルコントローラ4は、カウンタ回路46とタイマ回路47を設けることにより、一定周期の場合もフローティング周期の場合もスキャン処理が可能なプログラマブルコントローラである。従って、このプログラマブルコントローラ4は、管理プロセッサ41、プログラムメモリ(第1のメモリ)42、データメモリ(第2のメモリ)43、I/O装置14、専用プロセッサ45、カウンタ回路46、タイマ回路47、ワークメモリ18、通信インタフェース19、バス17及び18、及びモニタ装置10を備えている。尚、第1の実施の形態のプログラマブルコントローラ1の構成と同一部分には同一符号を付して説明を省略する。また、カウンタ回路46、タイマ回路47についても、前述したカウンタ回路26、タイマ回路36と同様であるため、説明を省略する。
【0065】
第1の実施の形態と同様に、管理プロセッサ41は、プログラマブルコントローラ4の中枢部分であり、プログラマブルコントローラ4全体の管理を行うCPUとなっている。専用プロセッサ45は、シーケンスプログラム実行用のプロセッサであるが、本発明においては、I/O入出力、タイマ更新およびシーケンスプログラム実行を行うCPUとなっている。また、プログラムメモリ(第1メモリ)42はユーザが作成したシーケンスプログラムを格納するメモリであり、データメモリ(第2メモリ)43はユーザが使用する変数や専用プロセッサが動作するためのデータを格納するメモリである。ここで、データメモリ(第2メモリ)43は、完了カウンタ431及び差分基準パルス計数カウンタ432が設けられているが(図示せず)、これについては、第3の実施の形態の完了カウンタ331及び差分基準パルス計数カウンタ332と同様であるため、説明を省略する。
【0066】
次に、本実施の形態のプログラマブルコントローラ4の動作を、カウンタ回路46及びタイマ回路47と、管理プロセッサ41及び専用プロセッサ45との信号のやりとりを表す図15を用いて説明する。
【0067】
まず、プログラマブルコントローラ4の起動により、管理プロセッサ41は専用プロセッサ45を起動させるが、このときに管理プロセッサ41は制御条件(一定周期でスキャンを行うか、フローティング周期でスキャンを行うかを指定する)を専用プロセッサ45に与える。専用プロセッサ45は、この制御条件により、制御する動作モードを判定し、判定された動作モードにおけるスキャン処理を行う。ここで、本実施の形態における一定周期のスキャン処理は、第2の実施の形態におけるスキャン処理と同様であり、カウンタ回路46から制御周期設定値、実行カウンタを参照して、スキャン処理を行い、スキャン処理終了後、完了カウンタを更新する。また、フローティング周期のスキャン処理は、第3の実施の形態におけるスキャン処理と同様であり、タイマ回路47から基準パルス計数カウンタを参照して、スキャン処理を行う。
【0068】
また、異常動作の検知についても、第2の実施の形態(一定周期の場合)、及び第3の実施の形態(フローティング周期の場合)の検知方法と同じであるため、説明は省略する。但し、ゲート48は一定周期の動作を指定した場合にのみ有効となるので、この場合にのみ異常動作検知の割り込み信号は管理プロセッサ41に通知される。
【0069】
従って、本実施の形態のプログラマブルコントローラ4によれば、カウンタ回路46及びタイマ回路47を設け、制御条件を与えると、専用プロセッサ45が一定周期もしくはフローティング周期でのI/O入出力、タイマ更新、シーケンスプログラムの実行を行うことが可能となるので、プログラマブルコントローラ4は高速なスキャン周期を実現することができる。
【0070】
また、一定周期においてもフローティング周期においても、スキャン動作の渋滞などの異常事態も検知し、この事態をユーザに通知することができる。
【0071】
【発明の効果】
以上説明したように、本発明のプログラマブルコントローラによれば、一定周期の場合において、専用プロセッサがI/O入出力、タイマ更新及びシーケンスプログラム実行からなるスキャン処理を実行し、管理プロセッサの負荷を軽減できるので、高速なスキャン周期を実現とすることができる。
【0072】
また、フローティング周期の場合においても、専用プロセッサがI/O入出力、タイマ更新及びシーケンスプログラム実行からなるスキャン処理を実行し、管理プロセッサの負荷を軽減できるので、高速なスキャン周期を実現とすることができる。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態に係るプログラマブルコントローラの概略構成図である。
【図2】本発明の第1の実施の形態に係るプログラマブルコントローラのデータメモリの概略構成図である。
【図3】本発明の第1の実施の形態に係るプログラマブルコントローラの動作を説明する図である。
【図4】本発明の第1の実施の形態に係るプログラマブルコントローラの管理プロセッサ及び専用プロセッサの動作を説明するフローチャートである。
【図5】本発明の第2の実施の形態に係るプログラマブルコントローラの概略構成図である。
【図6】本発明の第2の実施の形態に係るプログラマブルコントローラのカウンタ回路の概略構成図である。
【図7】本発明の第2の実施の形態に係るプログラマブルコントローラの動作を説明する図である。
【図8】本発明の第2の実施の形態に係るプログラマブルコントローラの管理プロセッサ、専用プロセッサ、及びカウンタ回路の動作を説明するフローチャートである。
【図9】本発明の第3の実施の形態に係るプログラマブルコントローラの概略構成図である。
【図10】本発明の第3の実施の形態に係るプログラマブルコントローラのデータメモリの概略構成図である。
【図11】本発明の第3の実施の形態に係るプログラマブルコントローラのタイマ回路の概略構成図である。
【図12】本発明の第3の実施の形態に係るプログラマブルコントローラの動作を説明する図である。
【図13】本発明の第3の実施の形態に係るプログラマブルコントローラの管理プロセッサ、専用プロセッサ、及びタイマ回路の動作を説明するフローチャートである。
【図14】本発明の第4の実施の形態に係るプログラマブルコントローラの概略構成図である。
【図15】本発明の第4の実施の形態に係るプログラマブルコントローラのカウンタ回路、タイマ回路を説明する図である。
【図16】従来のプログラマブルコントローラの1スキャンを説明する図である。
【符号の説明】
1,2,3,4 プログラマブルコントローラ
10 モニタ装置
11,21,31,41 管理プロセッサ
12,22,32,42 プログラムメモリ(第1メモリ)
13,23,33,43 データメモリ(第2メモリ)
14 I/O装置
15,25,35,45 専用プロセッサ
16,17 バス
18 ワークメモリ
19 通信インターフェース
26,46 カウンタ回路
36,47 タイマ回路
131 実行カウンタ
132,331 完了カウンタ
133 制御周期
261 制御周期設定レジスタ
262,361 基準パルス発生部
263,362 基準パルス計数カウンタ
264 比較部
265 実行カウンタレジスタ
266 完了カウンタレジスタ
267 監視部
332 差分基準パルス計数カウンタ
361 差分基準パルス計数カウンタ
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a programmable controller widely used for controlling industrial systems such as steel, paper manufacturing plants, public systems such as water and sewage systems, and the automobile industry.
[0002]
[Prior art]
FIG. 16 is a diagram showing a one-scan operation of a conventional programmable controller having a management processor and a dedicated processor for control (hereinafter referred to as a dedicated processor). Here, one scan means execution of a sequence program and a series of processing steps related to execution of the sequence program. Specifically, the input / output data is exchanged with an input / output module connected to the programmable controller. It consists of I / O input / output, timer update for updating timer values used in timer operations in sequence programs, and sequence program execution.
[0003]
In this figure, the management processor performs I / O input / output and timer update, and after these processes are completed, makes a startup request to the dedicated processor for executing the sequence program. The program is executed, and when the execution is completed, a completion notification is issued to the management processor. On the other hand, while the dedicated processor is executing the sequence program, the management processor performs transmission processing with the host monitoring apparatus as parallel processing. Then, the management processor that has received the completion notification from the dedicated processor repeats the operation of one scan starting from I / O input / output again.
[0004]
[Problems to be solved by the invention]
By the way, in such operation of the management processor, since the management processor manages the entire scan, overhead time is generated due to I / O input / output, timer update, and activation for the dedicated processor. In the current control system, since the connection between the host monitoring device and the program controller is indispensable, the load due to the transmission processing of the management processor tends to increase.
[0005]
Therefore, due to these factors, there is a problem that the programmable controller cannot be applied in a field that requires higher-speed scan cycle control. That is, in the case of a low-speed scan cycle, the above-described management processor performs I / O input / output and timer update, and after these processes are completed, the dedicated processor for control for sequence program execution executes the sequence program. Although there is no problem with the method of doing, there is a problem that in the case of a faster scan cycle, the load on the management processor is large, so that the programmable controller of the current method cannot be applied.
[0006]
The present invention has been made to solve the above-described problems, and an object thereof is to provide a programmable controller that can realize a high-speed scan cycle.
[0007]
[Means for Solving the Problems]
In order to achieve the above object, the present invention described in claim 1 includes a management processor that performs overall control, A program memory for storing a sequence program, a data memory for storing a sequence program calculation result, the number of executions, the number of execution completions, and a control cycle; A dedicated processor for control processing for sequence program execution , In a programmable controller that performs scanning processing consisting of input / output processing, timer update processing, and sequence program execution processing at a constant cycle, execution number storage means for storing the number of executions of the sequence program, and completion of execution of the sequence program Execution completion count storage means for storing the number of times, control cycle storage means for storing the fixed period as a control period, and the processor dedicated to the control process store in the execution count storage means, execution completion count storage means, and control cycle storage means Based on the value After setting the control cycle, which is data necessary for the scan control operation, the execution count for indicating the start of the scan is updated, and the processor dedicated to the control process calculates the difference between the execution count and the execution completion count. By monitoring the scan process at regular intervals The gist of the invention is to have a scan control means for controlling to execute.
[0008]
In the present invention described in claim 1, in a programmable controller having a management processor and a processor dedicated to control processing, dedicated control processing is provided by providing execution count storage means, execution completion count storage means, and control cycle storage means. The processor executes a scan process with a fixed period including an input / output process, a timer update process, and a sequence program execution process. As a result, in the scan processing of a fixed cycle, the input / output processing and timer update processing that have been conventionally executed by the management processor are executed by the processor dedicated to the control processing, so the load on the management processor is reduced, and the high-speed scan cycle Control becomes possible.
[0009]
According to a second aspect of the present invention, in the first aspect of the present invention, in the execution number storage unit, the management processor updates an execution number value for each fixed period, and the execution completion number storage unit The execution completion number value is updated after completion of the sequence program execution by the control processing dedicated processor, and the scan control means calculates the execution number value and the execution completion number value. If there is a difference between The control processing dedicated processor starts the input / output processing, and stores the control cycle stored in the control cycle storage means. As differential timer value The gist of the present invention is to perform control so that the timer update process for performing the timer update process is executed.
[0010]
In the present invention described in claim 2, the management processor updates the execution count value at a constant period, and the control processing processor updates the execution completion count value after completion of the sequence program execution. Then, the dedicated processor for control processing starts input / output processing based on the difference between the execution count value and the execution completion count value, and executes timer update processing using the control cycle. As a result, the dedicated control processor can grasp the control cycle as long as the execution count value and the execution completion count value are monitored, and thus can start a series of scan processing starting from input / output processing. In addition, the timer update process can be performed using the control cycle stored in the control cycle storage means as the difference timer value.
[0011]
The present invention described in claim 3 provides 2 In the described invention, the scan control means includes the execution count value and the execution completion count value. If there is a difference between The gist is that the control-dedicated processor performs control so as to notify the management processor of an abnormal state.
[0012]
In the present invention described in claim 3, based on the execution count value and the execution completion count value, the processor dedicated to control processing detects an abnormal state of the scan operation and notifies the management processor to that effect. As a result, the management processor can grasp the abnormal state of the scan operation of the processor dedicated to control processing, and can notify the user of the abnormal state.
[0013]
According to a fourth aspect of the present invention, in the first aspect of the invention, the execution number storage unit, the execution completion number storage unit, and the control cycle storage unit are provided in a counter circuit that measures a control cycle. And
[0014]
In the present invention described in claim 4, by adding a counter circuit having an execution count storage means, an execution completion count storage means, and a control cycle storage means, the control processing dedicated processor can perform counter input / output processing, timer update A scan process including a process and a sequence program execution process is executed. As a result, by using a counter circuit as hardware, the input / output processing and timer update processing that were conventionally executed by the management processor are executed by the processor dedicated to control processing, so the load on the management processor is reduced, A high-speed scan cycle can be controlled.
[0015]
According to a fifth aspect of the present invention, in the invention according to the fourth aspect, the execution count storage means updates the execution count value for each fixed period by the counter circuit, and the execution completion count storage means The execution completion number value is updated after execution of the sequence program by the processing-dedicated processor, and the scan control means calculates the execution number value and the execution completion number value. If there is a difference between The control processing dedicated processor starts the input / output processing, and stores the control cycle stored in the control cycle storage means. As differential timer value The gist is to perform control so as to execute the timer update process.
[0016]
In the present invention described in claim 5, the counter circuit updates the execution count value at a constant period, and the control processing dedicated processor updates the execution completion count value after completion of the sequence program execution. Then, the dedicated processor for control processing starts input / output processing based on the difference between the execution count value and the execution completion count value, and executes timer update processing using the control cycle. As a result, the dedicated control processor can grasp the control cycle as long as the execution count value and the execution completion count value are monitored, and thus can start a series of scan processing starting from input / output processing. In addition, the timer update process can be performed using the control cycle stored in the control cycle storage means as the difference timer value.
[0024]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0025]
<First Embodiment>
FIG. 1 shows the configuration of a programmable controller 1 according to the first embodiment of the present invention. The programmable controller 1 includes a management processor 11, a program memory (first memory) 12, a data memory (second memory) 13, an I / O device 14, a dedicated processor 15, a work memory 18, a communication interface 19, and a bus 16. 17 and the monitor device 10.
[0026]
The management processor 11 is a central part of the programmable controller and is a CPU that manages the entire programmable controller. The dedicated processor 15 is a processor for executing a sequence program. In the present invention, the dedicated processor 15 is a CPU that performs I / O input / output, timer update, and sequence program execution.
[0027]
A program memory (first memory) 12 is a memory for storing a sequence program created by a user, and a data memory (second memory) 13 is a memory for storing variables used by the user and data for operating a dedicated processor. is there. As shown in FIG. 2, the data memory 13 is provided with an execution counter 131, a completion counter 132, and a control cycle 133, which synchronizes the operations of the management processor 11 and the dedicated processor 15 as will be described later. It is supposed to be.
[0028]
The execution counter 131 is a storage area for storing the number of executions of the sequence program, and the management processor 11 increments the execution counter 131 at a constant period. The completion counter 132 is a storage area for storing the number of times the sequence program has been executed, and the dedicated processor 15 increments the completion counter 132 after the sequence program has been executed. The control cycle 133 is a storage area for storing a cycle of one scan, and stores a fixed cycle as a control cycle.
[0029]
The I / O device 14 is an input / output device for connecting the programmable controller 1 and an external control target device, and is a device that exchanges input / output data with the control target device via the input / output device. The bus 16 is a bus for connecting each element in the programmable controller 1 to the management processor 11 and the dedicated processor 15. The bus 16 exchanges address signals, data signals, and control signals. The bus 17 connects the management processor 11 and each element managed only by the management processor 11, and exchanges address signals, data signals, and control signals.
[0030]
The work memory 18 is a memory for a work area of the management processor 11. The monitor device 10 is a device for monitoring the operation of the sequence program and for giving a control command from the user to the programmable controller 1. The communication interface 19 is used for connecting the programmable controller 1 and the monitor device 10 through a communication medium. It is an interface circuit.
[0031]
Next, the operation of the programmable controller 1 according to the present embodiment will be described with reference to FIGS. 3 compares the execution counter value and the completion counter value with the scan operation of the dedicated processor 15, and FIG. 4 shows the operations of the management processor 11 and the dedicated processor 15 as a flowchart.
[0032]
First, the management processor 11 starts the dedicated processor 15 by starting the programmable controller 1 (steps S11 and S21).
[0033]
The management processor 11 increments the execution counter 131 every fixed period (control period) (steps S12 and S13, FIG. 3 (1)).
[0034]
On the other hand, the dedicated processor 15 refers to the counter values of the execution counter 131 and the dedicated counter 132, compares both values, and if the execution counter 131 has been updated (execution counter value = completion counter value + 1), scan processing is performed. It is determined that the process can be started, and I / O input / output processing is performed (steps S22 to S24). Next, timer update processing is performed using the value of the control period 133 stored in the data memory 13 as a difference timer value (step S25). Then, the sequence program is executed, and when the execution of the sequence program ends, the value of the completion counter 132 is incremented (steps S26 and S27).
[0035]
As a result, the process of one scan is completed, but when the control cycle elapses again, the management processor 11 starts the next scan and repeats the above-described scan process (FIG. 3 (2)).
[0036]
In addition, the management processor 11 monitors the completion counter register 132 in order to determine whether a series of scan processing from I / O input / output to sequence program execution is operating normally. If the completion counter 132 is not updated for a predetermined time, the operation of the dedicated processor 15 is determined to be abnormal, and this event is notified to the user.
[0037]
Regarding the detection of an abnormal situation, when the dedicated processor 15 compares the values of the execution counter register 131 and the completion counter register 132 at the start of scanning, and the difference between the values of the execution counter and the completion counter is greater than 1, Alternatively, it may be determined that a scan congestion has occurred, and the management processor 11 may be notified (FIG. 3 (3)).
[0038]
Therefore, according to the programmable controller 1 of the present embodiment, by providing the execution counter 131, the completion counter 132, and the control cycle 133 on the data memory 13, the management processor 11 performs a minimum process of updating the execution counter 131. The dedicated processor 15 can perform I / O input / output, timer update, and execution of a sequence program in a fixed cycle, so that the programmable controller 1 can realize a high-speed scan cycle.
[0039]
Further, it is possible to detect an abnormal situation such as a traffic jam in the scanning operation and notify the user of this situation.
[0040]
<Second Embodiment>
FIG. 5 shows a configuration of the programmable controller 2 according to the second embodiment of the present invention. The programmable controller 2 according to the present embodiment makes the execution counter 131, the completion counter 132, and the control cycle 133 that were included in the first embodiment independent from the data memory 13, and these functions are used as the counter circuit 26. It is added. Accordingly, the programmable controller 2 includes a management processor 21, a program memory (first memory) 22, a data memory (second memory) 23, an I / O device 14, a dedicated processor 25, a counter circuit 26, a work memory 18, A communication interface 19, buses 16 and 17, and a monitor device 10 are provided. In addition, the same code | symbol is attached | subjected to the part same as the structure of the programmable controller 1 of 1st Embodiment, and description is abbreviate | omitted.
[0041]
As in the first embodiment, the management processor 21 is a central part of the programmable controller 2 and is a CPU that manages the entire programmable controller 2. The dedicated processor 25 is a processor for executing a sequence program. In the present invention, the dedicated processor 25 is a CPU that performs I / O input / output, timer update, and sequence program execution. A program memory (first memory) 22 is a memory for storing a sequence program created by a user, and a data memory (second memory) 23 is for storing variables used by the user and data for operating a dedicated processor. It is memory.
[0042]
The counter circuit 26 has a configuration as shown in FIG. The control cycle setting register 261, the reference pulse generation unit 262, the reference pulse count counter 263, and the comparison unit 264 are for incrementing the execution counter register 265 at a constant cycle. The control cycle setting register 261 corresponds to the control cycle 133 in the first embodiment, and the management processor 21 sets a control cycle value (converted to the reference pulse number) that is a fixed cycle at the time of activation. The reference pulse generator 262 generates a reference pulse, and the reference pulse count counter 263 measures the number of reference pulses. The comparison unit 264 compares the value of the control cycle setting register 261 with the value of the reference pulse count counter 263. If they match, the comparison unit 264 determines that the control cycle has elapsed and sets the execution counter register 265. It is designed to increment.
[0043]
The execution counter register 265 corresponds to the execution counter 131 in the first embodiment, and is a storage area for storing the number of executions of the sequence program, and is incremented for each control cycle as described above. The completion counter register 266 corresponds to the completion counter 132 in the first embodiment, and is a storage area for storing the number of execution completions of the sequence program. The dedicated processor 25 increments the completion counter register 266 after completion of the sequence program execution. It is like that. The monitoring unit 267 notifies the management processor 21 of an abnormal situation of the dedicated processor 25 based on the counter values of the execution counter register 265 and the completion counter register 266.
[0044]
Next, the operation of the programmable controller 2 of the present embodiment will be described with reference to FIGS. FIG. 7 compares the scanning operation of the dedicated processor 25 with each counter value and various signals, and FIG. 8 shows the operations of the management processor 21, the dedicated processor 25, and the counter circuit 26 as a flowchart. .
[0045]
First, when the programmable controller 2 is activated, the management processor 21 first activates the dedicated processor 25 (step S31, step S41).
[0046]
Next, the management processor 21 writes a control cycle (constant cycle) in the control cycle setting register 261 of the counter circuit 26 (step S32).
[0047]
On the other hand, the counter circuit 26 in which the control period is written measures the number of reference pulses generated from the reference pulse generator 262 by the reference pulse count counter 263 (step S51). Then, the comparison unit 264 compares the control cycle setting value set in the control cycle setting register 261 with the counter value of the reference pulse count counter 263, and if they are equal, the execution counter register 265 is incremented (steps S52 to S54). FIG. 7 (1)). Thus, the counter circuit 26 can accurately grasp the control cycle by using the reference pulse. Note that after the execution counter register 265 is incremented, the value of the reference pulse count counter 263 is cleared (step S55).
[0048]
The dedicated processor 25 refers to the values of the execution counter register 265 and the dedicated counter register 266, compares both values, and if the execution counter register 265 has been updated (execution counter value = completion counter value + 1), scan processing is performed. I / O input / output processing is performed (steps S42 to S44). Next, timer update processing is performed using the value of the control cycle stored in the control cycle setting register 261 as the difference timer value (step S45). Then, the sequence program is executed, and when the execution of the sequence program ends, the counter value of the completion counter register 266 is incremented (steps S46 and S47).
[0049]
Then, the dedicated processor 26 repeats the above-described scanning process at a constant cycle (FIG. 7 (2)).
[0050]
In addition, the monitoring unit 267 monitors the execution counter register 265 and the completion counter register 266. Specifically, it is monitored whether or not the execution counter register 265 is updated again after the value of the execution counter register 265 is updated until the value of the completion counter register 266 is updated. This is because if the execution counter 265 is updated again before the completion counter 266 is updated, it is determined that a scan congestion has occurred, and the management processor 21 is notified as an interrupt signal that the scan congestion has occurred. The management processor 21 notifies the user of this event ((3) in FIG. 7).
[0051]
Therefore, according to the programmable controller 2 of the present embodiment, by providing the counter circuit 26, the management processor 21 only sets the control cycle in the counter circuit 26, and the dedicated processor 25 allows the I / O at a constant cycle. Since the input / output, timer update, and execution of the sequence program can be performed, the programmable controller 2 can realize a high-speed scan cycle.
[0052]
Further, it is possible to detect an abnormal situation such as a congestion of the scanning operation and notify the user of this situation.
[0053]
<Third Embodiment>
FIG. 9 shows the configuration of the programmable controller 3 according to the third embodiment of the present invention. The programmable controller 3 of the present embodiment performs a floating period scan process by providing a timer circuit 36. Accordingly, the programmable controller 3 includes a management processor 31, a program memory (first memory) 32, a data memory (second memory) 33, an I / O device 14, a dedicated processor 35, a timer circuit 36, a work memory 18, A communication interface 19, buses 17 and 18, and a monitor device 10 are provided. In addition, the same code | symbol is attached | subjected to the part same as the structure of the programmable controller 1 of 1st Embodiment, and description is abbreviate | omitted.
[0054]
As in the first embodiment, the management processor 31 is a central part of the programmable controller 3 and is a CPU that manages the entire programmable controller. The dedicated processor 35 is a processor for executing a sequence program. In the present invention, the dedicated processor 35 is a CPU that performs I / O input / output, timer update, and sequence program execution. A program memory (first memory) 32 is a memory for storing a sequence program created by a user, and a data memory (second memory) 33 is for storing variables used by the user and data for operating a dedicated processor. It is memory. Here, as shown in FIG. 10, the data memory (second memory) 33 is provided with a completion counter 331 and a difference reference pulse count counter 332, thereby enabling scan processing in a floating period and detection of an abnormality. It is possible.
[0055]
The completion counter 331 is a storage area for storing the number of completions of execution of the sequence program, and the dedicated processor 35 increments the completion counter 331 after completion of the sequence program execution. The differential reference pulse count counter 332 is a storage area for storing the counter value of the reference pulse count counter 361 after the I / O input / output of the scan process.
[0056]
The timer circuit 36 includes a reference pulse generator 361 that generates a reference pulse, and a reference pulse count counter 363 that measures the number of the reference pulses. The floating cycle can be grasped.
[0057]
Next, the operation of the programmable controller 3 of the present embodiment will be described with reference to FIGS. FIG. 12 compares the scan operation of the dedicated processor 35 with each counter value and various signals, and FIG. 13 shows the operations of the management processor 31, the dedicated processor 35, and the timer circuit 36 as a flowchart. .
[0058]
First, when the programmable controller 3 is activated, the management processor 31 first activates the dedicated processor 35 (steps S61 and S71). In addition, when the programmable controller 3 is activated, the reference pulse count counter 362 of the timer circuit 36 measures the number of reference pulses (step S81).
[0059]
Thereby, the dedicated processor 35 starts a series of scan processes starting from I / O input / output (step S72). After the I / O input / output, the counter value of the reference pulse count counter 362 is referred to, and the counter value at this time is written to the difference reference pulse count counter 332 (steps S73 and S74). Then, a timer update process is performed using the difference between the counter values of the difference reference pulse count counter 332 before and after the update as a difference timer value (step S75). Thereby, the control period in the floating period can be taken into execution of the sequence program. Next, the sequence program is executed, and when the execution of the sequence program ends, the value of the completion counter 331 is incremented (steps S76 and S77).
[0060]
Thus, one scan process is completed, but in the scan process in the floating period, the next scan is immediately started when the scan process is completed (FIGS. 12A and 12B).
[0061]
In addition, the management processor 31 monitors the completion counter 331 in order to determine whether a series of scan processing from I / O input / output to sequence program execution is operating normally. In this case, if the completion counter 331 is not updated for a predetermined time, the operation of the dedicated processor 35 is determined to be abnormal, and this event is notified to the user.
[0062]
Therefore, according to the programmable controller 3 of the present embodiment, by providing the timer circuit 36, the management processor 31 only activates the dedicated processor 35, and the dedicated processor 35 can perform I / O input / output in the floating cycle, Since the timer update and the execution of the sequence program can be performed, the programmable controller 3 can realize a high-speed scan cycle.
[0063]
Further, it is possible to detect an abnormal situation such as a congestion of the scanning operation and notify the user of this situation.
[0064]
<Fourth embodiment>
FIG. 14 shows the configuration of the programmable controller 4 according to the fourth embodiment of the present invention. The programmable controller 4 of the present embodiment is a programmable controller that can perform a scanning process in both a constant cycle and a floating cycle by providing a counter circuit 46 and a timer circuit 47. Accordingly, the programmable controller 4 includes a management processor 41, a program memory (first memory) 42, a data memory (second memory) 43, an I / O device 14, a dedicated processor 45, a counter circuit 46, a timer circuit 47, A work memory 18, a communication interface 19, buses 17 and 18, and a monitor device 10 are provided. In addition, the same code | symbol is attached | subjected to the part same as the structure of the programmable controller 1 of 1st Embodiment, and description is abbreviate | omitted. Further, the counter circuit 46 and the timer circuit 47 are the same as the counter circuit 26 and the timer circuit 36 described above, and thus description thereof is omitted.
[0065]
As in the first embodiment, the management processor 41 is a central part of the programmable controller 4 and is a CPU that manages the entire programmable controller 4. The dedicated processor 45 is a processor for executing a sequence program. In the present invention, the dedicated processor 45 is a CPU that performs I / O input / output, timer update, and sequence program execution. A program memory (first memory) 42 is a memory for storing a sequence program created by a user, and a data memory (second memory) 43 is for storing variables used by the user and data for operating a dedicated processor. It is memory. Here, the data memory (second memory) 43 is provided with a completion counter 431 and a difference reference pulse count counter 432 (not shown). These are the completion counter 331 and the third embodiment. Since it is the same as that of the difference reference pulse count counter 332, description is abbreviate | omitted.
[0066]
Next, the operation of the programmable controller 4 according to the present embodiment will be described with reference to FIG. 15 showing the exchange of signals between the counter circuit 46 and the timer circuit 47, the management processor 41 and the dedicated processor 45.
[0067]
First, when the programmable controller 4 is activated, the management processor 41 activates the dedicated processor 45. At this time, the management processor 41 specifies a control condition (whether scanning is performed at a constant cycle or scanning is performed at a floating cycle). Is given to the dedicated processor 45. The dedicated processor 45 determines an operation mode to be controlled based on the control condition, and performs a scan process in the determined operation mode. Here, the scan process with a fixed period in the present embodiment is the same as the scan process in the second embodiment, and the scan process is performed by referring to the control cycle set value and the execution counter from the counter circuit 46. After completion of the scanning process, the completion counter is updated. The floating period scan process is the same as the scan process in the third embodiment, and the scan process is performed by referring to the reference pulse count counter from the timer circuit 47.
[0068]
Also, the detection of abnormal operation is the same as the detection method of the second embodiment (in the case of a constant cycle) and the third embodiment (in the case of a floating cycle), and thus the description thereof is omitted. However, since the gate 48 is effective only when an operation of a certain period is designated, an interrupt signal for detecting an abnormal operation is notified to the management processor 41 only in this case.
[0069]
Therefore, according to the programmable controller 4 of the present embodiment, when the counter circuit 46 and the timer circuit 47 are provided and a control condition is given, the dedicated processor 45 performs I / O input / output, timer update, Since the sequence program can be executed, the programmable controller 4 can realize a high-speed scan cycle.
[0070]
In addition, it is possible to detect an abnormal situation such as a congestion of the scanning operation in both the fixed period and the floating period, and notify the user of this situation.
[0071]
【The invention's effect】
As described above, according to the programmable controller of the present invention, the dedicated processor executes scan processing including I / O input / output, timer update, and sequence program execution in the case of a fixed period, thereby reducing the load on the management processor. Therefore, a high-speed scan cycle can be realized.
[0072]
Even in the case of a floating cycle, the dedicated processor can execute scan processing consisting of I / O input / output, timer update, and sequence program execution, and the load on the management processor can be reduced. Can do.
[Brief description of the drawings]
FIG. 1 is a schematic configuration diagram of a programmable controller according to a first embodiment of the present invention.
FIG. 2 is a schematic configuration diagram of a data memory of the programmable controller according to the first embodiment of the present invention.
FIG. 3 is a diagram for explaining the operation of the programmable controller according to the first embodiment of the present invention.
FIG. 4 is a flowchart for explaining operations of a management processor and a dedicated processor of the programmable controller according to the first embodiment of the present invention.
FIG. 5 is a schematic configuration diagram of a programmable controller according to a second embodiment of the present invention.
FIG. 6 is a schematic configuration diagram of a counter circuit of a programmable controller according to a second embodiment of the present invention.
FIG. 7 is a diagram for explaining the operation of a programmable controller according to a second embodiment of the present invention.
FIG. 8 is a flowchart illustrating operations of a management processor, a dedicated processor, and a counter circuit of a programmable controller according to a second embodiment of the present invention.
FIG. 9 is a schematic configuration diagram of a programmable controller according to a third embodiment of the present invention.
FIG. 10 is a schematic configuration diagram of a data memory of a programmable controller according to a third embodiment of the present invention.
FIG. 11 is a schematic configuration diagram of a timer circuit of a programmable controller according to a third embodiment of the present invention.
FIG. 12 is a diagram for explaining the operation of a programmable controller according to a third embodiment of the present invention.
FIG. 13 is a flowchart for explaining operations of a management processor, a dedicated processor, and a timer circuit of a programmable controller according to a third embodiment of the present invention.
FIG. 14 is a schematic configuration diagram of a programmable controller according to a fourth embodiment of the present invention.
FIG. 15 is a diagram illustrating a counter circuit and a timer circuit of a programmable controller according to a fourth embodiment of the present invention.
FIG. 16 is a diagram illustrating one scan of a conventional programmable controller.
[Explanation of symbols]
1,2,3,4 Programmable controller
10 Monitor device
11, 21, 31, 41 Management processor
12, 22, 32, 42 Program memory (first memory)
13, 23, 33, 43 Data memory (second memory)
14 I / O devices
15, 25, 35, 45 Dedicated processor
16, 17 bus
18 Work memory
19 Communication interface
26, 46 counter circuit
36, 47 Timer circuit
131 execution counter
132,331 completion counter
133 Control cycle
261 Control cycle setting register
262,361 Reference pulse generator
263,362 Reference pulse counter
H.264 comparison unit
265 execution counter register
266 Completion Counter Register
267 monitoring unit
332 Differential reference pulse counter
361 Differential reference pulse counter

Claims (5)

全体の制御を行う管理プロセッサと、シーケンスプログラムを格納するためのプログラムメモリと、シーケンスプログラム演算結果と実行回数と実行完了回数および制御周期を格納するためのデータメモリと、シーケンスプログラム実行用の制御処理専用プロセッサと、を備えて、入出力処理とタイマ更新処理とシーケンスプログラム実行処理からなるスキャン処理を一定周期で行うプログラマブルコントローラにおいて、
前記シーケンスプログラムの実行回数を記憶する実行回数記憶手段と、
前記シーケンスプログラムの実行完了回数を記憶する実行完了回数記憶手段と、
前記一定周期を制御周期として記憶する制御周期記憶手段と、
前記制御処理専用プロセッサが前記実行回数記憶手段、実行完了回数記憶手段及び制御周期記憶手段に記憶された値に基づいてスキャン制御動作するために必要なデータである前記制御周期を設定した後に、スキャンの開始を表すための前記実行回数を更新し、前記制御処理専用プロセッサは前記実行回数と前記実行完了回数の差異を監視することで前記スキャン処理を一定周期で実行するように制御するスキャン制御手段と、
を有することを特徴とするプログラマブルコントローラ。
A management processor that performs overall control, a program memory for storing a sequence program, a data memory for storing a sequence program operation result, the number of executions, the number of execution completions, and a control cycle, and a control process for executing the sequence program In a programmable controller comprising a dedicated processor, and performing scan processing consisting of input / output processing, timer update processing, and sequence program execution processing at a constant cycle,
Execution number storage means for storing the number of executions of the sequence program;
Execution completion count storage means for storing the execution completion count of the sequence program;
Control cycle storage means for storing the fixed cycle as a control cycle;
After the control processing dedicated processor sets the control cycle, which is data necessary for the scan control operation based on the values stored in the execution count storage means, the execution completion count storage means, and the control cycle storage means, the scan is performed. Scan control means for updating the number of executions to indicate the start of the control, and the processor dedicated to the control process monitors the difference between the number of executions and the number of execution completions to control the scan process to be executed at a constant cycle When,
A programmable controller comprising:
前記実行回数記憶手段は、
前記管理プロセッサによって前記一定周期ごとに実行回数値が更新され、
前記実行完了回数記憶手段は、
前記制御処理専用プロセッサによってシーケンスプログラム実行完了後に実行完了回数値が更新され、
前記スキャン制御手段は、
前記実行回数値と前記実行完了回数値との間に差異が生じた場合に前記制御処理専用プロセッサが前記入出力処理を開始し、前記制御周期記憶手段に記憶している制御周期を差分タイマ値として用いてタイマ更新処理を行う前記タイマ更新処理を実行するように制御することを特徴とする請求項1記載のプログラマブルコントローラ。
The execution frequency storage means includes
The management processor updates the execution count value for each fixed period,
The execution completion number storage means includes
The execution completion count value is updated after completion of the sequence program execution by the control processing dedicated processor,
The scan control means includes
When there is a difference between the execution count value and the execution completion count value, the processor dedicated to control processing starts the input / output processing, and the control cycle stored in the control cycle storage means is set as a difference timer value. 2. The programmable controller according to claim 1, wherein the timer update process is performed to perform the timer update process.
前記スキャン制御手段は、
前記実行回数値と前記実行完了回数値との間に差異が生じた場合に、前記制御処理専用プロセッサが前記管理プロセッサに異常状態の旨を通知するように制御することを特徴とする請求項2記載のプログラマブルコントローラ。
The scan control means includes
3. The control-dedicated processor performs control so as to notify the management processor of an abnormal state when a difference occurs between the execution count value and the execution completion count value. The programmable controller described.
前記実行回数記憶手段、実行完了回数記憶手段及び制御周期記憶手段は、制御周期を計測するカウンタ回路に設けられていることを特徴とする請求項1記載のプログラマブルコントローラ。  The programmable controller according to claim 1, wherein the execution number storage unit, the execution completion number storage unit, and the control cycle storage unit are provided in a counter circuit that measures a control cycle. 前記実行回数記憶手段は、
前記カウンタ回路によって前記一定周期ごとに実行回数値が更新され、
前記実行完了回数記憶手段は、
前記制御処理専用プロセッサによってシーケンスプログラム実行完了後に実行完了回数値が更新され、
前記スキャン制御手段は、
前記実行回数値と前記実行完了回数値との間に差異が生じた場合に前記制御処理専用プロセッサが前記入出力処理を開始し、前記制御周期記憶手段に記憶している制御周期を差分タイマ値として用いて前記タイマ更新処理を実行するように制御することを特徴とする請求項4記載のプログラマブルコントローラ。
The execution frequency storage means includes
The counter circuit updates the number of executions for each fixed period,
The execution completion number storage means includes
The execution completion count value is updated after completion of the sequence program execution by the control processing dedicated processor,
The scan control means includes
When there is a difference between the execution count value and the execution completion count value, the processor dedicated to control processing starts the input / output processing, and the control cycle stored in the control cycle storage means is set as a difference timer value. 5. The programmable controller according to claim 4, wherein the control is performed so that the timer update process is executed.
JP2002194665A 2002-07-03 2002-07-03 Programmable controller Expired - Lifetime JP4024603B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002194665A JP4024603B2 (en) 2002-07-03 2002-07-03 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002194665A JP4024603B2 (en) 2002-07-03 2002-07-03 Programmable controller

Publications (2)

Publication Number Publication Date
JP2004038555A JP2004038555A (en) 2004-02-05
JP4024603B2 true JP4024603B2 (en) 2007-12-19

Family

ID=31703301

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002194665A Expired - Lifetime JP4024603B2 (en) 2002-07-03 2002-07-03 Programmable controller

Country Status (1)

Country Link
JP (1) JP4024603B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4521722B2 (en) * 2004-12-13 2010-08-11 関西電力株式会社 Plant operation control system
JP4894961B1 (en) * 2011-03-15 2012-03-14 オムロン株式会社 PLC CPU unit, PLC system program, and recording medium storing PLC system program
JP7020198B2 (en) * 2018-03-09 2022-02-16 オムロン株式会社 Controls and control systems

Also Published As

Publication number Publication date
JP2004038555A (en) 2004-02-05

Similar Documents

Publication Publication Date Title
US7865782B2 (en) I/O device fault processing method for use in virtual computer system
CN100492992C (en) Alarm processing method and its device
JP4024603B2 (en) Programmable controller
CN109074343B (en) Communication device, communication method, program, and communication system
JPWO2007097040A1 (en) Information processing apparatus control method, information processing apparatus
CN100369009C (en) Monitor system and method capable of using interrupt signal of system management
JPH1069470A (en) Multiprocessor system
KR100687616B1 (en) Apparatus and method for fault recognition and recovery of processor
JP2016167107A (en) Control device, bus circuit, method, and program
JP3320570B2 (en) How to recover from a system error
CN115794693A (en) GPIO (general purpose input/output) interface control method and system, storage medium and equipment
JP4983806B2 (en) System monitoring apparatus and monitoring method using dual timer
JP2009301079A (en) Electronic computer device and data storage method when software processing delay is detected
JPH11232143A (en) Multithread monitor method
CN106326026B (en) The method and device of operating system abnormal restarting
JPH10228395A (en) Abnormality diagnostic device for controller
JPH0962534A (en) Self-diagnostic method for electronic computer
JP2002244885A (en) Computer system monitoring system
JP3105025B2 (en) Redundant controller
JPH01183744A (en) Monitor device for processor stall
JP5768434B2 (en) Mutual monitoring system
JPH1139032A (en) Multi cpu type centralized monitoring device
JP2023170679A (en) On-vehicle device, program and information processing method
JPH1165986A (en) System and method for detecting fault of timer and recording medium recording program for executing the same
JP2005108034A (en) Computer system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050223

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070112

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070213

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070411

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070605

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070719

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20070925

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071003

R151 Written notification of patent or utility model registration

Ref document number: 4024603

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

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

Free format text: PAYMENT UNTIL: 20101012

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20111012

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20111012

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121012

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20131012

Year of fee payment: 6

EXPY Cancellation because of completion of term