JPH10149295A - Sequence controller - Google Patents

Sequence controller

Info

Publication number
JPH10149295A
JPH10149295A JP9042372A JP4237297A JPH10149295A JP H10149295 A JPH10149295 A JP H10149295A JP 9042372 A JP9042372 A JP 9042372A JP 4237297 A JP4237297 A JP 4237297A JP H10149295 A JPH10149295 A JP H10149295A
Authority
JP
Japan
Prior art keywords
instruction
storage address
control device
cpu
sequence control
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.)
Pending
Application number
JP9042372A
Other languages
Japanese (ja)
Inventor
Takanao Koike
孝尚 小池
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co 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 Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP9042372A priority Critical patent/JPH10149295A/en
Publication of JPH10149295A publication Critical patent/JPH10149295A/en
Pending legal-status Critical Current

Links

Landscapes

  • Accessory Devices And Overall Control Thereof (AREA)
  • Executing Machine-Instructions (AREA)
  • Facsimiles In General (AREA)
  • Facsimile Transmission Control (AREA)

Abstract

PROBLEM TO BE SOLVED: To decrease the fetch frequency of an instruction code by the sequence controller by reading a corresponding instruction out once a corresponding flag is set when an instruction is decoded and the read instruction is a conditional execution instruction. SOLUTION: An instruction code decoder 200 decodes the instruction and make a conditional execution instruction signal active when the instruction is the conditional execution instruction. An AND gate 201 makes its output signal active when the conditional execution instruction signal is active and the corresponding flag is active. When the output signal of the AND gate 201 is made active, an OR gate 202 makes a fetch enable signal active and an OR gate 203 makes a count-up enable signal active. Consequently, the value of a program counter 204 is increased and the corresponding instruction code is fetched from a microcode memory.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明が属する技術分野】本発明は、例えば遠隔診断機
能を有する複写機の本体側に使用可能なシーケンス制御
装置に関し、より詳細には、CPU等とバスを共有化
し、このバスに接続されたメモリにシーケンス制御装置
のマイクロプログラムを格納した場合に、命令のフェッ
チ回数を低減して、バスの占有時間の短縮を図ったシー
ケンス制御装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a sequence control device which can be used on a main body of a copying machine having a remote diagnosis function, for example. The present invention relates to a sequence control device in which when a microprogram of the sequence control device is stored in a memory, the number of instruction fetches is reduced to shorten the bus occupation time.

【0002】[0002]

【従来の技術】ホストコンピュータと複数の複写機とを
接続したシステムにおいて、複写機側でトラブルが発生
した場合に、複写機からホスト側にトラブルが発生した
旨を自動的に通知することができれば便利である。その
ため、ホストコンピュータと複写機との間に通信機能を
持たせたものが種々提案されている。
2. Description of the Related Art In a system in which a host computer is connected to a plurality of copying machines, if a trouble occurs on the copying machine side, if the copying machine can automatically notify the host that the trouble has occurred. It is convenient. For this reason, various devices having a communication function between a host computer and a copying machine have been proposed.

【0003】ホストコンピュータと複写機間の通信につ
いて開示するものとして、特開平7−129044号公
報『画像形成装置』がある。この画像形成装置は、記憶
された通信検査制御情報に基づいて、第1の制御手段
(装置本体の制御手段)及び第2の制御手段(通信制御
手段)が所定の検査データをやり取りして検査データの
通信状態を判定することにより、第1及び第2の制御手
段間の通信状況を安価かつ簡単に自己診断できるように
したものである。
[0003] Japanese Patent Application Laid-Open No. 7-129044 discloses an "image forming apparatus" that discloses communication between a host computer and a copying machine. In this image forming apparatus, the first control means (control means of the apparatus main body) and the second control means (communication control means) exchange predetermined inspection data based on the stored communication inspection control information to perform inspection. By judging the communication state of the data, the communication state between the first and second control means can be self-diagnosed inexpensively and easily.

【0004】また、ホストコンピュータと複数の複写機
間の通信について開示するものとして、特開平8−36
332号公報『画像形成装置管理システム』がある。こ
の画像形成装置管理システムは、画像形成装置とデータ
通信装置との間に接続不良が発生した場合、オペレータ
にその旨を報知できるようにしたものである。
Japanese Patent Laid-Open Publication No. Hei 8-36 discloses a communication between a host computer and a plurality of copying machines.
No. 332, there is an "image forming apparatus management system". In the image forming apparatus management system, when a connection failure occurs between the image forming apparatus and the data communication apparatus, the operator can be notified of the fact.

【0005】更に、ホストコンピュータと複写機間の通
信の応用例を開示するものとして、特開平8−6544
1号公報『画像形成システム』がある。この画像形成シ
ステムは、複数の供給手段から供給される用紙サイズ、
用紙の有無を含む用紙情報をホストコンピュータへ送信
することにより、画像形成動作中に用紙を供給している
用紙トレイが用紙切れとなった際、外部装置からのデー
タ受信を不可とせず、用紙切れでない用紙トレイを用い
て画像形成を可能としたものである。
Further, Japanese Patent Application Laid-Open No. 8-65444 discloses an application example of communication between a host computer and a copying machine.
There is Japanese Patent Publication No. 1 “Image forming system”. This image forming system includes a sheet size supplied from a plurality of supply units,
By transmitting paper information including the presence or absence of paper to the host computer, if the paper tray that supplies paper during the image forming operation runs out of paper, it does not disable data reception from the external device and runs out of paper. In this case, an image can be formed by using a paper tray which is not used.

【0006】このように複写機に遠隔診断機能を持たせ
るためには、一般に、複写機のメインCPUに加え、更
に別のCPUを中心としたシーケンサが必要となる。こ
れは、メインCPUに通信プロトコルの制御・コード解
析等の固定された処理を行わせると、メインCPUの負
荷が重くなり、通信速度に追従できないことが多いこと
によるものである。したがって、複写機に遠隔診断機能
を持たせることはかえって装置のコストアップにつなが
り、構成も複雑となるという問題があった。ところが近
年の半導体技術の進歩により、CPUをコアにして周辺
にシーケンス制御装置を組み込んだ回路を1チップ上に
形成することが可能となり、コストアップや構成の複雑
化という問題は解決されつつある。
In order to provide the copier with the remote diagnosis function, a sequencer mainly including another CPU is generally required in addition to the main CPU of the copier. This is because if the main CPU performs fixed processing such as communication protocol control and code analysis, the load on the main CPU becomes heavy, and it is often impossible to follow the communication speed. Accordingly, providing the copier with a remote diagnosis function has a problem that the cost of the apparatus is increased and the configuration is complicated. However, recent advances in semiconductor technology have made it possible to form a circuit having a sequence control device around a CPU as a core on a single chip, and the problems of increased cost and complicated configuration are being solved.

【0007】[0007]

【発明が解決しようとする課題】しかしながら、単にC
PUをコアにして周辺に複数のシーケンス制御装置を組
み込むと共に、CPUと複数のシーケンス制御装置とが
使用するバスを共有化させ、そのバスにシーケンス制御
装置のマイクロプログラムを格納したRAM・ROM等
のメモリを接続した場合、あるシーケンス制御装置がシ
ーケンスの実行のためにバスを占有してしまう状態が起
き(オーバーヘッド)、他のシーケンス制御装置のシー
ケンスの実行に支障を来すことがあるという問題があっ
た。以下に、通信制御を行うシーケンス制御装置を例に
して、この問題を詳細に説明する。
However, simply C
In addition to incorporating a plurality of sequence controllers around the PU as a core, a bus used by the CPU and the plurality of sequence controllers is shared, and a RAM / ROM or the like in which a microprogram of the sequence controller is stored in the bus. When a memory is connected, a state occurs in which a certain sequence controller occupies a bus for executing a sequence (overhead), which may hinder execution of a sequence by another sequence controller. there were. Hereinafter, this problem will be described in detail using a sequence control device that performs communication control as an example.

【0008】図12は、シーケンス制御装置による通信
制御の一例を説明するための説明図である。まず、RX
Dユニット(受信機)1200は、データ列を受信する
と、コード解析部1201との間に所定のフラグ120
8をセットする。
FIG. 12 is an explanatory diagram for explaining an example of communication control by the sequence control device. First, RX
When the D unit (receiver) 1200 receives the data sequence, the D unit (receiver) 1200
Set 8

【0009】コード解析部1201は、フラグ1208
がセットされたことを確認すると、受信されたデータ列
中の受信コードを読み取る。そして、コード解析部12
01は、コード内容をチェックしてフラグ1209をセ
ットすると共に、命令コードがACK・NACK等の何
れのコードに対応するかをプロトコル制御部1202に
伝える。
The code analysis unit 1201 has a flag 1208
When it is confirmed that is set, the reception code in the received data string is read. Then, the code analysis unit 12
01 checks the code content and sets a flag 1209, and informs the protocol control unit 1202 which code the instruction code corresponds to, such as ACK or NACK.

【0010】プロトコル制御部1202は、フラグ12
09がセットされたことを確認すると、受信(内部受
信)内容をチェックする。プロトコル制御部1202
は、受信内容に基づいてフラグ1210又はフラグ12
11をセットし、送信コード発生部1204に対し例え
ばACK・NACK等の信号を送信したり、CPU12
03に受信内容を報告したりする。
[0010] The protocol control unit 1202
After confirming that 09 has been set, the contents of reception (internal reception) are checked. Protocol control unit 1202
Is the flag 1210 or the flag 12
11 is transmitted to the transmission code generator 1204 to transmit a signal such as ACK / NACK,
03, and reports the received contents.

【0011】送信コード発生部1204は、フラグ12
11がセットされたことを確認してプロトコル制御部1
202から信号を受信(内部受信)し、送信コードを発
生すると共に、フラグ1212をセットする。
[0011] The transmission code generation unit 1204 is provided with a flag 12
11 is set and the protocol control unit 1
A signal is received (internal reception) from 202, a transmission code is generated, and a flag 1212 is set.

【0012】TXDユニット(送信機)1205は、フ
ラグ1212がセットされたことを確認して送信コード
発生部1204で発生された送信コードを受信し、送信
データと共に外部へ送信する。
The TXD unit (transmitter) 1205 confirms that the flag 1212 has been set, receives the transmission code generated by the transmission code generation unit 1204, and transmits the transmission code to the outside together with the transmission data.

【0013】なお、受信データは、DMAコントローラ
1206の制御により、RXDユニット1200からメ
モリ1207に転送され、送信データも同様に、メモリ
1207からTXDユニット1205に転送される。
The received data is transferred from the RXD unit 1200 to the memory 1207 under the control of the DMA controller 1206, and the transmission data is similarly transferred from the memory 1207 to the TXD unit 1205.

【0014】上述した処理で共通していることは、各ブ
ロックともある特定のフラグを確認し続けながらポーリ
ングを続け、受信を確認すると特定のコードを読み取っ
て処理を行うということである。図13は、ポーリング
の状態を示す説明図である。
What is common to the above-described processing is that each block continues polling while checking a specific flag, and when reception is confirmed, a specific code is read and processing is performed. FIG. 13 is an explanatory diagram illustrating a polling state.

