【0001】
【発明の属する技術分野】
本発明は、動作モードの設定を必要とするプログラマブルコントローラ(本明細書では、PLCという)に適用され、特に動作モードをスイッチにて設定する場合のPLCおよびその設定方法に関するものである。
【0002】
【従来の技術】
図5を参照して従来のPLCを説明する。図5は従来のPLCのブロック図である。
図5において、1はPLC、2はRUN状態を表示するLED表示器、4は手動でRUNまたはSTOPを選択し、且つユーザが入力したプログラムにしたがいPLC1を動作させるようにする運転制御スイッチ、6は動作モード、例えば出荷検査モード、社内検査モード等を選択するモード設定スイッチ、11はプログラム記憶部12に格納されたプログラムを読みだし、それを実行する演算・制御部、12はユーザが作成したプログラムの格納するプログラム記憶部、13は遠距離にある周辺装置15、例えばディスプレイ装置、ハードコピー等と演算・制御部11とを接続する通信インターフェイス、14は演算・制御のための各種データのデータ記憶部、16はリミットスイツチ等の外部機器(図示せず)から信号を入力させる入力インターフェイス、17は制御対象機器(図示せず)へ制御信号を出力させる出力インターフェイス、18はPLCへの電源を供給する電源部、19はユーザがプログラム記憶部12にプログラムをデバックするプログラム入出力機器である。
【0003】
上記演算・制御部11は、手動で設定された運転制御スイッチ4の状態(RUNもしくはSTOP)を読み取り、運転の場合にはプログラム記憶部12に保持されたプログラムにしたがい、データ記憶部14から各種のデータを読みだし、入力インターフェイス16から外部機器の信号を取り込み、必要に応じた演算処理を行ない、その結果に基づき出力インターフェイス17から制御対象機器へ制御信号を出力し、所望の制御を行なっている。停止の場合はPLC7がSTOPされている。前記運転もしくは停止の状態は、RUN状態を表示するLED2により、運転中は点灯、停止中は消灯と表示させる。
このとき、前記所望の制御には、使用目的に応じて特殊な使用方法、特殊な動作をさせたい場合、例えば社内検査、出荷検査、セルフチェック等を行なう場合が生じ、これ対応するため、モード設定スイッチ6が設けられ、使用目的に応じた必要なモード設定がなされていた。
【0004】
【発明が解決しようとする課題】
上記の如く、一般に、PLCにおいては、例えば外部との通信速度の設定や特殊な運転モードの是非、製品出荷時のチェックの是非といった各種の使用態様に応じるいわゆるモード設定を行なう必要があった。このモード設定スイッチ6には通常ディップスイッチが用いられる。
【0005】
前記ディップスイッチは、数個の横並びの小さなスイッチにより構成され、スイッチをスライドさせることによりON/OFFさせ、その組合せ信号(本明細書ではコードという)の表示により所望の設定モードが指定して得られていた。したがって、そのスイッチの個数はPLC1の動作モードの数が多数存在する場合は、前記ディップスイッチ6のスイッチの数を増やして対応する必要があった。
一般的に最近の電子機器は小型・高機能化の傾向にあり、PLCについても小型・高機能の要求が高まっている。高機能化に伴なって、例えば通信対象がモデムの場合のモデムの設定、システムダウンロードの場合のダウンロードの設定等、動作モード設定すべきモードが増える。設定すべきモードが増えると、この設定を行う前記ディップスイッチの数を増え、小型化の要求を満足することが難しくなるという課題があった。
【0006】
本発明は、かかる従来の課題を解決するためになされたもので、本来ディップスイッチにて設定していた動作モードを、最小限のハードスイッチとソフト処理と等価な各種手段による処理により設定することにより、動作モード設定用のディップスイッチなしで動作モード設定を可能とするPLCおよびその方法を提供することにある。
【0007】
【課題を解決するための手段】
本発明に係るPLCの構成は、ON/OFFの二つ以上の状態を示す信号を出力する出力スイッチと、内部の状態を表示する表示器とを配設したプログラマブルコントローラにおいて、電源投入時に、前記表示器に表示される所定の周期の点滅に応じて前記スイッチの状態を示す信号に基づいて内部処理手段により順番に前記スイッチの状態を記憶し、前記プログラマブルコントローラを前記スイッチの状態に対応した動作モードに設定できる手段を備えたことを特徴とするものである。
前項記載のPLCにおいて、電源投入後の一定期間、動作モードが設定できるようにし、動作モード設定操作の有無に関わらず、一定期間経過後は自動的に運転制御に切り換わる切換手段を備えたことを特徴とするものである。
【0008】
本発明に係るPLCの動作モード設定方法の構成は、ON/OFFの二つ以上の状態を示す信号を出力する手動スイッチと、内部の状態を表示する表示器とを配設したプログラマブルコントローラの動作モード設定方法において、電源投入時に、前記表示器に表示される所定の周期の点滅に応じて前記手動スイッチの状態を示す信号に基づいて、内部処理手段により順番に前記スイッチの状態を記憶し、前記プログラマブルコントローラを前記スイッチの状態に対応した動作モードに設定できることを特徴とするものである。
前項記載のPLCの動作モード設定方法において、電源投入後の一定期間、動作モード設定となり、動作モード設定操作の有無に関わらず、一定期間経過後は自動的に運転モードに移行することを特徴とするものである。
【0009】
【発明の実施の形態】
図1を参照して本発明に係る動作モード設定に用いられるPLCを説明する。図1は本発明に係る動作モード設定方法が用いられるPLCのブロック図、図2は図1のPLCの外形説明図であり、図1(a)は正面図、図1(b)は前面扉を開扉した場合の内部説明図である。なお、動作モード設定とは、目的のモードに応じて必要な回路部材で簡潔に回路構成をし、前記回路構成より不要の回路部材を排除し、回路経路を短く、且つ迅速に目的を達成するよう回路構成することをいう。
図1において、7はPLC、8は運転,停止の動作状態を表示する表示器、10はRUNまたはSTOPを手動で選択し、PLC7をユーザが入力したプログラムにしたがい動作するようにする運転制御スイッチとなり、もしくは10’の動作モード設定スイッチともなる手動のON/OFFスイッチ、11はプログラム記憶部12に格納されたプログラムを読みだしそれを実行する演算・制御部、12はユーザが作成したプログラムのプログラム記憶部、13は遠距離にある周辺装置15、例えばディスプレイ装置、ハードコピー等と演算・制御部11とを接続する通信インターフェイス、14は演算・制御のための各種データの格納するデータ記憶部、16はリミットスイツチ等の外部機器(図示せず)から信号を入力させる入力インターフェイス、17は制御対象機器(図示せず)へ制御信号を出力させる出力インターフェイス、18はPLCへの電源を供給する電源部、19はユーザがプログラム記憶部12にプログラムをデバックするプログラム入出力機器である。また、11−1は動作状態表示器を点滅させる点滅手段、11−2は動作状態表示器の点滅を計数する計数手段、11−3は運転制御時もしくはモード設定のいずれかを選択する設定選択手段、11−4は動作モード設定スイッチの状態記憶手段、11−5は所望の動作モードを判断する判断手段、11−6は演算・制御を実行する演算実行部であり、これらは演算・制御部11内に設けられた内部処理手段である。
【0010】
上記各部材で構成されるPLC7の概略を説明する。
上記図1において、内部処理手段である演算・制御部11は、その内設される設定選択手段11ー3によつて運転制御時もしくは動作モード設定のいずれかを選択することにより、前記手動のON/OFFスイッチが運転制御スイッチ10もしくは動作モード設定スイッチ10’のいずれかとなるよう選定するようになっている。
【0011】
運転制御時が選択された場合には、運転制御スイッチ10となり、その状態(RUNもしくはSTOP)を読み取り、運転の場合にはプログラム記憶部12に保持されたプログラムにしたがい、データ記憶部14から各種のデータを読みだし、入力インターフェイス16から外部機器の信号を取り込み、必要に応じた演算処理を行ない、その結果に基づき出力インターフェイス17から制御対象機器へ制御信号を出力し、所望の制御を行なっている。前記運転もしくは停止の状態は、状態を表示するLED8により、運転中は点灯、停止中は消灯と表示させる。
【0012】
動作モード設定が選択された場合には、状態を表示するLED8を周期的に点滅させ、前記点滅毎に所望の動作モードを表示するように、動作モード設定スイッチ10’をON/OFF(このスイッチのON/OFFで形成される組合せ信号をコードという)させ、動作モード設定スイッチ10’のコードを記憶させ
、記憶させたコードを読みだし、所望の動作モードであるかどうか判断するようにしたものである。
【0013】
次ぎに、PLC7の内部処理手段である演算・制御部11の構成を詳しく説明する。
図1において、演算・制御部11は、演算・制御を実行する演算実行部11−6と、前記演算実行部11−6によって制御され、運転制御時と動作設定モード時の設定を選択する設定選択手段11−3とが設けられている。
PLC7は前記設定選択手段11−3によって運転制御時と動作設定モード時とが選択されるがその際のそれぞれの構成を説明する。
【0014】
運転制御時が選択された場合.
演算実行部11−6が運転制御スイッチ10と接続され、その状態(RUNもしくはSTOP)を読み取り、運転の場合にはプログラム記憶部12に保持されたプログラムにしたがい、データ記憶部14から各種のデータを読みだし、入力インターフェイス16から外部機器の信号を取り込み、必要に応じた演算処理を行ない、その結果に基づき出力インターフェイス17から制御対象機器へ制御信号を出力し、所望の制御を行なっている。停止の場合はPLC7がSTOPされている。前記運転もしくは停止の状態は、演算実行部11−6が制御する状態表示するLED8により、運転中は点灯、停止中は消灯と表示させる。
【0015】
動作設定モード時が選択された場合.
演算実行部11−6が設定選択手段11−3に動作設定モード時の設定を選択させる。前記選択により運転制御スイッチ10を動作モード設定スイッチ10’として用いられるように選択される。
そして、動作状態表示器8と、動作状態表示器8を周期的に点滅させる点滅手段11−1と、前記点滅手段11−1による動作状態表示器8の周期的な点滅を計数させる計数手段11−2と、動作設定モード時の設定を選択する設定選択手段11−3に接続され、設定選択手段11−3を介して演算実行部11−6と接続されている。
【0016】
また、動作モード設定スイッチ10’と、前記動作モード設定スイッチ10’が動作状態表示器8の点滅毎に手動で所望の前記動作モードのコードを形成するように操作され、前記操作された動作モード設定スイッチ10’のコードを記憶させる記憶手段11−4と、前記計数手段11−2の所定の点滅回数毎に前記記憶手段11−4に記憶させた動作モード設定スイッチ10’のコードを読み出し、読み出したコードから所望の動作モードを判断する判断手段11−5とが接続され、さらに設定選択手段11−3介して演算実行部11−6と接続されている。  これらの各部材はいずれも演算実行部11−6によって制御されるようになっている。図1において、白抜き矢印は運転制御時の接続、黒矢印は動作設定モード時の接続、斜線部矢印は運転制御時および動作設定モード時の接続を示している。
【0017】
図2に示す如く、PLC7は、奥行きのある筐体に、前記動作状態表示器8、運転制御スイッチ10、演算・制御部11、プログラム記憶部12、通信インターフェイス13等が内蔵されている。
また、図2(a)に示す如く、前記動作状態表示器8およびRUNまたはSTOPを表示する運転制御スイッチ10が前面扉を開扉した場合に内扉面に設けられている。図2(b)に示す如く、前面扉を閉扉した場合を外面からRUN表示のみ見ることができるように構成されている。また、運転制御スイッチ10も外面からRUN表示のみ見ることができるように構成されている。なお、EPR9は、PLC7の異常表示を示すものである。
【0018】
図3を参照して、上記構成のPLCを機能的に説明する。図3は、図1のPLCのLEDによる動作モード設定説明図である。
図3において、PLCの動作状態を表示するLED8と2つ以上の運転,停止状態に切換えられる動作モード設定スイッチ10’を使用して実現する。
2つの運転状態(RUNおよびSTOP)に手動で切換えられる動作モード設定スイッチ10は、RUNおよびSTOPのいずれかを0もしくは1として、演算・制御部11の演算実行部1−6が前記0もしくは1の状態を読みだして認識することができる。運転制御スイッチ10は、電源投入時には1(0としても差し支えない)とし、動作設定モードスイッチ10として用いられる。また、前記運転制御スイッチと動作設定モードスイッチとをそれぞれ別個にしても差し支えない。
【0019】
動作設定モードの場合、演算実行部11−6で制御される点滅手段11−1が制御され、状態表示LED8を周期的に点滅させる。この周期的に点滅させる状態を図3(a)の波形11に示される。
図3(a)の波形11において、LED8を6回点滅させるが、最初の2回の点滅で動作設定モードの変更の有無、その後の4回の点滅で、どのような動作モード設定にするかを定める。動作状態表示のLED8は、動作モード設定スイッチ10’が動作設定モードの変更の有無、動作モード設定に従い切換えられるタイミングを外部に知らせる。
【0020】
動作モードを設定する場合は、状態表示のLED8が消灯したタイミングで動作モード設定スイッチ10を1の状態か0の状態に切換える。この状態を図3(b)の波形12に示される。
この状態で、演算実行部11−6は、再びLED8が点灯したタイミングで動作モード設定スイッチ10の状態を調べ、記憶手段11−4に記憶させる。これを動作モード数に応じて決められた回数分だけ動作モード設定スイッチ10の切り換えを行わせ、動作設定モードを終了する。そののち、演算実行部11−6は、前記スイッチ10’の操作したON/OFFを最初から順に演算実行部11−6が記憶手段11−4から読み出し、判断手段11−5で操作されたON/OFFパターンに相当する所望の動作モードで起動する。
【0021】
なお、図3(b)の波形12は、最初の2回の点滅での動作モード設定スイッチ10の切り換えで動作設定モードの変更の有無、その後の4回の点滅での動作モード設定スイッチ10’の操作で所望の動作モード設定を表すコードを形成させている。従来の4個のディップスイッチで設定したコードを図3(d)に示されるが、図3(d)のコードは、本実施形態で設定された動作設定モードのコードと等価な動作設定モードが設定されているのが分かる。
【0022】
動作モードの設定が成功した場合には、動作設定モードの最後にLED8を点滅させて外部に知らせる。また現在起動している動作モードを外部が知る必要があればLEDの変色・点滅・点灯・消灯の組合せにより外部に知らせることもできる。動作モードの設定を行わず、PLCを前の動作モードのままで起動させたい場合は、LEDの最初の2回の点滅時に動作モード設定スイッチ10を0か1のどちらかに固定して切り換えない。2回の点滅時において、動作モード設定スイッチ10が0,0(もしくは1,1)の状態を図3(c)の波形13に示されている。
【0023】
本実施の形態について、図4を参照して上記構成の動作を説明する。図4は図2のPLCのフローチャートである。
PLC7の動作モードを設定する場合、まず、動作モードの変更をするかどうか、動作状態表示LED8の2回の点滅動作で定める。
まず、ステップ14において、演算実行部11−6は、格納されたシステムプログラムに従い、動作設定モードを選択するか、運転設定にするか選択する。しかし、設定選択手段11−3により電源を投入した際は一定の間、動作設定モードを選択させることになる。なお、動作設定モード設定の後は、前記(RUN)もしくは(STOP)を設定する運転制御スイッチとなる。
【0024】
ステップ15において、電源投入により動作状態の表示LED8が演算実行部11−6が完全に動作する状態になるまで点灯させる。
まず、動作モードの変更をするかどうか、動作表示LED8は2回の点滅動作の間の動作モード設定スイッチ10’の切り換えで変更の意思表示をする。
ステップ16において、LED8を1秒間消灯16,ステップ17においてLED8を1秒間点灯17を行なわせる。次ぎに、手動で動作モード設定スイッチ10’を切り換えて動作モードの変更をするかどうかを定めることになる。
【0025】
ステップ18において、動作モード設定スイッチ10’の状態を記憶手段11−4に格納させる。
ステップ19において、演算実行部11−6は計数手段11−2によって動作表示LED8が2回点滅したかを確認する。これはカウンタを設け、1回の点滅にカウンタを1つずつ進める。このカウンタの内容を読みだすことにより比較をすることにより2回点滅確認を行なうことができる。
2回点滅しないときはステップ16にかえる。動作表示LED8は、2回点滅した場合、ステップ20に進む。
【0026】
ステップ20において、判断手段11−5が2回点滅の間にはスイッチ入力に変化があったかどうかを前記記憶手段11−4の格納データから判断する。
ステップ20において、2回点滅の間にはスイッチ入力に変化あれば、ステップ21に進む。ステップ21において動作表示LED8の消灯、ステップ22において動作表示LED8の点灯させる。
【0027】
ステップ23において、手動で動作モード設定スイッチ10’を切り換え、動作モード設定スイッチ10’の状態を記憶手段11−4に記憶させる。この消灯、点灯動作モード設定スイッチ10’を切り換え動作を4回繰り換えさせる。この切り換えは、所望の動作モードに表すスイッチのON/OFFの組合せにしたがってなされる。
【0028】
ステップ24において、動作表示LED8の点滅は、4回あったかどうか、確認する。この確認は、前記2回の時の点滅と同様にカウンタの内容を確認して行われる。動作表示LED8の点滅が4回なかった場合、ステップ21に再びかえる。4回あった場合、ステップ25に進む。
【0029】
ステップ25において、演算実行部11−6がその内部にモード表示の設定がされているか、どうか判断する。動作モードの設定が成功した場合は動作表示LED8を2回点滅させて知らせる。
起動した動作モードを知る必要の有る場合、通常運転時に個々の動作モードについてCPU内部に表示の有無を予め設定する。
YESの場合、動作モードの表示が選択されている動作モードで起動した場合はステップ26に進み、動作表示LED8の点滅、点灯、消灯、変色の組合せで動作モードを表示し、ステップ27に進む。
NOの場合、動作モードの表示が選択されていない場合も、ステップ27に進む。ステップ27においては、上記動作設定モードが終了した時点で最初から順に記憶させた動作モード設定スイッチ10’の状態を読み出して、その組合せに対応した新動作モードで起動する。
【0030】
ステップ20において、2回点滅の間にはスイッチ入力に変化がなければ、ステップ28に進む。この場合、起動した動作モードを知る必要の有る場合、ステップ25と同様に、通常運転時に個々の動作モードについてCPU内部に表示の有無を予め設定する。
YESの場合、動作モードの表示が選択されている動作モードで起動された場合にはステップ29に進む。ステップ29においては、動作表示LED8の点滅、点灯、消灯、変色の組合せで動作モードを表示し、ステップ30に進む。
【0031】
ステップ28において、NOの場合、動作モードの表示が選択されていない動作モードで起動された場合にもステップ30に進む。ステップ30において、前回設定した動作モードで起動する。
上記の動作モードの設定が完了すると、動作モード設定スイッチ10’は、RUNもしくはSTOPの状態を設定する運転制御スイッチに切り替る。
【0032】
【発明の効果】
以上、詳細に説明した如く、従来ハードウェアであるディップスイッチで設定していた動作モードの設定を1個のハードウェアスイッチとLED表示にて設定することにより、ディップスイッチを削除して、動作モード設定が可能となる。これによりPLCのハードウェアにおいて部品面積、プリント基板上のパターンが占める面積などが削減できるため、小型化したPLCを提供することができる。
また、動作モードの種類を増やししたい場合にも、従来ならばディップスイッチの数を増やす等ハードウェア自体の変更が必要となったが、この方法では電源投入時の動作モード設定スイッチの切り換え状態を増加させるだけで済むため、追加が容易に可能となる効果がある。
【図面の簡単な説明】
【図1】本発明に係る動作モード設定方法が用いられるPLCのブロック図である。
【図2】図1のPLCの外形説明図である。
【図3】図1のPLCのLEDによる動作モード設定説明図である。
【図4】図1のPLCのフローチャートである。
【図5】従来のPLCのブロック図である。
【符号の説明】
1,7…PLC
2,8…状態表示LED
3,9…異常表示LED
10…運転制御スイッチ
10’…動作モード設定スイッチ
11…演算・制御部
11−1…点滅手段
11−2…計数手段
11−3…設定選択手段
11−4…記憶手段
11−5…判断手段
11−6…演算実行部[0001]
 BACKGROUND OF THE INVENTION
 The present invention is applied to a programmable controller (referred to as a PLC in the present specification) that requires setting of an operation mode, and particularly relates to a PLC when the operation mode is set by a switch and a setting method thereof.
 [0002]
 [Prior art]
 A conventional PLC will be described with reference to FIG. FIG. 5 is a block diagram of a conventional PLC.
 In FIG. 5, 1 is a PLC, 2 is an LED display for displaying the RUN status, 4 is an operation control switch for manually selecting RUN or STOP, and operating thePLC 1 according to a program input by the user, 6 Is a mode setting switch for selecting an operation mode, for example, a shipping inspection mode or an in-house inspection mode, 11 is a calculation / control unit for reading out and executing a program stored in theprogram storage unit 12, and 12 is created by a user A program storage unit for storing a program, 13 is aperipheral device 15 at a long distance, for example, a display device, a communication interface for connecting a hard copy or the like to the calculation /control unit 11, and 14 is data of various data for calculation / controlA storage unit 16 is an input for inputting a signal from an external device (not shown) such as a limit switch. 17, an output interface for outputting a control signal to a control target device (not shown), 18 a power supply unit for supplying power to the PLC, and 19 a program input / output for allowing a user to debug a program to theprogram storage unit 12 Equipment.
 [0003]
 The calculation /control unit 11 reads the state (RUN or STOP) of theoperation control switch 4 set manually, and in the case of operation, various operations are performed from thedata storage unit 14 according to the program stored in theprogram storage unit 12. The data of the external device is read out, the signal of the external device is taken in from theinput interface 16 and the arithmetic processing is performed as necessary. Based on the result, the control signal is output from theoutput interface 17 to the control target device, and the desired control is performed. Yes. In the case of stop, thePLC 7 is stopped. The operation or stop state is indicated by theLED 2 that displays the RUN state as being lit during operation and unlit during stop.
 At this time, in the desired control, when it is desired to perform a special usage method or special operation according to the purpose of use, for example, in-house inspection, shipping inspection, self-check, etc. may occur, and in order to cope with this, A setting switch 6 was provided, and necessary mode settings were made according to the purpose of use.
 [0004]
 [Problems to be solved by the invention]
 As described above, in general, in a PLC, it is necessary to perform so-called mode setting corresponding to various usage modes such as setting of a communication speed with the outside, whether to use a special operation mode, and whether to check at the time of product shipment. A normal dip switch is used as the mode setting switch 6.
 [0005]
 The DIP switch is composed of several small switches arranged side by side. The switch is turned ON / OFF by sliding the switch, and a desired setting mode is designated by displaying a combination signal (referred to as a code in this specification). It was done. Therefore, when there are a large number of operation modes of thePLC 1, it is necessary to increase the number of switches of the dip switch 6 to cope with the number of switches.
 In general, recent electronic devices tend to be small and highly functional, and the demand for small and highly functional PLC is also increasing. Along with the increase in functionality, for example, there are more modes to set the operation mode, such as modem settings when the communication target is a modem and download settings when the system is downloaded. When the number of modes to be set increases, there is a problem that it becomes difficult to satisfy the demand for downsizing by increasing the number of DIP switches for performing this setting.
 [0006]
 The present invention has been made to solve such a conventional problem, and the operation mode originally set by the DIP switch is set by processing by various means equivalent to the minimum hardware switch and software processing. Accordingly, it is an object of the present invention to provide a PLC and a method thereof that enable operation mode setting without a dip switch for operation mode setting.
 [0007]
 [Means for Solving the Problems]
 The configuration of the PLC according to the present invention is a programmable controller including an output switch that outputs a signal indicating two or more ON / OFF states and a display that displays an internal state. Based on a signal indicating the state of the switch displayed on the display in accordance with blinking of a predetermined cycle, the state of the switch is sequentially stored by an internal processing means, and the programmable controller is operated according to the state of the switch. Means is provided for setting the mode.
 In the PLC described in the previous paragraph, the operation mode can be set for a certain period after the power is turned on, and provided with switching means that automatically switches to operation control after the lapse of the certain period regardless of the presence or absence of the operation mode setting operation. It is characterized by.
 [0008]
 The configuration of the operation mode setting method of the PLC according to the present invention is an operation of a programmable controller provided with a manual switch for outputting a signal indicating two or more states of ON / OFF and a display for displaying an internal state. In the mode setting method, when the power is turned on, based on a signal indicating the state of the manual switch in response to blinking of a predetermined period displayed on the display, the state of the switch is sequentially stored by the internal processing means, The programmable controller can be set to an operation mode corresponding to the state of the switch.
 In the operation mode setting method of the PLC described in the preceding paragraph, the operation mode is set for a certain period after the power is turned on, and automatically shifts to the operation mode after a certain period of time regardless of the operation mode setting operation. To do.
 [0009]
 DETAILED DESCRIPTION OF THE INVENTION
 The PLC used for the operation mode setting according to the present invention will be described with reference to FIG. FIG. 1 is a block diagram of a PLC in which an operation mode setting method according to the present invention is used, FIG. 2 is an external view of the PLC of FIG. 1, FIG. 1 (a) is a front view, and FIG. 1 (b) is a front door. It is internal explanatory drawing at the time of opening a door. The operation mode setting means that a simple circuit configuration is made with necessary circuit members according to a target mode, unnecessary circuit members are eliminated from the circuit configuration, a circuit path is shortened, and the object is achieved quickly. This means that the circuit is configured.
 In FIG. 1, 7 is a PLC, 8 is a display for displaying the operation status of operation and stop, 10 is an operation control switch for manually selecting RUN or STOP, and causing thePLC 7 to operate according to a program input by the user. Or a manual ON / OFF switch that also serves as an operationmode setting switch 10 ', 11 is a calculation / control unit that reads and executes a program stored in theprogram storage unit 12, and 12 is a program created by the user. A program storage unit, 13 is aperipheral device 15 at a long distance, for example, a display device, a communication interface for connecting a hard copy or the like to the calculation /control unit 11, and 14 is a data storage unit for storing various data for calculation / control , 16 is an input interface for inputting a signal from an external device (not shown) such as a limit switch.Reference numeral 17 denotes an output interface that outputs a control signal to a control target device (not shown), 18 denotes a power supply unit that supplies power to the PLC, and 19 denotes a program input / output device that allows a user to debug a program to theprogram storage unit 12 It is. 11-1 is a flashing means for flashing the operation status indicator, 11-2 is a counting means for counting the flashing of the operation status indicator, and 11-3 is a setting selection for selecting either operation control or mode setting. 11-4 is a state storage means for the operation mode setting switch, 11-5 is a determination means for determining a desired operation mode, and 11-6 is a calculation execution unit for executing calculation and control. This is an internal processing means provided in thesection 11.
 [0010]
 The outline of PLC7 comprised by said each member is demonstrated.
 In FIG. 1, the calculation /control unit 11 which is an internal processing unit selects either the operation control setting or the operation mode setting by the setting selection unit 11-3 provided therein, thereby the manual operation unit 11-3. The ON / OFF switch is selected to be either theoperation control switch 10 or the operationmode setting switch 10 ′.
 [0011]
 When the operation control time is selected, theoperation control switch 10 is selected, and the state (RUN or STOP) is read. In the case of operation, various operations are performed from thedata storage unit 14 according to the program held in theprogram storage unit 12. The data of the external device is read out, the signal of the external device is taken in from theinput interface 16 and the arithmetic processing is performed as necessary. Based on the result, the control signal is output from theoutput interface 17 to the control target device, and the desired control is performed. Yes. The state of the operation or stop is indicated by theLED 8 that displays the state as being lit during operation and unlit during stop.
 [0012]
 When the operation mode setting is selected, the operationmode setting switch 10 ′ is turned ON / OFF (this switch so that theLED 8 for displaying the state blinks periodically and the desired operation mode is displayed for each blinking. The combination signal formed by ON / OFF of the signal is referred to as a code), the code of the operation mode setting switch 10 'is stored, the stored code is read, and it is determined whether or not it is a desired operation mode. It is.
 [0013]
 Next, the configuration of the calculation /control unit 11 that is an internal processing unit of thePLC 7 will be described in detail.
 In FIG. 1, a calculation /control unit 11 is controlled by a calculation execution unit 11-6 that executes calculation / control and a setting that is controlled by the calculation execution unit 11-6 and that selects settings for operation control and operation setting mode. Selection means 11-3 is provided.
 ThePLC 7 selects the time of operation control and the time of the operation setting mode by the setting selection means 11-3, and each configuration at that time will be described.
 [0014]
 When operation control time is selected.
 The arithmetic execution unit 11-6 is connected to theoperation control switch 10, reads its state (RUN or STOP), and in the case of operation, various data are read from thedata storage unit 14 according to the program held in theprogram storage unit 12. Is read out, the signal of the external device is taken in from theinput interface 16, the arithmetic processing is performed as necessary, and based on the result, the control signal is output from theoutput interface 17 to the control target device to perform the desired control. In the case of stop, thePLC 7 is stopped. The operation or stop state is displayed as being lit during operation and unlit during stop by anLED 8 that displays a state controlled by the calculation execution unit 11-6.
 [0015]
 When the operation setting mode is selected.
 The calculation execution unit 11-6 causes the setting selection unit 11-3 to select the setting in the operation setting mode. Based on the selection, theoperation control switch 10 is selected to be used as the operationmode setting switch 10 ′.
 Then, theoperation state indicator 8, the blinking means 11-1 for periodically blinking theoperation state indicator 8, and the counting means 11 for counting the periodic blinking of theoperation state indicator 8 by the blinking means 11-1. -2, and setting selection means 11-3 for selecting the setting in the operation setting mode, and is connected to the calculation execution section 11-6 via the setting selection means 11-3.
 [0016]
 Further, the operationmode setting switch 10 ′ and the operationmode setting switch 10 ′ are manually operated to form a code of the desired operation mode every time theoperation state indicator 8 flashes, and the operated operation mode is operated. The storage means 11-4 for storing the code of the settingswitch 10 ′ and the code of the operationmode setting switch 10 ′ stored in the storage means 11-4 are read every predetermined number of blinks of the counting means 11-2, A determination unit 11-5 for determining a desired operation mode from the read code is connected, and further connected to the calculation execution unit 11-6 via the setting selection unit 11-3. Each of these members is controlled by the calculation execution unit 11-6. In FIG. 1, white arrows indicate connections during operation control, black arrows indicate connections during operation setting mode, and hatched arrows indicate connections during operation control and operation setting mode.
 [0017]
 As shown in FIG. 2, thePLC 7 includes theoperation state indicator 8, theoperation control switch 10, the calculation /control unit 11, theprogram storage unit 12, thecommunication interface 13, and the like in a deep housing.
 In addition, as shown in FIG. 2A, theoperation state indicator 8 and theoperation control switch 10 for displaying RUN or STOP are provided on the inner door surface when the front door is opened. As shown in FIG. 2B, when the front door is closed, only the RUN display can be seen from the outer surface. Theoperation control switch 10 is also configured so that only the RUN display can be seen from the outside. Note that EPR9 indicates an abnormal display of the PLC7.
 [0018]
 With reference to FIG. 3, the PLC having the above configuration will be functionally described. FIG. 3 is an explanatory diagram of operation mode setting by the LEDs of the PLC of FIG.
 In FIG. 3, this is realized by using anLED 8 that displays an operation state of the PLC and two or more operation mode setting switches 10 ′ that can be switched between operation and stop states.
 The operationmode setting switch 10 that can be manually switched between two operating states (RUN and STOP) is set to 0 or 1 for either RUN or STOP, and the calculation execution unit 1-6 of the calculation /control unit 11 is set to the above 0 or 1 You can read and recognize the state of. Theoperation control switch 10 is 1 (can be set to 0) when the power is turned on, and is used as the operation settingmode switch 10. Further, the operation control switch and the operation setting mode switch may be separately provided.
 [0019]
 In the case of the operation setting mode, the blinking means 11-1 controlled by the calculation execution unit 11-6 is controlled, and thestatus display LED 8 is periodically blinked. The state of periodically blinking is shown by awaveform 11 in FIG.
 In thewaveform 11 of FIG. 3A, theLED 8 blinks 6 times. Whether the operation setting mode is changed by the first 2 blinks, and what operation mode setting is made by the subsequent 4 blinks. Determine. The operationstate display LED 8 informs the outside of whether or not the operationmode setting switch 10 ′ is changed according to the operation mode setting and the operation mode setting.
 [0020]
 When setting the operation mode, the operationmode setting switch 10 is switched to the 1 state or the 0 state at the timing when thestatus display LED 8 is turned off. This state is shown by thewaveform 12 in FIG.
 In this state, the calculation execution unit 11-6 checks the state of the operationmode setting switch 10 at the timing when theLED 8 is turned on again and stores it in the storage unit 11-4. The operationmode setting switch 10 is switched by the number of times determined according to the number of operation modes, and the operation setting mode is terminated. After that, the calculation execution unit 11-6 reads ON / OFF operated by theswitch 10 ′ from the storage unit 11-4 in order from the beginning, and the ON performed by the determination unit 11-5. Start in a desired operation mode corresponding to the / OFF pattern.
 [0021]
 Note that thewaveform 12 in FIG. 3 (b) indicates that the operationmode setting switch 10 is switched by the first two flashes, and the operation mode setting switch 10 'is changed by the subsequent four flashes. In this way, a code representing a desired operation mode setting is formed. The code set by the conventional four dip switches is shown in FIG. 3D. The code shown in FIG. 3D has an operation setting mode equivalent to the code of the operation setting mode set in the present embodiment. You can see that it is set.
 [0022]
 When the setting of the operation mode is successful, theLED 8 is blinked at the end of the operation setting mode to notify the outside. Further, if it is necessary for the outside to know the operation mode that is currently activated, it can be notified to the outside by a combination of LED discoloration, blinking, lighting, and extinguishing. If you do not want to set the operation mode and want to start the PLC with the previous operation mode, the operationmode setting switch 10 is fixed to either 0 or 1 when the LED flashes for the first two times. . Awaveform 13 in FIG. 3C shows a state where the operationmode setting switch 10 is 0, 0 (or 1, 1) at the time of blinking twice.
 [0023]
 In this embodiment, the operation of the above configuration will be described with reference to FIG. FIG. 4 is a flowchart of the PLC of FIG.
 When setting the operation mode of thePLC 7, first, whether or not to change the operation mode is determined by two blinking operations of the operationstate display LED 8.
 First, instep 14, the calculation execution unit 11-6 selects whether to select an operation setting mode or an operation setting according to the stored system program. However, when the power is turned on by the setting selection unit 11-3, the operation setting mode is selected for a certain period. Note that after the operation setting mode is set, the operation control switch sets (RUN) or (STOP).
 [0024]
 Instep 15, the operatingstate display LED 8 is turned on by turning on the power until the calculation execution unit 11-6 is completely operated.
 First, whether or not to change the operation mode, theoperation display LED 8 displays an intention to change by switching the operationmode setting switch 10 ′ between two blinking operations.
 Instep 16,LED 8 is turned off 16 for 1 second, and instep 17,LED 8 is turned on 17 for 1 second. Next, it is determined whether to change the operation mode by manually switching the operation mode setting switch 10 '.
 [0025]
 Instep 18, the state of the operation mode setting switch 10 'is stored in the storage means 11-4.
 Instep 19, the calculation execution unit 11-6 confirms whether theoperation display LED 8 blinks twice by the counting unit 11-2. This provides a counter and advances the counter one by one for one flash. By making a comparison by reading the contents of this counter, it is possible to confirm blinking twice.
 If it does not blink twice, return to step 16. When theoperation display LED 8 blinks twice, the process proceeds to Step 20.
 [0026]
 Instep 20, it is determined from the data stored in the storage means 11-4 whether or not the switch input has changed while the determination means 11-5 blinks twice.
 If it is determined instep 20 that the switch input is changed between the two blinks, the process proceeds to step 21. Instep 21, theoperation display LED 8 is turned off, and instep 22, theoperation display LED 8 is turned on.
 [0027]
 In step 23, the operation mode setting switch 10 'is manually switched, and the state of the operation mode setting switch 10' is stored in the storage means 11-4. The switching operation of the turn-off / lighting operationmode setting switch 10 ′ is repeated four times. This switching is performed according to a combination of ON / OFF of the switch that represents the desired operation mode.
 [0028]
 Instep 24, it is confirmed whether or not theoperation display LED 8 blinks four times. This confirmation is performed by confirming the contents of the counter in the same manner as the blinking at the second time. If theoperation display LED 8 does not blink four times, the process returns to step 21 again. If there are four times, go toStep 25.
 [0029]
 Instep 25, the calculation execution unit 11-6 determines whether or not the mode display is set therein. When the setting of the operation mode is successful, theoperation display LED 8 blinks twice to notify.
 When it is necessary to know the activated operation mode, the presence / absence of display in the CPU for each operation mode is set in advance during normal operation.
 In the case of YES, if the operation mode is activated in the selected operation mode, the process proceeds to step 26, the operation mode is displayed by a combination of blinking, lighting, extinguishing, and discoloration of theoperation display LED 8, and the process proceeds to step 27.
 In the case of NO, the process proceeds to step 27 also when the display of the operation mode is not selected. Instep 27, the state of the operationmode setting switch 10 ′ stored in order from the beginning when the operation setting mode is completed is read out, and a new operation mode corresponding to the combination is started.
 [0030]
 Instep 20, if there is no change in the switch input between the two blinks, the process proceeds to step 28. In this case, if it is necessary to know the activated operation mode, whether or not to display the individual operation modes during normal operation is set in advance in the same manner as instep 25.
 In the case of YES, if the operation mode is activated in the selected operation mode, the process proceeds to step 29. Instep 29, the operation mode is displayed by a combination of blinking, lighting, extinguishing, and discoloration of theoperation display LED 8, and the process proceeds to step 30.
 [0031]
 If NO atstep 28, the process also proceeds to step 30 even when the operation mode is activated in an operation mode not selected. Instep 30, the system is started up in the previously set operation mode.
 When the setting of the operation mode is completed, the operationmode setting switch 10 ′ is switched to an operation control switch for setting the RUN or STOP state.
 [0032]
 【The invention's effect】
 As described above in detail, the dip switch is deleted by setting the operation mode setting that has been set with the conventional hardware dip switch with one hardware switch and LED display, and the operation mode Setting is possible. As a result, it is possible to reduce the component area, the area occupied by the pattern on the printed circuit board, and the like in the PLC hardware, so that a downsized PLC can be provided.
 Also, if you want to increase the number of operation modes, it was necessary to change the hardware itself by increasing the number of dip switches in the past. Since only the increase is required, there is an effect that the addition can be easily performed.
 [Brief description of the drawings]
 FIG. 1 is a block diagram of a PLC in which an operation mode setting method according to the present invention is used.
 FIG. 2 is a diagram for explaining the external shape of the PLC shown in FIG. 1;
 FIG. 3 is an explanatory diagram of operation mode setting by the LED of the PLC in FIG. 1;
 FIG. 4 is a flowchart of the PLC of FIG. 1;
 FIG. 5 is a block diagram of a conventional PLC.
 [Explanation of symbols]
 1,7 ... PLC
 2,8 ... Status display LED
 3,9 ... Error indication LED
 DESCRIPTION OFSYMBOLS 10 ... Operation control switch 10 '... Operationmode setting switch 11 ... Calculation / control part 11-1 ... Flashing means 11-2 ... Counting means 11-3 ... Setting selection means 11-4 ... Storage means 11-5 ... Determination means 11 -6 ... Calculation execution part