JPH07120167B2 - Processing method and processing device for sequence control - Google Patents
Processing method and processing device for sequence controlInfo
- Publication number
- JPH07120167B2 JPH07120167B2 JP62141490A JP14149087A JPH07120167B2 JP H07120167 B2 JPH07120167 B2 JP H07120167B2 JP 62141490 A JP62141490 A JP 62141490A JP 14149087 A JP14149087 A JP 14149087A JP H07120167 B2 JPH07120167 B2 JP H07120167B2
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- processing
- register
- value
- address
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
- 238000003672 processing method Methods 0.000 title claims description 6
- 238000000034 method Methods 0.000 claims description 59
- 230000006870 function Effects 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 8
- 238000007796 conventional method Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
Landscapes
- Executing Machine-Instructions (AREA)
- Programmable Controllers (AREA)
Description
【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、シーケンス制御の処理方法及び処理装置に係
り、特にその高速化に関するものである。Description: TECHNICAL FIELD The present invention relates to a sequence control processing method and processing apparatus, and more particularly to speeding up the processing.
従来のシーケンス制御装置(シーケンスコントローラと
いう)としては、例えば特願昭59−36040号記載のもの
がある。この従来装置では、プロセス入出力装置との間
でデータ授受を行うためのビツトレジスタと、演算器
と、演算結果を記憶するアキユムレータとを有し、アン
ド処理やオア処理の実行時には、最初にプロセス入出力
装置からビツトレジスタにデータを読出し、次に演算器
による論理演算を行い、最後に演算結果をアキユムレー
タに記憶するという処理を行っていた。A conventional sequence control device (referred to as a sequence controller) is disclosed in Japanese Patent Application No. 59-36040. This conventional device has a bit register for exchanging data with the process input / output device, an arithmetic unit, and an accumulator for storing the arithmetic result. The data is read from the input / output device to the bit register, the logical operation is performed by the arithmetic unit, and finally the arithmetic result is stored in the accumulator.
第10図は、シーケンス処理のうちの、アンド処理の例を
示したものである。ここでI1は読出し命令(LD命令)、
I2はアンド命令、I3は書き込み命令(ST)であり、これ
ら命令の対象となるプロセス入出力装置のアドレスがそ
れぞれPIO1〜PIO3で示してある。このシーケンス処理
は、下記のように書くことができる。FIG. 10 shows an example of AND processing in the sequence processing. Here, I1 is a read command (LD command),
I2 is an AND instruction, I3 is a write instruction (ST), and the addresses of the process input / output devices targeted by these instructions are indicated by PIO1 to PIO3, respectively. This sequence process can be written as:
(PIO3)=(PIO1)・(PIO2)但し(a)は、アドレス
aに格納されたデータ(論理値)を示す。このシーケン
ス処理を、従来のシーケンスコントローラでは第11図
(a)に示すフローで行つていた。即ち、各命令はそれ
ぞれ、命令の読出し(ステツプ1101,1104,1107)、読出
した命令の指示するアドレス(プロセス入出力装置)ま
たはアキユムレータACCからビツトレジスタ(Dr)への
データ転送(ステツプ1102,1105,1108)、及び命令の指
示する処理の実行(ステツプ1103,1106、1109)の3ス
テツプにより実行される。(PIO3) = (PIO1). (PIO2) However, (a) shows the data (logical value) stored in the address a. This sequence processing is performed by the conventional sequence controller according to the flow shown in FIG. That is, each of instructions, read instructions (step 1101,1104,1107), the data transfer from the instruction address (process input and output device) or accumulator ACC of the read out instruction bit to the register (D r) (step 1102, 1105, 1108) and the execution of the process instructed by the instruction (steps 1103, 1106, 1109).
第12図は、シーケンス処理のうちの、オア処理の例を示
したものである。ここで、I4は読出し命令、I5はオア命
令、I6は書き込み命令である。このシーケンス処理は、
以下のように書くことができる。FIG. 12 shows an example of OR processing in the sequence processing. Here, I4 is a read command, I5 is an OR command, and I6 is a write command. This sequence process is
It can be written as
(PIO6)=(PIO4)+(PIO5) この処理を、従来のシーケンスコントローラでは第13図
(a)に示すフローで行つていた。即ちこの場合も、各
命令I4〜I6はそれぞれ3ステツプの処理によつて実行さ
れていた。(PIO6) = (PIO4) + (PIO5) This process is performed by the conventional sequence controller according to the flow shown in FIG. 13 (a). That is, also in this case, each of the instructions I4 to I6 has been executed by the processing of three steps.
上記従来技術では、アンド処理やオア処理の実行時に、
プロセス入出力装置のデータ読出しと、論理演算とを必
ず行うから、処理の高速化に限度があつた。In the above-mentioned conventional technique, at the time of executing the AND processing and the OR processing,
Since the process I / O device always reads data and performs logical operation, there is a limit to the speeding up of processing.
本発明の目的は、シーケンス処理を高速化することので
きるシーケンス制御の処理方法及び処理装置を提供する
にある。It is an object of the present invention to provide a sequence control processing method and processing device capable of speeding up sequence processing.
上記の目的は、プロセス入出力装置からビツトレジスタ
へ読出した第1のデータの値(0か1か)と命令の種類
とに応じて、0、1、またはプロセス入出力装置から読
出した第2のデータのいずれかを演算結果として出力す
る手段とを設けることにより達成され、さらに、複数の
処理結果をデータとして演算処理を行うときの、以前に
得た処理結果を一時退避しておくためのスタツク手段を
設けることにより達成される。The above-mentioned purpose is 0, 1, or the second read from the process input / output device depending on the value (0 or 1) of the first data read from the process input / output device to the bit register and the type of instruction. It is achieved by providing a means for outputting any of the data as a calculation result, and for temporarily saving the previously obtained processing result when performing the calculation processing with a plurality of processing results as data. This is accomplished by providing stacking means.
アンド演算のときは、一つのデータが0のとき他方のデ
ータ値に関係なく答えは0であり、一つのデータが1の
ときは他方のデータ値そのものが答えになる。また、オ
ア演算のときは、一つのデータが1のとき他方のデータ
値に関係なく答えは1であり、一つのデータが0のとき
は他方のデータ値そのものが答えになる。従つて命令が
アンド演算かオア演算かの判定とプロセス入出力装置か
ら読出した第一のデータの値とから、答えとして0又は
1をビツトレジスタにセツトするか(これは第一のデー
タそのもので、判定前にセツトされているので実際には
何もしなくてよい)、あるいは第二のデータをプロセス
入出力装置から読出してその値をビツトレジスタにセツ
トすればよく、従来のようにアキユムレータとのデータ
転送及び論理演算ステツプ、第二データ不要のときでも
それをプロセス入出力装置から読出するステツプ等を省
略でき、処理が高速化される。また、前回の処理結果と
今回の処理結果との演算処理を行うときには、前回の処
理結果をスタツクへ退避しておき、この退避した値と今
回の処理結果であるビツトレジスタの値とから、それら
の値を判定して必要なときのみビツトレジスタの値を書
き換えて答えとする。このようにスタツクを用いると、
そこへのデータの入出力は高速に行えるから、全体の処
理も高速化される。In the case of AND operation, when one data is 0, the answer is 0 regardless of the other data value, and when one data is 1, the other data value itself is the answer. In the case of OR operation, when one data is 1, the answer is 1 regardless of the other data value, and when one data is 0, the other data value itself is the answer. Therefore, whether 0 or 1 is set in the bit register as an answer from the judgment whether the instruction is an AND operation or an OR operation and the value of the first data read from the process input / output device (this is the first data itself. , It does not have to actually do anything because it has been set before the determination), or it is sufficient to read the second data from the process I / O device and set the value in the bit register, which is the same as the conventional accumulator. The data transfer and logical operation step, the step of reading the second data from the process input / output device even when the second data is unnecessary, and the like can be omitted, and the processing speed is increased. In addition, when performing the arithmetic processing of the previous processing result and the current processing result, the previous processing result is saved in a stack, and the saved value and the bit register value which is the current processing result The value of the bit register is judged and the value in the bit register is rewritten only when necessary to give the answer. Using stacks like this,
Since data can be input and output at high speed, the whole process is also speeded up.
以下、本発明を実施例により詳細に説明する。第1図は
本発明の装置の一実施例を示したものであり、シーケン
スコントローラ42は、命令アドレス発生器43、デコーダ
44、ビツトレジスタ45、ゲート46等から成つている。命
令は第2図に示したフオーマツトから成り、命令メモリ
1から命令バス50上に出力される命令のうち、コードは
バス51を介してデコーダ44へ、プロセス入出力装置のア
ドレス(PIOアドレス)はバス52を介してプロセス入出
力装置2へ出力される。バス54は、プロセス入出力装置
2とビツトレジスタ45間でデータ授受を行うためのバス
である。Hereinafter, the present invention will be described in detail with reference to Examples. FIG. 1 shows an embodiment of the device of the present invention. The sequence controller 42 includes an instruction address generator 43, a decoder.
44, a bit register 45, a gate 46, etc. The instructions are composed of the format shown in FIG. 2. Among the instructions output from the instruction memory 1 to the instruction bus 50, the code is sent to the decoder 44 via the bus 51 and the address (PIO address) of the process input / output device is It is output to the process input / output device 2 via the bus 52. The bus 54 is a bus for exchanging data between the process input / output device 2 and the bit register 45.
次に、本実施例の動作を説明する。命令読出しは、デコ
ーダ44からアドレス更新信号56を出力し、アドレス更新
信号56を受信した命令アドレス発生器43は実行する命令
のアドレスを命令アドレスバス53上に出力する。そうす
ると、命令メモリ1から読出された命令のコード部は、
バス51を介してデコーダ44へ送られ、PIOアドレスはバ
ス52を介してプロセス入出力装置2へ出力される。プロ
セス入出力装置2では、このアドレスと、デコーダ44か
らのリード信号57を受信すると、対応するデータがバス
54上に読出され、このデータは、デコーダ44からのラツ
チ信号59によつてビツトレジスタ45にセツトされる。Next, the operation of this embodiment will be described. For instruction reading, the address update signal 56 is output from the decoder 44, and the instruction address generator 43 receiving the address update signal 56 outputs the address of the instruction to be executed onto the instruction address bus 53. Then, the code part of the instruction read from the instruction memory 1 becomes
The PIO address is sent to the decoder 44 via the bus 51, and the PIO address is output to the process input / output device 2 via the bus 52. When the process input / output device 2 receives this address and the read signal 57 from the decoder 44, the corresponding data is transferred to the bus.
Read out on 54, this data is set in bit register 45 by latch signal 59 from decoder 44.
プロセス入出力装置2へのデータ書き込みは、デコーダ
44からゲートオン信号60を出力することによりゲート46
をオンとして、バス54上にデータを出力し、その後デコ
ーダ44からライト信号58を出力してバス54上のデータを
プロセス入出力装置2へ書き込むことにより実行する。Data is written to the process input / output device 2 by a decoder.
By outputting the gate-on signal 60 from 44, the gate 46
Is turned on to output data on the bus 54, and then the decoder 44 outputs a write signal 58 to write the data on the bus 54 to the process input / output device 2 for execution.
以上が、本実施例の動作であるが、これらによつて実行
される基本的シーケンス処理は、第3図に示したよう
に、命令及びビツトレジスタ45の内容の違いによつて、
(イ),(ロ),(ハ)の3種類の内のどれかである。
即ち、(イ)命令を読出し、そのPIOアドレスに従つて
プロセス入出力装置からデータを読出してビツトレジス
タDrへセツトする、(ロ)命令読出しのみを行う、
(ハ)命令を読出し、そのPIOアドレスに従つてビツト
レジスタDrの内容をプロセス入出力装置へ書き込む、の
いずれかである。The above is the operation of the present embodiment. The basic sequence processing executed by them is as follows, as shown in FIG. 3, because of the difference in the instruction and the contents of the bit register 45.
It is one of the three types of (a), (b), and (c).
That is, (a) the instruction is read, the data is read from the process input / output device according to the PIO address, and the data is set to the bit register D r . (B) Only the instruction is read.
(C) Either read the instruction and write the contents of the bit register D r to the process input / output device according to the PIO address.
これらの基本的シーケンス処理による処理方法を、従来
例で用いた第10図〜第13図の場合によりまず説明する。
第10図の命令I1は読出し命令(LD)であるので、ビツト
レジスタDrの値に関係なく第3図の処理(イ)が実行さ
れる。これは第11図(b)のステツプ1101,1102であ
る。次の命令I2はアンド命令であるから、ビツトレジス
タ45の値Drによつて処理が異なる。即ち、Dr=0のとき
は(これは、ビツトレジスタ45の値Drがバス55を介して
デコーダ44へ与えられているので、命令を読出したとき
にすぐ判定できる)、第3図の(ロ)の処理、つまり命
令読出しだけで終わる処理となり、Dr=1のときは第3
図(イ)の処理を実行する。これは第11図(b)のステ
ツプ1110,1105であり、これによつてアンド処理の答え
がビツトレジスタ45にセツトされる。第10図最後の命令
I3は書き込み(ST)であるから、第3図(ハ)の処理、
つまり第11図(b)のステツプ1107,1109が実行され、
アドレスPIO3へアンド処理の答えが書き込まれる。A processing method based on these basic sequence processing will be first described with reference to FIGS. 10 to 13 used in the conventional example.
Since instruction I1 in FIG. 10 is a read command (LD), the processing of FIG. 3, regardless of the value of bit registers D r (it) is performed. This is steps 1101 and 1102 in FIG. 11 (b). Since the next instruction I2 is an AND instruction, the processing differs depending on the value D r of the bit register 45. That is, when D r = 0 (this can be determined immediately when the instruction is read because the value D r of the bit register 45 is given to the decoder 44 via the bus 55). The process of (b), that is, the process that ends only by reading the instruction, is the third when D r = 1.
The processing of FIG. This is steps 1110 and 1105 in FIG. 11 (b), whereby the answer of the AND processing is set in the bit register 45. Fig. 10 Last instruction
Since I3 is writing (ST), the processing of FIG.
That is, steps 1107 and 1109 of FIG. 11 (b) are executed,
The AND processing answer is written to the address PIO3.
第11図(b)と同(a)を比べれば明らかなように、従
来方法のとき9ステツプで処理されたアンド演算が、本
実施例では5又は6ステツプで処理でき、このステツプ
数の減少分だけ処理が高速化できる。As is apparent from comparison between FIG. 11 (b) and FIG. 11 (a), the AND operation processed in 9 steps in the conventional method can be processed in 5 or 6 steps in this embodiment, and the number of steps is reduced. The processing can be speeded up by the amount.
第12図のオア処理の場合も、第3図を適用すると第13図
(b)のフローで処理されることが容易にわかり、アン
ド処理のときと同じく高速化できる。Also in the case of the OR processing in FIG. 12, it is easily understood that the processing in FIG. 13 (b) is processed by applying FIG. 3, and the speed can be increased as in the case of the AND processing.
第4図はアンド、オアの双方を含むシーケンスの例であ
つて、いまプロセス入出力装置2の各アドレスの値が次
のとおりとする: (PIO11)=1 (PIO12)=(PIO13)=0 第1図,第3図で示した実施例によりこのシーケンス処
理を行うと以下のようになる。まず、命令I11は読出し
命令であるから、第3図(イ)の処理となり、ビツトレ
ジスタ45にはアドレスPIO11の値“1"が記憶される(第
5図ステツプ501,502)。次の命令I12はオア命令であ
り、このときビツトレジスタ45の内容は“1"であるか
ら、第3図(ロ)の処理(ステツプ503)となり、次の
命令に進む。命令I13はアンド命令であり、このときビ
ツトレジスタの内容は1であるから、第3図(イ)の処
理となり、ビツトレジスタ45にはアドレスPIO13の値
“0"が記憶される(ステツプ504,505)。命令I14は書き
込み命令であるから、第3図(ハ)の処理となり、ビツ
トレジスタ45の内容“0"がアドレスPIO14に書き込まれ
る(ステツプ506,507)。以上の処理によつて、(PIO1
4)=((PIO11)+(PIO12))・(PIO13) なる演算結果が第5図の7ステツプで得られる。これは
従来方法の4つの命令で12ステツプ要するのに比べて、
大幅に高速化されていることを示している。FIG. 4 is an example of a sequence including both AND and OR, and the value of each address of the process input / output device 2 is as follows: (PIO11) = 1 (PIO12) = (PIO13) = 0 When this sequence processing is carried out by the embodiment shown in FIGS. 1 and 3, it becomes as follows. First, since the instruction I11 is a read instruction, the processing shown in FIG. 3A is performed, and the value "1" of the address PIO11 is stored in the bit register 45 (steps 501 and 502 in FIG. 5). The next instruction I12 is an OR instruction, and since the content of the bit register 45 is "1" at this time, the processing (step 503) of FIG. 3B is performed, and the processing proceeds to the next instruction. The instruction I13 is an AND instruction, and the content of the bit register at this time is 1. Therefore, the processing is as shown in FIG. 3A, and the value "0" of the address PIO13 is stored in the bit register 45 (steps 504, 505). . Since the instruction I14 is a write instruction, the processing shown in FIG. 3C is performed, and the content "0" of the bit register 45 is written to the address PIO14 (steps 506 and 507). By the above processing, (PIO1
4) = ((PIO11) + (PIO12)). (PIO13) The calculation result is obtained in 7 steps of FIG. This is 12 steps with 4 instructions in the conventional method.
It shows that it is significantly faster.
第6図は、本発明の別の実施例を示したものであり、シ
ーケンスコントローラ3は、アドレスレジスタ10,命令
レジスタ11,デコーダー12,マイクロプログラムアドレス
発生器13,マイクロプログラムメモリ14,制御器15,命令
アドレス発生器16,ビツトレジスタ17,スタツク18,ゲー
ト19,制御信号21〜30などより成る。FIG. 6 shows another embodiment of the present invention. The sequence controller 3 includes an address register 10, an instruction register 11, a decoder 12, a micro program address generator 13, a micro program memory 14, and a controller 15. An instruction address generator 16, a bit register 17, a stack 18, a gate 19, and control signals 21 to 30.
命令レジスタ11は、命令メモリ1から読出した命令を記
憶するものであり、記憶した命令のうち、命令コードを
バス33を介してデコーダ12へ出力し、プロセス入出力装
置アドレスをバス37,アドレスレジスタ10,アドレスバス
4を介してプロセス入出力装置2へ出力する。デコーダ
12は、命令コードとビツトレジスタ17の内容とスタツク
18の内容を解析して実行するマイクロプログラムの先頭
アドレスを決定し、それをマイクロプログラムアドレス
発生器13へ出力する。マイクロプログラムアドレス発生
器13は、アドレスカウンタ機能とジヤンプ先アドレスラ
ツチ機能をあわせもつものであり、バス35上にマイクロ
プログラムアドレスを出力する。マイクロプログラムメ
モリ14は、バス36上にマイクロプログラムを出力し、こ
のマイクロプログラムは制御器15を経て、制御信号21〜
30となり、各装置を制御する。命令アドレス発生器16
は、実行する命令のアドレスを出力するものであり、出
力された命令アドレスは、バス37、アドレスレジスタ1
0、アドレスバス4を介して命令メモリ1へ出力され
る。ビツトレジスタ17は、プロセス入出力装置2から読
出したデータを記憶するものであり、ゲート19は、ビツ
トレジスタ17の内容をプロセス入出力装置2へ出力する
ものである。スタツク18は、ビツトレジスタ17の内容を
一時退避するためのものである。The instruction register 11 stores the instruction read from the instruction memory 1, outputs the instruction code among the stored instructions to the decoder 12 via the bus 33, and outputs the process input / output device address to the bus 37, the address register. 10, output to the process input / output device 2 via the address bus 4. decoder
12 is the instruction code and the contents and stack of the bit register 17.
The contents of 18 are analyzed to determine the start address of the microprogram to be executed, and it is output to the microprogram address generator 13. The micro program address generator 13 has both an address counter function and a jump destination address latch function, and outputs a micro program address onto the bus 35. The micro program memory 14 outputs a micro program on the bus 36, and the micro program goes through the controller 15 and the control signals 21 to 21.
30 and control each device. Instruction address generator 16
Outputs the address of the instruction to be executed, and the output instruction address is the bus 37, address register 1
0, output to the instruction memory 1 via the address bus 4. The bit register 17 stores the data read from the process input / output device 2, and the gate 19 outputs the contents of the bit register 17 to the process input / output device 2. The stack 18 is for temporarily saving the contents of the bit register 17.
第7図は、本実施例における基本的シーケンス処理を示
すもので、(ニ)〜(リ)の6種類のどれかが実行され
る。これらは(ニ)命令読出し、ビツトレジスタの内容
Drをスタツク18(Sr)へ転送、プロセス入出力装置から
ビツトレジスタへの読出し、(ホ)命令読出し、プロセ
ス入出力装置からビツトレジスタへの読出し、(へ)命
令読出しのみ、(ト)命令読出し、ビツトレジスタへ1
をセツト、(チ)命令読出し、ビツトレジスタへ0をセ
ツト、(リ)命令読出し、ビツトレジスタの内容Drをプ
ロセス入出力装置へ書き込み、の6種類で、どれになる
かは命令の種類、ビツトレジスタの内容Dr、スタツクの
内容Srにより決まる。ビツトレジスタ17の内容Drが信号
31として、またスタツク18の内容Srが信号37として、命
令レジスタ内のコードが信号33としてデコーダ12に与え
られるので、デコーダ12は、読出された命令が命令レジ
スタ11へセツトされたステツプ時に上記のどれを実行す
るかの判定を行うことができる。FIG. 7 shows the basic sequence processing in this embodiment, and any one of the six types (d) to (d) is executed. These are (d) instruction read, bit register contents
Transfer D r to stack 18 (S r ), read from process I / O device to bit register, (e) instruction read, read from process I / O device to bit register, (to) instruction read only, (g) Instruction read, to bit register 1
The excisional, (h) instruction read, excisional 0 to bit register, (re) instruction read, write to the process input and output device contents D r of bit registers, 6 kinds, which in Become types of instructions, the contents of the bit register D r, determined by the contents of S r of Sutatsuku. Contents of bit register 17 D r is signal
31 and the contents S r of the stack 18 as a signal 37 and the code in the instruction register is provided as a signal 33 to the decoder 12, so that the decoder 12 will be at the step when the read instruction is set into the instruction register 11. It can be determined which of these is to be executed.
この実施例の動作を第8図のシーケンスを例にして説明
する。同図において、 (PIO21)=0 (PIO22)=1 (PIO23)=0 (PIO24)=(PIO25)=(PIO27)=1 とする。命令I21は読出し命令(LD)であるから、第7
図(ニ)の処理となり、ビツトレジスタ17には(PIO2
1)=0がセツトされる(第9図ステツプ901〜903)。
但しこのとき、スタツク18の内容Srは不定である。しか
しスタツク18の内容Srの違いによつて処理が異なるのは
後述のオアスペシヤルとアンドスペシヤルの場合のみで
あり、この2つの命令はシーケンス処理の構成上読出し
命令が2回以上実行された後にしか出現しない。読出し
命令を2回以上実行すればスタツク18の内容Srが必ず確
定するため何ら問題は生じない。さて次の命令I22はア
ンド命令であり、このときビツトレジスタ17の内容はDr
であるから、(ヘ)の処理のみとなり(ステツプ90
4)、次の命令I23に進む。この命令は読出し命令である
から(ニ)の処理となり、スタツク18にはビツトレジス
タ17の内容0が退避され、その後ビツトレジスタ17には
(PIO23)=0がセツトされる(ステツプ905〜907)。
命令I24はオア命令であり、このときビツトレジスタ17
の内容Dr=0であるから、(ホ)の処理となり、ビツト
レジスタ17には(PIO24)=1がセツトされる(ステツ
プ908,ステツプ909)。命令I25はアンド命令であり、こ
のときビツトレジスタ17の内容Dr=1であるから、再び
(ホ)の処理となり、ビツトレジスタ17には(PIO25)
=1がセツトされる(ステツプ910,911)。命令I26はオ
アスペシヤルである。この命令はスタツクの内容Srとビ
ツトレジスタの内容Drとのオアを算出してDrにその結果
をセツトするもので、今の場合Dr=1、Sr=0であるか
ら、(ヘ)の処理となり(ステツプ912)、次の命令に
進む。命令I27はアンド命令であり、このときビツトレ
ジスタ17の内容Dr=1であるから、(ホ)の処理とな
り、ビツトレジスタ17には(PIO27)=1がセツトされ
る(ステツプ913,914)。命令I28は書き込み命令である
から、(リ)の処理となり、ビツトレジスタ17の内容Dr
=1がアドレスPIO28に書き込まれる(ステツプ915,91
6)。以上の処理をまとめると下記演算を実行したのと
同じ結果となる。The operation of this embodiment will be described by taking the sequence of FIG. 8 as an example. In the figure, (PIO21) = 0 (PIO22) = 1 (PIO23) = 0 (PIO24) = (PIO25) = (PIO27) = 1. Since the instruction I21 is a read instruction (LD), the seventh
The process shown in Fig. (D) is performed, and the bit register 17 (PIO2
1) = 0 is set (steps 901 to 903 in FIG. 9).
However, at this time, the contents S r of the stack 18 are indefinite. However, the processing differs depending on the contents S r of the stack 18 only in the case of the later special and the later special, and these two instructions are after the read instruction is executed twice or more due to the configuration of the sequence processing. Only appears. If the read command is executed more than once, the content S r of the stack 18 is definitely determined and no problem occurs. Now, the next instruction I22 is an AND instruction, and at this time, the content of the bit register 17 is D r
Therefore, only (f) processing is required (step 90
4) Go to the next instruction I23. Since this instruction is a read instruction, the processing becomes (d), the contents 0 of the bit register 17 is saved in the stack 18, and then (PIO23) = 0 is set in the bit register 17 (steps 905 to 907). .
Instruction I24 is an OR instruction, and at this time, bit register 17
Since the content D r of 0 is 0, the processing of (e) is performed, and (PIO24) = 1 is set in the bit register 17 (steps 908 and 909). The instruction I25 is an AND instruction, and at this time, the content D r of the bit register 17 is 1, so the processing in (e) is performed again, and the bit register 17 has (PIO25).
= 1 is set (steps 910 and 911). Order I26 is or special. Since this instruction is intended to excisional the result to the contents S r and bit register contents D by calculating the OR of the r D r of Sutatsuku a D r = 1, S r = 0 in this case, ( The process of (f) is performed (step 912) and the process proceeds to the next command. Since instruction I27 is and instruction, a content D r = 1 in this case bit register 17 becomes a process of (e), the bit register 17 (PIO27) = 1 is excisional (step 913 and 914). Since the instruction I28 is a write instruction, it is the processing of (i), and the contents of the bit register 17 D r
= 1 is written to address PIO28 (steps 915,91
6). When the above processes are summarized, the same result as when the following calculation is executed is obtained.
(PIO28)=((PIO21)・(PIO22)+((PIO23) +(PIO24))・(PIO25))・PIO27 この例の場合、従来方法では8個の命令I21〜I28に各3
ステツプ必要で合計24ステツプを要したが、本実施例で
は第9図に示したとおり16ステツプで処理が終わり、高
速化されている。(PIO28) = ((PIO21)-(PIO22) + ((PIO23) + (PIO24))-(PIO25))-PIO27 In this example, the conventional method uses 8 instructions I21 to I28, each with 3
A total of 24 steps are required because of the need of steps, but in the present embodiment, the processing is completed in 16 steps as shown in FIG. 9, and the processing speed is increased.
なお上記第8図のシーケンスでは、アンドスペシヤルは
用いていないが、この命令もオアスペシヤルと同様で、
スタツク18へ退避した値Srと、ビツトレジスタ17の値Dr
とのアンドをとるもので、先に求めた演算結果をスタツ
クへ退避することによつて、そのデータ転送等の高速化
をはかるためのものである。In the sequence shown in FIG. 8 above, the AND-SPECIAL is not used, but this instruction is the same as the OR-SPECIAL.
The value S r saved to the stack 18 and the value D r of the bit register 17
This is for the purpose of speeding up the data transfer, etc. by saving the previously obtained calculation result in the stack.
また、本実施例では、シーケンス処理をマイクロプログ
ラムで実行する構成としているが、シーケンス処理をハ
ードウエアで実行した場合においても本発明の動作原理
は同じであり、同様の効果であることは明白である。さ
らに、以上説明した2つの実施例は、1ビツトのシーケ
ンス演算を実行するシーケンスコントローラの例を示し
ているが、1ビツトのシーケンス演算機能とワード演算
機能を合わせもつシーケンスコントローラで実行した場
合においても、本発明の動作原理は同じであり、同様の
効果であることは明白である。Further, in the present embodiment, the sequence processing is configured to be executed by the microprogram, but the operation principle of the present invention is the same even when the sequence processing is executed by hardware, and it is obvious that the same effect is obtained. is there. Further, although the two embodiments described above show examples of the sequence controller that executes the 1-bit sequence operation, even when the sequence controller having both the 1-bit sequence operation function and the word operation function is executed. It is clear that the operating principle of the present invention is the same and the same effect is obtained.
本発明によれば、論理演算を不要とするとともに、条件
によつてはプロセス入出力装置のデータ読出しを不要と
することができるので、シーケンス処理を高速化できる
という効果がある。According to the present invention, it is possible to eliminate the need for a logical operation and the need to read out data from the process input / output device depending on the conditions. Therefore, the sequence processing can be speeded up.
第1図は本発明の一実施例の構成図、第2図は命令のフ
オーマツトを示す図、第3図は第1図の実施例における
基本的シーケンス処理を示す図、第4図はシーケンス処
理の例を示す図、第5図は第4図のシーケンスを第1図
の実施例により処理するときの処理フロー図、第6図は
本発明の別の実施例を示す構成図、第7図は第6図の実
施例における基本的シーケンス処理を示す図、第8図は
シーケンス処理の例を示す図、第9図は第8図のシーケ
ンスを第6図の実施例により処理するときの処理フロー
図、第10図及び第11図はアンド演算のシーケンスとその
処理フローを示す図、第12図及び第13図はオア演算のシ
ーケンスとその処理フローを示す図である。 1……命令メモリ、2……プロセス入出力装置、3,42…
…シーケンスコントローラ、12,44……デコーダ、17,45
……ビツトレジスタ、18……スタツク。FIG. 1 is a block diagram of an embodiment of the present invention, FIG. 2 is a diagram showing the format of instructions, FIG. 3 is a diagram showing a basic sequence processing in the embodiment of FIG. 1, and FIG. 4 is a sequence processing. FIG. 5 is a process flow chart when the sequence of FIG. 4 is processed by the embodiment of FIG. 1, FIG. 6 is a configuration diagram showing another embodiment of the present invention, and FIG. Is a diagram showing a basic sequence process in the embodiment of FIG. 6, FIG. 8 is a diagram showing an example of the sequence process, and FIG. 9 is a process when the sequence of FIG. 8 is processed by the embodiment of FIG. Flow charts, FIGS. 10 and 11 are diagrams showing an AND operation sequence and its processing flow, and FIGS. 12 and 13 are diagrams showing an OR operation sequence and its processing flow. 1 ... Instruction memory, 2 ... Process input / output device, 3, 42 ...
… Sequence controller, 12,44 …… Decoder, 17,45
… Bit register, 18… Stack.
Claims (4)
を格納した命令メモリから第1の処理対象データのアド
レスを有したデータ読出し命令を受け取つたときにはプ
ロセス入出力装置の当該アドレスから上記第1の処理対
象データを読出して処理作業用に設けられたレジスタへ
セツトして当該命令の処理を終わり、上記命令メモリか
ら第2の処理対象データのアドレスを有したアンド命令
を受けとりかつ上記レジスタにセツトされている値が0
のとき、あるいは上記命令メモリから第2の処理対象デ
ータのアドレスを有したオア命令を受けとりかつ上記レ
ジスタにセツトされている値が1のときには上記第2の
処理対象データを読出すことなく当該命令の処理を終わ
り、上記命令メモリから第2の処理対象データのアドレ
スを有したアンド命令を受けとりかつ上記レジスタにセ
ツトされている値が1のとき、あるいは上記命令メモリ
から第2の処理対象データのアドレスを有したオア命令
を受けとりかつ上記レジスタにセツトされている値が0
のときには上記第2の処理対象データをプロセス入出力
装置の当該アドレスから読出してこれを上記レジスタへ
セツトして当該命令の処理を終わり、上記命令メモリか
ら書き込みアドレスを有した書き込み命令を受け取つた
ときには上記レジスタの値をプロセス入出力装置の上記
書き込みアドレスへ転送して当該命令の処理を終了する
ようにしたことを特徴とするシーケンス制御の処理方
法。1. When a data read command having an address of a first process target data is received from a command memory storing a command for sequence control of a process, the first process is performed from the address of the process input / output device. The target data is read out and set in a register provided for processing work to finish the processing of the instruction, and the AND instruction having the address of the second processing target data is received from the instruction memory and set in the register. Value is 0
Or when the OR instruction having the address of the second processing target data is received from the instruction memory and the value set in the register is 1, the instruction is not read out without reading the second processing target data. When the AND instruction having the address of the second data to be processed is received from the instruction memory and the value set in the register is 1, or the second data to be processed from the instruction memory is processed. The OR instruction having the address is received and the value set in the above register is 0.
In the case of, the second data to be processed is read from the address of the process input / output device, is set in the register to end the processing of the instruction, and when the write instruction having the write address is received from the instruction memory. A sequence control processing method characterized in that the value of the register is transferred to the write address of the process input / output device to terminate the processing of the instruction.
設けるとともに:前記命令メモリより前記データ読出し
命令を受けとつたときにはまず前記レジスタの値を上記
スタツクへ転送したのちプロセス入出力装置の前記アド
レスから前記第1の処理対象データを読出して前記レジ
スタへセツトして当該命令の処理を終わり、前記命令メ
モリよりスペシヤルアンド命令を受けとつたときには、
上記レジスタの値が1で上記スタツクの値が0のときは
上記レジスタの値を0にセツトしそれ以外のときには何
もしないで当該命令の処理を終わり、前記命令メモリよ
りスペシヤルオア命令を受けとつたときには、上記レジ
スタの値が0で上記スタツクの値が1のときには上記レ
ジスタの値を1にセツトしそれ以外のときには何もしな
いで当該命令の処理を終る;ようにしたことを特徴とす
る、特許請求の範囲第1項記載のシーケンス制御の処理
方法。2. A stack for saving the intermediate processing result is provided: When the data read command is received from the command memory, the value of the register is first transferred to the stack and then the address of the process input / output device is set. When the first and second data to be processed are read from the above, are set in the register to finish the processing of the instruction, and when the special and instruction is received from the instruction memory,
When the value of the register is 1 and the value of the stack is 0, the value of the register is set to 0, and otherwise the processing of the instruction is ended and the special or instruction is received from the instruction memory. If the value of the register is 0 and the value of the stack is 1, the value of the register is set to 1, and otherwise the processing of the instruction is terminated without doing anything. A processing method of sequence control according to claim 1.
するための命令を読出す命令読出し手段と、レジスタ
と、該レジスタとプロセス入出力装置との間のデータ転
送を行うデータ転送手段と、制御手段とを備えるととも
に;前記命令メモリから第1の処理対象データのアドレ
スを有したデータ読出し命令を受けとつたときにはプロ
セス入出力装置の当該アドレスから上記第1の処理対象
データを読出して上記レジスタへセツトして当該命令の
処理を終わり、上記命令メモリから第2の処理対象デー
タのアドレスを有したアンド命令を受けとりかつ上記レ
ジスタにセツトされている値が0のとき、あるいは上記
命令メモリから第2の処理対象データのアドレスを有し
たオア命令を受けとりかつ上記レジスタにセツトされて
いる値が1のときには上記第2の処理対象データを読出
すことなく当該命令の処理を終わり、上記命令メモリか
ら第2の処理対象データのアドレスを有したアンド命令
を受けとりかつ上記レジスタにセツトされている値が1
のとき、あるいは上記命令メモリから第2の処理対象デ
ータのアドレスを有したオア命令を受けとりかつ上記レ
ジスタにセツトされている値が0のときには上記第2の
処理対象データをプロセス入出力装置の当該アドレスか
ら上記データ転送手段により読出させてこれを上記レジ
スタへセツトして当該命令の処理を終わり、上記命令メ
モリから書き込みアドレスを有した書き込み命令を受け
取つたときには上記レジスタの値をプロセス入出力装置
の上記書き込みアドレスへ上記データ転送手段により転
送させて当該命令の処理を終了する;機能を上記制御手
段に有せしめたことを特徴とするシーケンス制御の処理
装置。3. Instruction reading means for reading an instruction for sequence control of a process from an instruction memory, a register, a data transfer means for transferring data between the register and a process input / output device, and a control means. When receiving a data read command having the address of the first process target data from the command memory, the first process target data is read from the address of the process input / output device and set in the register. Ends the processing of the instruction, receives the AND instruction having the address of the second data to be processed from the instruction memory and the value set in the register is 0, or the second processing from the instruction memory. When the OR instruction with the address of the target data is received and the value set in the above register is 1. The second processing target data end the processing of the instruction without reading the value that is excisional the second processing target and instructions are received and the register having the address of the data from the instruction memory 1
Or when the OR instruction having the address of the second data to be processed is received from the instruction memory and the value set in the register is 0, the second data to be processed is stored in the process input / output device. The value of the register is read from the address by the data transfer means, set in the register to finish the processing of the instruction, and when the write instruction having the write address is received from the instruction memory, the value of the register is stored in the process input / output device. A sequence control processing device characterized in that the data transfer means transfers the instruction to the write address to end the processing of the instruction; the control means has a function.
設けるとともに:前記命令メモリより前記データ読出し
命令を受けとつたときにはまず前記レジスタの値を上記
スタツクへ転送したのちプロセス入出力装置の前記アド
レスから前記第1の処理対象データを読出して前記レジ
スタへセツトして当該命令の処理を終わり、前記命令メ
モリよりスペシヤルアンド命令を受けとつたときには、
上記レジスタの値が1で上記スタツクの値が0のときは
上記レジスタの値を0にセツトしそれ以外のときには何
もしないで当該命令の処理を終わり、前記命令メモリよ
りスペシヤルオア命令を受けとつたときには、上記レジ
スタの値が0で上記スタツクの値が1のときは上記レジ
スタの値を1にセツトしそれ以外のときには何もしない
で当該命令の処理を終る;機能を前記制御手段に有せし
めたことを特徴とする、特許請求の範囲第3項記載のシ
ーケンス制御の処理装置。4. A stack for saving the intermediate processing result is provided: When the data read command is received from the command memory, the value of the register is first transferred to the stack and then the address of the process input / output device is set. When the first and second data to be processed are read from the above, are set in the register to finish the processing of the instruction, and when the special and instruction is received from the instruction memory,
When the value of the register is 1 and the value of the stack is 0, the value of the register is set to 0, and otherwise the processing of the instruction is ended and the special or instruction is received from the instruction memory. When the value of the register is 0 and the value of the stack is 1, the value of the register is set to 1, and otherwise the processing of the instruction is terminated; the control means has the function. The sequence control processing device according to claim 3, wherein the processing device is a sequence control device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP62141490A JPH07120167B2 (en) | 1987-06-08 | 1987-06-08 | Processing method and processing device for sequence control |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP62141490A JPH07120167B2 (en) | 1987-06-08 | 1987-06-08 | Processing method and processing device for sequence control |
Publications (2)
Publication Number | Publication Date |
---|---|
JPS63305405A JPS63305405A (en) | 1988-12-13 |
JPH07120167B2 true JPH07120167B2 (en) | 1995-12-20 |
Family
ID=15293128
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP62141490A Expired - Lifetime JPH07120167B2 (en) | 1987-06-08 | 1987-06-08 | Processing method and processing device for sequence control |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH07120167B2 (en) |
-
1987
- 1987-06-08 JP JP62141490A patent/JPH07120167B2/en not_active Expired - Lifetime
Also Published As
Publication number | Publication date |
---|---|
JPS63305405A (en) | 1988-12-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JPS6239780B2 (en) | ||
JPH0248931B2 (en) | ||
JPH0414385B2 (en) | ||
JPS623461B2 (en) | ||
JPS6212529B2 (en) | ||
EP0240606A2 (en) | Pipe-line processing system and microprocessor using the system | |
JPS5851327A (en) | input/output control system | |
JPH07120167B2 (en) | Processing method and processing device for sequence control | |
JP2731047B2 (en) | Program operand check method | |
JP3695078B2 (en) | Programmable controller with pulse output instructions | |
JP3130798B2 (en) | Bus transfer device | |
JP2000029508A (en) | Programmable controller | |
JP2883489B2 (en) | Instruction processing unit | |
JPH0233173B2 (en) | ||
JPS62147545A (en) | Transfer command processing method in information processing equipment | |
JPH0588893A (en) | Parallel operation processor | |
JPS6238748B2 (en) | ||
JPH01140351A (en) | Data processor | |
JPH0675789A (en) | Information processor | |
JPH06295252A (en) | calculator | |
JPH0738157B2 (en) | Register selection method | |
JPH08328852A (en) | Programmable controller and its register initialization method | |
JPH0282318A (en) | floating point arithmetic unit | |
JPS61188635A (en) | Microcomputer | |
JPH04245333A (en) | information processing equipment |