【0015】すなわち、上述した処理を実行するシーケ
ンス制御装置は、ポーリング動作を実行するためにプロ
グラムを格納したメモリからバスを使って命令コードを
フェッチし続ける。図14は、シーケンス制御装置が命
令コードをフェッチする様子を示す説明図である。図1
4に示すように、シーケンス制御装置は、ポーリング動
作を実行しているだけであるにも拘らず、命令コードの
フェッチのためにバスをほとんど占有している。このよ
うに、特定のシーケンス制御装置がバスを占有している
状態が続くと、共通のバスに接続されたCPUや他のシ
ーケンス制御装置がバスを使用することができなくなる
(オーバーヘッドが生じる)。
That is, the sequence control device that executes the above-described processing keeps fetching the instruction code from the memory storing the program to execute the polling operation by using the bus. FIG. 14 is an explanatory diagram showing how the sequence control device fetches an instruction code. FIG.
As shown in FIG. 4, the sequence control device almost occupies the bus for fetching the instruction code, not only performing the polling operation. As described above, when the state where the specific sequence control device occupies the bus continues, the CPU and other sequence control devices connected to the common bus cannot use the bus (overhead occurs).

【0016】特定のシーケンス制御装置がバスを占有し
てしまう状態を防ぐ方法として、シーケンス制御装置に
予想されるジャンプ先をプリフェッチさせることも考え
られる。この方法によれば、プリフェッチされた命令中
にジャンプ先が含まれる場合、シーケンス制御装置が命
令コードのフェッチを繰り返し実行する必要をなくすこ
とができる。しかし、その反面、シーケンス制御装置に
プリフェッチ機能を持たせる必要があり、構成が複雑と
なるという問題があった。
As a method of preventing a state in which a specific sequence controller occupies the bus, it is conceivable to cause the sequence controller to prefetch an expected jump destination. According to this method, when the jump destination is included in the prefetched instruction, it is possible to eliminate the need for the sequence control device to repeatedly execute the fetch of the instruction code. However, on the other hand, there is a problem that the sequence control device needs to have a prefetch function, and the configuration becomes complicated.

【0017】次に、上述したようにRAM・ROM等に
マイクロプログラムを用意し、シーケンス制御装置がソ
フト的にシーケンスを制御するのではなく、ハードワイ
ヤードロジックで構成されたマイクロプログラムに基づ
いて、ハード的にシーケンスを制御する場合について検
討する。マイクロプログラムをハードワイヤードロジッ
クで構成した場合には、RAM・ROM等にプログラム
を格納する場合に比べて、ロジック量を大幅に圧縮でき
るという利点がある。
Next, as described above, the microprogram is prepared in the RAM / ROM or the like, and the sequence controller does not control the sequence by software, but executes the hardware program based on the microprogram constituted by hardwired logic. Consider the case where the sequence is controlled. When the microprogram is configured by hard-wired logic, there is an advantage that the amount of logic can be greatly reduced as compared with the case where the program is stored in RAM / ROM or the like.

【0018】しかしながら、マイクロプログラムをハー
ドワイヤードロジックで構成した場合には、バグが確認
された場合等において、マイクロプログラムの内容を必
要に応じて修正することは不可能であるという問題があ
った。特に、通信制御を行う場合には、処理内容の変更
が多いため、修正が不可能であることは非常に問題であ
った。
However, when the microprogram is constituted by hard-wired logic, there is a problem that it is impossible to modify the contents of the microprogram as necessary when a bug is confirmed. In particular, when performing communication control, there is a great deal of change in the processing contents, so that it is very problematic that correction is impossible.

【0019】本発明は上記に鑑みてなされたものであっ
て、シーケンス制御装置による命令コードのフェッチ回
数の低減を図ることを目的とする。
The present invention has been made in view of the above, and has as its object to reduce the number of instruction code fetches performed by a sequence control device.

【0020】また、シーケンス制御装置のマイクロプロ
グラムをハードワイヤードロジックで構成した場合であ
っても、シーケンス制御装置の処理内容を変更可能とす
ることを目的とする。
Another object of the present invention is to make it possible to change the processing content of the sequence control device even when the microprogram of the sequence control device is constituted by hard-wired logic.

【0021】[0021]

【課題を解決するための手段】上記目的を達成するた
め、請求項1のシーケンス制御装置は、CPUをコアと
して、その周辺にCPU等と共に同一のバスを共有する
ように構成され、前記バスに接続された格納手段に格納
された命令群に応じて、所定のタスクの実行を要求する
フラグがセットされたか否かを確認し、前記フラグがセ
ットされると所定のタスクを実行するシーケンス制御装
置において、次に読み出す命令の格納アドレスを保持す
る格納アドレス保持手段と、前記格納アドレス保持手段
に保持された格納アドレスに基づいて、前記格納手段か
ら該当する命令を読み出す命令読出手段と、前記命令読
出手段で読み出した命令を解読する命令解読手段と、を
備え、前記命令群は、フラグがアクティブである場合に
次の命令を読み出す条件実行命令を含み、前記命令読出
手段は、前記命令解読手段で命令を解読した結果、読み
出した命令が条件実行命令である場合に、該当するフラ
グがセットされると前記格納手段から該当する命令を読
み出すものである。
According to a first aspect of the present invention, there is provided a sequence control apparatus comprising a CPU as a core, and a common bus shared with a CPU and the like around the CPU. A sequence control device for confirming whether a flag for requesting execution of a predetermined task has been set according to an instruction group stored in the connected storage means, and executing the predetermined task when the flag is set. A storage address holding means for holding a storage address of an instruction to be read next; an instruction reading means for reading a corresponding instruction from the storage means based on the storage address held in the storage address holding means; Instruction decoding means for decoding the instruction read by the means, wherein the instruction group reads the next instruction when the flag is active The instruction reading means decodes the instruction by the instruction decoding means, and when the read instruction is a conditional execution instruction and a corresponding flag is set, the corresponding instruction is read from the storage means. Is read.

【0022】また、請求項2のシーケンス制御装置は、
請求項1記載のシーケンス制御装置において、実行する
タスクの数に応じて前記格納アドレス保持手段を複数備
えると共に、複数の格納アドレス保持手段のうちの1つ
を選択することによってタスクを切り替えるタスク切替
手段を備え、前記タスク切替手段は、現在選択中の格納
アドレス保持手段に保持された格納アドレスに基づいて
読み出された命令が条件実行命令でありかつ該当するフ
ラグがアクティブでない場合に、予め設定された順序に
従って他の格納アドレス保持手段を選択してタスクを切
り替え、前記命令読出手段は、前記タスク切替手段で他
の格納アドレス保持手段が選択されると、選択された格
納アドレス保持手段に保持された格納アドレスに基づい
て、前記格納手段から該当する命令を読み出すものであ
る。
Further, the sequence control device of claim 2 is
2. The sequence control device according to claim 1, further comprising a plurality of said storage address holding units according to the number of tasks to be executed, and a task switching unit for switching a task by selecting one of the plurality of storage address holding units. Wherein the task switching means is preset when the instruction read based on the storage address held in the currently selected storage address holding means is a condition execution instruction and the corresponding flag is not active. The task is switched by selecting another storage address holding unit in accordance with the order, and the instruction reading unit is held by the selected storage address holding unit when another storage address holding unit is selected by the task switching unit. The corresponding instruction is read from the storage means based on the stored address.

【0023】また、請求項3のシーケンス制御装置は、
請求項1または2記載のシーケンス制御装置において、
前記命令読出手段が格納手段から該当する命令を読み出
す際に、前記CPUに対してバスの明け渡しを要求し、
前記CPUからバスが明け渡されると前記格納手段から
該当する命令を読み出す読出制御手段を備えるものであ
る。
The sequence control device according to claim 3 is
The sequence control device according to claim 1 or 2,
When the instruction reading unit reads the corresponding instruction from the storage unit, the instruction reading unit requests the CPU to give up the bus,
When the bus is surrendered from the CPU, read control means for reading a corresponding instruction from the storage means is provided.

【0024】さらに、請求項4のシーケンス制御装置
は、CPUをコアとして、その周辺にCPU等と共に同
一のバスを共有するように構成され、予め用意された命
令群に基づいて、所定のタスクを実行するシーケンス制
御装置において、ハードワイヤードロジックで構成され
た命令群を格納した格納手段と、次に読み出す命令の格
納アドレスを保持する第1の格納アドレス保持手段と、
前記第1の格納アドレス保持手段に保持された格納アド
レスに基づいて、前記格納手段から該当する命令を読み
出す命令読出手段と、前記命令読出手段で読み出した命
令を解読する命令解読手段と、任意の命令の格納アドレ
スを保持する第2の格納アドレス保持手段と、前記第1
の格納アドレス保持手段で保持された格納アドレスと前
記第2の格納アドレス保持手段で保持された格納アドレ
スとを入力して比較し、両者の格納アドレスが一致する
場合に、前記命令解読手段を制御して自装置の動作を停
止すると共に、自装置が動作停止状態にあることを通知
するホールド信号を前記CPUに出力するホールド制御
手段と、を備え、前記第1の格納アドレス保持手段は、
動作停止状態にある間に、前記CPUによって格納アド
レスが再設定され、前記ホールド制御手段は、前記CP
Uから動作停止状態を解除するホールド解除信号を入力
し、前記命令解読手段を制御して自装置の動作を再開
し、前記命令読出手段は、前記第1の格納アドレス保持
手段に再設定された格納アドレスに基づいて、前記格納
手段から該当する命令を読み出すものである。
Further, the sequence control device of the present invention is configured such that the CPU is used as a core and the same bus is shared with the CPU and the like around the CPU, and a predetermined task is performed based on a group of instructions prepared in advance. In the sequence control device to be executed, storage means for storing an instruction group constituted by hard-wired logic, first storage address storage means for storing a storage address of an instruction to be read next,
An instruction reading means for reading a corresponding instruction from the storage means based on the storage address held in the first storage address holding means; an instruction decoding means for decoding the instruction read by the instruction reading means; Second storage address holding means for holding a storage address of the instruction;
The storage address held by the storage address holding means is input and compared with the storage address held by the second storage address holding means, and when the two storage addresses match, the instruction decoding means is controlled. Holding control means for stopping the operation of the own device and outputting a hold signal notifying that the own device is in the operation stopped state to the CPU, wherein the first storage address holding means comprises:
During the operation stop state, the storage address is reset by the CPU, and the hold control means
A hold release signal for releasing the operation stop state is input from U, the operation of the own device is restarted by controlling the instruction decoding means, and the instruction reading means is reset to the first storage address holding means. A corresponding instruction is read from the storage means based on the storage address.

【0025】[0025]

【発明の実施の形態】以下、本発明のシーケンス制御装
置の実施の形態について、〔実施の形態1〕・〔実施の
形態2〕・〔実施の形態3〕・〔実施の形態4〕の順で
図面を参照しつつ詳細に説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Hereinafter, embodiments of a sequence control apparatus according to the present invention will be described in the order of [Embodiment 1], [Embodiment 2], [Embodiment 3], [Embodiment 4]. This will be described in detail with reference to the drawings.

