JP3733746B2 - Programmable controller - Google Patents

Programmable controller Download PDF

Info

Publication number
JP3733746B2
JP3733746B2 JP15783098A JP15783098A JP3733746B2 JP 3733746 B2 JP3733746 B2 JP 3733746B2 JP 15783098 A JP15783098 A JP 15783098A JP 15783098 A JP15783098 A JP 15783098A JP 3733746 B2 JP3733746 B2 JP 3733746B2
Authority
JP
Japan
Prior art keywords
instruction
instructions
read
state
programmable controller
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP15783098A
Other languages
Japanese (ja)
Other versions
JPH11353174A (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.)
Panasonic Electric Works Co Ltd
Original Assignee
Matsushita Electric Works Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Matsushita Electric Works Ltd filed Critical Matsushita Electric Works Ltd
Priority to JP15783098A priority Critical patent/JP3733746B2/en
Publication of JPH11353174A publication Critical patent/JPH11353174A/en
Application granted granted Critical
Publication of JP3733746B2 publication Critical patent/JP3733746B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Description

【0001】
【発明の属する技術分野】
本発明は、基本的なビット演算命令処理と、複数ビットの応用命令処理の両方を処理することのできる専用ハードウェアを備えたプログラマブルコントローラに関する。
【0002】
【従来の技術】
プログラマブルコントローラは、産業用装置、機械、FA装置の制御に広く用いられている。最も単純な構成は図7に示す通り、制御対象に接続された各種I/O1と制御プログラムやデータを格納したメモリ2と汎用マイクロプロセッサ(以下MPUと言う)3とで構成され、メモリ2に格納された命令をMPU3が順次解釈実行することで制御機能を実現している。ところで制御対象となる装置の複雑化、さらなる高速化の要求に応じて、より多数の入出力信号を高速に処理することが求められている。このため図8に示すようにビット演算処理を主とする基本命令と複数ビットで構成されるデータを処理する応用命令の−部を実行することができる専用ハードウェア(プロセッサ<以下BPUと言う>)4で高速化を実現し、通信処理・周辺処理・応用命令の実行などを行うMPU3、ユーザープログラムや内部リレーの情報などを格納するメモリや、制御対象や周辺装置などとの情報のやりとりを行う為の各種I/O1などから構成されたプログラマブルコントローラが提供されている。
【0003】
そして更に高速化を図る手段として、ユーザーが作成した制御プログラムを高速実行に向く形式に変換してからBPUで実行するという構成も提供されている。このプログラマブルコントローラの構成例を図9に示す。図9の構成では図8の構成に加えて、BPU4のプログラムを格納するための第2のメモリ5を追加している。第1のメモリ2に格納されたユーザーが作成した制御プログラムを変換して第2のメモリ5に転送し、BPU4は第2のメモリ5からプログラムを読み込み順次解釈実行することにより制御機能を実現する。図9の構成例の場合、第2のメモリ5に展開する命令に第1のメモリ2に格納された元の命令に比べて構造を単純化したRISC型の命令体系を採用したり、BPU4をパイプライン構成にすることにより、図8の構成に比べて更に高速化を実現することができる。ただし命令メモリが2組必要になることと、命令語の構成によってはMPU3側とBPU4側でバスの構成が異なるため、バスインターフェースユニット(BIU)6が新たに必要になるなど回路構成は複雑になり、その分コストも上昇する。
【0004】
【発明が解決しようとする課題】
先にも述べた通り高速化の要求により、プログラマブルコントローラを構成するための専用ハードウェア(プロセッサ)を開発してシステム全体の動作速度の向上を進めてきた。その際、専用ハードウェアで実行するための命令語は、汎用マイクロプロセッサのそれとは異なりプログラマブルコントローラの構成を考慮して最適なものが開発されてきた。
【0005】
その一方でより多数の入出力信号を処理したいという要求もあるが、一度専用ハードウェアの命令語を定めてしまうと、その要求に応えることが難しくなるという問題が生じることがある。この問題の説明のため、図10に専用ハードウェアの命令語の構造の例を示す。命令語は16bit 長でそのうちの6bit が命令の種類を示すオベコード部分(OP Code)、残りの10bit がデータ番号(DATA No.)を示す部分であるとする。この場合、1つの命令で扱えるデータは10bit で表現できる1024個となり、命令語を開発した時点ではこのデータ点数で十分であるという判断のもと、このような命令語が定義された。しかしより多数の入出力信号を処理したいという要求、すなわちより多くのデータ点数を扱いたいという要求に対しては、この命令語では対応できない場合がある。
【0006】
そこでより多くのデータ点数を扱えるように命令語を修正することを検討する必要あるが、それまでの開発資産を無駄にしないため、修正した命令語は従来の命令語と上位互換性を持たせることが望まれる。その条件を満足するように修正した命令語の構成例を図11に示す。命令語の中で未使用のコードを拡張命令として使用することにし、拡張命令を前置した命令語はデータ番号にあらかじめ定めた値を加算して解釈するものとする。図11の例では拡張命令(Expand1 )を前置した命令語にはデータ番号に1024を、拡張命令(Expand2 )を前置した命令語にはデータ番号に2048を加算して解釈するものとする。すなわち図11(a)はXリレー100番に対するST命令(スタート命令)、図11(b)はXリレー1124番に対するST命令、図11(c)はXリレー2 148番に対するST命令と解釈される。
【0007】
このように命令語の未使用コードをデータ領域の拡張に用いる拡張命令として使用することにより、多数の入出力信号を処理したいという要求に応えることができる。また同様に未使用コードをインデックス修飾と呼ぶデータアドレスの間接指定に用いることにより、プログラム開発の自由度を上げることにも役立てることができる。ところでこのような拡張命令を追加する前の命令語が図8の構成のプログラマブルコントローラと同時に開発されたものである場合、命令語を実行するBPU4は追加された拡張命令を解釈実行できないため、このような命令語を使用することはできない。またユーザーが作成した制御プログラムをまったく別の形式の命令語に変換してから実行する図9の構成のプログラマブルコントローラではこのような拡張命令の追加にも対応できるが、その場合にはデータ点数の増加と処理速度の向上と引き替えにコスト上昇という欠点も生じることになる。
【0008】
一方、図7のように専用ハードウェア(BPU)を用いずにMPU3のソフトウェア処理だけで命令を解釈実行することもできるが、この場合は高速処理の要求に応えることが難しくなる。
【0009】
本発明は上述の点に鑑みて為されたもので、その目的とするところは、データの領域の拡大やアドレスの間接指定を行うための拡張命令をもった命令語を高速に実行することができ、しかもコスト的にも安価なプログラマブルコントローラを提供することにある。
【0010】
【発明を解決するための手段】
請求項1の発明では、制御対象に接続されたI/Oと、制御プログラムやデータを格納するメモリと、通信処理・周辺処理・応用命令の実行を少なくとも行う汎用マイクロプロセッサとを備えるとともに、通常の命令の前に配置することでデータ領域の拡張やアドレスの間接指定を可能とした専用の拡張命令や、基本的なビット演算命令、複数ビットの応用命令等の命令語を順次読み込み、基本的なビット演算命令、複数ビットの応用命令であればそれらの命令の処理を実行し、拡張命令を読み込んだ場合には、後続の通常命令も読み込み、これら拡張命令,通常命令をあわせて命令の内容を解釈した後、命令の処理を実行する専用ハードウェアを備えたことを特徴する。
【0011】
請求項2の発明では、請求項1の発明において、上記専用ハードウェアの制御をステートマシンで行い、命令読み出しを行うステートから通常命令か拡張命令かを判断する処理を独立したステートに分離したことを特徴とする。
【0012】
請求項3の発明では、請求項1の発明において、上記専用ハードウェアの制御をステートマシンで行い、命令読み出しを行うステートを、最初の1語目を読み出すステートと2語目以降の命令語を読み出すステートとで構成したことを特徴とする。
【0013】
請求項4の発明では、請求項1乃至3の何れかの発明において、拡張命令を読み込む処理において、読み込んだ拡張命令の内容を後で判別できるための最小限のデータ量に変換して内部の専用記憶手段に記憶し該記憶データを用いて命令実行の処理を行うことを特徴とする。
【0014】
請求項5の発明では、請求項1乃至4の何れかの発明において、上記専用ハードウェアが実行処理する命令中、類似処理を行う命令を複数のグループに分類し、上記専用ハードウェアを制御するステートマシンの命令実行を行うステートをグループ別に独立させたことを特徴とする。
【0015】
【発明の実施の形態】
本発明は、データ点数の拡張やアドレスの間接指定を行うための拡張命令を追加した命令語を実行するプログラマブルコントローラを実現するにあたり、動作速度とコストのトレードオフを考慮して図8の構成を採用することにする。ここで拡張命令を実行する専用ハードウェアたるBPU4は、通常命令を読み込んだ時はその処理を、拡張命令を読み込んだときは更に後続の通常命令を読み込んであわせて命令の内容を解釈し、命令を実行することが可能なものとする。 以下本発明を、実施形態により説明する。
【0016】
(実施形態1)
本実施形態は図11(b)、(c)に示すように、通常の命令だけでなく別に定めた拡張命令(Expand)を通常の命令の前に配置することによりデータ領域の拡張やアドレスの間接指定が可能となる命令語を定義し、その命令語を順次読み込み解釈実行する専用ハードウェアを実現し、それを用いて図8と同様な構成のプログラマブルコントローラを実現したもので、BPU4の制御を図1で示すステートマシンで実現した。図1で用いられているステートの意味は
IF:命令読み出し(Instruction Fetch )
ID:命令解読(Instruction Decode)
EX:実行(Execute)
で、図1ではIFステート(ステージ)で命令を読み出し、それを、IDステート(ステージ)で解釈した後、もしそれが拡張命令だった場合は再びIFステート(ステージ)に戻ってさらに後続の命令読み出し処理を行い、拡張命令と後続の命令とを併せて命令の内容を解釈して命令の処理実行(EX1,…)に移る。また読み出した命令が拡張命令(Expand)ではなく通常命令だった場合は命令解釈(解読)結果に従ってデータの読み書きや演算処理等の命令実行処理に移る。なお図ではステートマシンの一部のみを図示している。またハードウェア構成は図8と同じであるから、図8を参照し、ここでは図示しない。
(実施形態2)
本発明のように拡張命令を前置した命令の場合、上述したように命令解読と命令読み出しが繰り返されることになるが、この命令解読処理を本実施形態では、図2のステートマシンの状態遷移で示すように
ID1:通常命令または拡張命令を判断する処理
ID2:それ以外の命令解読処理
に分割しており、IF1ステート(ステージ)で命令を読み出し、命令解読ステート(ステージ)ID1で通常命令又は拡張命令の判断処理をすることにより、命令実行の高速化を図ることができる。
【0017】
図3(a)、(b)の命令実行時のタイミングチャートに示すように、通常命令のみの場合は命令解読ステート(ステージ)を分割しない図1のステートマシンを用いた構成(図3(a)の場合)でも本実施形態のように命令解読ステート(ステージ)を分割した構成(図3(b)の場合)でも、命令実行時間は変わらない。しかし通常命令の前に拡張命令が配置された命令を実行する場合は、本実施形態では図3(e) に示すように、最初の命令語を読み込んでそれが拡張命令であると判断し、更に命令語を読み込む動作が速くなるので、命令解読ステート(ステージ)を分割しない図1のステートマシンを用いた図3(d)の場合に比べて命令実行時間を短縮することができる。 尚ハードウェア構成は図8と同じであるから,図8を参照し、ここでは図示しない。
【0018】
(実施形態3)
ところで命令を実行するBPU4には命令を読み込むための命令レジスタは1つしか無いため、読み込んだ命令語が拡張命令であった場合はその情報をBPU4内部に記憶して更に後続の命令を読み込む。拡張命令を読み込んだという情報を記憶しないと命令レジスタの内容が後続命令で上書きされてしまうためであるが、この拡張命令を読み込んだと言う情報は最初の命令語を読み込む度にクリアしなければ、いま実行している命令が拡張命令を前置していない命令であっても、前に実行された命令が拡張命令付きの命令だった場合にその拡張命令の情報が現在の命令実行に悪影響を及ぼすことになる。
【0019】
また命令語を読む込むときに無条件に拡張命令の情報をクリアすると、拡張命令を読み込んだ後の命令読み込みで拡張命令がクリアされてしまうので、正しく命令を実行することができなくなる。このように「最初の命令語を読み込んだ時に拡張命令情報をクリア」しなければならないが、これを実現するためには命令語読み込みと拡張命令情報のセットとクリアに関して複雑な制御回路を構成する必要が生じる。そこでステートマシンの命令読み出し処理を、最初の1語目を読み出すステートと2語目以降の命令語を読み出すステートの2つで実現することで、命令を実行する専用ハードウェアの制御回路を簡単にする。
【0020】
本実施形態のBPU4を制御するステートマシンの状態遷移は上記実施形態と同様に図2に示すステートマシンの状態遷移を用いる。図4は本実施形態の命令実行時のタイミングチャートを示す。
【0021】
本実施形態では図4(a)又は(c)に示す命令読み出しを行うIF1ステート(ステージ)で拡張命令情報を図4(b)又は(d)に示すようにBPU4内の拡張命令情報レジスタ(図示せず)をクリアするので、通常命令のみの図4(a)、(b)の場合でも拡張命令が前置された図4(c)、(d)の場合でも、命令読み出し開始時に前の命令の影響を取り消すことができる。そして解読の結果最初に読み込んだ命令語が拡張命令でさらに命令語を読み込む必要があるときはIF1ステート(ステージ)ではなくIF2ステート(ステージ)に遷移して命令読み出しを行い、この時には命令解読の結果セットされた拡張命令情報(Expand1)をクリアしないので、この拡張命令情報(Expand1)を用いて誤りなく命令を実行することができる。
【0022】
このようにデータ領域の拡張やアドレスの間接指定を行うための拡張命令を読み込んだ時には、その情報をBPU4内部の専用記憶手段である拡張命令情報レジスタに記憶するが、このとき拡張命令を命令語の形式そのままで保存するのではなく、拡張命令の判別ができる必要最小限の情報量に変換して記憶すると、ハードウェアの規模を削減することができる。 ここで図10で示したように命令語のデータ幅を16bit とし、拡張命令の種類が合計7種だとすると、命令語の形式でそのまま記憶する場合には16bit 長の記憶場所が必要になるが、7種の拡張命令を表現するには拡張命令の有無1bit と拡張命令の番号を示す3bit の合計4bit でできるため、そのように拡張命令情報を変換すれば4bit の記憶場所ですむことになる。
【0023】
図4で示した「拡張命令情報レジスタ」は、このように拡張命令の有無、種類を判別するために必要最小限のbit 幅で構成されている。
【0024】
(実施形態4)
ところで、命令を解読した後は、解読した内容に従ってデータの読み書きや演算処理などの命令実行処理が行われる。これが図2のステートマシンで示したEX1、EX2ステート(ステージ)であるが、プログラマブルコントローラの命令の種類によりアクセスするデータのアドレスも様々であり、そもそも命令の種類によってはメモリヘのアクセスが必要ないものや1つだけメモリからの読み込みが必要なもの、1つのデータを読み込んでそれを基に演算処理を行いその結果を再び1つのメモリに書き込むものや、複数のメモリの値を読み込んで演算処理を行いその結果を複数のメモリに書き込むものなど様々なものがあり、それらをすべて場合分けしてEX1、EX2、…ステート(ステージ)で実行するとステート1つあたりの処理が複雑になり、命令実行にかかる時間も多くなってしまう。そこでプログラマブルコントローラの命令をメモリヘのアクセスの様子などに注目してよく似た処理を行う命令のグループに分類して、ステートマシンの命令実行を行うステートを命令のグループ別に独立して持たせることにより、命令の実行速度を向上させることにしたのが本実施形態である。
【0025】
図5は本実施形態のステートマシンの状態遷移を示し、図6は実施形態2の場合の命令実行時と本実施形態の命令実行時を比較するためののタイミングチャートを示す。
【0026】
本実施形態のステートマシンは図2のステートマシンに比べてステートD2の後のEX1、EX2、EX3、…の命令実行に関するステートが命令のグループ分けに応じて複数(EXA1,…、EXB1,…、EXC1,…、)に分割している。このためステートマシンの規模は大きくなり、専用ハードウェアであるBPU4の規模も大きくなるが、その反面EXステート(ステージ)の1つが実行する処理の内容は少なくなるため、ステート(ステージ)1つにかかる時間を少なくすることができる。図6(b)に示すように命令のグループ分けに応じて複数に分割することによりEXステート(ステージ)に関する処理が図6(a)に示す場合に比べて速くなり、その結果命令実行速度を向上させることができる。
【0027】
【発明の効果】
請求項1の発明は、制御対象に接続されたI/Oと、制御プログラムやデータを格納するメモリと、通信処理・周辺処理・応用命令の実行を少なくとも行う汎用マイクロプロセッサとを備えるとともに、通常の命令の前に配置することでデータ領域の拡張やアドレスの間接指定を可能とした専用の拡張命令や、基本的なビット演算命令、複数ビットの応用命令等の命令語を順次読み込み、基本的なビット演算命令、複数ビットの応用命令であればそれらの命令の処理を実行し、拡張命令を読み込んだ場合には、後続の通常命令も読み込み、これら拡張命令,通常命令をあわせて命令の内容を解釈した後、命令の処理を実行する専用ハードウェアを備えたので、データ領域の拡大やアドレスの間接指定を行うための拡張命令を持った命令語を高速に実行することができ、また構成も簡単でコストも安価であるという効果がある。
【0028】
請求項2の発明は、請求項1の発明において、上記専用ハードウェアの制御をステートマシンで行い、命令読み出しを行うステートから通常命令か拡張命令かを判断する処理を独立したステートに分離したので、上記拡張命令を前置した命令を実行する際の高速化を実現することができるという効果がある。
【0029】
請求項3の発明は、請求項1の発明において、上記専用ハードウェアの制御をステートマシンで行い、命令読み出しを行うステートを、最初の1語目を読み出すステートと2語目以降の命令語を読み出すステートとで構成したので、命令読み出しと拡張命令の情報の記憶処理を簡単にすることができ、制御回路の設計を容易にできるという効果がある。
【0030】
請求項4の発明は、請求項1乃至3の何れかの発明において、拡張命令を読み込む処理において、読み込んだ拡張命令の内容を後で判別できるための最小限のデータ量に変換して内部の専用記憶手段に記憶し該記憶データを用いて命令実行の処理を行うので、読み込んだ拡張命令の情報を記憶する記憶手段の規模を削減することができ、プログラマブルコントローラの中の命令を実行する専用ハードウェア部分の規模を削減することができるという効果がある。
【0031】
請求項5の発明は、請求項1乃至4の何れかの発明において、上記専用ハードウェアが実行処理する命令中、類似処理を行う命令を複数のグループに分類し、上記専用ハードウェアを制御するステートマシンの命令実行を行うステートをグループ別に独立させたので、命令実行速度を向上させることができるという効果がある。
【図面の簡単な説明】
【図1】実施形態1に用いる専用ハードウェアを制御するステートマシンの構成図である。
【図2】実施形態2に用いる専用ハードウェアを制御するステートマシンの構成図である。
【図3】同上の動作説明用タイミングチャートである。
【図4】実施形態3の動作説明用タイミングチャートである。
【図5】実施形態4に用いる専用ハードウェアを制御するステートマシンの構成図である。
【図6】同上の動作説明用タイミングチャートである。
【図7】プログラマブルコントローラの一例を示す構成図である。
【図8】プログラマブルコントローラの別の例を示す構成図である。
【図9】プログラマブルコントローラの他の例を示す構成図である。
【図10】プログラマブルコントローラの命令語の構造説明図である。
【図11】(a)は通常命令の説明図である。
(b)は通常命令と拡張命令との説明図である。
(c)は通常命令と別の拡張命令との説明図である。
【符号の説明】
IF 命令読み出しのステート(ステージ)
ID 命令解読のステート(ステージ)
EX1,… 実行のステート(ステージ)
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a programmable controller including dedicated hardware capable of processing both basic bit operation instruction processing and multi-bit application instruction processing.
[0002]
[Prior art]
Programmable controllers are widely used for controlling industrial devices, machines, and FA devices. As shown in FIG. 7, the simplest configuration is composed of various I / Os 1 connected to the controlled object, a memory 2 storing control programs and data, and a general-purpose microprocessor (hereinafter referred to as MPU) 3. The MPU 3 sequentially interprets and executes the stored instructions to realize a control function. By the way, it is required to process a larger number of input / output signals at a high speed in response to a demand for higher complexity and a device to be controlled. Therefore, as shown in FIG. 8, dedicated hardware (processor <hereinafter referred to as BPU>) capable of executing a basic instruction mainly including bit operation processing and an application instruction for processing data composed of a plurality of bits. ) 4 realizes high speed, MPU3 that performs communication processing, peripheral processing, application command execution, etc., memory that stores user program and internal relay information, etc., and exchanges information with control targets and peripheral devices There is provided a programmable controller composed of various I / Os 1 for performing.
[0003]
As a means for further speeding up, a configuration is also provided in which a control program created by a user is converted into a format suitable for high-speed execution and then executed by the BPU. A configuration example of this programmable controller is shown in FIG. In the configuration of FIG. 9, in addition to the configuration of FIG. 8, a second memory 5 for storing the program of the BPU 4 is added. The control program created by the user stored in the first memory 2 is converted and transferred to the second memory 5, and the BPU 4 reads the program from the second memory 5 and sequentially interprets and executes the control function. . In the case of the configuration example of FIG. 9, a RISC type instruction system having a simplified structure compared to the original instruction stored in the first memory 2 is adopted for the instruction expanded in the second memory 5, By adopting a pipeline configuration, a higher speed can be realized compared to the configuration of FIG. However, because two sets of instruction memory are required and the bus configuration differs between the MPU 3 side and the BPU 4 side depending on the configuration of the instruction word, the circuit configuration is complicated, for example, a new bus interface unit (BIU) 6 is required. As a result, the cost increases accordingly.
[0004]
[Problems to be solved by the invention]
As described above, in response to the demand for higher speeds, dedicated hardware (processors) for configuring programmable controllers has been developed to improve the operating speed of the entire system. At that time, an optimum instruction word to be executed by dedicated hardware has been developed in consideration of the configuration of the programmable controller, unlike that of a general-purpose microprocessor.
[0005]
On the other hand, there is a request to process a larger number of input / output signals, but once a dedicated hardware instruction word is defined, there may be a problem that it becomes difficult to meet the request. In order to explain this problem, FIG. 10 shows an example of the structure of instruction words of dedicated hardware. The instruction word is 16 bits long, of which 6 bits are an obcode part (OP Code) indicating the type of instruction, and the remaining 10 bits are a part indicating a data number (DATA No.). In this case, the number of data that can be handled by one instruction is 1024 that can be expressed in 10 bits, and such an instruction word is defined based on the determination that the number of data points is sufficient when the instruction word is developed. However, this command may not be able to handle a request to process a larger number of input / output signals, that is, a request to handle a larger number of data points.
[0006]
Therefore, it is necessary to consider modifying the instruction word so that it can handle a larger number of data points. However, in order not to waste development resources up to that point, the modified instruction word has upward compatibility with conventional instruction words. It is desirable. FIG. 11 shows a configuration example of an instruction word modified to satisfy the condition. An unused code in the instruction word is used as an extension instruction, and an instruction word preceded by the extension instruction is interpreted by adding a predetermined value to the data number. In the example of FIG. 11, 1024 is added to the data number for the instruction word prefixed with the extended instruction (Expand1), and 2048 is added to the data number for the instruction word prefixed with the extended instruction (Expand2). . 11 (a) is interpreted as an ST command (start command) for the X relay No. 100, FIG. 11 (b) is interpreted as an ST command for the X relay 1124, and FIG. 11 (c) is interpreted as an ST command for the X relay 2 148. The
[0007]
In this way, by using the unused code of the instruction word as an extension instruction used for extending the data area, it is possible to meet the demand for processing a large number of input / output signals. Similarly, by using the unused code for indirect designation of the data address called index modification, it can be used to increase the degree of freedom of program development. By the way, when the instruction word before adding such an extension instruction is developed at the same time as the programmable controller having the configuration of FIG. 8, the BPU 4 executing the instruction word cannot interpret and execute the added extension instruction. Such an instruction word cannot be used. In addition, the programmable controller having the configuration shown in FIG. 9 that executes the control program created by the user after converting it into a completely different type of instruction word can cope with the addition of such an extension instruction. In exchange for the increase and the improvement of the processing speed, there is a disadvantage that the cost increases.
[0008]
On the other hand, as shown in FIG. 7, it is possible to interpret and execute instructions only by software processing of the MPU 3 without using dedicated hardware (BPU). However, in this case, it becomes difficult to meet the demand for high-speed processing.
[0009]
The present invention has been made in view of the above points, and its object is to execute an instruction word having an extension instruction for expanding a data area or indirectly specifying an address at high speed. An object of the present invention is to provide a programmable controller that can be manufactured at low cost.
[0010]
[Means for Solving the Invention]
The invention of claim 1 includes an I / O connected to a control target, a memory for storing a control program and data, and a general-purpose microprocessor that at least executes communication processing, peripheral processing, and application instructions. Instructions such as dedicated extension instructions that enable data area expansion and indirect address specification, basic bit operation instructions, multi-bit application instructions, etc. If a bit operation instruction or multi-bit application instruction is executed, processing of those instructions is executed. When an extended instruction is read, the subsequent normal instruction is also read, and the contents of the instruction are combined with these extended instruction and normal instruction. After interpreting the above, it is provided with dedicated hardware for executing instruction processing.
[0011]
According to a second aspect of the present invention, in the first aspect of the invention, the dedicated hardware is controlled by a state machine, and the process for determining whether the instruction is read from a normal instruction or an extended instruction is separated into independent states. It is characterized by.
[0012]
According to a third aspect of the present invention, in the first aspect of the present invention, the dedicated hardware is controlled by a state machine, the state in which the instruction is read out, the state in which the first word is read out, and the instruction word in the second and subsequent words. It is characterized by comprising a state to be read.
[0013]
According to a fourth aspect of the present invention, in the process of reading an extension instruction according to any one of the first to third aspects, the contents of the read extension instruction are converted into a minimum data amount that can be determined later, and It is stored in a dedicated storage means, and instruction execution processing is performed using the stored data.
[0014]
According to the invention of claim 5, in the invention of any one of claims 1 to 4, among the instructions executed by the dedicated hardware, the instructions for performing similar processing are classified into a plurality of groups, and the dedicated hardware is controlled. The state in which the state machine executes instructions is made independent for each group.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
The present invention implements the configuration shown in FIG. 8 in consideration of a trade-off between operation speed and cost when realizing a programmable controller that executes an instruction word to which an extension instruction for extending the number of data points or indirectly specifying an address is added. I will adopt it. Here, the BPU4, which is dedicated hardware for executing the extended instruction, interprets the contents of the instruction by reading the normal instruction when the normal instruction is read, and further reading the subsequent normal instruction when the extended instruction is read. Can be executed. Hereinafter, the present invention will be described with reference to embodiments.
[0016]
(Embodiment 1)
In this embodiment, as shown in FIGS. 11B and 11C, not only a normal instruction but also a separately defined extension instruction (Expand) is arranged before a normal instruction, thereby expanding the data area and addressing. Defines instruction words that can be indirectly specified, implements dedicated hardware that sequentially reads, interprets and executes the instruction words, and implements a programmable controller having the same configuration as that shown in FIG. Was realized by the state machine shown in FIG. The meaning of the states used in Fig. 1 is IF: Instruction Read (Instruction Fetch)
ID: Instruction Decode
EX: Execute
In FIG. 1, after reading an instruction in the IF state (stage) and interpreting it in the ID state (stage), if it is an extended instruction, it returns to the IF state (stage) again and further subsequent instructions. A read process is performed, the contents of the instruction are interpreted together with the extension instruction and the subsequent instruction, and the process proceeds to instruction execution (EX1,...). If the read instruction is not an extended instruction (Expand) but a normal instruction, the process proceeds to instruction execution processing such as data reading / writing and arithmetic processing according to the instruction interpretation (decoding) result. In the figure, only a part of the state machine is illustrated. Since the hardware configuration is the same as that in FIG. 8, reference is made to FIG. 8, which is not shown here.
(Embodiment 2)
In the case of an instruction prefixed with an extended instruction as in the present invention, instruction decoding and instruction reading are repeated as described above. In this embodiment, this instruction decoding process is performed in the state transition of the state machine of FIG. As shown in FIG. 1, ID1: Processing for determining a normal instruction or an extended instruction ID2: Dividing into other instruction decoding processes, reading an instruction in the IF1 state (stage), and normal instruction or in an instruction decoding state (stage) ID1 By executing the extension instruction determination process, it is possible to speed up the instruction execution.
[0017]
As shown in the timing charts at the time of instruction execution in FIGS. 3A and 3B, the configuration using the state machine of FIG. 1 that does not divide the instruction decoding state (stage) in the case of only normal instructions (FIG. 3A In the case of ()), the instruction execution time does not change even in the case where the instruction decoding state (stage) is divided as in the present embodiment (in the case of FIG. 3B). However, when an instruction in which an extended instruction is arranged before a normal instruction is executed, in this embodiment, as shown in FIG. 3E, the first instruction word is read and it is determined that it is an extended instruction. Further, since the operation of reading the instruction word becomes faster, the instruction execution time can be shortened compared to the case of FIG. 3D using the state machine of FIG. 1 in which the instruction decoding state (stage) is not divided. Since the hardware configuration is the same as that in FIG. 8, reference is made to FIG. 8, which is not shown here.
[0018]
(Embodiment 3)
By the way, since the BPU 4 that executes an instruction has only one instruction register for reading an instruction, if the read instruction word is an extension instruction, the information is stored in the BPU 4 and further subsequent instructions are read. This is because if the information that the extended instruction is read is not stored, the contents of the instruction register are overwritten by subsequent instructions. However, the information that this extended instruction has been read must be cleared each time the first instruction word is read. Even if the instruction currently being executed is an instruction that does not prepend an extension instruction, if the previously executed instruction is an instruction with an extension instruction, the information on the extension instruction has an adverse effect on the current instruction execution. Will be affected.
[0019]
Further, if the information of the extension instruction is unconditionally cleared when the instruction word is read, the extension instruction is cleared when the instruction is read after the extension instruction is read, so that the instruction cannot be executed correctly. As described above, the extension instruction information must be cleared when the first instruction word is read. To achieve this, a complicated control circuit is configured for reading the instruction word and setting and clearing the extension instruction information. Need arises. Therefore, by implementing the instruction read processing of the state machine in two states, a state in which the first word is read and a state in which the second and subsequent instruction words are read out, a dedicated hardware control circuit that executes the instructions can be simplified. To do.
[0020]
For the state transition of the state machine that controls the BPU 4 of this embodiment, the state transition of the state machine shown in FIG. 2 is used as in the above embodiment. FIG. 4 shows a timing chart at the time of instruction execution in the present embodiment.
[0021]
In this embodiment, the extended instruction information is stored in the extended instruction information register (in the BPU 4 as shown in FIG. 4B or FIG. 4D) in the IF1 state (stage) in which the instruction is read as shown in FIG. 4 (a) and (b) with only a normal instruction, and even in the case of FIGS. 4 (c) and 4 (d) in which an extended instruction is preceded, the previous instruction is started. Can cancel the effect of the order. When the first instruction word read as a result of decoding is an extension instruction and further instruction words need to be read, the instruction reading is performed by changing to the IF2 state (stage) instead of the IF1 state (stage). Since the extended instruction information (Expand 1) set as a result is not cleared, the extended instruction information (Expand 1) can be used to execute an instruction without error.
[0022]
When an extension instruction for data area expansion or address indirect designation is read in this way, the information is stored in the extension instruction information register, which is a dedicated storage means inside the BPU 4, and at this time, the extension instruction is stored in the instruction word. If the data is converted into a minimum amount of information that can be used to distinguish an extension instruction and stored instead of being stored as it is, the scale of the hardware can be reduced. As shown in FIG. 10, if the data width of the instruction word is 16 bits and there are a total of 7 types of extension instructions, a 16-bit storage location is required if the instruction words are stored as they are. Since 7 types of extension instructions can be expressed with a total of 4 bits, 1 bit of presence / absence of extension instructions and 3 bits indicating the number of extension instructions, if the extension instruction information is converted in this way, a storage area of 4 bits is required.
[0023]
The “extended instruction information register” shown in FIG. 4 is configured with a minimum bit width necessary for determining the presence / absence and type of an extended instruction.
[0024]
(Embodiment 4)
By the way, after the instruction is decoded, instruction execution processing such as data reading / writing and arithmetic processing is performed according to the decoded contents. This is the EX1 and EX2 states (stages) shown in the state machine of FIG. 2, but there are various data addresses to be accessed depending on the type of instruction of the programmable controller, and access to the memory is not required depending on the type of instruction in the first place. Or one that needs to be read from memory, one that reads data and performs arithmetic processing based on it, writes the result back to one memory, or reads multiple memory values to perform arithmetic processing There are various things, such as those that write the results into a plurality of memories, all of which are divided into cases and executed in EX1, EX2,... State (stage), the processing per state becomes complicated, and instruction execution It takes a lot of time. Therefore, by classifying the instructions of the programmable controller into groups of instructions that perform similar processing by paying attention to the state of access to the memory, etc., and having the state that executes the instructions of the state machine independently for each group of instructions In this embodiment, the instruction execution speed is improved.
[0025]
FIG. 5 shows the state transition of the state machine of the present embodiment, and FIG. 6 shows a timing chart for comparing the instruction execution time in the second embodiment with the instruction execution time in the present embodiment.
[0026]
The state machine of this embodiment has a plurality of states (EXA1,..., EXB1,..., EXA1,..., EXB1,. EXC1,...). For this reason, the scale of the state machine becomes large and the scale of the BPU 4 which is dedicated hardware also becomes large, but on the other hand, since the contents of processing executed by one of the EX states (stages) are reduced, the state (stage) becomes one. Such time can be reduced. As shown in FIG. 6B, by dividing into a plurality of instructions according to the instruction grouping, the processing related to the EX state (stage) becomes faster than the case shown in FIG. 6A. As a result, the instruction execution speed is increased. Can be improved.
[0027]
【The invention's effect】
The invention of claim 1 includes an I / O connected to a control target, a memory for storing a control program and data, and a general-purpose microprocessor that at least executes communication processing, peripheral processing, and application instructions. Instructions such as dedicated extension instructions that enable data area expansion and indirect address specification, basic bit operation instructions, multi-bit application instructions, etc. If a bit operation instruction or multi-bit application instruction is executed, processing of those instructions is executed. When an extended instruction is read, the subsequent normal instruction is also read, and the contents of the instruction are combined with these extended instruction and normal instruction. Since it has dedicated hardware that executes instruction processing after interpreting, instruction words with extended instructions to expand the data area and indirectly specify addresses There is an effect that can be performed, also configured with easy cost is inexpensive.
[0028]
According to a second aspect of the present invention, in the first aspect of the invention, the dedicated hardware is controlled by a state machine, and the process of determining whether the instruction is read from a normal instruction or an extended instruction is separated into independent states. There is an effect that it is possible to realize a high speed when executing an instruction preceded by the extended instruction.
[0029]
According to a third aspect of the present invention, in the first aspect of the invention, the dedicated hardware is controlled by a state machine, the state in which the instruction is read out, the state in which the first word is read out, and the instruction word in the second and subsequent words. Since it is configured with a read state, it is possible to simplify the process of reading instructions and storing information of extended instructions, and the design of the control circuit can be facilitated.
[0030]
According to a fourth aspect of the present invention, in the process of reading an extension instruction according to any one of the first to third aspects of the invention, the contents of the read extension instruction are converted into a minimum data amount that can be discriminated later. Since it is stored in the dedicated storage means and the instruction execution process is performed using the stored data, the scale of the storage means for storing the read extended instruction information can be reduced, and the instruction for executing the instructions in the programmable controller can be reduced. There is an effect that the scale of the hardware portion can be reduced.
[0031]
According to a fifth aspect of the present invention, in the invention according to any one of the first to fourth aspects, among the instructions executed by the dedicated hardware, the instructions for performing similar processing are classified into a plurality of groups, and the dedicated hardware is controlled. Since the state in which the state machine executes instructions is made independent for each group, the instruction execution speed can be improved.
[Brief description of the drawings]
FIG. 1 is a configuration diagram of a state machine that controls dedicated hardware used in the first embodiment.
FIG. 2 is a configuration diagram of a state machine that controls dedicated hardware used in the second embodiment.
FIG. 3 is a timing chart for explaining the operation.
FIG. 4 is a timing chart for explaining operations of the third embodiment.
FIG. 5 is a configuration diagram of a state machine that controls dedicated hardware used in the fourth embodiment.
FIG. 6 is a timing chart for explaining the operation of the above.
FIG. 7 is a configuration diagram illustrating an example of a programmable controller.
FIG. 8 is a configuration diagram illustrating another example of a programmable controller.
FIG. 9 is a configuration diagram illustrating another example of a programmable controller.
FIG. 10 is an explanatory diagram of the structure of an instruction word of a programmable controller.
FIG. 11A is an explanatory diagram of a normal instruction.
(B) is an explanatory diagram of a normal instruction and an extended instruction.
(C) is an explanatory diagram of a normal instruction and another extension instruction.
[Explanation of symbols]
IF instruction read state (stage)
ID Instruction decoding state (stage)
EX1, ... Execution state (stage)

