JP3627087B2 - Programmable controller and control method thereof - Google Patents

Programmable controller and control method thereof Download PDF

Info

Publication number
JP3627087B2
JP3627087B2 JP23689097A JP23689097A JP3627087B2 JP 3627087 B2 JP3627087 B2 JP 3627087B2 JP 23689097 A JP23689097 A JP 23689097A JP 23689097 A JP23689097 A JP 23689097A JP 3627087 B2 JP3627087 B2 JP 3627087B2
Authority
JP
Japan
Prior art keywords
unit
storage
storage means
sequence program
interface
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
JP23689097A
Other languages
Japanese (ja)
Other versions
JPH1185227A (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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP23689097A priority Critical patent/JP3627087B2/en
Publication of JPH1185227A publication Critical patent/JPH1185227A/en
Application granted granted Critical
Publication of JP3627087B2 publication Critical patent/JP3627087B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
この発明は、高速な処理が可能で、シーケンスプログラムの作成や他システムへの流用、システムの変更等が容易なプログラマブルコントローラおよびその制御方法に関するものである。
【0002】
【従来の技術】
図13は、特開昭64−44509号公報に記載されている、パターンテーブルを利用した高速I/Oユニットのシステム構成図である。図において、18はI/Oバス、19はEPROM、20は入力回路、21は出力回路である。
この従来システムにおいては、外部のアブソリュートエンコーダ(図示せず)からの信号を入力回路20に受けて、これをEPROM19のメモリに格納されている変換テーブルに基づき変換し、変換結果を出力回路21を介して出力し、外部の機器(図示せず)を高速に制御する。そして、必要であれば変換結果がI/Oバス18を通じてPC制御部に送られる。このようにしてアブソリュートエンコーダからの信号の処理が高速に行われる。
【0003】
図14は、別の従来システムを示す構成図であり、ベルトコンベアを前進後退させる従来システムを示している。図において、22はCPUユニット、28は前進運転接点、29はモータ、30は後進運転接点、31はベルトコンベア、32は前進端センサ、33は後進端センサである。
出力機器である前進運転接点28および後進運転接点30、入力機器である前進端センサ32および後進端センサ33のシーケンスプログラム上でのデバイス名は、それぞれY50、Y51、X0、X1であり、デバイス情報、例えば、ON/OFF情報はCPUユニット22内のデバイスメモリ232において、それぞれY50、Y51、X0、X1により指定されるアドレスに格納されている。
図15は、プログラマブルコントローラ(以後、PCと称する)に設けられているスロットにCPUユニット22等が装着された様子を示す図である。図において、17は入力点数が16点ある入力ユニット、34は出力点数が16点ある出力ユニットである。
【0004】
図16は、ラダー図で表されたシーケンスプログラムを示す図である。このシーケンスプログラムは、CPUユニット22により実行される。
図16において、ステップS151では、T0がONになっていなければ通常処理を行うものとしてP0(ステップS154)へジャンプする。T0はサイクルタイムオーバーがあった場合においてはセットされている。
ステップS152では前回のスキャンですでにM0がONになっていればCHK命令が再度実行されないようにステップS154にジャンプする。
ステップS153においては、前後進動作時においてサイクルタイムオーバーが発生していればCHK命令が実行され、動作異常検出回路の故障診断を行い故障があればM0がセットされる。
ステップS154では、コンベア前進指令(X4)のON等を条件に前進運転するとともに、故障検出に使用するY0(このPCにおいては、前進端センサの接点番号と同一接点番号の出力デバイスに設定される)をONする。
ステップS155では、コンベア後退指令(X5)がONであること等を条件に後進運転するとともに、Y0をOFFにする。
ステップS156では、サイクルタイムチェックタイマを動作させ、設定時間内に前進端か後進端に到達しない場合はエラーとし、T0をONにする。
以上の動作によりY0は前進運転中はON、後進運転中はOFFになる。また、CHK命令の実行により動作異常検出回路の故障チェックを行い、故障を検出するとデバイスM0をONし、デバイスD0に故障番号をBCD値で格納する。ステップS153の接点(X0)はCHK命令の実行を制御するものではなく、チェック条件を設定する接点である。なお、このPCにおいては、CHK命令はポインタP254のステップで記述するように定められている。
【0005】
このような従来のPCにおいては、I/O点数の割付けや、ユニットの配置をすべて決定した上で、そのI/O割付けが反映されたシーケンスプログラムを作成する必要があり、I/O割付けが変更された場合にはシーケンスプログラムのデバイス名を変更する必要があった。
【0006】
図17は、複数のPCがネットワーク接続された従来のネットワークシステムの接続図である。図において、231はCPUユニット22により実行されるシーケンスプログラムが格納されるシーケンスプログラムメモリ、232はデバイスメモリ、24はネットワークユニット、25はI/Oユニット、26はI/Oバスである。
このネットワークシステムにおいては、複数のPCがそれぞれネットワークユニット24を介して同軸バス27により接続され、PC相互間でデータをやりとりが行われるように構成され、それぞれのPCにおいては、CPUユニット22がI/Oバス26を介して各I/Oユニット25に指令を与えるように構成されている。そして、それぞれのPCは共用デバイス(PC相互間でアクセスする必要のあるデバイス)を記憶するエリアがデバイスメモリ232に設けられ、このデバイスメモリ232の記憶内容は定期的にリフレッシュされる。
【0007】
【発明が解決しようとする課題】
図13に示すような従来システムにおいては、例えば、タイマやカウンタを使用した高速制御、すなわち、以前の状態に依存する高速制御(タイマのオンオフ状態やカウンタのカウント状態により処理内容を変える高速制御)が必要な場合においては対応が困難であり、自由度、汎用性、あるいは、プログラミングの容易性等の点で問題があった。また、高速処理できる対象が特定の機能に限定されるという問題点があった。
【0008】
また、図14に示す従来システムにおいては、CPUユニット22が実行するシーケンスプログラム上でI/Oユニット25の行う処理がすべて記述されるので、I/Oユニット25が行う処理に必要なデバイス名をすべて適切に定めた上でシーケンスプログラムを作成する必要があった。また、他のシステムからシーケンスプログラムを流用する際には、シーケンスプログラム上のデバイス名を自システムにあわせて書き換える必要があるという問題点があった。
また、CPUユニット22が実行するシーケンスプログラムが長大化し、PCの応答速度が阻害されるという問題点があった。
【0009】
この発明は、上述のような問題点を解決するためになされたものであり、CPUユニットのスキャンタイムの増大化を防止しシステム全体のスループットを向上させるとともに、I/Oユニットにおける処理速度や応答速度の低下を防止することを目的とする。
【0010】
また、シーケンスプログラムの作成、システムの変更、シーケンスプログラムの流用等を容易化することを目的とする。
【0011】
【課題を解決するための手段】
この発明に係るプログラマブルコントローラは、PC本体ユニットと、所定数のI/Oユニットとを備えたプログラマブルコントローラにおいて、
I/Oユニットは、制御対象に設けられた入力/出力機器の状態等を示すデバイス情報を記憶する第1記憶手段と、第1記憶手段におけるデバイス情報の記憶アドレスが記述された第1シーケンスプログラムを繰り返し実行することにより第1記憶手段を介して制御対象を制御する第1制御手段と、第1シーケンスプログラムにその記憶アドレスが記述されているデバイス情報のうちPC本体ユニット間で授受されるインターフェースデバイス情報の記憶アドレスが記述されたインターフェースプログラムを記憶する第2記憶手段とを有し、
PC本体ユニットは、第3記憶手段と、インターフェースデバイス情報の記憶アドレスについて第1記憶手段における記憶アドレスと第3記憶手段における記憶アドレスとの対応を示す第1テーブルを作成し、インターフェースプログラムにおけるインターフェースデバイス情報の記憶アドレスをPC本体ユニットにおけるアドレスに変換し、変換されたインターフェースプログラムと自身のシーケンスプログラムとを有する第2シーケンスプログラムを繰り返し実行し自身のシーケンスプログラムによる所定の制御に加えてインターフェースプログラムによるI/Oユニットの制御を上記第3記憶手段を介して行う第2制御手段とを有し、
第1テーブルにもとづきインターフェースデバイス情報について第1、第3記憶手段の記憶内容が同一になるように第1、第3記憶手段の記憶内容がリフレッシュされ、電源投入時等にインターフェースプログラムがI/OユニットからPC本体ユニットに転送されるようにしたものである。
【0012】
また、I/Oユニットは自身のユニットの名称を記憶する第4記憶手段を有し、各スロットに挿入されているI/Oユニットにおける第4記憶手段の記憶内容が電源投入時等に読み出され名称とI/Oユニットが挿入されているスロットの番号との対応を示す第2テーブルが第2制御手段により作成され、第2制御手段は第2テーブルにより名称に対応するスロット番号を認知するようにしたものである。
【0013】
この発明に係るプログラマブルコントローラの制御方法は、制御対象に設けられた入力/出力機器の状態等を示すデバイス情報の第1記憶手段における記憶アドレスが記述された第1シーケンスプログラムを第1制御手段が繰り返し実行することにより第1記憶手段を介して制御対象を制御するI/OユニットからPC本体ユニットに、デバイス情報のうちPC本体ユニット間で授受されるインターフェースデバイス情報の第1記憶手段における記憶アドレスが記述されたインターフェースプログラムが転送されるとともに、インターフェースデバイス情報についてI/Oユニットの第1記憶手段における記憶アドレスとPC本体ユニットの第3記憶手段における記憶アドレスとの対応を示す第1テーブルが第2制御手段により作成され、インターフェースプログラムにおけるインターフェースデバイス情報のI/Oユニットにおける記憶アドレスが第2制御手段によりPC本体ユニットにおける記憶アドレスに変換される段階と、
変換されたインターフェースプログラムと自身のシーケンスプログラムとを有する第2シーケンスプログラムが第2制御手段により実行され、第1テーブルにもとづきインターフェースデバイス情報について第1、第3記憶手段の記憶内容が同一になるように第1、第3記憶手段の記憶内容がリフレッシュされるとともに、自身のシーケンスプログラムによる所定の制御に加えてインターフェースプログラムによるI/Oユニットの制御が第3記憶手段を介して行われる段階と、を有するようにしたものである。
【0014】
また、I/Oユニットの第4記憶手段に自身のユニットの名称が記憶される段階と、
各スロットに挿入されているI/Oユニットにおける第4記憶手段の記憶内容が読み出され、名称とI/Oユニットが挿入されているスロットの番号との対応を示す第2テーブルが第2制御手段により作成される段階と、
第2テーブルにもとづき名称に対応するスロット番号が第2制御手段により認知される段階と、を有するようにしたものである。
【0015】
【発明の実施の形態】
実施の形態1.
図1は、本発明の一例の実施の形態によるI/Oユニットのブロック構成図である。なお、このI/OユニットはPCに設けられたスロットに装着されている。
図において、1はI/Oバス、8はI/Oユニット、201はI/Oユニット8内のシーケンスプログラムメモリ(図中ではSPメモリと表記)であり、第1シーケンスプログラム、例えば、I/Oユニット8により実行されるシーケンスプログラムが格納される。202はI/Oユニット8内の第2記憶手段、例えば、インターフェースシーケンスプログラムメモリ(図中ではI/F・SPメモリと表記)であり、CPUユニット6に転送するインターフェースシーケンスプログラムが格納される。203はI/Oユニット8内に設けられている第1記憶手段、例えば、デバイスメモリである。3は第1制御手段、例えば、制御装置である。4は入力回路、5は出力回路である。制御装置3はシーケンスプログラムメモリ201に格納されているシーケンスプログラムを繰り返し実行する。このI/Oユニット8とCPUユニット6との信号授受はI/Oバス1を経由して行われる。
【0016】
図2は、本発明の実施の形態1によるPC本体ユニット、例えば、CPUユニットのブロック構成図である。
図において、6はCPUユニット、701はCPUユニット6内のシーケンスプログラムメモリであり、CPUユニット6が実行するシーケンスプログラムが格納される。702は第3記憶手段、例えば、CPUユニット6内のデバイスメモリである。703はスクラッチメモリ、704は第2制御手段、例えば、制御装置である。
図3は、CPUユニット6と複数のI/Oユニット8とがI/Oバス1により接続されたシステムのブロック構成図である。
【0017】
次に、図3に示すシステムの概要について説明する。このシステムにおいては、始めにインターフェースプログラム、例えば、インターフェースシーケンスプログラムがI/Oユニット8のインターフェースシーケンスプログラムメモリ202から読み出され、CPUユニット6に送られる。そして、このインターフェースシーケンスプログラムに記述されているデバイス番号(I/Oユニット8上でのデバイス番号)はCPUユニット6上でのデバイス番号に変換される。この変換されたインターフェースシーケンスプログラムはCPUユニット6のシーケンスプログラムに追加され、CPUユニット6のシーケンスプログラムの一部として実行される。
I/Oユニット8を1つ部品とするため、I/Oユニット8のインターフェースシーケンスプログラムメモリ202に格納されているインターフェースシーケンスプログラムにおけるデバイス番号は固定であり、このインターフェースシーケンスプログラムがCPUユニット6にローディングされる時に、後述するようにCPUユニット6におけるデバイス番号に自動的に変換される。
このように、ローディング時においてデバイス番号が変換されるため、シーケンスプログラムの実行時には変換する必要がなく、I/Oユニット8へデバイスのON/OFF指令を送る際等における処理速度の低下が防止される。
【0018】
図4は、電源投入時等において、I/Oユニット8のメモリに格納されているインターフェースシーケンスプログラムをCPUユニット6が読み出す際の、すなわち、ローデイングの際の動作を示すフロー図である。
ローディング時におけるデバイス番号の変換は、CPUユニット6が当該I/Oユニット8のスロット番号より若いスロット番号の総てのスロットの占有点数の合計点数(スロットの占有点数はユニットが装着されていればそのユニットの占有点数とし、空きスロットであれば16点とする)と、当該I/Oユニット8におけるデバイス番号と、を加算することにより行われる。
例えば、スロット0に16点占有するユニットが装着されている状態において、I/Oユニット8がスロット1に挿入される場合には、このI/Oユニット8のデバイス番号0のデバイスは、CPUユニット6におけるデバイス番号は10になる。
【0019】
次に、この変換動作の詳細について図4により説明する。ステップS301においては、ワーク変数u_no(スロット番号)およびd_no(デバイス名における数値部分)を初期化する。
ステップS302においては、u_noがPCが装着できる最大のユニット数以上であるか否かを判定し、以上でなければステップS303に進み、以上であれば終了する。
ステップS303では、u_no番目のスロットに装着されているユニットのカード情報(自ユニットの名称、例えば、ユニット名、スロット番号、ユニットのタイプ、占有点数等からなる情報)を当該ユニットの第4記憶手段、例えば、カード情報メモリから読み出し、CPUユニット6内の第2テーブル、例えば、スロットテーブル10にこのカード情報を格納する。
ステップS304では当該スロットにユニットが実際に装着されているか否か判定し、装着されていなければステップS308に進み、装着されていればステップS305に進む。
ステップS305では前回の電源ON時における構成と比較し、異なっていればステップS306に進み、同じであればステップS310に進む。
ステップS306では当該I/Oユニットからインターフェースシーケンスプログラムを読み出しCPUユニット6のシーケンスプログラムメモリ701にローデイングする。なお、シーケンスプログラムメモリ701はスロット毎に固定サイズのエリアを有しており、ローデイング時においては当該エリアにローデイングされる。
スロットテーブル10においては、図5に示されるように、スロット番号別に上述のカード情報の他に、このとき、ローデイングされたインターフェースシーケンスプログラムの容量と、このインターフェースシーケンスプログラムがCPUユニット6内にあるシーケンスプログラムメモリ701のいずれの番地から格納されるかを示す先頭アドレスとが格納される。
ステップS307ではローデイングされたインターフェースシーケンスプログラム中に点在するインターフェースデバイス名をCPUユニット6上でのデバイス番号に変換するため、デバイス番号にd_noのオフセットを加算する。このとき、図6に示す第1テーブル、例えば、シンボルテーブルにオフセットを加算する前のデバイス名(I/Oユニット上でのデバイス名)と、加算後のデバイス名(CPUユニット上でのデバイス名)と、スロット番号とが記入される。なお、I/Oユニット8において入力デバイスであればCPUユニット6においては出力デバイスになり、I/Oユニット8において出力デバイスであればCPUユニット6においては入力デバイスになるので、デバイス名におけるXはYに、YはXに置き換えられる。
ステップS308では当該ユニットの占有点数をd_noに加算しステップS302に戻る。
ステップS304からステップS309に移行した場合は、ステップS309においてスロットテーブルにおける当該スロットの欄の内容をクリアしステップS310に進む。
ステップS310では空きスロット分の占有点数として16点(16進数表現では10点)をd_noに加算しステップS302に戻る。
【0020】
この図4に示す動作により、それぞれのI/Oユニット8からインターフェースシーケンスプログラムがCPUユニット6にロードされると、CPUユニット6は、CPUユニット6自身のシーケンスプログラムをスキャンした後にそれぞれのインターフェースシーケンスプログラムをその格納アドレスをスロットテーブルを参照して求めてスキャン実行する。
すなわち、CPUユニット6自身のシーケンスプログラムとそれぞれのインターフェースシーケンスプログラムとがつなげられたシーケンスプログラムが第2シーケンスプログラム、例えば、新たなシーケンスプログラムとなりCPUユニット6によりスキャン実行される。なお、スロットテーブル10の当該スロット番号の欄においてユニット名等がクリアされていればそのスロットにはユニットが装着されていないものとして読み出しは行われない。
【0021】
図7は図1に示すI/Oユニット8とこのI/Oユニット8を介して制御される一例のベルトコンベアシステムを示す説明図である。図において、11は前進運転接点、13は後進運転接点である。
前進運転接点11、後進運転接点13のI/Oユニット8におけるデバイス名はそれぞれY10、Y11である。また、前進端センサ32および後進端センサ33のI/Oユニット8におけるデバイス名はそれぞれX00、X01である。ベルトコンベア31にはモータ29が取り付けられており、CPUユニット6はI/Oユニット8を介してモータ29に対して正転・逆転・停止を指令する。ベルトコンベア31の一端(図7において左端)の近傍には前進端センサ32が、他端(図7において右端)の近傍には後進端センサ33がそれぞれ取り付けられており、それぞれベルトコンベア31上のワークが前進端、後進端に到達したことを検知しI/Oユニット8に知らせる。
【0022】
図8は、PC内のスロットにCPUユニット6やI/Oユニット8等が装着されている様子を示す図である。
【0023】
図9は、図7に示すベルトコンベアシステムにおいて、I/Oユニット8からCPUユニット6にローデイングされ、CPUユニット6において実行される一例のインターフェースシーケンスプログラムを示すラダー図である。なお、この図9にはデバイス名が変換された後の状態が示されている。
次に、このラダー図について説明する。図9において、ステップ801では、X0がONであればI/Oユニット8上の緊急停止出力Y7FをONにする指令が出されベルトコンベアを緊急停止させる(デバイス名のY7FはI/Oユニット8においてはX1F)。
ステップ802においては、X1がONであればY74(前進指令)をONにする指令が出される(デバイス名Y74はI/Oユニット8においてはX14)。
ステップ803においては、X2がONであればY75(後進指令)をONにする指令が出される(デバイス名Y75はI/Oユニット8においてはX15)。
ステップ804においては、X7EがONであればFROM命令により故障番号をI/Oユニット8からCPUユニット6に転送する(デバイス名X7EはI/Oユニット8においてはY1E)。なお、このX7Eはエラー発生時(サイクルタイムオーバー時)にONする。
Y7F、Y74、Y75をONにすると、シーケンスプログラムのEND処理において、上述のシンボルテーブルを参照してこれらのデバイス名に対応するスロット番号とI/Oユニット8上のデバイス名を得て、そのデバイス名のデバイスをONにするTO命令を実行し、該当I/Oユニット8の該当デバイス(X1F、X14、X15)をONにする。また、同様にシーケンスプログラムのEND処理において、シンボルテーブルからX7Eに対応するスロット番号とI/Oユニット8上のデバイス番号(Y1E)とを得て、このスロットに装着されているI/Oユニット8からこのデバイス名のデバイスの内容を読み取るFROM命令を実行してX7Eの状態を設定する。このようにして、インターフェースデバイスであるX1F、X14、X15、および、X7Eがリフレッシュされる。
X0、X1、X2はCPUユニット6のシーケンスプログラム(インターフェースシーケンスプログラムを含まない部分)においてオンオフ制御される。なお、これらのX0、X1、X2は、I/Oユニット8に格納されているインターフェースシーケンスプログラムにおいてはインターフェースデバイスと判定されないデバイス名に設定されている。
【0024】
図10は、図7に示されるベルトコンベアシステムにおいて、I/Oユニット8内で実行されるシーケンスプログラムの一例を示すラダー図である。図中、インターフェースデバイス名の表記において、括弧内の表記はインターフェースシーケンスプログラムがCPUユニット6へローデイングされデバイス名が変換された後の表記(CPUユニット8内における表記)を参考野ために示している。
図において、ステップS901においては、T0がONになっていなければ通常処理を行うものとしてステップS905へジャンプする。なお、T0はサイクルタイムオーバー等によりセットされる。
ステップS902においては、前回のスキャンですでにY1EがONになっていれば再度CHK命令を実行しないようにするためにステップS905にジャンプする。なお、CHK命令による故障診断で故障を検出するとY1EがONする。Y1EはI/Oユニット8内でのデバイス名でありCPUユニット6内ではX7Eである。
ステップS903においては、前後進動作時においてサイクルタイムオーバーが発生していればCHK命令が実行され、上述のように故障が検出されるとY1Eがセットされる。
ステップS904においては、故障番号をCPUユニット8に転送する。
ステップS905においては、X15(後退指令デバイス)、X00(前進端センサの状態を示すデバイス)、X1F(緊急停止指令デバイス)がOFFしている状態でX14がONすると、Y10(前進運転中を示すデバイス)をONし、故障検出に使用するY00をONする。なお、X14はコンベア前進指令を示すデバイスであり、ラダー回路上においてY10の接点はX14と並列に接続されている。
ステップS906においては、X14(前進指令デバイス)、X01(後進端センサの状態を示すデバイス)、X1F(緊急停止指令デバイス)がOFFしている状態でX15がONすると、Y11(後退運転中を示すデバイス)をONし、故障検出に使用するY00をOFFする。なお、ラダー回路上においてY11の接点はX15と並列に接続されている。
ステップS907においては、X00がONしていればY74をリセットする。Y74は前進指令なのでY74がリセットされると前進指令がリセットされ前進動作が停止される。
ステップS908においては、X01がONしていればY75をリセットする。Y75は後進指令なので、Y75がリセットされると後進指令がリセットされ後進動作が停止される。
ステップS909においては、X00がOFF、X1FがOFFの状態でY10がONしているとき、または、X01がOFF、X1FがOFFの状態でY11がONしているときサイクルタイムチェックタイマを動作させ、カウントアップするとT0をONにする。
【0025】
なお、図10のラダー図におけるステップS905、ステップS906は、図16のラダー図におけるステップS154、ステップS155に比べて緊急停止用の接点X1F(Y7F)が追加されている。これは、I/Oユニット8を1個の部品とするために必要な処置の1つである。
また、図10のラダー図においては、図16に比べてステップS907およびステップS908が追加されているが、これらのステップもI/Oユニット8を1つの部品とするために必要な処置として追加されたものであり、CPUユニット6からI/Oユニット8内に送られた前進/後進の指令によりONになっている出力デバイスをOFFにする。
なお、I/Oユニット8が一つの部品と見なせるということは、操作者がこのI/Oユニット8をPCのスロットに挿入しスロット番号をセットするだけで、CPUユニット6およびI/Oユニット8のプログラムをほとんど修正することなく、このI/Oユニット8使用できるということを意味している。
【0026】
以上説明したように、図7に示すシステムにおいては、CPUユニット6がI/Oユニット8に対して、コンベア動作許可、前進指令、後進指令の3つの指令を出し、エラー発生時にはエラーNoをI/Oユニット8から受け取るようにしている。すなわち、I/Oユニット8はCPUユニット6の指令に従い、前進、後進、停止動作を行い、サイクルタイムオーバー時にはCPUユニット6において、ローデイングされたインターフェースシーケンスプログラムにおけるFROM命令が実行され故障番号がCPUユニット6に送信されるように構成されている。
【0027】
図16に示すシーケンスプログラムをCPUユニット22が実行する従来システムに比べ、図7に示すシステムにおいては、シーケンスプログラムが図10に示されるI/Oユニット8により処理される部分と図9に示されるインターフェース部分とに分けられ、CPUユニット6内のシーケンスプログラムにおいては図10に示される処理を行わずに済むようにしたので、CPUユニット6により実行されるシーケンスプログラムのスキャンタイムが短くなり高速処理が可能になる。
また、図16に示すシーケンスプログラムをCPUユニット22が実行する従来システムに比べ、この発明の実施の形態においては、上述のようにI/Oユニット8により処理される部分とインターフェースの部分とに分けられているので、システムを再構築する場合等においは、変更を必要とする部分が容易にわかりプログラムの開発効率が向上する。
すなわち、図10に示すシーケンスプログラムはI/Oユニット8に固有のシーケンスプログラムであり通常のシステムの変更の際には変更の必要がなく、また、システムを再構築する場合等においては、図9に示すシーケンスプログラムを変更または作成するだけで良く、プログラミング作業が大幅に軽減される。
【0028】
次に、I/Oユニット8のデバイスのアクセス方法について説明する。図11はCPUユニット6とI/Oユニット8との間の情報授受における信号経路を示す説明図である。図11に示されるシステムにおいて、それぞれのI/Oユニット8は数値や記号等からなるシンボル(ユニット名)がつけられ、CPUユニット6からI/Oユニット8のデバイスをアクセスする場合、もしくは、別のI/OユニットからI/Oユニット8のデバイスをアクセスする場合において、このシンボルによりI/Oユニット8を指定するようにしている。CPUユニット6はこのシンボルをスロットテーブル10によりCPUユニット6におけるスロット番号に変換する。
例えば、I/Oユニット8aのシンボルがUNITAであり、I/Oユニット8bのシンボルがUNITBである場合において、I/Oユニット8aがI/Oユニット8bのデバイスX0をアクセスする際には、図12に示されるように、I/Oユニット8aはこのデバイスX0を(UNITB.X0)で指定する。
なお、図5においては、I/Oユニット8aの装着位置がスロット5、I/Oユニット8aのシンボルがUNITAであり、I/Oユニット8bの装着位置が6、I/Oユニット8bのシンボルがUNITBである場合のスロットテーブル10の一部が図示されている。
CPUユニット6は、スロットテーブル10によりシンボルUNITBをスロット番号に変換して、対応するスロットのユニットに対してアクセスする。
このようにして、I/Oユニット8がいずれのスロットに挿されていてもそのI/Oユニット8のデバイスを容易に指定することができる。
【0029】
次に、図12に示す変換について説明を補足する。I/Oユニット8aがI/Oユニット8bのデバイスX0にアクセスする場合には、まず、I/Oユニット8aはCPUユニット6にI/Oユニット8bのデバイスX0をONしたい旨のメッセージを伝える。このメッセージは(I/Oユニット8bのシンボル+I/Oユニット8b上でのデバイス番号+オペレーションコード)という構成のメッセージになっている。オペレーションコードは、”ON”、”OFF”等を示すコードである。この例の場合におけるメッセージは、例えば、”UNIT.B X0 ON”となる。
CPUユニット6では、スロットテーブル10からI/Oユニット8bのスロット番号を得て、このスロットのユニットに対してこのメッセージを送る。このようにして、メッセージがI/Oユニット8bに転送される。
I/Oユニット8bはメッセージ中のデバイス番号により指定される自ユニット内のデバイスに対しメッセージ中のオペレーションコードが示す処理を行う。この例の場合にはI/Oユニット8b内のデバイスX0をオンする処理が行われる。
【0030】
以上のように、本発明によればI/Oユニット8を一つの部品と見なすことができ、CPUユニット6におけるシーケンスプログラムにおいては、この部品を操作するインターフェースシーケンスプログラムを自身のシーケンスプログラムに加えて実行すればよい。I/Oユニット8において自身のシーケンスプログラムにより個々に独立して処理が行われるので、CPUのシーケンスプログラムの長大化が防止され(スキャン時間の長大化が防止され)PCの高速動作が可能になる。また、システムの変更や構築の際や、他のシステムのシーケンスプログラムを流用する際などにおいて、インターフェースシーケンスプログラムを修正/作成を行えばよく、システムの変更や構築や他のシステムのシーケンスプログラムを流用が容易にできる。
【0031】
【発明の効果】
以上説明したように、制御対象に設けられた入力/出力機器の状態等を示すデバイス情報の第1記憶手段における記憶アドレスが記述された第1シーケンスプログラムを第1制御手段が繰り返し実行することにより第1記憶手段を介して制御対象を制御するI/OユニットからPC本体ユニットに、デバイス情報のうちPC本体ユニット間で授受されるインターフェースデバイス情報の第1記憶手段における記憶アドレスが記述されたインターフェースプログラムが転送されるとともに、インターフェースデバイス情報についてI/Oユニットの第1記憶手段における記憶アドレスとPC本体ユニットの第3記憶手段における記憶アドレスとの対応を示す第1テーブルが第2制御手段により作成され、インターフェースプログラムにおけるインターフェースデバイス情報のI/Oユニットにおける記憶アドレスが第2制御手段によりPC本体ユニットにおける記憶アドレスに変換され、変換されたインターフェースプログラムと自身のシーケンスプログラムとを有する第2シーケンスプログラムが第2制御手段により実行され、第1テーブルにもとづきインターフェースデバイス情報について第1、第3記憶手段の記憶内容が同一になるように第1、第3記憶手段の記憶内容がリフレッシュされるとともに、自身のシーケンスプログラムによる所定の制御に加えてインターフェースプログラムによるI/Oユニットの制御が第3記憶手段を介して行われるようにしたので、I/Oユニット毎にそのI/Oユニットが実行するシーケンスプログラムを作成すれば、そのI/Oユニットは一つの部品として他のプログラマブルコントローラにも流用でき、I/Oユニットの追加に伴うPC本体ユニットのシーケンスプログラムへの追加プログラムの増大化が防止され、プログラムの作成の困難化を防止できるとともに、PC本体ユニットのスキャン時間の増大化が防止されPC本体ユニットの処理速度の低下を防止できる効果がある。また、システムの変更や、シーケンスプログラムの他システムへの流用を容易化できる効果がある。
【0032】
また、I/Oユニットの第4記憶手段に自身のユニットの名称が記憶され、各スロットに挿入されているI/Oユニットにおける第4記憶手段の記憶内容が読み出され、名称とI/Oユニットが挿入されているスロットの番号との対応を示す第2テーブルが第2制御手段により作成され、第2テーブルにもとづき名称に対応するスロット番号が第2制御手段により認知されるようにしたので、プログラム上において名称によりI/Oユニットを指定することが可能になり、プログラム作成の困難化を防止できる効果がある。また、システムの変更や、シーケンスプログラムの他システムへの流用を容易化できる効果がある。
【図面の簡単な説明】
【図1】この発明の実施の形態1によるI/Oユニットのブロック構成図である。
【図2】この発明の実施の形態1によるCPUユニットのブロック構成図である。
【図3】この発明の実施の形態1によるシステム構成図である。
【図4】この発明の実施の形態1による電源投入時のにおけるCPUユニットの動作フロー図である。
【図5】この発明の実施の形態1におけるスロットテーブルの一例を示す説明図である。
【図6】この発明の実施の形態1におけるシンボルテーブルの一例を示す説明図である。
【図7】この発明の実施の形態1によるベルトコンベアシステムを示すブロック図である。
【図8】この発明の実施の形態1においてPCのスロットにCPUユニット等が装着された様子を示す説明図である。
【図9】この発明の実施の形態1におけるインターフェースシーケンスプログラムを示すラダー図である。
【図10】この発明の実施の形態1においてI/Oユニット内で実行されるシーケンスプログラムを示すラダー図である。
【図11】この発明の実施の形態1における信号経路を示す図である。
【図12】この発明の実施の形態1においてI/Oユニット間でアクセスする場合の説明図である。
【図13】パターンテーブルを利用した従来のI/Oユニットのブロック図である。
【図14】従来のベルトコンベアシステムを示すブロック図である。
【図15】図14に示すベルトコンベアシステムにおいてPCのスロットにCPUユニット等が装着された様子を示す説明図である。
【図16】図14に示すベルトコンベアシステムにおいてCPUユニットが実行するシーケンスプログラムのラダー図である。
【図17】複数のPCが接続された従来のネットワークのブロック構成図である。
【符号の説明】
1 I/Oバス
3 制御装置
4 入力回路
5 出力回路
6 CPUユニット
7 シーケンスプログラムメモリ
8 I/Oユニット
9 制御装置
10 スロットテーブル
11 前進運転接点
12 モータ
13 後進運転接点
14 ベルトコンベア
15 前進端センサ
16 後進端センサ
17 入力ユニット
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a programmable controller capable of high-speed processing, easy to create a sequence program, divert it to another system, change the system, and the like, and a control method therefor.
[0002]
[Prior art]
FIG. 13 is a system configuration diagram of a high-speed I / O unit using a pattern table described in JP-A No. 64-44509. In the figure, 18 is an I / O bus, 19 is an EPROM, 20 is an input circuit, and 21 is an output circuit.
In this conventional system, a signal from an external absolute encoder (not shown) is received by the input circuit 20 and converted based on the conversion table stored in the memory of the EPROM 19, and the conversion result is output to the output circuit 21. And external devices (not shown) are controlled at high speed. If necessary, the conversion result is sent to the PC control unit via the I / O bus 18. In this way, the signal from the absolute encoder is processed at high speed.
[0003]
FIG. 14 is a block diagram showing another conventional system, and shows a conventional system for moving a belt conveyor forward and backward. In the figure, 22 is a CPU unit, 28 is a forward drive contact, 29 is a motor, 30 is a reverse drive contact, 31 is a belt conveyor, 32 is a forward end sensor, and 33 is a reverse end sensor.
The device names on the sequence programs of the forward operation contact 28 and the reverse operation contact 30 which are output devices, and the forward end sensor 32 and the reverse end sensor 33 which are input devices are Y50, Y51, X0 and X1, respectively. For example, ON / OFF information is stored in the device memory 232 in the CPU unit 22 at addresses specified by Y50, Y51, X0, and X1, respectively.
FIG. 15 is a diagram illustrating a state in which the CPU unit 22 and the like are mounted in a slot provided in a programmable controller (hereinafter referred to as a PC). In the figure, 17 is an input unit having 16 input points, and 34 is an output unit having 16 output points.
[0004]
FIG. 16 is a diagram showing a sequence program represented by a ladder diagram. This sequence program is executed by the CPU unit 22.
In FIG. 16, in step S151, if T0 is not ON, the routine jumps to P0 (step S154) assuming that normal processing is performed. T0 is set when there is a cycle time over.
In step S152, if M0 is already ON in the previous scan, the process jumps to step S154 so that the CHK instruction is not executed again.
In step S153, the CHK instruction is executed if the cycle time over has occurred during the forward / reverse operation, and the failure diagnosis of the operation abnormality detection circuit is performed, and M0 is set if there is a failure.
In step S154, the forward operation is performed under the condition that the conveyor advance command (X4) is turned ON, etc., and Y0 used for failure detection (in this PC, an output device having the same contact number as the contact number of the forward end sensor is set. ) Is turned on.
In step S155, the reverse operation is performed on the condition that the conveyor backward command (X5) is ON, and Y0 is turned OFF.
In step S156, the cycle time check timer is operated, and if the forward end or the reverse end is not reached within the set time, an error is determined and T0 is turned ON.
With the above operation, Y0 is turned on during forward operation and turned off during reverse operation. Also, a failure check of the operation abnormality detection circuit is performed by executing the CHK instruction. When a failure is detected, the device M0 is turned on, and the failure number is stored in the device D0 as a BCD value. The contact (X0) in step S153 does not control the execution of the CHK instruction, but is a contact for setting a check condition. In this PC, the CHK instruction is determined to be described in the step of the pointer P254.
[0005]
In such a conventional PC, it is necessary to create a sequence program that reflects the I / O allocation after determining the allocation of I / O points and the arrangement of units. When changed, it was necessary to change the device name of the sequence program.
[0006]
FIG. 17 is a connection diagram of a conventional network system in which a plurality of PCs are network-connected. In the figure, reference numeral 231 denotes a sequence program memory in which a sequence program executed by the CPU unit 22 is stored, 232 a device memory, 24 a network unit, 25 an I / O unit, and 26 an I / O bus.
In this network system, a plurality of PCs are connected to each other by a coaxial bus 27 via a network unit 24 so that data can be exchanged between the PCs. A command is given to each I / O unit 25 via the / O bus 26. Each PC is provided with an area for storing a shared device (a device that needs to be accessed between PCs) in the device memory 232, and the stored contents of the device memory 232 are periodically refreshed.
[0007]
[Problems to be solved by the invention]
In the conventional system as shown in FIG. 13, for example, high-speed control using a timer or counter, that is, high-speed control depending on the previous state (high-speed control that changes processing contents depending on the on / off state of the timer or the count state of the counter) When it is necessary, it is difficult to deal with, and there are problems in terms of flexibility, versatility, ease of programming, and the like. In addition, there is a problem that a target that can be processed at high speed is limited to a specific function.
[0008]
Further, in the conventional system shown in FIG. 14, all the processing performed by the I / O unit 25 is described in the sequence program executed by the CPU unit 22, so that the device name necessary for the processing performed by the I / O unit 25 is set. It was necessary to create a sequence program with everything properly defined. In addition, when diverting a sequence program from another system, there is a problem that it is necessary to rewrite the device name on the sequence program in accordance with the own system.
In addition, the sequence program executed by the CPU unit 22 is lengthened and the response speed of the PC is hindered.
[0009]
The present invention has been made to solve the above-described problems, and prevents an increase in the scan time of the CPU unit to improve the throughput of the entire system, and the processing speed and response in the I / O unit. The purpose is to prevent a decrease in speed.
[0010]
Another object of the present invention is to facilitate the creation of sequence programs, system changes, and diversion of sequence programs.
[0011]
[Means for Solving the Problems]
A programmable controller according to the present invention is a programmable controller including a PC main unit and a predetermined number of I / O units.
The I / O unit includes a first storage unit that stores device information indicating a state of an input / output device provided for a control target, and a first sequence program in which a storage address of the device information in the first storage unit is described The first control means for controlling the controlled object via the first storage means by repeatedly executing the interface, and the interface exchanged between the PC main body units among the device information whose storage address is described in the first sequence program Second storage means for storing an interface program in which a storage address of device information is described;
The PC main body unit creates a first table indicating the correspondence between the storage address in the first storage means and the storage address in the third storage means for the storage address of the third storage means and the interface device information, and the interface device in the interface program The information storage address is converted into an address in the PC main unit, the second sequence program having the converted interface program and its own sequence program is repeatedly executed, and in addition to predetermined control by the own sequence program, I Second control means for controlling the / O unit via the third storage means,
Based on the first table, the stored contents of the first and third storage means are refreshed so that the stored contents of the first and third storage means become the same for the interface device information. The data is transferred from the unit to the PC main unit.
[0012]
In addition, the I / O unit has fourth storage means for storing the name of its own unit, and the stored contents of the fourth storage means in the I / O unit inserted in each slot are read when the power is turned on. The second table showing the correspondence between the name and the slot number in which the I / O unit is inserted is created by the second control means, and the second control means recognizes the slot number corresponding to the name by the second table. It is what I did.
[0013]
According to the programmable controller control method of the present invention, the first control means stores the first sequence program in which the storage address in the first storage means of the device information indicating the state of the input / output device provided in the control target is described. The storage address in the first storage means of the interface device information that is exchanged between the PC main body units among the device information from the I / O unit that controls the control object via the first storage means by repeatedly executing to the PC main body unit. Is transferred, and the first table showing the correspondence between the storage address in the first storage unit of the I / O unit and the storage address in the third storage unit of the PC main unit is provided for the interface device information. 2 Created by the control means, A step of storing addresses in the I / O unit interface device information in interface program is converted in the storage address in the PC main unit by the second control means,
A second sequence program having the converted interface program and its own sequence program is executed by the second control means so that the contents stored in the first and third storage means are the same for the interface device information based on the first table. In addition, the stored contents of the first and third storage means are refreshed, and the I / O unit is controlled by the interface program via the third storage means in addition to the predetermined control by its sequence program, It is made to have.
[0014]
A stage in which the name of the own unit is stored in the fourth storage means of the I / O unit;
The stored contents of the fourth storage means in the I / O unit inserted in each slot are read, and the second table indicating the correspondence between the name and the slot number in which the I / O unit is inserted is the second control. A stage created by means;
A slot number corresponding to the name based on the second table is recognized by the second control means.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
Embodiment 1 FIG.
FIG. 1 is a block diagram of an I / O unit according to an embodiment of the present invention. This I / O unit is mounted in a slot provided in the PC.
In the figure, 1 is an I / O bus, 8 is an I / O unit, 201 is a sequence program memory (denoted as SP memory in the figure) in the I / O unit 8, and a first sequence program, for example, I / O unit A sequence program executed by the O unit 8 is stored. Reference numeral 202 denotes second storage means in the I / O unit 8, for example, an interface sequence program memory (indicated as I / F • SP memory in the figure), which stores an interface sequence program to be transferred to the CPU unit 6. Reference numeral 203 denotes first storage means provided in the I / O unit 8, for example, a device memory. Reference numeral 3 denotes first control means, for example, a control device. 4 is an input circuit, and 5 is an output circuit. The control device 3 repeatedly executes the sequence program stored in the sequence program memory 201. Signal transmission / reception between the I / O unit 8 and the CPU unit 6 is performed via the I / O bus 1.
[0016]
FIG. 2 is a block diagram of a PC main unit, for example, a CPU unit according to the first embodiment of the present invention.
In the figure, 6 is a CPU unit, 701 is a sequence program memory in the CPU unit 6, and stores a sequence program executed by the CPU unit 6. Reference numeral 702 denotes third storage means, for example, a device memory in the CPU unit 6. Reference numeral 703 denotes a scratch memory, and reference numeral 704 denotes second control means such as a control device.
FIG. 3 is a block configuration diagram of a system in which a CPU unit 6 and a plurality of I / O units 8 are connected by an I / O bus 1.
[0017]
Next, an overview of the system shown in FIG. 3 will be described. In this system, first, an interface program, for example, an interface sequence program is read from the interface sequence program memory 202 of the I / O unit 8 and sent to the CPU unit 6. The device number (device number on the I / O unit 8) described in the interface sequence program is converted into a device number on the CPU unit 6. The converted interface sequence program is added to the sequence program of the CPU unit 6 and executed as a part of the sequence program of the CPU unit 6.
Since the I / O unit 8 is a single component, the device number in the interface sequence program stored in the interface sequence program memory 202 of the I / O unit 8 is fixed, and this interface sequence program is loaded into the CPU unit 6. Is automatically converted into a device number in the CPU unit 6 as will be described later.
As described above, since the device number is converted at the time of loading, it is not necessary to convert it at the time of execution of the sequence program, and a decrease in processing speed when a device ON / OFF command is sent to the I / O unit 8 is prevented. The
[0018]
FIG. 4 is a flowchart showing the operation when the CPU unit 6 reads the interface sequence program stored in the memory of the I / O unit 8 when the power is turned on, that is, when loading.
The conversion of the device number at the time of loading is performed when the CPU unit 6 has a total number of occupied points of all slots having a slot number younger than the slot number of the I / O unit 8 (if the unit is mounted, the number of occupied points of the slot is This is performed by adding the number of points occupied by the unit, 16 points if the slot is empty) and the device number in the I / O unit 8.
For example, in a state where a unit occupying 16 points in slot 0 is mounted, when I / O unit 8 is inserted into slot 1, the device of device number 0 of this I / O unit 8 is the CPU unit. The device number in 6 is 10.
[0019]
Next, details of this conversion operation will be described with reference to FIG. In step S301, work variables u_no (slot number) and d_no (numeric part in the device name) are initialized.
In step S302, it is determined whether or not u_no is equal to or greater than the maximum number of units that can be mounted on the PC. If not, the process proceeds to step S303, and if not, the process ends.
In step S303, the card information of the unit installed in the u_no-th slot (the name of its own unit, for example, information including the unit name, slot number, unit type, number of occupied points, etc.) is stored in the fourth storage means of the unit. For example, the card information is read from the card information memory, and the card information is stored in a second table in the CPU unit 6, for example, the slot table 10.
In step S304, it is determined whether or not the unit is actually installed in the slot. If not, the process proceeds to step S308, and if it is installed, the process proceeds to step S305.
In step S305, the configuration is compared with the previous power-on configuration, and if different, the process proceeds to step S306, and if the same, the process proceeds to step S310.
In step S306, the interface sequence program is read from the I / O unit and loaded into the sequence program memory 701 of the CPU unit 6. Note that the sequence program memory 701 has an area of a fixed size for each slot, and is loaded into the area at the time of loading.
In the slot table 10, as shown in FIG. 5, in addition to the card information described above for each slot number, the capacity of the interface sequence program loaded at this time and the sequence in which this interface sequence program is stored in the CPU unit 6 A head address indicating from which address of the program memory 701 is stored is stored.
In step S307, in order to convert the interface device names scattered in the loaded interface sequence program into device numbers on the CPU unit 6, an offset of d_no is added to the device number. At this time, the device name (device name on the I / O unit) before adding the offset to the first table shown in FIG. 6, for example, the symbol table, and the device name after addition (device name on the CPU unit) ) And the slot number. If the I / O unit 8 is an input device, it becomes an output device in the CPU unit 6, and if it is an output device in the I / O unit 8, it becomes an input device in the CPU unit 6. Y is replaced by X with Y.
In step S308, the number of occupied points of the unit is added to d_no, and the process returns to step S302.
When the process proceeds from step S304 to step S309, the contents of the slot field in the slot table are cleared in step S309, and the process proceeds to step S310.
In step S310, 16 points (10 points in hexadecimal notation) are added to d_no as the number of occupied points for empty slots, and the process returns to step S302.
[0020]
When the interface sequence program is loaded from each I / O unit 8 to the CPU unit 6 by the operation shown in FIG. 4, the CPU unit 6 scans the sequence program of the CPU unit 6 itself, and then the respective interface sequence program. The storage address is obtained by referring to the slot table and scanned.
That is, a sequence program in which the sequence program of the CPU unit 6 itself and each interface sequence program are connected becomes a second sequence program, for example, a new sequence program, and is scanned by the CPU unit 6. If a unit name or the like is cleared in the slot number column of the slot table 10, no reading is performed assuming that no unit is installed in the slot.
[0021]
FIG. 7 is an explanatory diagram showing an example of the I / O unit 8 shown in FIG. 1 and a belt conveyor system controlled through the I / O unit 8. In the figure, 11 is a forward drive contact, and 13 is a reverse drive contact.
The device names of the forward operation contact 11 and the reverse operation contact 13 in the I / O unit 8 are Y10 and Y11, respectively. The device names of the forward end sensor 32 and the reverse end sensor 33 in the I / O unit 8 are X00 and X01, respectively. A motor 29 is attached to the belt conveyor 31, and the CPU unit 6 instructs the motor 29 to perform normal rotation / reverse rotation / stop via the I / O unit 8. A forward end sensor 32 is attached in the vicinity of one end (left end in FIG. 7) of the belt conveyor 31, and a reverse end sensor 33 is attached in the vicinity of the other end (right end in FIG. 7). The I / O unit 8 is notified by detecting that the workpiece has reached the forward end or the reverse end.
[0022]
FIG. 8 is a diagram illustrating a state in which the CPU unit 6, the I / O unit 8, and the like are mounted in the slots in the PC.
[0023]
FIG. 9 is a ladder diagram showing an example of an interface sequence program that is loaded from the I / O unit 8 to the CPU unit 6 and executed by the CPU unit 6 in the belt conveyor system shown in FIG. FIG. 9 shows a state after the device name is converted.
Next, the ladder diagram will be described. In FIG. 9, in step 801, if X0 is ON, a command to turn ON the emergency stop output Y7F on the I / O unit 8 is issued to stop the belt conveyor (the device name Y7F is the I / O unit 8). X1F).
In step 802, if X1 is ON, a command to turn ON Y74 (forward command) is issued (device name Y74 is X14 in the I / O unit 8).
In step 803, if X2 is ON, a command to turn ON Y75 (reverse drive command) is issued (device name Y75 is X15 in the I / O unit 8).
In step 804, if X7E is ON, the failure number is transferred from the I / O unit 8 to the CPU unit 6 by the FROM command (the device name X7E is Y1E in the I / O unit 8). This X7E is turned ON when an error occurs (when the cycle time is over).
When Y7F, Y74, and Y75 are turned ON, in the END processing of the sequence program, the slot numbers corresponding to these device names and the device names on the I / O unit 8 are obtained by referring to the symbol table described above, and the device A TO command to turn on the device with the name is executed, and the corresponding device (X1F, X14, X15) of the corresponding I / O unit 8 is turned on. Similarly, in the END processing of the sequence program, the slot number corresponding to X7E and the device number (Y1E) on the I / O unit 8 are obtained from the symbol table, and the I / O unit 8 installed in this slot is obtained. The FROM command for reading the contents of the device with this device name is executed to set the state of X7E. In this way, the interface devices X1F, X14, X15, and X7E are refreshed.
X0, X1, and X2 are on / off controlled in the sequence program of the CPU unit 6 (the portion not including the interface sequence program). These X0, X1, and X2 are set to device names that are not determined as interface devices in the interface sequence program stored in the I / O unit 8.
[0024]
FIG. 10 is a ladder diagram showing an example of a sequence program executed in the I / O unit 8 in the belt conveyor system shown in FIG. In the figure, in the notation of the interface device name, the notation in parentheses shows the notation after the interface sequence program is loaded into the CPU unit 6 and the device name is converted (notation in the CPU unit 8) for reference purposes. .
In the figure, in step S901, if T0 is not ON, the routine jumps to step S905 assuming that normal processing is performed. T0 is set when the cycle time is over.
In step S902, if Y1E is already ON in the previous scan, the process jumps to step S905 in order not to execute the CHK instruction again. When a failure is detected by failure diagnosis using the CHK instruction, Y1E is turned ON. Y1E is a device name in the I / O unit 8 and is X7E in the CPU unit 6.
In step S903, the CHK instruction is executed if the cycle time has exceeded during forward / reverse operation, and Y1E is set when a failure is detected as described above.
In step S904, the failure number is transferred to the CPU unit 8.
In step S905, when X14 is turned on while X15 (reverse command device), X00 (device indicating the state of the forward end sensor), and X1F (emergency stop command device) are turned off, Y10 (indicating forward operation) Device) is turned on, and Y00 used for failure detection is turned on. X14 is a device indicating a conveyor advance command, and the contact point of Y10 is connected in parallel with X14 on the ladder circuit.
In step S906, when X15 is turned on while X14 (forward command device), X01 (device indicating the state of the reverse end sensor), and X1F (emergency stop command device) are turned off, Y11 (reverse operation is being performed). Device) is turned on, and Y00 used for failure detection is turned off. On the ladder circuit, the contact point of Y11 is connected in parallel with X15.
In step S907, if X00 is ON, Y74 is reset. Since Y74 is a forward command, when Y74 is reset, the forward command is reset and the forward movement is stopped.
In step S908, if X01 is ON, Y75 is reset. Since Y75 is a reverse command, when Y75 is reset, the reverse command is reset and the reverse operation is stopped.
In step S909, the cycle time check timer is operated when X00 is OFF and X1F is OFF and Y10 is ON, or when X01 is OFF and X1F is OFF and Y11 is ON. When counting up, T0 is turned ON.
[0025]
Note that step S905 and step S906 in the ladder diagram of FIG. 10 are provided with an emergency stop contact X1F (Y7F) compared to steps S154 and S155 in the ladder diagram of FIG. This is one of the measures necessary for making the I / O unit 8 into one component.
Further, in the ladder diagram of FIG. 10, step S907 and step S908 are added compared to FIG. 16, but these steps are also added as measures necessary for making the I / O unit 8 as one component. Therefore, the output device that is turned on by the forward / reverse command sent from the CPU unit 6 into the I / O unit 8 is turned off.
The fact that the I / O unit 8 can be regarded as one component means that the operator simply inserts the I / O unit 8 into the slot of the PC and sets the slot number, and the CPU unit 6 and the I / O unit 8. This means that the I / O unit 8 can be used with almost no modification.
[0026]
As described above, in the system shown in FIG. 7, the CPU unit 6 issues three commands to the I / O unit 8, that is, conveyor operation permission, forward command, and reverse command. / O unit 8 is received. That is, the I / O unit 8 performs forward, reverse, and stop operations in accordance with instructions from the CPU unit 6. When the cycle time is over, the CPU unit 6 executes the FROM command in the loaded interface sequence program, and the failure number is the CPU unit 6. Configured to be sent to.
[0027]
Compared to the conventional system in which the CPU unit 22 executes the sequence program shown in FIG. 16, in the system shown in FIG. 7, the sequence program is processed by the I / O unit 8 shown in FIG. The sequence program in the CPU unit 6 is not required to perform the processing shown in FIG. 10 because it is divided into the interface portion, so that the scan time of the sequence program executed by the CPU unit 6 is shortened and high-speed processing is performed. It becomes possible.
In addition, compared with the conventional system in which the CPU unit 22 executes the sequence program shown in FIG. 16, in the embodiment of the present invention, it is divided into a part processed by the I / O unit 8 and an interface part as described above. Therefore, when the system is reconstructed, the part that needs to be changed can be easily identified and the program development efficiency can be improved.
That is, the sequence program shown in FIG. 10 is a sequence program specific to the I / O unit 8 and does not need to be changed when a normal system is changed. It is only necessary to change or create the sequence program shown in FIG.
[0028]
Next, a device access method of the I / O unit 8 will be described. FIG. 11 is an explanatory diagram showing signal paths in information exchange between the CPU unit 6 and the I / O unit 8. In the system shown in FIG. 11, each I / O unit 8 is assigned a symbol (unit name) consisting of a numerical value, a symbol, etc., and when accessing the device of the I / O unit 8 from the CPU unit 6, When accessing the device of the I / O unit 8 from this I / O unit, the I / O unit 8 is designated by this symbol. The CPU unit 6 converts this symbol into a slot number in the CPU unit 6 using the slot table 10.
For example, when the symbol of the I / O unit 8a is UNITA and the symbol of the I / O unit 8b is UNITB, when the I / O unit 8a accesses the device X0 of the I / O unit 8b, FIG. 12, the I / O unit 8a designates this device X0 with (UNITB.X0).
In FIG. 5, the mounting position of the I / O unit 8a is slot 5, the symbol of the I / O unit 8a is UNITA, the mounting position of the I / O unit 8b is 6, and the symbol of the I / O unit 8b is A part of the slot table 10 in the case of UNITB is illustrated.
The CPU unit 6 converts the symbol UNITB into a slot number by the slot table 10 and accesses the unit of the corresponding slot.
In this way, the device of the I / O unit 8 can be easily specified regardless of the slot in which the I / O unit 8 is inserted.
[0029]
Next, a supplementary explanation will be given for the conversion shown in FIG. When the I / O unit 8a accesses the device X0 of the I / O unit 8b, first, the I / O unit 8a transmits a message to the CPU unit 6 that the device X0 of the I / O unit 8b is to be turned on. This message has a structure of (symbol of I / O unit 8b + device number on I / O unit 8b + operation code). The operation code is a code indicating “ON”, “OFF” or the like. In this example, the message is, for example, “UNIT.B X0 ON”.
The CPU unit 6 obtains the slot number of the I / O unit 8b from the slot table 10 and sends this message to the unit of this slot. In this way, the message is transferred to the I / O unit 8b.
The I / O unit 8b performs the process indicated by the operation code in the message for the device in the unit specified by the device number in the message. In this example, processing for turning on the device X0 in the I / O unit 8b is performed.
[0030]
As described above, according to the present invention, the I / O unit 8 can be regarded as one component, and in the sequence program in the CPU unit 6, the interface sequence program for operating this component is added to its own sequence program. Just do it. Since the I / O unit 8 performs processing independently by its own sequence program, the CPU sequence program is prevented from being lengthened (the scan time is prevented from being lengthened) and the PC can be operated at high speed. . In addition, when changing or constructing a system, or when diverting a sequence program of another system, the interface sequence program may be modified / created, and the system change or construction or the sequence program of another system may be diverted. Can be easily done.
[0031]
【The invention's effect】
As described above, the first control unit repeatedly executes the first sequence program in which the storage address in the first storage unit of the device information indicating the state of the input / output device provided in the control target is described. An interface in which a storage address in the first storage means of interface device information that is exchanged between the PC main body units among the device information is described from the I / O unit that controls the controlled object via the first storage means to the PC main body unit. As the program is transferred, the second control means creates a first table showing the correspondence between the storage address in the first storage means of the I / O unit and the storage address in the third storage means of the PC main unit for the interface device information. In the interface program The storage address of the interface device information in the I / O unit is converted to the storage address in the PC main unit by the second control means, and the second sequence program having the converted interface program and its own sequence program is the second control means. The stored contents of the first and third storage means are refreshed so that the stored contents of the first and third storage means become the same for the interface device information based on the first table, and also according to its own sequence program Since the control of the I / O unit by the interface program is performed via the third storage means in addition to the predetermined control, if a sequence program executed by the I / O unit is created for each I / O unit The I / O unit It can be diverted to other programmable controllers as a single component, preventing the addition of additional programs to the sequence program of the PC main unit due to the addition of the I / O unit, preventing difficulty in creating the program, and PC An increase in the scan time of the main body unit is prevented, and a reduction in processing speed of the PC main body unit can be prevented. In addition, there is an effect that the change of the system and the diversion of the sequence program to the other system can be facilitated.
[0032]
Also, the name of the own unit is stored in the fourth storage means of the I / O unit, the stored contents of the fourth storage means in the I / O unit inserted in each slot are read, and the name and I / O are read out. The second table indicating the correspondence with the slot number in which the unit is inserted is created by the second control means, and the slot number corresponding to the name is recognized by the second control means based on the second table. This makes it possible to specify an I / O unit by name on the program, thereby preventing the difficulty of creating a program. In addition, there is an effect that the change of the system and the diversion of the sequence program to the other system can be facilitated.
[Brief description of the drawings]
FIG. 1 is a block configuration diagram of an I / O unit according to a first embodiment of the present invention.
FIG. 2 is a block configuration diagram of a CPU unit according to the first embodiment of the present invention.
FIG. 3 is a system configuration diagram according to Embodiment 1 of the present invention;
FIG. 4 is an operation flowchart of the CPU unit when power is turned on according to the first embodiment of the present invention.
FIG. 5 is an explanatory diagram showing an example of a slot table according to the first embodiment of the present invention.
FIG. 6 is an explanatory diagram showing an example of a symbol table according to Embodiment 1 of the present invention.
FIG. 7 is a block diagram showing a belt conveyor system according to Embodiment 1 of the present invention.
FIG. 8 is an explanatory diagram showing a state in which a CPU unit or the like is mounted in a slot of a PC according to Embodiment 1 of the present invention.
FIG. 9 is a ladder diagram showing an interface sequence program according to the first embodiment of the present invention.
FIG. 10 is a ladder diagram showing a sequence program executed in the I / O unit in the first embodiment of the present invention.
FIG. 11 is a diagram showing signal paths in the first embodiment of the present invention.
FIG. 12 is an explanatory diagram when accessing between I / O units in the first embodiment of the present invention;
FIG. 13 is a block diagram of a conventional I / O unit using a pattern table.
FIG. 14 is a block diagram showing a conventional belt conveyor system.
15 is an explanatory diagram showing a state in which a CPU unit or the like is installed in a slot of a PC in the belt conveyor system shown in FIG.
16 is a ladder diagram of a sequence program executed by a CPU unit in the belt conveyor system shown in FIG.
FIG. 17 is a block diagram of a conventional network in which a plurality of PCs are connected.
[Explanation of symbols]
1 I / O bus
3 Control device
4 Input circuit
5 Output circuit
6 CPU unit
7 Sequence program memory
8 I / O unit
9 Control device
10 Slot table
11 Forward operation contact
12 Motor
13 Reverse operation contact
14 Belt conveyor
15 Advance end sensor
16 Reverse end sensor
17 Input unit

Claims (4)

PC本体ユニットと、所定数のI/Oユニットとを備えたプログラマブルコントローラにおいて、
上記I/Oユニットは、制御対象に設けられた入力/出力機器の状態等を示すデバイス情報を記憶する第1記憶手段と、上記第1記憶手段における上記デバイス情報の記憶アドレスが記述された第1シーケンスプログラムを繰り返し実行することにより上記第1記憶手段を介して上記制御対象を制御する第1制御手段と、上記第1シーケンスプログラムにその記憶アドレスが記述されている上記デバイス情報のうち上記PC本体ユニット間で授受されるインターフェースデバイス情報の記憶アドレスが記述されたインターフェースプログラムを記憶する第2記憶手段とを有し、
上記PC本体ユニットは、第3記憶手段と、上記インターフェースデバイス情報の記憶アドレスについて上記第1記憶手段における記憶アドレスと上記第3記憶手段における記憶アドレスとの対応を示す第1テーブルを作成し、上記インターフェースプログラムにおける上記インターフェースデバイス情報の記憶アドレスを上記PC本体ユニットにおけるアドレスに変換し、変換された上記インターフェースプログラムと自身のシーケンスプログラムとを有する第2シーケンスプログラムを繰り返し実行し上記自身のシーケンスプログラムによる所定の制御に加えて上記インターフェースプログラムによる上記I/Oユニットの制御を上記第3記憶手段を介して行う第2制御手段とを有し、
上記第1テーブルにもとづき上記インターフェースデバイス情報について上記第1、第3記憶手段の記憶内容が同一になるように上記第1、第3記憶手段の記憶内容がリフレッシュされ、電源投入時等に上記インターフェースプログラムが上記I/Oユニットから上記PC本体ユニットに転送されることを特徴とするプログラマブルコントローラ。
In a programmable controller having a PC main unit and a predetermined number of I / O units,
The I / O unit includes a first storage unit that stores device information indicating a state of an input / output device provided to a control target, and a first address in which a storage address of the device information in the first storage unit is described. First control means for controlling the control object via the first storage means by repeatedly executing one sequence program, and the PC among the device information whose storage address is described in the first sequence program Second storage means for storing an interface program in which a storage address of interface device information exchanged between the main unit is described;
The PC main unit creates a first table indicating the correspondence between the storage address in the first storage means and the storage address in the third storage means with respect to the storage address of the third storage means and the interface device information, A storage address of the interface device information in the interface program is converted into an address in the PC main unit, and a second sequence program having the converted interface program and its own sequence program is repeatedly executed, and the predetermined sequence by the own sequence program is determined. In addition to the control of the second control means for controlling the I / O unit by the interface program via the third storage means,
Based on the first table, the stored contents of the first and third storage means are refreshed so that the stored contents of the first and third storage means are the same for the interface device information, and the interface is displayed when the power is turned on. A programmable controller, wherein a program is transferred from the I / O unit to the PC main unit.
I/Oユニットは自身のユニットの名称を記憶する第4記憶手段を有し、各スロットに挿入されている上記I/Oユニットにおける上記第4記憶手段の記憶内容が電源投入時等に読み出され上記名称と上記I/Oユニットが挿入されているスロットの番号との対応を示す第2テーブルが第2制御手段により作成され、上記第2制御手段は上記第2テーブルにより上記名称に対応するスロット番号を認知することを特徴とする請求項1記載のプログラマブルコントローラ。The I / O unit has fourth storage means for storing the name of its own unit, and the stored contents of the fourth storage means in the I / O unit inserted in each slot are read when the power is turned on. The second table indicating the correspondence between the name and the slot number in which the I / O unit is inserted is created by the second control means, and the second control means corresponds to the name by the second table. The programmable controller according to claim 1, wherein the slot number is recognized. 制御対象に設けられた入力/出力機器の状態等を示すデバイス情報の第1記憶手段における記憶アドレスが記述された第1シーケンスプログラムを第1制御手段が繰り返し実行することにより上記第1記憶手段を介して上記制御対象を制御するI/OユニットからPC本体ユニットに、上記デバイス情報のうち上記PC本体ユニット間で授受されるインターフェースデバイス情報の上記第1記憶手段における記憶アドレスが記述されたインターフェースプログラムが転送されるとともに、上記インターフェースデバイス情報について上記I/Oユニットの上記第1記憶手段における記憶アドレスと上記PC本体ユニットの上記第3記憶手段における記憶アドレスとの対応を示す第1テーブルが第2制御手段により作成され、上記インターフェースプログラムにおける上記インターフェースデバイス情報の上記I/Oユニットにおける記憶アドレスが上記第2制御手段により上記PC本体ユニットにおける記憶アドレスに変換される段階と、
変換された上記インターフェースプログラムと自身のシーケンスプログラムとを有する第2シーケンスプログラムが上記第2制御手段により実行され、上記第1テーブルにもとづき上記インターフェースデバイス情報について上記第1、第3記憶手段の記憶内容が同一になるように上記第1、第3記憶手段の記憶内容がリフレッシュされるとともに、上記自身のシーケンスプログラムによる所定の制御に加えて上記インターフェースプログラムによる上記I/Oユニットの制御が上記第3記憶手段を介して行われる段階と、を有することを特徴とするプログラマブルコントローラの制御方法。
When the first control unit repeatedly executes the first sequence program in which the storage address in the first storage unit of the device information indicating the state of the input / output device provided for the control target is described, the first storage unit is executed. An interface program in which the storage address in the first storage means of the interface device information exchanged between the PC main body units among the device information is described from the I / O unit that controls the control object via the PC to the PC main body unit. Is transferred, and the first table indicating the correspondence between the storage address in the first storage means of the I / O unit and the storage address in the third storage means of the PC main unit is second for the interface device information. Created by the control means, The method is converted into a storage address in the PC main unit by the storage address is the second control means in the I / O unit of the interface device information in the scan program,
A second sequence program having the converted interface program and its own sequence program is executed by the second control means, and the contents stored in the first and third storage means for the interface device information based on the first table. The stored contents of the first and third storage means are refreshed so that they are the same, and the I / O unit is controlled by the interface program in addition to the predetermined control by the own sequence program. And a step of performing control via a storage means.
I/Oユニットの第4記憶手段に自身のユニットの名称が記憶される段階と、
各スロットに挿入されている上記I/Oユニットにおける上記第4記憶手段の記憶内容が読み出され、上記名称と上記I/Oユニットが挿入されているスロットの番号との対応を示す第2テーブルが第2制御手段により作成される段階と、
上記第2テーブルにもとづき上記名称に対応するスロット番号が上記第2制御手段により認知される段階と、を有することを特徴とする請求項3記載のプログラマブルコントローラの制御方法。
Storing the name of the unit in the fourth storage means of the I / O unit;
The stored contents of the fourth storage means in the I / O unit inserted in each slot are read, and the second table showing the correspondence between the name and the slot number in which the I / O unit is inserted Is created by the second control means;
4. The method of controlling a programmable controller according to claim 3, further comprising the step of recognizing the slot number corresponding to the name based on the second table by the second control means.
JP23689097A 1997-09-02 1997-09-02 Programmable controller and control method thereof Expired - Lifetime JP3627087B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP23689097A JP3627087B2 (en) 1997-09-02 1997-09-02 Programmable controller and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP23689097A JP3627087B2 (en) 1997-09-02 1997-09-02 Programmable controller and control method thereof

Publications (2)

Publication Number Publication Date
JPH1185227A JPH1185227A (en) 1999-03-30
JP3627087B2 true JP3627087B2 (en) 2005-03-09

Family

ID=17007297

Family Applications (1)

Application Number Title Priority Date Filing Date
JP23689097A Expired - Lifetime JP3627087B2 (en) 1997-09-02 1997-09-02 Programmable controller and control method thereof

Country Status (1)

Country Link
JP (1) JP3627087B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2221679B1 (en) * 2009-02-11 2012-06-06 Siemens Aktiengesellschaft Method for logically connecting safety circuits in an industrial automation assembly and device for planning and carrying out this method

Also Published As

Publication number Publication date
JPH1185227A (en) 1999-03-30

Similar Documents

Publication Publication Date Title
CA1174368A (en) Programmable controller with back-up capability
CA1151306A (en) Programmable controller
US4488258A (en) Programmable controller with control program comments
US4809217A (en) Remote I/O port for transfer of I/O data in a programmable controller
US4623961A (en) Programmable controller having automatic contact line solving
US4455621A (en) Programmable controller with multiple functions
US4918589A (en) Method and apparatus for linking processors in a hierarchical control system
US5099449A (en) Industrial controller with variable I/O update rate
JPS6224802B2 (en)
WO1992009033A1 (en) Method and apparatus for providing down-loaded instructions for execution by a peripheral controller
GB2177826A (en) Programmable controller
JP3627087B2 (en) Programmable controller and control method thereof
JPS61269444A (en) Data transmission system
US5025390A (en) Robotic workcell control system with a binary accelerator providing enhanced binary calculations
US6182207B1 (en) Microcontroller with register system for the indirect accessing of internal memory via auxiliary register
US4700326A (en) Firmware transitional programmable sequential logic controller
EP0923010B1 (en) Programmable controller
US4564898A (en) Programmable controller having a drum type sequencer function subject to programming
CA1175575A (en) Programmable controller with multiple functions
JPH0769882B2 (en) Input / output control system having cross-call function and dynamic configuration change method in the system
JPS5822765B2 (en) Program loading method in electronic computer system
JP2522047B2 (en) Programmable controller for device control
JP2001125606A (en) State machine
CN113885442A (en) Method for realizing indexing shaft limiting through PLC in numerical control system
JP2011060211A (en) Programmable controller

Legal Events

Date Code Title Description
RD01 Notification of change of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7421

Effective date: 20040715

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041104

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: 20041109

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20041122

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

Free format text: PAYMENT UNTIL: 20071217

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20081217

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20091217

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20091217

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20101217

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20111217

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20111217

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20121217

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20121217

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20131217

Year of fee payment: 9

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

EXPY Cancellation because of completion of term