【0026】〔実施の形態1〕実施の形態1のシーケン
ス制御装置は、所定のタスクの実行を要求するフラグが
アクティブになるまで次の命令コードのフェッチを行わ
ないという命令(条件実行命令)を用いることにより、
CPUや他のシーケンス制御装置と共有化されたバスを
介してメモリからプログラムをフェッチする回数を低減
し、特定のシーケンス制御装置がプログラムのフェッチ
のためにバスを占有してしまうことを防止するものであ
る。
[Embodiment 1] The sequence control apparatus according to Embodiment 1 issues an instruction (condition execution instruction) that the next instruction code is not fetched until a flag for requesting execution of a predetermined task becomes active. By using
A method that reduces the number of times a program is fetched from a memory via a bus shared with a CPU or another sequence control device and prevents a specific sequence control device from occupying the bus for fetching a program. It is.

【0027】図1は、実施の形態1のシーケンス制御装
置が、CPUをコアとし、その周囲にCPUと共に1つ
のバスを共有するように構成された様子を示す構成図で
ある。図1において、100はチップであり、チップ1
00上にCPU101が形成されると共に、CPU10
1をコアとして、その周囲にシーケンス制御装置102
が形成されている。なお、説明の便宜上、図1中に示す
シーケンス制御装置の数を1つとしたが、複数設けるこ
ともできる。CPU101とシーケンス制御装置102
は、共通のデータバス103及びアドレスバス104を
使用するように構成されており、このデータバス103
及びアドレスバス104にはメモリ105(請求項1記
載の格納手段に該当する)が接続されている。メモリ1
05は、CPU101の動作手順を規定するプログラム
(命令群)を格納したプログラムメモリ106と、シー
ケンス制御装置102の動作手順を規定するマイクロプ
ログラム(命令群)を格納したマイクロコードメモリ1
07とを含んでいる。
FIG. 1 is a configuration diagram showing a state in which the sequence control device of the first embodiment is configured so that a CPU is used as a core and one bus is shared with the CPU around the core. In FIG. 1, reference numeral 100 denotes a chip;
The CPU 101 is formed on the
1 as a core and a sequence controller 102 around the core.
Are formed. Although the number of the sequence control device shown in FIG. 1 is one for convenience of description, a plurality of sequence control devices may be provided. CPU 101 and sequence controller 102
Are configured to use a common data bus 103 and address bus 104.
The address bus 104 is connected to a memory 105 (corresponding to a storage unit according to claim 1). Memory 1
Reference numeral 05 denotes a program memory 106 that stores a program (instruction group) that defines the operation procedure of the CPU 101, and a microcode memory 1 that stores a microprogram (instruction group) that defines the operation procedure of the sequence control device 102.
07.

【0028】図2は、実施の形態1のシーケンス制御装
置の要部構成を示す構成図である。図2に示すシーケン
ス制御装置102は、命令コードデコーダ200(請求
項1および請求項4記載の命令解読手段に該当する)
と、ANDゲート201,ORゲート202及びORゲ
ート203(請求項1および請求項4記載の命令読出手
段に該当する)と、プログラムカウンタ204(請求項
1記載の格納アドレス保持手段および請求項4記載の第
1の格納アドレス保持手段に該当する)とを備えてい
る。
FIG. 2 is a configuration diagram showing a main configuration of the sequence control device according to the first embodiment. The sequence control device 102 shown in FIG. 2 is an instruction code decoder 200 (corresponding to the instruction decoding means in claims 1 and 4).
And an AND gate 201, an OR gate 202 and an OR gate 203 (corresponding to the instruction reading means of the first and fourth aspects), and a program counter 204 (the storage address holding means and the fourth area of the fourth aspect). (Corresponding to the first storage address holding means).

【0029】命令コードデコーダ200は、マイクロコ
ードメモリ107からフェッチした命令コードを入力
し、入力した命令コードを解読して、命令が条件実行命
令,通常命令又はジャンプ命令のいずれであるかを特定
する。ここで、条件実行命令とは、後述するフラグがア
クティブである場合にのみ次の命令コードをフェッチ可
能とし、フラグがアクティブでない場合は、フラグがア
クティブになるまでフラグチェックを繰り返すという命
令である。通常命令とは、通常実行する演算処理等の命
令である。また、ジャンプ命令とは、途中の命令を飛ば
し、指定された格納アドレスに該当する命令を実行する
という命令である。
The instruction code decoder 200 inputs the instruction code fetched from the microcode memory 107, decodes the input instruction code, and specifies whether the instruction is a conditional execution instruction, a normal instruction or a jump instruction. . Here, the conditional execution instruction is an instruction for enabling the next instruction code to be fetched only when a flag described later is active, and for repeating the flag check until the flag becomes active when the flag is not active. The normal instruction is an instruction such as an arithmetic processing that is normally executed. The jump instruction is an instruction for skipping an intermediate instruction and executing an instruction corresponding to a specified storage address.

【0030】そして、命令コードデコーダ200は、命
令を解読した結果に基づいて、条件実行命令信号、通常
命令信号又はジャンプ命令信号の何れかをアクティブに
する。
Then, the instruction code decoder 200 activates one of the condition execution instruction signal, the normal instruction signal, and the jump instruction signal based on the result of decoding the instruction.

【0031】ANDゲート201は、条件実行命令信号
がアクティブで、かつフラグがアクティブである場合に
出力信号をアクティブにする。このフラグは、所定のタ
スクの実行を要求するものであって、例えばシーケンス
制御装置102が図12に示す通信制御を行うものであ
るとした場合、図12中のフラグ1208等に該当す
る。すなわち、フラグは、データ列の受信があった場合
等にセットされ、対応するタスク、例えばコード解析処
理等を実行することができるということを示すものであ
る(図12のコード解析部1201参照)。
The AND gate 201 activates the output signal when the condition execution command signal is active and the flag is active. This flag requests execution of a predetermined task. For example, when the sequence control device 102 performs the communication control shown in FIG. 12, the flag corresponds to the flag 1208 in FIG. That is, the flag is set, for example, when a data string is received, and indicates that a corresponding task, for example, a code analysis process or the like can be executed (see the code analysis unit 1201 in FIG. 12). .

【0032】ORゲート202は、(1)通常命令信号
がアクティブである場合,(2)ジャンプ命令信号がア
クティブである場合又は(3)条件実行命令信号がアク
ティブであり、かつフラグがアクティブである場合にフ
ェッチイネーブル信号をアクティブにする。その結果、
後述するプログラムカウンタ204の値に基づいて、マ
イクロコードメモリ107から該当する命令コードがフ
ェッチされる。
The OR gate 202 is (1) when the normal instruction signal is active, (2) when the jump instruction signal is active, or (3) when the condition execution instruction signal is active and the flag is active. In this case, the fetch enable signal is activated. as a result,
A corresponding instruction code is fetched from the microcode memory 107 based on a value of a program counter 204 described later.

【0033】また、ORゲート203は、(1)通常命
令信号がアクティブである場合又は(2)条件実行命令
信号がアクティブであり、かつフラグがアクティブであ
る場合、プログラムカウンタ204へのカウントアップ
イネーブル信号をアクティブにする。
When the (1) normal instruction signal is active or (2) the condition execution instruction signal is active and the flag is active, the OR gate 203 counts up to the program counter 204. Activate the signal.

【0034】プログラムカウンタ204は、命令コード
を格納したマイクロコードメモリ107の格納アドレス
を記憶しているレジスタであり、次の命令が格納されて
いるマイクロコードメモリ107の格納アドレスを表示
するものである。実施の形態1のシーケンス制御装置に
おいては、ORゲート203でカウントアップイネーブ
ル信号がアクティブにされた場合に、プログラムカウン
タ204の値がカウントアップされる。
The program counter 204 is a register for storing the storage address of the microcode memory 107 storing the instruction code, and indicates the storage address of the microcode memory 107 storing the next instruction. . In the sequence control device according to the first embodiment, when the count-up enable signal is activated by OR gate 203, the value of program counter 204 is counted up.

【0035】また、プログラムカウンタ204は、通
常、プログラムの実行に伴ってシーケンシャルに値が増
加するカウンタであるが、ジャンプ命令が実行されると
ある値を飛び越した値がセットされる。すなわち、命令
コードがジャンプ命令である場合、ジャンプ命令信号が
アクティブになることによってプログラムカウンタ20
4はジャンプアドレスをロードする。
The program counter 204 is normally a counter whose value increases sequentially with the execution of a program, but is set to a value that jumps a certain value when a jump instruction is executed. That is, when the instruction code is a jump instruction, the activation of the jump instruction signal causes the program counter 20
4 loads the jump address.

【0036】次に、実施の形態1のシーケンス制御装置
の動作について、(通常命令の場合)・(ジャンプ命令
の場合)・(条件実行命令の場合)の順で説明する。
Next, the operation of the sequence control device according to the first embodiment will be described in the order of (in the case of a normal instruction), (in the case of a jump instruction), and (in the case of a conditional execution instruction).

【0037】(通常命令の場合)命令コードデコーダ2
00は、フェッチされた命令コードを入力して命令の内
容を解読し、命令が条件実行命令,通常命令又はジャン
プ命令のいずれであるかを判定する。
(In the case of a normal instruction) Instruction code decoder 2
00 inputs the fetched instruction code, decodes the contents of the instruction, and determines whether the instruction is a conditional execution instruction, a normal instruction, or a jump instruction.

【0038】命令コードデコーダ200は、命令を解読
した結果、通常命令である場合は通常命令信号をアクテ
ィブにする。通常命令信号がアクティブとなった場合、
ORゲート202はフェッチイネーブル信号をアクティ
ブにし、ORゲート203はカウントアップイネーブル
信号をアクティブにする。このように、通常命令の場合
は、フェッチイネーブル信号およびカウントアップイネ
ーブル信号が常にアクティブな状態にあり、命令コード
のフェッチとプログラムカウンタ204の値のカウント
アップとが繰り返し実行されることになる。
The instruction code decoder 200 activates a normal instruction signal if the instruction is a normal instruction as a result of decoding the instruction. When the normal instruction signal becomes active,
OR gate 202 activates the fetch enable signal, and OR gate 203 activates the count-up enable signal. As described above, in the case of the normal instruction, the fetch enable signal and the count-up enable signal are always active, and the fetch of the instruction code and the count-up of the value of the program counter 204 are repeatedly executed.

【0039】(ジャンプ命令の場合)命令コードデコー
ダ200は、命令を解読した結果、ジャンプ命令である
場合はジャンプ命令信号をアクティブにする。ジャンプ
命令信号がアクティブとなった場合、ORゲート202
はフェッチイネーブル信号をアクティブにする。また、
ジャンプ命令信号がアクティブになることによりデータ
ロードイネーブル信号がアクティブとなり、プログラム
カウンタ204は、ジャンプアドレスをロードする。そ
の結果、プログラムカウンタ204にロードされた値に
基づいて、マイクロコードメモリ107から次の命令コ
ードがフェッチされる。
(In the case of a jump instruction) As a result of decoding the instruction, the instruction code decoder 200 activates the jump instruction signal if the instruction is a jump instruction. When the jump command signal becomes active, the OR gate 202
Activates the fetch enable signal. Also,
When the jump instruction signal becomes active, the data load enable signal becomes active, and the program counter 204 loads the jump address. As a result, the next instruction code is fetched from the microcode memory 107 based on the value loaded into the program counter 204.