Claims (5)

制御対象に接続されたI/Oと、制御プログラムやデータを格納するメモリと、通信処理・周辺処理・応用命令の実行を少なくとも行う汎用マイクロプロセッサとを備えるとともに、通常の命令の前に配置することでデータ領域の拡張やアドレスの間接指定を可能とした専用の拡張命令や、基本的なビット演算命令、複数ビットの応用命令等の命令語を順次読み込み、基本的なビット演算命令、複数ビットの応用命令であればそれらの命令の処理を実行し、拡張命令を読み込んだ場合には、後続の通常命令も読み込み、これら拡張命令,通常命令をあわせて命令の内容を解釈した後、命令の処理を実行する専用ハードウェアを備えたことを特徴するプログラマブルコントローラ。It has an I / O connected to the control target, a memory for storing control programs and data, and a general-purpose microprocessor that at least executes communication processing, peripheral processing, and application instructions, and is arranged before normal instructions. In this way, instruction words such as dedicated extension instructions that enable data area expansion and indirect address specification, basic bit operation instructions, and multi-bit application instructions are read sequentially, basic bit operation instructions, and multiple bits. If it is an application instruction, the processing of those instructions is executed. When an extended instruction is read, the subsequent normal instructions are also read. After interpreting the contents of the instruction by combining these extended instructions and normal instructions, A programmable controller comprising dedicated hardware for executing processing. 上記専用ハードウェアの制御をステートマシンで行い、命令読み出しを行うステートから通常命令か拡張命令かを判断する処理を独立したステートに分離したことを特徴とする請求項1記載のプログラマブルコントローラ。2. The programmable controller according to claim 1, wherein the dedicated hardware is controlled by a state machine, and the process of determining whether the instruction is a normal instruction or an extended instruction is separated into an independent state from a state in which the instruction is read. 上記専用ハードウェアの制御をステートマシンで行い、命令読み出しを行うステートを、最初の1語目を読み出すステートと2語目以降の命令語を読み出すステートとで構成したことを特徴とする請求項1記載のプログラマブルコントローラ。2. The state in which the dedicated hardware is controlled by a state machine and the instruction is read out is configured by a state in which the first word is read and a state in which the second and subsequent instruction words are read. The programmable controller described. 拡張命令を読み込む処理において、読み込んだ拡張命令の内容を後で判別できるための最小限のデータ量に変換して内部の専用記憶手段に記憶し該記憶データを用いて命令実行の処理を行うことを特徴とする請求項1乃至3の何れか記載のプログラマブルコントローラ。In the process of reading an extended instruction, the contents of the read extended instruction are converted into a minimum amount of data that can be discriminated later, stored in an internal dedicated storage means, and executed using the stored data The programmable controller according to any one of claims 1 to 3. 上記専用ハードウェアが実行処理する命令中、類似処理を行う命令を複数のグループに分類し、上記専用ハードウェアを制御するステートマシンの命令実行を行うステートをグループ別に独立させたことを特徴とする請求項1乃至4の何れか記載のプログラマブルコントローラ。Among the instructions executed by the dedicated hardware, the instructions for performing similar processing are classified into a plurality of groups, and the states for executing instructions of the state machine for controlling the dedicated hardware are made independent for each group. The programmable controller in any one of Claims 1 thru | or 4.
JP15783098A 1998-06-05 1998-06-05 Programmable controller Expired - Fee Related JP3733746B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15783098A JP3733746B2 (en) 1998-06-05 1998-06-05 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15783098A JP3733746B2 (en) 1998-06-05 1998-06-05 Programmable controller