【0040】(条件実行命令の場合)命令コードデコー
ダ200は、命令を解読した結果、条件実行命令である
場合は条件実行命令信号をアクティブにする。ANDゲ
ート201は、条件実行命令信号がアクティブで、かつ
該当するフラグがアクティブである場合に、出力信号を
アクティブにする。ANDゲート201の出力信号がア
クティブとなった場合に、ORゲート202はフェッチ
イネーブル信号をアクティブにし、かつORゲート20
3はカウントアップイネーブル信号をアクティブにす
る。その結果、プログラムカウンタ204の値がカウン
トアップされると共に、マイクロコードメモリ107か
ら該当する命令コードがフェッチされる。
(In the case of a conditional execution instruction) As a result of decoding the instruction, the instruction code decoder 200 activates the conditional execution instruction signal if the instruction is a conditional execution instruction. The AND gate 201 activates the output signal when the condition execution command signal is active and the corresponding flag is active. When the output signal of the AND gate 201 becomes active, the OR gate 202 makes the fetch enable signal active and the OR gate 20
3 activates the count-up enable signal. As a result, the value of the program counter 204 is counted up, and the corresponding instruction code is fetched from the microcode memory 107.

【0041】命令が条件実行命令である場合、上述した
ように該当するフラグがアクティブか否かが判定され、
該当するフラグがアクティブである場合はフェッチイネ
ーブル信号がアクティブとなる。一方、該当するフラグ
がアクティブでない場合はフェッチイネーブル信号もア
クティブとならない。上述したように、条件実行命令は
フラグがアクティブになるまで内部で繰り返しフラグチ
ェックを行わせるという命令である。この場合、命令コ
ードデコーダは200は、条件実行命令を保持して条件
実行命令信号をアクティブにした状態を保つ。その結
果、フラグがアクティブになるまで次の命令をフェッチ
することなく、シーケンス制御装置102内部で繰り返
しフラグチェックの命令(条件実行命令)を実行し続け
ることになる。
If the instruction is a conditional execution instruction, it is determined whether the corresponding flag is active as described above,
When the corresponding flag is active, the fetch enable signal becomes active. On the other hand, if the corresponding flag is not active, the fetch enable signal is not active. As described above, the conditional execution instruction is an instruction for repeatedly performing the flag check internally until the flag becomes active. In this case, the instruction code decoder 200 holds the condition execution instruction and keeps the condition execution instruction signal active. As a result, the sequence control apparatus 102 repeatedly executes the flag check instruction (condition execution instruction) without fetching the next instruction until the flag becomes active.

【0042】図3は、実施の形態1のシーケンス制御装
置による命令コードのフェッチの様子を示す説明図であ
る。図3に示すように、プログラムに条件実行命令を含
め、フラグがアクティブになるまで命令コードのフェッ
チを行わせないようにしたため、シーケンス制御装置1
02がポーリング動作のためにバス103,104を占
有するということをなくすことができる。例えば、実施
の形態1のシーケンス制御装置102が図12に示す通
信制御を行う場合、RXDユニット1200でデータを
受信して受信フラグ1208がセットされるまでの間、
内部で繰り返しフラグチェックを繰り返すことになる。
したがって、ポーリング動作のためにシーケンス制御装
置102がバス103,104を占有することを防止す
ることができる。
FIG. 3 is an explanatory diagram showing how an instruction code is fetched by the sequence control device of the first embodiment. As shown in FIG. 3, since the program includes a conditional execution instruction and does not fetch the instruction code until the flag becomes active, the sequence controller 1
02 does not occupy the buses 103 and 104 for the polling operation. For example, when the sequence control apparatus 102 according to the first embodiment performs the communication control illustrated in FIG. 12, the data is received by the RXD unit 1200 until the reception flag 1208 is set.
The flag check is repeated internally.
Therefore, it is possible to prevent the sequence controller 102 from occupying the buses 103 and 104 for the polling operation.

【0043】このように、実施の形態1のシーケンス制
御装置によれば、シーケンス制御装置による命令コード
のフェッチ回数を低減することができ、複数のシーケン
ス制御装置で1つのバスを共有するように構成した場合
であっても、各シーケンス制御装置がバスを有効に使用
することができる(オーバーヘッドをなくすことができ
る)。
As described above, according to the sequence controller of the first embodiment, the number of fetches of instruction codes by the sequence controller can be reduced, and a plurality of sequence controllers share one bus. Even in this case, each sequence control device can effectively use the bus (the overhead can be eliminated).

【0044】〔実施の形態2〕実施の形態2のシーケン
ス制御装置は、複数のタスクの切り換えの効率化を図っ
たものである。
[Second Embodiment] A sequence control device according to a second embodiment is intended to make switching between a plurality of tasks more efficient.

【0045】図4は、実施の形態2のシーケンス制御装
置の要部構成を示す構成図である。図4に示すシーケン
ス制御装置102は、実施の形態1のシーケンス制御装
置において、更に、実行するタスクの数に応じて複数設
けられ、命令コードの格納アドレスを保持するプログラ
ムカウンタ204a〜204dと、プログラムカウンタ
204a〜204dのうちの1つを選択するセレクタ4
00(請求項2記載のタスク切替手段に該当する)と、
現在選択中のプログラムカウンタ202a〜204dの
いずれかに保持された格納アドレスに基づいて読み出さ
れた命令が条件実行命令でありかつ該当するフラグがア
クティブでない場合に、セレクタ400を制御して他の
プログラムカウンタを選択し、タスクを切り替えるタス
クカウンタ401(請求項2記載のタスク切替手段に該
当する)とを備えている。
FIG. 4 is a configuration diagram showing a main configuration of a sequence control device according to the second embodiment. The sequence control device 102 shown in FIG. 4 is different from the sequence control device of the first embodiment in that a plurality of program counters 204a to 204d are provided in accordance with the number of tasks to be executed and hold instruction code storage addresses. Selector 4 for selecting one of counters 204a to 204d
00 (corresponding to the task switching means of claim 2);
If the instruction read based on the storage address held in any of the currently selected program counters 202a to 204d is a condition execution instruction and the corresponding flag is not active, the selector 400 is controlled to A task counter 401 for selecting a program counter and switching tasks (corresponding to a task switching means according to claim 2);

【0046】なお、実施の形態2において、シーケンス
制御装置102で実行されるタスクを4個とするが、タ
スクの数を4個に限定するものではない。これらのタス
クは、例えば、図9におけるコード解析処理(コード解
析部901)やプロトコル制御処理(プロトコル制御部
902)に該当する。また、例えば、コード解析処理の
タスクに該当するフラグは、図9に示すフラグ1208
であり、プロトコル制御処理のタスクに該当するフラグ
は、同じく図9に示すフラグ1209である。
In the second embodiment, the number of tasks executed by the sequence controller 102 is four, but the number of tasks is not limited to four. These tasks correspond to, for example, the code analysis process (code analysis unit 901) and the protocol control process (protocol control unit 902) in FIG. Further, for example, the flag corresponding to the task of the code analysis processing is a flag 1208 shown in FIG.
The flag corresponding to the task of the protocol control process is the flag 1209 also shown in FIG.

【0047】また、図4において、命令コードデコーダ
200は、図2に示すものと同一であり、フェッチした
命令を解読し、命令が条件実行命令,通常命令又はジャ
ンプ命令のいずれであるかを特定する。なお、図4中に
図示することを省略したが、命令コードデコーダ200
の後段には、図2の場合と同様にANDゲート201,
ORゲート202およびORゲート203が接続されて
おり、フェッチイネーブル信号を出力すると共に、プロ
グラムカウンタ204a〜204dのいずれかに対して
カウントアップイネーブル信号を出力する。
In FIG. 4, the instruction code decoder 200 is the same as that shown in FIG. 2, decodes the fetched instruction, and specifies whether the instruction is a conditional execution instruction, a normal instruction or a jump instruction. I do. Although not shown in FIG. 4, the instruction code decoder 200
In the subsequent stage, as in the case of FIG.
An OR gate 202 and an OR gate 203 are connected to output a fetch enable signal and output a count-up enable signal to any of the program counters 204a to 204d.

【0048】タスクカウンタ401は、現在実行中のタ
スクの値を保持しており、フェッチした命令コードが条
件実行命令であり、かつ、現在実行中のタスクに該当す
るフラグがアクティブでない場合にカウントアップされ
る。なお、図4中に図示することを省略したが、このタ
スクカウンタ401には、各タスクに該当するフラグが
セットされたか否かを確認するための信号線が接続され
ている。
The task counter 401 holds the value of the currently executing task, and counts up when the fetched instruction code is a conditional execution instruction and the flag corresponding to the currently executing task is not active. Is done. Although not shown in FIG. 4, the task counter 401 is connected to a signal line for checking whether a flag corresponding to each task has been set.

【0049】セレクタ400は、タスクカウンタ401
の値がカウントアップされると、現在選択中のプログラ
ムカウンタ204a〜204dの1つから他の異なるプ
ログラムカウンタ204a〜204dの1つを選択し、
タスクを切り替える。例えば、後述するように、タスク
1、タスク2、・・・の順、即ちプログラムカウンタ2
04a、プログラムカウンタ204b、・・・の順でプ
ログラムカウンタ204a〜204dの中から1つのプ
ログラムカウンタを選択し、タスクを切り替える。そし
て、選択されたプログラムカウンタ204a〜204d
の1つに保持された格納アドレスに基づいて、マイクロ
コードメモリ107から該当する命令コードがフェッチ
される。
The selector 400 has a task counter 401
Is counted up, one of the currently selected program counters 204a to 204d is selected, and one of the other different program counters 204a to 204d is selected.
Switch tasks. For example, as will be described later, the order of task 1, task 2,...
04a, the program counter 204b,..., One program counter is selected from the program counters 204a to 204d, and the task is switched. Then, the selected program counters 204a to 204d
The corresponding instruction code is fetched from the microcode memory 107 based on the storage address held in one of the above.

【0050】プログラムカウンタ204a〜204d
は、それぞれ図2に示すプログラムカウンタ204と同
一のものである。実施の形態2のシーケンス制御装置1
02では4個のタスクを実行することを想定しているた
め、4個のタスクに対応して4個のプログラムカウンタ
204a〜204dが設けられている。なお、プログラ
ムカウンタ204a〜204dは、タスクカウンタ40
1の制御に基づいて、現在アクティブなタスクに対応し
たプログラムカウンタ204a〜204dの1つのみ
が、カウントアップイネーブル信号,データロードイネ
ーブル信号等を受け付け可能とされ、値をカウントアッ
プし又はジャンプアドレスをロードする等の動作が可能
な状態となる。
Program counters 204a to 204d
Are the same as the program counter 204 shown in FIG. Sequence control device 1 of the second embodiment
In 02, it is assumed that four tasks are executed, so that four program counters 204a to 204d are provided corresponding to the four tasks. Note that the program counters 204a to 204d
Based on the control of 1, only one of the program counters 204a to 204d corresponding to the currently active task can receive the count-up enable signal, the data load enable signal, and the like, and count up the value or determine the jump address. An operation such as loading is enabled.

【0051】次に、実施の形態2のシーケンス制御装置
の動作を図5に基づいて説明する。図5は、実施の形態
2のシーケンス制御装置の動作タイミングを示すタイミ
ングチャートである。
Next, the operation of the sequence control device according to the second embodiment will be described with reference to FIG. FIG. 5 is a timing chart showing operation timings of the sequence control device according to the second embodiment.

【0052】実施の形態2のシーケンス制御装置の動作
を説明する前提として、タスクカウンタ401はタスク
1の値を示しているものとし、セレクタ400はプログ
ラムカウンタ204aを選択しているものとする。以
下、(a)タスク1,(b)タスク2,(c)タスク
3,(d)タスク4の順で実施の形態2のシーケンス制
御装置の動作を説明する。
As a premise for explaining the operation of the sequence control device according to the second embodiment, it is assumed that the task counter 401 indicates the value of the task 1 and the selector 400 has selected the program counter 204a. Hereinafter, the operation of the sequence control device according to the second embodiment will be described in the order of (a) task 1, (b) task 2, (c) task 3, and (d) task 4.

【0053】(a)タスク1 マイクロコードメモリ107からフェッチされた命令コ
ードが命令コードデコーダ200に入力され、命令コー
ドデコーダ200が命令コードを解読する。命令コード
を解読した結果、命令が通常命令である場合はタスク1
が継続して実行される(命令1及び命令2)。
(A) Task 1 The instruction code fetched from the microcode memory 107 is input to the instruction code decoder 200, and the instruction code decoder 200 decodes the instruction code. If the instruction is a normal instruction as a result of decoding the instruction code, task 1
Are continuously executed (instruction 1 and instruction 2).

【0054】次にフェッチされた命令コードが条件実行
命令であり、かつ、タスク1に該当するフラグがアクテ
ィブでない場合に、タスクカウンタ401の値がタスク
2の値にカウントアップされる。その結果、セレクタ4
00は、プログラムカウンタ204bを選択し、タスク
1からタスク2にタスクを切り替える。
Next, when the fetched instruction code is a conditional execution instruction and the flag corresponding to task 1 is not active, the value of task counter 401 is counted up to the value of task 2. As a result, the selector 4
00 selects the program counter 204b and switches the task from task 1 to task 2.

【0055】(b)タスク2 そして、選択されたプログラムカウンタ204bの値に
基づいて、マイクロコードメモリ107から該当する命
令コードがフェッチされる。命令コードデコーダ200
は、フェッチされた命令を入力して解読する。命令が通
常命令である場合(命令1)は、プログラムカウンタ2
04bの値がカウントアップされ、マイクロコードメモ
リ107から該当する命令コードがフェッチされる。命
令コードデコーダ200は同様に、フェッチされた命令
を入力して解読する。その結果、命令が条件実行命令で
あり、かつ、タスク2に該当するフラグがアクティブで
ない場合に、タスクカウンタ401の値がタスク3にカ
ウントアップされ、セレクタ400はプログラムカウン
タ204cを選択し、タスク2からタスク3にタスクを
切り替える。
(B) Task 2 The corresponding instruction code is fetched from the microcode memory 107 based on the value of the selected program counter 204b. Instruction code decoder 200
Input and fetch the fetched instruction. If the instruction is a normal instruction (instruction 1), the program counter 2
The value of 04b is counted up, and the corresponding instruction code is fetched from the microcode memory 107. The instruction code decoder 200 similarly inputs and decodes the fetched instruction. As a result, when the instruction is a conditional execution instruction and the flag corresponding to task 2 is not active, the value of task counter 401 is counted up to task 3, selector 400 selects program counter 204c, and task 2 From task to task 3.

【0056】(c)タスク3 続いて、選択されたプログラムカウンタ204cの値に
基づいて、マイクロコードメモリ107から該当する命
令コードがフェッチされる。命令コードデコーダ200
は、フェッチされた命令コードを入力して解読する。そ
の結果、命令が条件実行命令であり、かつ、タスク3に
該当するフラグがアクティブでない場合に、タスクカウ
ンタ401の値がタスク4にカウントアップされる。続
いて、セレクタ400は、プログラムカウンタ204d
を選択し、タスク3からタスク4にタスクを切り替え
る。
(C) Task 3 Subsequently, the corresponding instruction code is fetched from the microcode memory 107 based on the value of the selected program counter 204c. Instruction code decoder 200
Inputs and decodes the fetched instruction code. As a result, when the instruction is a conditional execution instruction and the flag corresponding to task 3 is not active, the value of task counter 401 is counted up to task 4. Subsequently, the selector 400 sets the program counter 204d
To switch the task from task 3 to task 4.

【0057】(d)タスク4 さらに、選択されたプログラムカウンタ204dの値に
基づいて、マイクロコードメモリ107から該当する命
令コードがフェッチされる。命令コードデコーダ200
は、フェッチされた命令コードを入力して解読する。そ
の結果、命令が条件実行命令であり、かつ、タスク4に
該当するフラグがアクティブでない場合に、タスクカウ
ンタ401の値がタスク1にカウントアップされる。続
いて、セレクタ400は、プログラムカウンタ204a
を選択し、タスク4からタスク1にタスクを切り替え
る。
(D) Task 4 Further, the corresponding instruction code is fetched from the microcode memory 107 based on the value of the selected program counter 204d. Instruction code decoder 200
Inputs and decodes the fetched instruction code. As a result, when the instruction is a conditional execution instruction and the flag corresponding to task 4 is not active, the value of task counter 401 is counted up to task 1. Subsequently, the selector 400 sets the program counter 204a
To switch the task from task 4 to task 1.

【0058】このように、実施の形態2のシーケンス制
御装置においては、条件実行命令が入力され、かつ、実
行中のタスクに該当するフラグがアクティブでない場合
に、タスクカウンタ401の値が次のタスクの値にカウ
ントアップされ、このタスクカウンタ401の値に基づ
いてセレクタ400がプログラムカウンタ204a〜2
04dの1つを選択し、タスクが切り替えられる。した
がって、現在アクティブであるタスクが待ち状態(フラ
グがアクティブでなく、フラグがアクティブになるまで
待つ動作)に入った場合にタスクを切り替えることがで
きるため、効率的に複数のタスクを実行することができ
る。また、突然のタスクの切り替えも発生しないため、
フラグやレジスタの値を待避させる必要をなくすことが
できる。
As described above, in the sequence control apparatus according to the second embodiment, when the condition execution instruction is input and the flag corresponding to the task being executed is not active, the value of the task counter 401 is changed to the next task. , And based on the value of the task counter 401, the selector 400
04d is selected, and the task is switched. Therefore, when the currently active task enters a waiting state (an operation in which the flag is not active and waits until the flag becomes active), the task can be switched, so that a plurality of tasks can be efficiently executed. it can. Also, because there is no sudden task switching,
This eliminates the need to save the values of flags and registers.

【0059】〔実施の形態3〕複数のシーケンス制御装
置でバスを共有する場合、必要なときのみバスを獲得し
て命令をフェッチすることにすればバスを効率的に使用
することができる。そこで、実施の形態3のシーケンス
制御装置は、実施の形態1または2のシーケンス制御装
置において、フェッチイネーブル信号がアクティブにな
った場合、該当する命令コードのフェッチをDMAコン
トローラによるDMA転送で行うこととし、CPU10
1とシーケンス制御装置102とにバスを共有させた場
合であっても、DMAによりCPUによるプログラムの
フェッチとシーケンス制御装置102による命令コード
の読み取りを効率的に行えるようにしたものである。
[Embodiment 3] When a bus is shared by a plurality of sequence controllers, the bus can be used efficiently by acquiring the bus only when necessary and fetching an instruction. Therefore, the sequence control device of the third embodiment differs from the sequence control device of the first or second embodiment in that when a fetch enable signal becomes active, the corresponding instruction code is fetched by DMA transfer by a DMA controller. , CPU10
Even when the bus is shared by the sequence control device 1 and the sequence control device 102, the program can be efficiently fetched by the CPU and the instruction code can be read by the sequence control device 102 by DMA.

【0060】図6は実施の形態3のシーケンス制御装置
がCPUとバスを共有するように構成された様子を示す
構成図であり、図7は実施の形態3のシーケンス制御装
置の要部構成を示す構成図である。実施の形態3のシー
ケンス制御装置102は、実施の形態1または2のシー
ケンス制御装置において、更に、命令コードをフェッチ
する場合にバス103,104を確保し、マイクロコー
ドメモリ107からの命令コードの読み出しを制御する
DMAコントローラ700(請求項3記載の読出制御手
段に該当する)を備えている。なお、図7は、実施の形
態1のシーケンス制御装置にDMAコントローラ700
を設けた場合の構成を示している。
FIG. 6 is a configuration diagram showing a state in which the sequence control device of the third embodiment is configured to share a bus with a CPU. FIG. 7 shows a main configuration of the sequence control device of the third embodiment. FIG. The sequence control apparatus 102 according to the third embodiment is different from the sequence control apparatus according to the first or second embodiment in that when fetching an instruction code, the buses 103 and 104 are secured and the instruction code is read from the microcode memory 107. And a DMA controller 700 (corresponding to the read control means according to claim 3). FIG. 7 shows the DMA controller 700 in the sequence control device of the first embodiment.
Is shown in the case of providing.

【0061】以下に、図8に基づいて実施の形態3のシ
ーケンス制御装置の動作を説明する。図8は、実施の形
態3のシーケンス制御装置の動作タイミングを示すタイ
ミングチャートである。
The operation of the sequence control device according to the third embodiment will be described below with reference to FIG. FIG. 8 is a timing chart illustrating operation timings of the sequence control device according to the third embodiment.

【0062】命令コードデコーダ200でフェッチした
命令コードを解読した結果、命令が条件実行命令である
場合、命令コードデコーダ200は条件実行命令信号を
アクティブにする。ところが、この条件実行命令をフェ
ッチした際、該当するフラグがアクティブでなかったと
すると、フェッチイネーブル信号はアクティブとなら
ず、命令コードのフェッチは行われない(条件実行命令
1)。
As a result of decoding the instruction code fetched by the instruction code decoder 200, if the instruction is a conditional execution instruction, the instruction code decoder 200 activates the conditional execution instruction signal. However, if the corresponding flag is not active when the conditional execution instruction is fetched, the fetch enable signal does not become active and the instruction code is not fetched (condition execution instruction 1).

【0063】このように、命令が条件実行命令であり、
かつ、フラグがアクティブでない場合は、フラグがアク
ティブになるまでフラグチェックが繰り返し実行される
(条件実行命令2)。そして、フラグがアクティブにな
った場合、ANDゲート201の出力信号がアクティブ
となり、ORゲート202がフェッチイネーブル信号を
アクティブにする。アクティブにされたフェッチイネー
ブル信号は、DMAリクエスト信号としてDMAコント
ローラ700に入力される。
As described above, the instruction is a conditional execution instruction,
If the flag is not active, the flag check is repeatedly executed until the flag becomes active (condition execution instruction 2). When the flag becomes active, the output signal of the AND gate 201 becomes active, and the OR gate 202 makes the fetch enable signal active. The activated fetch enable signal is input to the DMA controller 700 as a DMA request signal.

【0064】DMAコントローラ700は、CPU10
1に対してDMAREQ信号(DMAリクエスト信号)
を出力し、CPU101にバス103,104の明け渡
しを要求する。その後、CPU101は、DMAコント
ローラ700にDMAACK信号(DMAアクノリッジ
信号)を出力して、バス103,104を明け渡す。
The DMA controller 700 has a CPU 10
DMAREQ signal (DMA request signal) for 1
And requests the CPU 101 to surrender the buses 103 and 104. After that, the CPU 101 outputs a DMAACK signal (DMA acknowledge signal) to the DMA controller 700, and passes the buses 103 and 104.

【0065】DMAコントローラ700は、DMAAC
K信号を入力すると、CPU101をバス103、10
4から切り離す。そして、DMAコントローラの制御の
下、マイクロコードメモリ107から該当する命令コー
ドがフェッチされ、その命令コードによるタスクが実行
される。
The DMA controller 700 has a DMAAC
When the K signal is input, the CPU 101 causes the buses 103, 10
Disconnect from 4. Then, under the control of the DMA controller, the corresponding instruction code is fetched from the microcode memory 107, and a task based on the instruction code is executed.

【0066】また、図8に示すように、条件実行命令以
外の通常命令やジャンプ命令においても、上述したDM
Aコントローラ700の制御の下、該当する命令コード
のフェッチが実行される(命令1、命令2)。通常命令
やジャンプ命令のときの動作も上述した条件実行命令の
場合と同様であるため、その説明は省略する。
As shown in FIG. 8, the normal instruction and the jump instruction other than the conditional execution instruction also include the above-described DM.
Under the control of the A controller 700, the fetch of the corresponding instruction code is executed (instruction 1, instruction 2). The operation at the time of a normal instruction or a jump instruction is the same as that of the above-described conditional execution instruction, and therefore, the description thereof is omitted.

【0067】このように、実施の形態3のシーケンス制
御装置によれば、DMA動作で命令コードを取り込み可
能とすることにより、簡単な構成でバスの調停を行うこ
とができる。したがって、CPU101は、シーケンス
処理を実行するシーケンス制御装置102のことを考慮
することなく個別に処理を実行することができる。
As described above, according to the sequence control device of the third embodiment, arbitration of the bus can be performed with a simple configuration by enabling the instruction code to be fetched by the DMA operation. Therefore, the CPU 101 can individually execute the processing without considering the sequence control device 102 that executes the sequence processing.

【0068】〔実施の形態4〕実施の形態4のシーケン
ス制御装置は、実施の形態1〜3と異なり、マイクロプ
ログラムをハードワイヤードロジックで構成したもので
ある。マイクロプログラムをハードワイヤードロジック
で構成した場合は、このマイクロプログラムに基づく処
理内容を修正することは不可能であるが、実施の形態4
のシーケンス制御装置では、CPUを介在させて、処理
内容を変更することができるようにしたものである。
[Fourth Embodiment] A sequence control device according to a fourth embodiment differs from the first to third embodiments in that a microprogram is configured by hard-wired logic. When the microprogram is configured by hard-wired logic, it is impossible to modify the processing content based on the microprogram.
In this sequence control device, the content of processing can be changed by interposing a CPU.

【0069】図9は実施の形態4のシーケンス制御装置
がCPUとバスを共有するように構成された様子を示す
構成図である。図9に示すように、実施の形態4のシー
ケンス制御装置102では、マイクロプログラム(命令
群)がハードワイヤードロジックで構成され、このマイ
クロプログラムはシーケンス制御装置102内のマイク
ロコードメモリ108(請求項4記載の格納手段に該当
する)に格納されている。
FIG. 9 is a configuration diagram showing a state in which the sequence control device of the fourth embodiment is configured to share a bus with a CPU. As shown in FIG. 9, in the sequence control device 102 according to the fourth embodiment, a microprogram (instruction group) is configured by hard-wired logic, and the microprogram is a microcode memory 108 in the sequence control device 102. (Corresponding to the storage means described).

【0070】また、図10は実施の形態4のシーケンス
制御装置の要部構成を示す構成図である。なお、図10
に示すシーケンス制御装置102においては、図4に示
す実施の形態2のシーケンス制御装置102と同一の構
成については同一の符号を付すこととし、ここでは異な
る構成のみ説明することにする。
FIG. 10 is a configuration diagram showing a main configuration of a sequence control device according to the fourth embodiment. Note that FIG.
In the sequence control device 102 shown in FIG. 4, the same components as those in the sequence control device 102 of the second embodiment shown in FIG. 4 are denoted by the same reference numerals, and only different components will be described here.

【0071】実施の形態4のシーケンス制御装置102
は、実施の形態2のシーケンス制御装置102の構成に
加え、任意の格納アドレスを保持するブレークポイント
レジスタ1001(請求項4の第2の格納アドレス保持
手段に該当する)と、セレクタ400で選択されたプロ
グラムカウンタ204a〜204dのいずれか一つに保
持された格納アドレスとブレークポイントレジスタ10
01に保持された格納アドレスとを入力して比較し、両
者の格納アドレスが一致する場合に、命令コードデコー
ダ200を制御して自装置の動作を停止すると共に、自
装置が動作停止状態にあることを通知するホールド信号
(INTREQ)をCPU101に出力し、その後CP
U101から動作停止状態を解除するホールド解除信号
を入力すると、命令コードデコーダ200を制御して自
装置の動作を再開する比較器1002(請求項4記載の
ホールド制御手段に該当する)とを備えている。
Sequence control device 102 of the fourth embodiment
Is selected by the selector 400 in addition to the configuration of the sequence controller 102 of the second embodiment, a breakpoint register 1001 for holding an arbitrary storage address (corresponding to a second storage address holding means in claim 4). Storage address and the breakpoint register 10 stored in any one of the program counters 204a to 204d.
01 is input and compared, and when both storage addresses match, the instruction code decoder 200 is controlled to stop the operation of the own device, and the own device is in the operation stopped state. Is output to the CPU 101, and then the hold signal (INTREQ)
A comparator 1002 (corresponding to the hold control means according to claim 4) which controls the instruction code decoder 200 and resumes the operation of its own device when a hold release signal for releasing the operation stop state is input from U101. I have.

【0072】次に、実施の形態4のシーケンス制御装置
102の動作を図11に基づいて説明する。図11は、
実施の形態4のシーケンス制御装置102の動作を示す
説明図である。なお、実施の形態4のシーケンス制御装
置102において、複数のタスクの切り替え処理等は、
実施の形態2で既に説明した通りであるため、ここで
は、CPU101を介在させて、シーケンス制御装置1
02の処理内容を変更する処理のみを説明する。
Next, the operation of the sequence control device 102 according to the fourth embodiment will be described with reference to FIG. FIG.
FIG. 14 is an explanatory diagram illustrating an operation of the sequence control device 102 according to the fourth embodiment. In the sequence control device 102 according to the fourth embodiment, the switching processing of a plurality of tasks and the like
Since it has already been described in the second embodiment, here, the sequence control device 1
Only the process of changing the process content of the process No. 02 will be described.

【0073】予め、シーケンス制御装置102のブレー
クポイントレジスタ1001には、処理内容を変更した
い命令コードの格納アドレスを保持させておく。そし
て、シーケンス制御装置102は、例えば、セレクタ4
00で選択されたプログラムカウンタ204aに保持さ
れた格納アドレスに基づいて、マイクロコードメモリ1
08から該当する命令コードをフェッチし、図11に示
す処理1〜処理3を実行する(S1101〜S110
3)。このとき比較器1002は、プログラムカウンタ
204aに保持された格納アドレスとブレークポイント
レジスタ1001に保持された格納アドレスとを入力し
て比較し、両者の格納アドレスが一致するか否かを判定
している。
The breakpoint register 1001 of the sequence control device 102 previously holds the storage address of the instruction code whose processing content is to be changed. Then, the sequence control device 102, for example,
00, the microcode memory 1 based on the storage address stored in the program counter 204a.
08, the corresponding instruction code is fetched, and processing 1 to processing 3 shown in FIG. 11 are executed (S1101 to S110).
3). At this time, the comparator 1002 inputs and compares the storage address stored in the program counter 204a with the storage address stored in the breakpoint register 1001, and determines whether or not the two storage addresses match. .

【0074】比較器1002が、プログラムカウンタ2
04aに保持された格納アドレスとブレークポイントレ
ジスタ1001に保持された格納アドレスとを入力して
比較した結果、両者の格納アドレスが一致したとする
(S1104)。比較器1002は、命令コードデコー
ダ200にホールド信号を出力し、命令コードデコーダ
200の動作を停止する。その結果、命令コードデコー
ダ200で一切命令コードの解読が行われないため、プ
ログラムカウンタ204a〜204dやタスクカウンタ
401の動作も停止し、シーケンス制御装置102でシ
ーケンスを制御することができない状態になる。比較器
1002は、同時に、ホールド信号を割り込み信号(I
NTREQ)としてCPU101に出力する。
The comparator 1002 is a program counter 2
It is assumed that as a result of inputting and comparing the storage address stored in the storage address 04a with the storage address stored in the breakpoint register 1001, both storage addresses match (S1104). Comparator 1002 outputs a hold signal to instruction code decoder 200, and stops the operation of instruction code decoder 200. As a result, the instruction code decoder 200 does not decode any instruction code, so that the operations of the program counters 204a to 204d and the task counter 401 are stopped, and the sequence control device 102 cannot control the sequence. The comparator 1002 simultaneously outputs the hold signal to the interrupt signal (I
NTREQ) to the CPU 101.

【0075】CPU101は、図9に示すように、シー
ケンス制御装置102内の所定のレジスタにバス10
3,104を介して自由にアクセスできるように構成さ
れている。したがって、CPU101は、シーケンス制
御装置102からホールド信号を入力すると、予め用意
されたプログラムに基づいて、シーケンス制御装置10
2内の所定のレジスタにアクセスし、任意のシーケンス
を制御する(S1111およびS1112)。すなわ
ち、実施の形態4のシーケンス制御装置102のハード
的な処理に対し、CPU101によるソフト的な処理が
実行される。
As shown in FIG. 9, the CPU 101 stores a bus 10 in a predetermined register in the sequence controller 102.
It is configured such that it can be freely accessed via the 3104. Therefore, when the CPU 101 receives the hold signal from the sequence control device 102, the sequence control device 10
2 is accessed to control an arbitrary sequence (S1111 and S1112). In other words, software processing by the CPU 101 is performed for hardware processing of the sequence control device 102 according to the fourth embodiment.

【0076】そして、CPU101は、処理が終了する
と、次の命令コードの格納アドレスを例えばプログラム
カウンタ204cにセットし(S1113)、ホールド
解除命令を比較器1002に出力する(S1114)。
なお、CPU101は、シーケンス制御装置102の動
作が停止された時点でアクティブであったプログラムカ
ウンタ204aではなく、異なるプログラムカウンタ2
04cに格納アドレスをセットする場合、セレクタ40
0をプログラムカウンタ204cに切り替えると共に、
タスクカウンタ401にも新たな値をセットする必要が
ある。
When the processing is completed, the CPU 101 sets the storage address of the next instruction code in, for example, the program counter 204c (S1113), and outputs a hold release instruction to the comparator 1002 (S1114).
Note that the CPU 101 is not the program counter 204a that was active when the operation of the sequence control device 102 was stopped, but a different program counter 2
04c, the selector 40
While switching 0 to the program counter 204c,
It is necessary to set a new value in the task counter 401 as well.

【0077】比較器1002は、CPU101からホー
ルド解除命令を入力し、命令コードデコーダ200の動
作停止状態を解除することにより、シーケンス制御装置
102でシーケンスを制御可能な状態に戻す。その結
果、CPU101によってプログラムカウンタ204c
にセットされた格納アドレスに基づいて、マイクロコー
ドメモリ108から命令コードがフェッチされ、所定の
処理が継続して実行される(S1107およびS110
8)。
The comparator 1002 receives a hold release command from the CPU 101 and releases the operation stop state of the instruction code decoder 200, thereby returning the sequence to a state in which the sequence control device 102 can control the sequence. As a result, the program counter 204c is
The instruction code is fetched from the microcode memory 108 based on the storage address set in, and predetermined processing is continuously executed (S1107 and S110).
8).

【0078】このように、実施の形態4のシーケンス制
御装置102においては、マイクロプログラムに基づく
処理の任意の場所にCPU101による処理を入れ込む
ことにしたため、ハードワイヤードロジックで構成され
て変更不可能なマイクロプログラムに不備がある場合で
あっても、CPU101によるソフト的な処理でマイク
ロプログラムを変更した場合と実質的に同一の結果を得
ることができる。
As described above, in the sequence control device 102 according to the fourth embodiment, since the processing by the CPU 101 is inserted into an arbitrary place of the processing based on the microprogram, it is constituted by hard-wired logic and cannot be changed. Even when the microprogram is defective, substantially the same result as when the microprogram is changed by software processing by the CPU 101 can be obtained.

【0079】なお、以上では、実施の形態4のシーケン
ス制御装置102を実施の形態2のシーケンス制御装置
の構成に基づいて説明したが、これに限定するものでは
なく、例えば、実施の形態1のシーケンス制御装置に適
用することができることはいうまでもない。
Although the sequence controller 102 according to the fourth embodiment has been described based on the configuration of the sequence controller according to the second embodiment, the present invention is not limited to this. For example, the sequence controller 102 according to the first embodiment may be used. It goes without saying that the present invention can be applied to a sequence control device.

【0080】[0080]

【発明の効果】以上説明したように、本発明のシーケン
ス制御装置(請求項1)によれば、次に読み出す命令の
格納アドレスを保持する格納アドレス保持手段と、格納
アドレス保持手段に保持された格納アドレスに基づい
て、格納手段から該当する命令を読み出す命令読出手段
と、命令読出手段で読み出した命令を解読する命令解読
手段と、を備え、命令群は、フラグがアクティブである
場合に次の命令を読み出す条件実行命令を含み、命令読
出手段は、命令解読手段で命令を解読した結果、読み出
した命令が条件実行命令である場合に、該当するフラグ
がセットされると格納手段から該当する命令を読み出す
ため、プログラムのフェッチ回数を低減することができ
る。したがって、複数のシーケンス制御装置でバスを共
有した場合であっても、特定のシーケンス制御装置がバ
スを占有してしまうという問題を解消することができる
(オーバーヘッドをなくすことができる)。
As described above, according to the sequence controller of the present invention (claim 1), the storage address holding means for holding the storage address of the instruction to be read next, and the storage address holding means for holding the storage address of the next instruction. An instruction reading unit that reads a corresponding instruction from the storage unit based on the storage address; and an instruction decoding unit that decodes the instruction read by the instruction reading unit. The instruction reading means includes a conditional execution instruction for reading the instruction, and as a result of decoding the instruction by the instruction decoding means, if the read instruction is a conditional execution instruction and a corresponding flag is set, the instruction is read from the storage means. , The number of program fetches can be reduced. Therefore, even when the bus is shared by a plurality of sequence controllers, the problem that a specific sequence controller occupies the bus can be eliminated (overhead can be eliminated).

【0081】また、本発明のシーケンス制御装置(請求
項2)によれば、請求項1記載のシーケンス制御装置に
おいて、実行するタスクの数に応じて格納アドレス保持
手段を複数備えると共に、複数の格納アドレス保持手段
のうちの1つを選択することによってタスクを切り替え
るタスク切替手段を備え、タスク切替手段は、現在選択
中の格納アドレス保持手段に保持された格納アドレスに
基づいて読み出された命令が条件実行命令でありかつ該
当するフラグがアクティブでない場合に、予め設定され
た順序に従って他の格納アドレス保持手段を選択してタ
スクを切り替え、命令読出手段は、タスク切替手段で他
の格納アドレス保持手段が選択されると、選択された格
納アドレス保持手段に保持された格納アドレスに基づい
て、格納手段から該当する命令を読み出すため、タスク
が待ち状態になったときにタスク切り換えを行うことが
でき、効率良く複数のタスクを実行することが可能とな
る。したがって、不意にタスク切り換えが発生すること
がなく、レジスタ,フラグ等を待避させる必要がない。
Further, according to the sequence control device of the present invention, the sequence control device of the first aspect is provided with a plurality of storage address holding means according to the number of tasks to be executed, and a plurality of storage address storage means. A task switching unit that switches a task by selecting one of the address holding units; the task switching unit is configured to execute the instruction read based on the storage address held in the currently selected storage address holding unit. When the instruction is a conditional execution instruction and the corresponding flag is not active, another storage address holding unit is selected according to a preset order to switch the task, and the instruction reading unit switches the other storage address holding unit by the task switching unit. Is selected from the storage means based on the storage address held in the selected storage address holding means. To read an instruction equivalent to, it is possible to perform task switching when a task becomes a waiting state, and efficiently can perform multiple tasks. Therefore, the task switching does not occur unexpectedly, and there is no need to save the registers, flags, and the like.

【0082】また、本発明のシーケンス制御装置(請求
項3)によれば、請求項1または2記載のシーケンス制
御装置において、命令読出手段が格納手段から該当する
命令を読み出す際に、CPUに対してバスの明け渡しを
要求し、CPUからバスが明け渡されると格納手段から
該当する命令を読み出す読出制御手段を備えるため、D
MA動作で命令コードを取り込むことができ、簡単な構
成でバスの調停を行うことができる。したがって、本体
のCPUは、シーケンス処理を実行するシーケンス制御
装置を考慮することなく、個別に処理を実行することが
できる。
Further, according to the sequence control device of the present invention, in the sequence control device of the first or second aspect, when the instruction reading means reads a corresponding instruction from the storage means, Read control means for reading out the corresponding instruction from the storage means when the bus is requested by the CPU.
Instruction codes can be fetched by MA operation, and bus arbitration can be performed with a simple configuration. Therefore, the CPU of the main body can execute the processing individually without considering the sequence control device that executes the sequence processing.

【0083】さらに、本発明のシーケンス制御装置(請
求項4)によれば、ハードワイヤードロジックで構成さ
れた命令群を格納した格納手段と、次に読み出す命令の
格納アドレスを保持する第1の格納アドレス保持手段
と、第1の格納アドレス保持手段に保持された格納アド
レスに基づいて、格納手段から該当する命令を読み出す
命令読出手段と、命令読出手段で読み出した命令を解読
する命令解読手段と、任意の命令の格納アドレスを保持
する第2の格納アドレス保持手段と、第1の格納アドレ
ス保持手段で保持された格納アドレスと第2の格納アド
レス保持手段で保持された格納アドレスとを入力して比
較し、両者の格納アドレスが一致する場合に、命令解読
手段を制御して自装置の動作を停止すると共に、自装置
が動作停止状態にあることを通知するホールド信号をC
PUに出力するホールド制御手段と、を備え、第1の格
納アドレス保持手段は、動作停止状態にある間に、CP
Uによって格納アドレスが再設定され、ホールド制御手
段は、CPUから動作停止状態を解除するホールド解除
信号を入力し、命令解読手段を制御して自装置の動作を
再開し、命令読出手段は、第1の格納アドレス保持手段
に再設定された格納アドレスに基づいて、格納手段から
該当する命令を読み出すため、ハードワイヤードロジッ
クで構成されて変更不可能なマイクロプログラムに不備
がある場合であっても、CPUによるソフト的な処理で
マイクロプログラムを変更した場合と実質的に同一の結
果を得ることができる。
Further, according to the sequence control device of the present invention (claim 4), a storage means for storing an instruction group constituted by hard-wired logic, and a first storage for storing a storage address of an instruction to be read next. Address holding means, instruction reading means for reading a corresponding instruction from the storage means based on the storage address held in the first storage address holding means, instruction decoding means for decoding the instruction read by the instruction reading means, A second storage address holding means for holding a storage address of an arbitrary instruction, and a storage address held by the first storage address holding means and a storage address held by the second storage address holding means are inputted. If the two storage addresses match, the instruction decoding means is controlled to stop the operation of the own device and to stop the operation of the own device. The hold signal C to notify that
And a hold control unit for outputting to the PU, wherein the first storage address holding unit controls the CP while the operation is stopped.
The storage address is reset by U, the hold control means inputs a hold release signal for releasing the operation stop state from the CPU, controls the command decoding means, and resumes the operation of the apparatus itself. In order to read the corresponding instruction from the storage unit based on the storage address reset in the storage address holding unit of the first, even if there is a defect in the unchangeable microprogram constituted by hard-wired logic, Substantially the same result can be obtained as when the microprogram is changed by software processing by the CPU.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の実施の形態1のシーケンス制御装置
が、CPUをコアとし、その周囲にCPUと共に1つの
バスを共有するように構成された様子を示す構成図であ
る。
FIG. 1 is a configuration diagram illustrating a state in which a sequence control device according to a first embodiment of the present invention is configured to use a CPU as a core and share one bus with the CPU around the core;

【図2】本発明の実施の形態1のシーケンス制御装置の
要部構成を示す構成図である。
FIG. 2 is a configuration diagram illustrating a main configuration of a sequence control device according to the first embodiment of the present invention.

【図3】本発明の実施の形態1のシーケンス制御装置の
命令コードのフェッチの様子を示す説明図である。
FIG. 3 is an explanatory diagram showing how an instruction code is fetched by the sequence control device according to the first embodiment of the present invention;

【図4】本発明の実施の形態2のシーケンス制御装置の
要部構成を示す構成図である。
FIG. 4 is a configuration diagram illustrating a main configuration of a sequence control device according to a second embodiment of the present invention;

【図5】本発明の実施の形態2のシーケンス制御装置の
動作タイミングを示すタイミングチャートである。
FIG. 5 is a timing chart showing operation timings of the sequence control device according to the second embodiment of the present invention.

【図6】本発明の実施の形態3のシーケンス制御装置が
CPUと共に1つのバスを共有するように構成された様
子を示す構成図である。
FIG. 6 is a configuration diagram illustrating a state in which the sequence control device according to the third embodiment of the present invention is configured to share one bus with a CPU.

【図7】図6に示すシーケンス制御装置の要部構成を示
す構成図である。
FIG. 7 is a configuration diagram illustrating a main configuration of the sequence control device illustrated in FIG. 6;

【図8】実施の形態3のシーケンス制御装置の動作タイ
ミングを示すタイミングチャートである。
FIG. 8 is a timing chart showing operation timings of the sequence control device according to the third embodiment.

【図9】実施の形態4のシーケンス制御装置がCPUと
バスを共有するように構成された様子を示す構成図であ
る。
FIG. 9 is a configuration diagram illustrating a state in which the sequence control device according to the fourth embodiment is configured to share a bus with a CPU.

【図10】実施の形態4のシーケンス制御装置の要部構
成を示す構成図である。
FIG. 10 is a configuration diagram illustrating a main configuration of a sequence control device according to a fourth embodiment;

【図11】実施の形態4のシーケンス制御装置の動作を
示す説明図である。
FIG. 11 is an explanatory diagram illustrating an operation of the sequence control device according to the fourth embodiment.

【図12】シーケンス制御装置による通信制御の一例を
説明するための説明図である。
FIG. 12 is an explanatory diagram illustrating an example of communication control by a sequence control device.

【図13】シーケンス制御装置におけるポーリングの状
態を示す説明図である。
FIG. 13 is an explanatory diagram showing a polling state in the sequence control device.

【図14】シーケンス制御装置で命令をフェッチする様
子を示す説明図である。
FIG. 14 is an explanatory diagram showing how an instruction is fetched by the sequence control device.

【符号の説明】[Explanation of symbols]

100 チップ 101 CPU 102 シーケンス制御装置 103 データバス 104 アドレスバス 105 メモリ 106 プログラムメモリ 107,108 マイクロコードメモリ 200 命令コードデコーダ 201 ANDゲート 202,203 ORゲート 204,204a〜204d プログラムカウンタ 400 セレクタ 401 タスクカウンタ 700 DMAコントローラ 1001 ブレークポイントレジスタ 1002 比較器 1200 RXDユニット(受信機) 1201 コード解析部 1202 プロトコル制御部 1203 CPU 1204 送信コード発生部 1205 TXDユニット(送信機) 1206 DMAコントローラ 1207 メモリ 1208,1209,1210,1211,1212
フラグ
REFERENCE SIGNS LIST 100 chip 101 CPU 102 sequence controller 103 data bus 104 address bus 105 memory 106 program memory 107, 108 microcode memory 200 instruction code decoder 201 AND gate 202, 203 OR gate 204, 204a-204d program counter 400 selector 401 task counter 700 DMA controller 1001 Breakpoint register 1002 Comparator 1200 RXD unit (receiver) 1201 Code analyzer 1202 Protocol controller 1203 CPU 1204 Transmission code generator 1205 TXD unit (transmitter) 1206 DMA controller 1207 Memory 1208, 1209, 1210, 1211 , 1212
flag

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.6 識別記号 FI H04N 1/00 107 H04N 1/00 107Z 1/32 1/32 Z ──────────────────────────────────────────────────の Continued on the front page (51) Int.Cl. 6 Identification code FI H04N 1/00 107 H04N 1/00 107Z 1/32 1/32 Z

Claims (4)

【特許請求の範囲】[Claims] 【請求項1】 CPUをコアとして、その周辺にCPU
等と共に同一のバスを共有するように構成され、前記バ
スに接続された格納手段に格納された命令群に応じて、
所定のタスクの実行を要求するフラグがセットされたか
否かを確認し、前記フラグがセットされると所定のタス
クを実行するシーケンス制御装置において、 次に読み出す命令の格納アドレスを保持する格納アドレ
ス保持手段と、 前記格納アドレス保持手段に保持された格納アドレスに
基づいて、前記格納手段から該当する命令を読み出す命
令読出手段と、 前記命令読出手段で読み出した命令を解読する命令解読
手段と、を備え、 前記命令群は、フラグがアクティブである場合に次の命
令を読み出す条件実行命令を含み、 前記命令読出手段は、前記命令解読手段で命令を解読し
た結果、読み出した命令が条件実行命令である場合に、
該当するフラグがセットされると前記格納手段から該当
する命令を読み出すことを特徴とするシーケンス制御装
置。
1. A CPU having a CPU as a core and a CPU
Etc. are configured to share the same bus, and according to a group of instructions stored in storage means connected to the bus,
A sequence control device that checks whether a flag for requesting execution of a predetermined task is set, and executes the predetermined task when the flag is set. Means, an instruction reading means for reading a corresponding instruction from the storage means based on the storage address held in the storage address holding means, and an instruction decoding means for decoding the instruction read by the instruction reading means. The instruction group includes a condition execution instruction for reading a next instruction when a flag is active, and the instruction reading unit decodes the instruction by the instruction decoding unit, and the read instruction is a condition execution instruction. In case,
A sequence control device, wherein a corresponding instruction is read from the storage means when a corresponding flag is set.
【請求項2】 実行するタスクの数に応じて前記格納ア
ドレス保持手段を複数備えると共に、複数の格納アドレ
ス保持手段のうちの1つを選択することによってタスク
を切り替えるタスク切替手段を備え、 前記タスク切替手段は、現在選択中の格納アドレス保持
手段に保持された格納アドレスに基づいて読み出された
命令が条件実行命令でありかつ該当するフラグがアクテ
ィブでない場合に、予め設定された順序に従って他の格
納アドレス保持手段を選択してタスクを切り替え、 前記命令読出手段は、前記タスク切替手段で他の格納ア
ドレス保持手段が選択されると、選択された格納アドレ
ス保持手段に保持された格納アドレスに基づいて、前記
格納手段から該当する命令を読み出すことを特徴とする
請求項1記載のシーケンス制御装置。
2. A task switching means comprising: a plurality of storage address holding means according to the number of tasks to be executed; and a task switching means for switching a task by selecting one of the plurality of storage address holding means; When the instruction read based on the storage address held in the currently selected storage address holding unit is a condition execution instruction and the corresponding flag is not active, the switching unit performs another switching according to a preset order. When the task switching means selects another storage address holding means, the instruction reading means selects a storage address holding means to switch a task, and based on the storage address held by the selected storage address holding means. 2. The sequence control device according to claim 1, wherein a corresponding instruction is read from said storage means.
【請求項3】 前記命令読出手段が格納手段から該当す
る命令を読み出す際に、前記CPUに対してバスの明け
渡しを要求し、前記CPUからバスが明け渡されると前
記格納手段から該当する命令を読み出す読出制御手段を
備えることを特徴とする請求項1または2記載のシーケ
ンス制御装置。
3. The instruction reading means requests the CPU to give up a bus when reading the corresponding instruction from the storage means, and reads out the corresponding instruction from the storage means when the bus is yielded from the CPU. 3. The sequence control device according to claim 1, further comprising read control means.
【請求項4】 CPUをコアとして、その周辺にCPU
等と共に同一のバスを共有するように構成され、予め用
意された命令群に基づいて、所定のタスクを実行するシ
ーケンス制御装置において、 ハードワイヤードロジックで構成された命令群を格納し
た格納手段と、 次に読み出す命令の格納アドレスを保持する第1の格納
アドレス保持手段と、 前記第1の格納アドレス保持手段に保持された格納アド
レスに基づいて、前記格納手段から該当する命令を読み
出す命令読出手段と、 前記命令読出手段で読み出した命令を解読する命令解読
手段と、 任意の命令の格納アドレスを保持する第2の格納アドレ
ス保持手段と、 前記第1の格納アドレス保持手段で保持された格納アド
レスと前記第2の格納アドレス保持手段で保持された格
納アドレスとを入力して比較し、両者の格納アドレスが
一致する場合に、前記命令解読手段を制御して自装置の
動作を停止すると共に、自装置が動作停止状態にあるこ
とを通知するホールド信号を前記CPUに出力するホー
ルド制御手段と、を備え、 前記第1の格納アドレス保持手段は、動作停止状態にあ
る間に、前記CPUによって格納アドレスが再設定さ
れ、 前記ホールド制御手段は、前記CPUから動作停止状態
を解除するホールド解除信号を入力し、前記命令解読手
段を制御して自装置の動作を再開し、 前記命令読出手段は、前記第1の格納アドレス保持手段
に再設定された格納アドレスに基づいて、前記格納手段
から該当する命令を読み出すことを特徴とするシーケン
ス制御装置。
4. A CPU as a core and a CPU around the core.
A sequence control device configured to share the same bus together with the like, and to execute a predetermined task based on a group of instructions prepared in advance, storing means for storing a group of instructions configured by hard-wired logic, First storage address holding means for holding a storage address of an instruction to be read next, and instruction reading means for reading a corresponding instruction from the storage means based on the storage address held in the first storage address holding means. An instruction decoding means for decoding an instruction read by the instruction reading means; a second storage address holding means for holding a storage address of an arbitrary instruction; a storage address held by the first storage address holding means; The storage address held by the second storage address holding means is input and compared, and if both storage addresses match, Holding control means for controlling the command decoding means to stop the operation of the own device and outputting a hold signal notifying that the own device is in an operation stopped state to the CPU; In the storage address holding means, the storage address is reset by the CPU while in the operation stop state, and the hold control means inputs a hold release signal for releasing the operation stop state from the CPU and decodes the instruction. Controlling the means to restart the operation of its own device, wherein the instruction reading means reads the corresponding instruction from the storage means based on the storage address reset in the first storage address holding means. Sequence control device.
JP9042372A 1996-09-19 1997-02-26 Sequence controller Pending JPH10149295A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9042372A JPH10149295A (en) 1996-09-19 1997-02-26 Sequence controller

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP24841496 1996-09-19
JP8-248414 1996-09-19
JP9042372A JPH10149295A (en) 1996-09-19 1997-02-26 Sequence controller

Publications (1)

Publication Number Publication Date
JPH10149295A true JPH10149295A (en) 1998-06-02

Family

ID=26382040

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9042372A Pending JPH10149295A (en) 1996-09-19 1997-02-26 Sequence controller

Country Status (1)

Country Link
JP (1) JPH10149295A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007193572A (en) * 2006-01-19 2007-08-02 Seiko Epson Corp Cpu, integrated circuit device, microcomputer, and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007193572A (en) * 2006-01-19 2007-08-02 Seiko Epson Corp Cpu, integrated circuit device, microcomputer, and electronic equipment

Similar Documents

Publication Publication Date Title
US5471625A (en) Method and apparatus for entering a low-power mode and controlling an external bus of a data processing system during low-power mode
US5819111A (en) System for managing transfer of data by delaying flow controlling of data through the interface controller until the run length encoded data transfer is complete
EP0380858A2 (en) Method and apparatus for detecting and correcting errors in a pipelined computer system
US20070074214A1 (en) Event processing method in a computer system
US9514070B2 (en) Debug control circuit
US20040205719A1 (en) Hop method for stepping parallel hardware threads
US20070240011A1 (en) FIFO memory data pipelining system and method for increasing I²C bus speed
JPH06250916A (en) Exclusive control method for shared memory
JPH024932B2 (en)
CA2058933C (en) Reset method when adaptor module is faulty and computer system executing same
JP2874488B2 (en) Processing equipment
JPH10149295A (en) Sequence controller
JPH08115271A (en) Data-processing system and related method
JPS598038A (en) Data input and output processor
JPH0312768A (en) I/o controller
JPH02730B2 (en)
JP2504515B2 (en) Test channel instruction execution control method
JPH0540666A (en) Interruption monitoring device for integrated circuit microprocessor
JPH05282243A (en) Bus master device and electronic equipment using the same
JPH04178869A (en) Interruption control device for multiprocessor system and its interruption communication method
JPS6228866A (en) Main memory access system
JPH0784933A (en) Input/output control board
JPH11327798A (en) Data transfer controller
JPH0822441A (en) Information processor and its communication error detecting method
JPH0683226B2 (en) Information transfer control method