Publications (2)

Publication Number Publication Date
JPH11353174A JPH11353174A (en) 1999-12-24
JP3733746B2 true JP3733746B2 (en) 2006-01-11

Family

ID=15658268

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15783098A Expired - Fee Related JP3733746B2 (en) 1998-06-05 1998-06-05 Programmable controller

Country Status (1)

Country Link
JP (1) JP3733746B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008226276A (en) * 2008-06-09 2008-09-25 Matsushita Electric Works Ltd Programmable controller

Also Published As

Publication number Publication date
JPH11353174A (en) 1999-12-24

Similar Documents

Publication Publication Date Title
CA1202425A (en) Multiprocessor system including firmware
WO2009085877A2 (en) Coupled symbiotic operating systems
US6687808B2 (en) Data processor using indirect register addressing
US4821231A (en) Method and apparatus for selectively evaluating an effective address for a coprocessor
KR19990036893A (en) Processor Architecture for Execution of Multiple Addressing Modes and Its Design Method
EP0240606B1 (en) Pipe-line processing system and microprocessor using the system
JP3733746B2 (en) Programmable controller
JPH0683615A (en) Computer for executing instruction set emulation
JPH0619711B2 (en) Data processing system with priority branch mechanism
US6766448B2 (en) Microcomputer for transferring program data to an internal memory from an external memory connected via a bus and a method therefor
JP2568017B2 (en) Microprocessor and data processing system using the same
US4758978A (en) Method and apparatus for selectively evaluating an effective address for a coprocessor
JPH056281A (en) Information processor
JP2826309B2 (en) Information processing device
US20050216704A1 (en) Device and method for managing a microprocessor instruction set
JPH08249018A (en) Multiprocessor arithmetic unit and programmable controller having the arithmetic unit
JP2000112754A (en) Data processor
US6832309B2 (en) Generation of modified commands repeatedly from feedback or base command
JP3954159B2 (en) Synchronous RAM access control circuit, data processor and control method thereof
JP2000029508A (en) Programmable controller
US20110010529A1 (en) Instruction execution control method, instruction format, and processor
JP3097602B2 (en) Data processing device
JPH0241770B2 (en)
JP2003162411A (en) Data processor
JP3027984B2 (en) Single chip microcomputer

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050624

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050705

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20051010

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

Free format text: PAYMENT UNTIL: 20081028

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20091028

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20091028

Year of fee payment: 4

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

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

Free format text: PAYMENT UNTIL: 20091028

Year of fee payment: 4

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20101028

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20101028

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20111028

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20111028

Year of fee payment: 6

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

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

Free format text: PAYMENT UNTIL: 20111028

Year of fee payment: 6

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

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

Free format text: PAYMENT UNTIL: 20111028

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20121028

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees