JPH036706A - Sequence controller - Google Patents

Sequence controller

Info

Publication number
JPH036706A
JPH036706A JP14264889A JP14264889A JPH036706A JP H036706 A JPH036706 A JP H036706A JP 14264889 A JP14264889 A JP 14264889A JP 14264889 A JP14264889 A JP 14264889A JP H036706 A JPH036706 A JP H036706A
Authority
JP
Japan
Prior art keywords
sequence
instruction
execution
program
data
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
JP14264889A
Other languages
Japanese (ja)
Inventor
Yoshiaki Sekiya
関谷 良明
Shigeru Hishinuma
菱沼 繁
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.)
Hitachi Seiki Co Ltd
Original Assignee
Hitachi Seiki 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 Hitachi Seiki Co Ltd filed Critical Hitachi Seiki Co Ltd
Priority to JP14264889A priority Critical patent/JPH036706A/en
Publication of JPH036706A publication Critical patent/JPH036706A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To shorten the processing time of a sequence program by outputting an interruption request signal to an interruption controller only when an execution signal is produced from a sequence arithmetic logic circuit. CONSTITUTION:A function instruction execution flag ACT is added to the data (sequence instruction) of a sequence program 4. Then a sequence arithmetic logic circuit 7 produces an execution signal if the flag ACT is equal to '1' when reading the sequence instruction. While no execution signal is produced if the flag ACT is equal to '0'. Then an AND gate 15 outputs an interruption request signal produced by an instruction decoder 6 to an interruption controller 10 only when the execution signal is produced. Thus it is possible to carry on a normal sequence process without starting an interruption routine with a function instruction which requires no execution. As a result, the processing time is shortened for the program 4.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はシーケンスコントローラに係り、特ニ汎用のマ
イクロプロセッサ(以下MPUと称す)を使用してシー
ケンスプログラムの処理時間を短縮し、実効的な処理速
度の向上を図ることのできるシーケンスコントローラに
関するものである。
[Detailed Description of the Invention] [Industrial Application Field] The present invention relates to a sequence controller, which uses a special general-purpose microprocessor (hereinafter referred to as MPU) to shorten the processing time of a sequence program and realize effective The present invention relates to a sequence controller that can improve processing speed.

〔従来の技術] シーケンスコントローラは予め定められた条件、順序に
従って逐次進めていく制御装置であるが、特に数値制御
工作機械等の制御目的に応じた制御機能を充分に発揮す
るコントローラが必要とされる。
[Prior Art] A sequence controller is a control device that sequentially advances operations according to predetermined conditions and sequences, but in particular, a controller that fully demonstrates the control function according to the control purpose of numerically controlled machine tools, etc. is required. Ru.

特に、シーケンスコントローラは、MPUにおいてバイ
ト、あるいはワード単位の演算を行い、そのMPUの指
示によりシーケンス論理演算回路においてビット単位の
論理演算を行う構成となっている。このために、シーケ
ンスコントローラはビット単位の論理演算をするのにシ
ーケンスプログラムにおいて複数バイト、あるいは複数
ワードの容量が必要となり、メモリ効率が悪くなってシ
ーケンスプログラムの処理時間がかかってしまうという
問題があった。
In particular, the sequence controller is configured such that an MPU performs a byte-based or word-based operation, and a sequence logic operation circuit performs a bit-based logical operation based on instructions from the MPU. For this reason, the sequence controller requires a capacity of multiple bytes or multiple words in the sequence program to perform bit-wise logical operations, resulting in a problem of poor memory efficiency and increased processing time for the sequence program. Ta.

ところで、シーケンスプログラムのデータ(シーケンス
命令)には、基本命令(第8図(a)参照)と機能命令
(第8図(b)参照)とがあり、基本命令はシーケンス
プログラムを作成する上で最も多く使用される命令で、
ニーモニックrAND(データ読み込み)」や「OR(
論理和)j等の1ビツトの論理演算を行う命令である。
By the way, sequence program data (sequence instructions) includes basic instructions (see Figure 8 (a)) and functional instructions (see Figure 8 (b)), and basic instructions are used when creating a sequence program. The most frequently used command is
Mnemonic rAND (data reading)” and “OR(
This is an instruction that performs a 1-bit logical operation such as OR) j.

また、機能命令は、NC工作機械専用に準備された「M
OV(データの転送機能)」やrJMP (ジャンプ機
能)」等のバイト、あるいはワード単位の論理演算を行
う命令で、基本命令だけでは困難なシーケンスプログラ
ムを容易にすることのできる命令である。
In addition, the function commands are prepared exclusively for NC machine tools.
These instructions perform logical operations in byte or word units, such as OV (data transfer function) and rJMP (jump function), and can facilitate sequence programs that are difficult to perform using basic instructions alone.

そして、シーケンス命令が機能命令である場合は、シー
ケンス処理を一時中断する割り込み処理を行い、MPU
においてその機能命令を実行してから、再び、シーケン
ス処理に戻っていた。すなわち、MPU50 (第9図
参照)が指示するアドレスのシーケンスプログラム51
のデータを命令デコーダ52に出力し、この命令デコー
ダ52は読み込んだデータが基本命令か、あるいは機能
命令かを解読する。そして、そのデータが基本命令であ
る場合はシーケンスプログラム51のデータとシーケン
ス論理演算回路53を組み合わせてシーケンス処理を行
い、そのデータが機能命令である場合は命令デコーダ5
2が割り込み要求信号を割り込みコントローラ54に出
力して、割り込みコントローラ54を介してMPU50
に割り込みをかける。すると、MPU50は直ちに割り
込み処理ルーチンに入り、プログラムカウンタ、各種レ
ジスタ内容の待避等の割り込み処理ルーチンを実行し、
しかる後、該当するシーケンスプログラム51のデータ
を再度読み取って、そのデータの実行フラグの状態を見
て、フラグが「1」であれば、機能命令を実行し、フラ
グが「0」であれば、機能命令を実行しないようにして
いる。機能命令の処理が終了すれば、割り込みルーチン
から通常のルーチンにリターンする。
If the sequence instruction is a functional instruction, interrupt processing is performed to temporarily interrupt the sequence processing, and the MPU
After executing that functional command, the process returns to sequence processing. That is, the sequence program 51 of the address specified by the MPU 50 (see FIG. 9)
The data is output to an instruction decoder 52, and the instruction decoder 52 decodes whether the read data is a basic instruction or a functional instruction. If the data is a basic instruction, sequence processing is performed by combining the data of the sequence program 51 and the sequence logic operation circuit 53, and if the data is a functional instruction, the instruction decoder 5
2 outputs an interrupt request signal to the interrupt controller 54 and sends it to the MPU 50 via the interrupt controller 54.
interrupt. Then, the MPU 50 immediately enters the interrupt processing routine, executes the interrupt processing routine such as saving the contents of the program counter and various registers,
After that, the data of the corresponding sequence program 51 is read again and the state of the execution flag of the data is checked. If the flag is "1", the function instruction is executed, and if the flag is "0", Prevents functional instructions from being executed. When the processing of the functional instruction is completed, the interrupt routine returns to the normal routine.

〔発明が解決しようとしている課題] しかし、従来のシーケンスコントローラは、シーケンス
プログラムに機能命令が存在すると、旦割り込みルーチ
ン(シーケンス処理の中断)を実行してから、該当する
機能命令が実行を必要とするのか、あるいは実行を必要
としないのかを判断していたために、その機能命令が実
行を必要としない場合は割り込みルーチンを実行した分
だけ、シーケンスプログラムの処理時間が長くなってし
まうという問題があった。
[Problems to be Solved by the Invention] However, in conventional sequence controllers, when a functional instruction exists in a sequence program, it first executes an interrupt routine (suspension of sequence processing) and then executes the interrupt routine when the corresponding functional instruction requires execution. If the function instruction does not require execution, the processing time of the sequence program increases by the amount of time required to execute the interrupt routine. Ta.

以上から本発明の目的は、実行を必要としない機能命令
の場合は割り込みルーチンに入らずに通常のシーケンス
処理を続けることができ、シーケンスプログラムの処理
時間を短くすることができるシーケンスコントローラを
提供することである。
From the above, an object of the present invention is to provide a sequence controller that can continue normal sequence processing without entering an interrupt routine in the case of a functional instruction that does not require execution, and can shorten the processing time of a sequence program. That's true.

〔課題を解決するための手段〕[Means to solve the problem]

前記課題を解決するために、本発明のシーケンスコント
ローラは、機能命令の実行を要するシーケンスプログラ
ム4(第1図参照)のデータには機能命令実行フラグA
CTrl、を設け、機能命令の実行を要しないデータに
は機能命令実行フラグACTrO,を設けておき、機能
命令実行フラグACTが「1」の場合は実行信号を発生
し、機能命令実行フラグACTが「0」の場合は実行信
号を発生しない手段を有するシーケンス論理演算回路7
と、前記実行信号が発生している場合だけ、命令デコー
ド6が発生する割り込み要求信号を割り込みコントロー
ラ10に出力する論理積ゲート15とから構成される。
In order to solve the above problem, the sequence controller of the present invention sets a functional command execution flag A to data of a sequence program 4 (see FIG. 1) that requires the execution of a functional command.
CTrl is provided, and a functional instruction execution flag ACTrO is provided for data that does not require the execution of a functional instruction, and when the functional instruction execution flag ACT is "1", an execution signal is generated, and the functional instruction execution flag ACT is Sequence logic operation circuit 7 having means for not generating an execution signal in the case of “0”
and an AND gate 15 that outputs an interrupt request signal generated by the instruction decode 6 to the interrupt controller 10 only when the execution signal is generated.

〔作用〕[Effect]

シーケンスプログラム4のデータを命令デコード6にて
解読し、解読の結果、機能命令である場合は、シーケン
ス論理演算回路7より該当するデータの機能命令実行フ
ラグACTの信号に送出させ、論理積ゲー)15におい
て該当するデータのデコード結果と機能命令実行フラグ
ACTの信号との論理積ANDをとる。その結果が真で
あれば、割り込みコントローラ10に割り込み要求信号
を出力する。一方、上述の論理積ANDの結果が偽であ
る場合は割り込み要求信号を出力しない。
The data of the sequence program 4 is decoded by the instruction decode 6, and if the result of decoding is a functional command, the sequence logic operation circuit 7 sends out the signal of the functional command execution flag ACT of the corresponding data, and the logical product game) At step 15, the logical AND of the decoding result of the corresponding data and the signal of the functional instruction execution flag ACT is performed. If the result is true, an interrupt request signal is output to the interrupt controller 10. On the other hand, if the result of the above-mentioned logical product AND is false, no interrupt request signal is output.

〔実施例] 以下、本発明の実施例を図面に基づいて詳細に説明する
[Example] Hereinafter, an example of the present invention will be described in detail based on the drawings.

図は本発明のシーケンスコントローラの主要部を示すブ
ロック線図である。
The figure is a block diagram showing the main parts of the sequence controller of the present invention.

第1図において、1は汎用マイクロプロセッサ(以下M
PUと称す)、2は接点命令や機能命令の処理および割
り込みを処理する際のプログラムやインストラクション
を処理するプログラムを記憶するメインプログラム、3
は実行時間が最小となる命令コード(例えば、NOP命
令)を生成するNOPコード生成回路、4はデータエリ
アとしてのシーケンスプログラム、5はMPUIが出力
するアドレスをメインプログラム2あるいはシーケンス
プログラム4に分配するアドレスデコーダ、6はシーケ
ンスプログラム4から出力されるシーケンス命令が基本
命令か、あるいは機能命令かを解読する命令デコーダ、
7は1ビツトの論理演算を行うシーケンス論理演算回路
、8は人力部、9は出力部、10は演算等の割り込みコ
ントローラ、11はバッファ、12はデータトランスミ
ッタ、13は16ビツトのアドレスバス、14はMPU
1が出力するリード信号、15は割り込み要求信号を発
生する際の論理積ゲート、16は8ビツトのデータバス
、17はシーケンスプログラム用の16ビツトのデータ
ライン、C8oはメインプログラム2を選択するための
セレクト信号、C31はシーケンスプログラム4を選択
するためのセレクト信号、18は4ビツトのシーケンス
命令コードライン、19は入出力アドレスラインでビッ
トデータラインも含んでいる。5CLKはシーケンスク
ロックライン、20は演算処理等の割り込み信号ライン
、21はMPUに対する割り込み要求信号、22はシー
ケンスクロック5CLKを発生する際の論理積ゲートで
ある。
In Figure 1, 1 is a general-purpose microprocessor (hereinafter referred to as M
(referred to as PU), 2 is a main program that stores programs for processing contact commands, functional commands, and interrupts, and a program for processing instructions;
4 is a sequence program as a data area; 5 is a NOP code generation circuit that generates an instruction code (for example, a NOP instruction) that minimizes the execution time; 5 is a circuit that distributes the address output by the MPUI to the main program 2 or sequence program 4. an address decoder 6, an instruction decoder that decodes whether the sequence instruction output from the sequence program 4 is a basic instruction or a functional instruction;
7 is a sequence logic operation circuit that performs a 1-bit logic operation, 8 is a human power section, 9 is an output section, 10 is an interrupt controller for operations, etc., 11 is a buffer, 12 is a data transmitter, 13 is a 16-bit address bus, 14 is MPU
1 is a read signal to output, 15 is an AND gate for generating an interrupt request signal, 16 is an 8-bit data bus, 17 is a 16-bit data line for sequence program, and C8o is for selecting main program 2. C31 is a select signal for selecting sequence program 4, 18 is a 4-bit sequence instruction code line, and 19 is an input/output address line which also includes a bit data line. 5CLK is a sequence clock line, 20 is an interrupt signal line for arithmetic processing, etc., 21 is an interrupt request signal to the MPU, and 22 is an AND gate for generating the sequence clock 5CLK.

なお、機能命令の実行を要するシーケンスプログラム4
のデータ(シーケンス命令)には機能命令実行フラグA
CTrlJを設け、機能命令の実行を要しないシーケン
ス命令には機能命令実行フラグACTrOJを設けてお
く。また、シーケンス論理演算回路7は、シーケンス命
令を読み込む際に、その機能命令実行フラグACTが「
1」の場合は実行信号を発生し、機能命令実行フラグA
CTが「0」の場合は実行信号を発生しない手段を有し
ている。
Note that sequence program 4 that requires the execution of functional commands
The data (sequence command) has a function command execution flag A.
CTrlJ is provided, and a functional instruction execution flag ACTrOJ is provided for sequence instructions that do not require execution of functional instructions. Further, when the sequence logic operation circuit 7 reads a sequence instruction, the function instruction execution flag ACT is set to “
1”, an execution signal is generated and the functional instruction execution flag A
It has means for not generating an execution signal when CT is "0".

第2図はシーケンス用プログラムカウンタ(以下、PC
と称す)により接点命令や機能命令を処理する場合を説
明する流れ図である。以下、第2図の流れ図に沿って本
発明の詳細な説明する。なお、MPUIのメインプログ
ラム2の所定エリアをシーケンスプログラム4を実行す
るだめのエリアとして割り当て、MPUIのPCをシー
ケンスプログラム4のPCとして共有する手段が設けら
れているものとする。また、NOPコード生成回路3は
、MPUIのメインプログラム2に予め決められたシー
ケンスプログラム4を実行するためのエリアをMPUI
がオペコードフェッチする場合や実行を必要としない機
能命令のオペランドデータを読み出した場合に、NOP
命令を生成してデータバス16に送出するものとする。
Figure 2 shows the sequence program counter (hereinafter referred to as PC
12 is a flowchart illustrating a case in which contact commands and function commands are processed by a method called . Hereinafter, the present invention will be explained in detail along the flowchart of FIG. It is assumed that means is provided for allocating a predetermined area of the main program 2 of the MPUI as a reserved area for executing the sequence program 4 and sharing the PC of the MPUI as the PC of the sequence program 4. The NOP code generation circuit 3 also creates an area for executing a predetermined sequence program 4 in the main program 2 of the MPUI.
NOP occurs when fetching an opcode or reading operand data of a functional instruction that does not require execution.
Assume that an instruction is generated and sent to the data bus 16.

動作を開始すると、MPUIのPCにシーケンスプログ
ラム4のPCの初期値、例えば、rmmmmJがセット
される(ステップ1.01)。
When the operation starts, the initial value of the sequence program 4 PC, for example rmmmmJ, is set in the MPUI PC (step 1.01).

MPUIのPCにrmmmmJがセットされると、アド
レスデコーダ5によりアドレスrmmmm」がメインプ
ログラム2とシーケンスプログラム4に分配され、メイ
ンプログラム2に分配されたアドレスの命令部分に、例
えば、 mmmm  NOP のようにNOPコード生成回路3からNOP命令がデー
タバス16を介して送出されるから、MPU1はオペコ
ードフェッチサイクルでNOP命令をリードする。なお
、NOP命令の実行とは処理をしないことであるから、
MPUIはNOP命令の実行と同時に、シーケンスプロ
グラム4のアドレス’mmmmJにあるシーケンス命令
をリードし、そのシーケンス命令に基づいて論理演算処
理を行う(ステップ102)。
When rmmmmJ is set in the MPUI PC, the address decoder 5 distributes the address "rmmmm" to the main program 2 and the sequence program 4, and the command part of the address distributed to the main program 2 is written as, for example, mmmm NOP. Since the NOP instruction is sent from the NOP code generation circuit 3 via the data bus 16, the MPU 1 reads the NOP instruction in the operation code fetch cycle. Note that executing a NOP instruction means not performing any processing, so
At the same time as executing the NOP instruction, the MPUI reads the sequence instruction at address 'mmmmJ of the sequence program 4, and performs logical operation processing based on the sequence instruction (step 102).

アドレスrmmmmJが示す命令が実行がされれば、M
PUIはPCを自動的にインクリメント(+l)する。
If the instruction indicated by address rmmmmJ is executed, M
PUI automatically increments (+l) the PC.

例えば、PCをrmmm(m+1)Jとする(ステップ
103)、PCをインクリメントした後、MPUIはス
テップ102以降の処理を繰り返す。
For example, after setting PC to rmmm(m+1)J (step 103) and incrementing PC, the MPUI repeats the processing from step 102 onwards.

以上のようにMPUがオペコードフェッチする場合に、
最小時間で実行できる命令NOPを実行する時間で、1
ステツプのシーケンス命令を実行できるという高速性を
発揮することができる。
When the MPU fetches the opcode as described above,
The time to execute the instruction NOP that can be executed in the minimum time is 1
It is possible to demonstrate high-speed execution of step sequence commands.

第3図は本発明にかかる割り込み処理を説明する流れ図
である。以下、第3図に従って割り込み処理を説明する
FIG. 3 is a flowchart illustrating interrupt processing according to the present invention. The interrupt processing will be explained below with reference to FIG.

前記の命令デコーダ6において、基本命令か、あるいは
機能命令かどうかを解読する(機能命令かどうか判断す
る、ステップ201)。
The instruction decoder 6 decodes whether the instruction is a basic instruction or a functional instruction (determine whether it is a functional instruction, step 201).

判断の結果、基本命令(第8図〔a))を示していれば
、通常のシーケンス処理を行い、一方、機能命令(第8
図(b))を示していれば、つぎに、機能命令実行フラ
グACTが「1」かどうかを判断する(ステップ202
)。
As a result of the judgment, if the basic command (Fig. 8 [a)] is indicated, normal sequence processing is performed, while the functional command (Fig. 8 [a)]
(b)), then it is determined whether the functional instruction execution flag ACT is "1" (step 202).
).

判断の結果、機能命令実行フラグACTが「0」であれ
ば、通常のシーケンス処理を行い、一方、機能命令実行
フラグACTが「1」であれば、割り込み要求信号を割
り込みコントローラ10に出力する。なお、シーケンス
プログラム4のデータを命令デコード6にて解読し、解
読の結果、機能命令である場合は、シーケンス論理演算
回路7より該当するデータの機能命令実行フラグACT
の信号に送出させ、論理積ゲート15において該当する
データのデコード結果と機能命令実行フラグACTの信
号との論理積ANDをとるものとする。
As a result of the determination, if the functional instruction execution flag ACT is "0", normal sequence processing is performed; on the other hand, if the functional instruction execution flag ACT is "1", an interrupt request signal is output to the interrupt controller 10. Note that the data of the sequence program 4 is decoded by the instruction decode 6, and if the decoding result is a functional command, the sequence logic operation circuit 7 outputs the functional command execution flag ACT of the corresponding data.
The AND gate 15 performs an AND operation between the decoding result of the corresponding data and the signal of the functional instruction execution flag ACT.

すると、割り込みコントローラ10はMPUIに対して
割り込み処理を要求し、MPUIは割り込み処理に入る
。すなわち、MPUIはPCおよびレジシタの内容によ
り待避などの割り込み処理を行うと共に、MPUIはシ
ーケンスプログラム4から割り込み命令(機能命令)が
何の命令かどうかを読み取ってその処理に入る(ステッ
プ203)。
Then, the interrupt controller 10 requests the MPUI to perform interrupt processing, and the MPUI starts the interrupt processing. That is, the MPUI performs interrupt processing such as saving according to the contents of the PC and the register, and also reads from the sequence program 4 whether the interrupt instruction (function instruction) is an instruction or not, and enters the processing (step 203).

ついで、シーケンスプログラム4よりの割り込み命令が
シーケンスプログラム4の終了を示すEND命令かどう
か判断しくステップ204)、END命令であれば、P
Cをシーケンスプログラム4の初期値rmmmmJに戻
しくPC4−mmmm、ステップ205)、処理を終了
する。一方、END命令でなければ、該当する機能命令
の処理を行い(ステップ206)、割り込み処理より通
常のシーケンス処理にリターンしくステップ20.7 
)、割り込み処理を終了する。
Next, it is determined whether the interrupt instruction from the sequence program 4 is an END instruction indicating the end of the sequence program 4 (step 204), and if it is an END instruction, the P
PC4-mmmm to return C to the initial value rmmmmJ of the sequence program 4, step 205), and the process ends. On the other hand, if it is not an END instruction, the corresponding functional instruction is processed (step 206), and the interrupt processing returns to normal sequence processing.Step 20.7
), terminates interrupt processing.

ところで、ステップ202の判断において、機能命令実
行フラグACTが「1」であり、前記の論理積ANDの
結果が偽である時、MPUIが該当する機能命令のオペ
ランドデータを読み出した場合は、MPUIに対しNO
Pコード発生回路3からNOP命令を出力するから、割
り込み処理ルーチンには入らずに通過する(処理的にジ
ャンプする)。
By the way, in the determination at step 202, when the functional instruction execution flag ACT is "1" and the result of the above-mentioned AND is false, if the MPUI reads the operand data of the corresponding functional instruction, the MPUI No to
Since the NOP instruction is output from the P code generation circuit 3, the interrupt processing routine is passed through without entering (jumping in terms of processing).

つぎに第4図のラダーシーケンス図で示す内容のラダー
シーケンスプログラムを処理する場合の作用について詳
細に説明する。
Next, the operation when processing the ladder sequence program shown in the ladder sequence diagram of FIG. 4 will be explained in detail.

なお、シーケンスプログラム4(第1図参照)には第4
図のラダーシーケンス図で示す内容のラダーシーケンス
プログラム(ラダー言語)が第5図の形でメモリ内に入
っているものとする。また、このラダー言語は、実際に
は、第6図で示されるマシン語(マシンコード)として
実行可能な内容の形式で記憶されている。すなわち、上
位4ビツトがシーケンス命令コードであり、つぎの3ビ
ツトはビット指定データ、残りの9ビツトは人出力アド
レスデータである。なお、ビット指定データは、一般の
MPUIが入出力データをパラレルデータとして扱うう
えにおいて、シーケンス処理の1ビツトデータとして変
換するためのデータである。
Note that the sequence program 4 (see Figure 1) includes the fourth
It is assumed that a ladder sequence program (ladder language) having the content shown in the ladder sequence diagram in the figure is stored in the memory in the form shown in FIG. Furthermore, this ladder language is actually stored in the form of executable contents as machine language (machine code) shown in FIG. That is, the upper 4 bits are a sequence instruction code, the next 3 bits are bit designation data, and the remaining 9 bits are human output address data. Note that the bit designation data is data for converting input/output data into 1-bit data for sequence processing when a general MPUI treats input/output data as parallel data.

シーケンスの起動により、MPU1のプログラムカウン
タPCにシーケンスプログラム4のPCの初期値’mm
mmJがセントされる。
By starting the sequence, the initial value of the PC of the sequence program 4 is set to the program counter PC of the MPU1.
mmJ is cent.

MPUIのPCにrmmmmJがセットされると、アド
レスrmmmmJがアドレスバス13を介してメインプ
ログラム2に出力される。すると、MPUIはリード信
号14を介してNOPコード生成回路3よりNOP命令
を生成させ、そのNOP命令を実行する。一方、アドレ
スrmmmmJはアドレスデコーダ5により分配され、
セレクト信号CS +を介してシーケンスプログラム4
に出力される。すなわち、第7図のタイミングチャート
図に従って、シーケンスプログラム4を選択するための
セレクト信号C8l  リード信号14、シーケンスク
ロックS CL K、シーケンスデータライン17によ
りシーケンス命令、すなわち、第6図のメモリアドレス
rmmmmJにあるrRDool」という内容のシーケ
ンス命令が出力されることになる。
When rmmmmJ is set in the MPUI PC, address rmmmmJ is output to the main program 2 via the address bus 13. Then, the MPUI causes the NOP code generation circuit 3 to generate a NOP instruction via the read signal 14, and executes the NOP instruction. On the other hand, the address rmmmmJ is distributed by the address decoder 5,
Sequence program 4 via select signal CS+
is output to. That is, according to the timing chart of FIG. 7, the sequence command, that is, the memory address rmmmmJ of FIG. A sequence command with the content "a certain rRDool" will be output.

このシーケンス命令は、001番地の内容である二−モ
ニックrRD、(第5図参照)であり、このシーケンス
命令を命令デコーダ6を通して解読し、基本命令(第8
図(a))を示しているから、シーケンス論理演算回路
7に出力される。そして、シーケンス論理演算回路7に
おいてシーケンス処理を行う。その動作は第7図のシー
ケンスクロック5CLKの立ち下がりから立ち上がりの
間に行われる。
This sequence instruction is the monic rRD, which is the content of address 001 (see FIG. 5), and this sequence instruction is decoded through the instruction decoder 6 and basic instruction (8th
Since it is shown in Figure (a), it is output to the sequence logic operation circuit 7. Then, sequence processing is performed in the sequence logic operation circuit 7. This operation is performed between the fall and rise of the sequence clock 5CLK in FIG.

メモリアドレスr m、 m m m Jにある内容の
シーケンス命令を実行すれば、MPUIはPCに+1(
インクリメント)を行い、PC−PC+1とする。する
と、PCはrmmm(m−t−1)Jとなる。
If you execute the sequence command with the contents at memory address r m, m m m J, MPUI will give +1 (
Increment) and set it as PC-PC+1. Then, PC becomes rmmm(m-t-1)J.

同様にPCの処理動作を繰り返し行ってシーケンス処理
を実行していき、例えば第4図のラダーシーケンス図の
(It)で示される、シーケンスプログラム4の場合を
説明する。なお、このシーケンスプログラム4はラダー
言語として、第5図の(II)で示される形でシーケン
スプログラム4に入っているものとする。第2図に示す
PCの処理プログラムにより、PCの内容を連続的にカ
ウントアツプし、rmmm(m±5)」とすると、この
PCの内容をMPUIはシーケンスプログラム4に出力
し、rmmm(m+5) J番地の内容をシーケンス論
理演算回路7に読み込む。
Similarly, the sequence processing is executed by repeating the processing operations of the PC. For example, the case of the sequence program 4 shown by (It) in the ladder sequence diagram of FIG. 4 will be described. It is assumed that this sequence program 4 is included in the sequence program 4 as a ladder language in the form shown in (II) in FIG. If the PC processing program shown in Fig. 2 continuously counts up the contents of the PC to rmmm (m ± 5), then the MPUI outputs the contents of this PC to the sequence program 4 and outputs the contents of the PC to rmmm (m + 5). The contents of address J are read into the sequence logic operation circuit 7.

つぎにMPUIがPCを+1すると、rmmm(m+6
)」となり、さらにMPUIがPCの内容をシーケンス
プログラム4に出力すると、rmmm(m+6)」番地
の内容は機能命令(MOV)を示しているから、シーケ
ンス論理演算回路7において読み込んだシーケンス命令
の機能命令実行フラグACTが「1」か「0」かを判断
し、「1」である場合は論理積ゲート15に実行信号を
出力する。一方、命令デコーダ6はシーケンス命令が機
能命令であるから、所定信号を出力する。
Next, when MPUI increases PC by +1, rmmm(m+6
)", and when the MPUI outputs the contents of the PC to the sequence program 4, the contents of the address "rmmm(m+6)" indicate a function instruction (MOV), so the function of the sequence instruction read in the sequence logic operation circuit 7. It is determined whether the instruction execution flag ACT is "1" or "0", and if it is "1", an execution signal is output to the AND gate 15. On the other hand, since the sequence command is a functional command, the command decoder 6 outputs a predetermined signal.

論理積ゲート15はシーケンス論理演算回路7から実行
信号が出力されていれば、割り込み要求信号を割り込み
コントローラ10に出力し、割り込みコントローラ10
は割り込み処理に入る。すなわち、MPU1はrmmm
(m+6)」番地の内容が005であった時にrmmm
(m+7)」番地の(A)の内容をrmmm(m+8)
」番地の(B)へ転送するという仕事を行う。
If the execution signal is output from the sequence logic operation circuit 7, the AND gate 15 outputs an interrupt request signal to the interrupt controller 10.
enters interrupt processing. That is, MPU1 is rmmm
(m+6)" when the contents of the address are 005, rmmm
(m+7)” content of (A) at address rmmm(m+8)
” performs the job of forwarding to address (B).

二のようにして、MPUIの持っている割り込み機能を
利用してシーケンス動作と第2図の機能を持ったソフト
ウェアによる仕事を処理することができ、プログラム機
能の融通性を発揮することができる。
2, the interrupt function of the MPUI can be used to process sequence operations and tasks by software having the functions shown in FIG. 2, and the flexibility of the program function can be demonstrated.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明によれば、機能命令の実行を
要するシーケンスプログラムのデータには機能命令実行
フラグ「1」を設け、機能命令の実行を要しないデータ
には機能命令実行フラグ「0」を設けておき、機能命令
実行フラグが「1」の場合は実行信号を発生し、機能命
令実行フラグが「0」の場合は実行信号を発生しない手
段を有するシーケンス論理演算回路と、前記実行信号が
発生している場合だけ、前記命令デコードが発生する割
り込み要求信号を割り込みコントローラに出力する手段
とを有するように構成したから、実行を必要としない機
能命令の場合は割り込みルーチンに入らずに通常のシー
ケンス処理を続けることができ、シーケンスプログラム
の処理時間を短くすることができる。その結果工作機械
等のシーケンスコントローラとしての処理効率、処理能
力等の向上をあげることができる。
As explained above, according to the present invention, the functional instruction execution flag is set to "1" for sequence program data that requires the execution of a functional instruction, and the functional instruction execution flag is set to "0" for data that does not require the execution of a functional instruction. a sequence logic operation circuit having a means for generating an execution signal when the functional instruction execution flag is "1" and not generating an execution signal when the functional instruction execution flag is "0"; Since the above-mentioned instruction decoding has means for outputting an interrupt request signal generated by the instruction decoding to the interrupt controller only when a sequence processing can be continued, and the processing time of the sequence program can be shortened. As a result, it is possible to improve processing efficiency, processing capacity, etc. as a sequence controller for machine tools, etc.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明のシーケンスコントローラの主要部を示
すブロック線図、第2図はシーケンス用プログラムカウ
ンタの処理を説明する流れ図、第3図は本発明の割り込
み処理を説明する流れ図、第4図は本発明の二実施例の
ラダーシーケンス図、第5図は第4図の状態をコーアン
ダした図、第6図はマシンコードの説明図、第7図はM
PUの命令により発せられる各種信号のタイミングチャ
ート図、第8図はシーケンス命令の説明図であり、第8
図(a)は基本命令の説明図、第8図(b)は機能命令
の説明図、第9図は従来の割り込み処理を行うシーケン
スコントローラのブロック線図である。 ■・・・マイクロプロセッサ(MPU)、2・・・メイ
ンプログラム、 3・・・NOPコード生成回路、 4・・・シーケンスプログラム、 5・・・アドレスデコーダ、 6・・・命令デコーダ、 7・・・シーケンス論理演算回路、 8・・・人力部、 9・・・出力部、 10・・・割り込みコントローラ、 15・・・論理積ゲート、 ACT・・・機能命令実行フラグ。 第4図 第6図 合金コード ビプトデータ 人出力アドレスヂータ 第3図 第7図 第8図 手続補正書 (方式) 事件の表示 特願平1−142648号 発明の名称   シーケンスコントローラ3゜ 補正をする者 事件との関係 特許出願人 住 所  千葉県我孫子市我孫子1番地名 称   日
立精機株式会社 代表者 手島五部 4゜
FIG. 1 is a block diagram showing the main parts of the sequence controller of the present invention, FIG. 2 is a flowchart explaining the processing of the sequence program counter, FIG. 3 is a flowchart explaining the interrupt processing of the present invention, and FIG. 4 is a ladder sequence diagram of two embodiments of the present invention, FIG. 5 is a co-under diagram of the state in FIG. 4, FIG. 6 is an explanatory diagram of the machine code, and FIG.
FIG. 8 is a timing chart of various signals issued by PU commands, and is an explanatory diagram of sequence commands.
FIG. 8(a) is an explanatory diagram of basic instructions, FIG. 8(b) is an explanatory diagram of functional instructions, and FIG. 9 is a block diagram of a conventional sequence controller that performs interrupt processing. ■... Microprocessor (MPU), 2... Main program, 3... NOP code generation circuit, 4... Sequence program, 5... Address decoder, 6... Instruction decoder, 7... - Sequence logic operation circuit, 8... Human power section, 9... Output section, 10... Interrupt controller, 15... AND gate, ACT... Functional instruction execution flag. Fig. 4 Fig. 6 Alloy code bit data Human output address data Fig. 3 Fig. 7 Fig. 8 Procedural amendment (method) Display of incident Title of invention in patent application No. 1-142648 Sequence controller 3° correction Relationship with the patent case Patent applicant address: 1 Abiko, Abiko City, Chiba Name: Hitachi Seiki Co., Ltd. Representative: Teshima Gobe 4゜

Claims (1)

【特許請求の範囲】 汎用マイクロプロセッサと、この汎用マイクロプロセッ
サの指示するアドレスのシーケンスプログラムのデータ
を解読し、解読したデータが機能命令であれば、割り込
み要求信号を発生する命令デコーダと、前記シーケンス
プログラムのデータとシーケンス論理演算回路とを組み
合わせてシーケンス処理を行う手段と、前記汎用マイク
ロプロセッサと連接し、前記割り込み要求信号により割
り込み処理を指示する割込コントローラとを有するシー
ケンスコントローラにおいて、 機能命令の実行を要する前記シーケンスプログラムのデ
ータには機能命令実行フラグ「1」を設け、機能命令の
実行を要しないデータには機能命令実行フラグ「0」を
設けておき、機能命令実行フラグが「1」の場合は実行
信号を発生し、機能命令実行フラグが「0」の場合は実
行信号を発生しない手段を有するシーケンス論理演算回
路と、前記実行信号が発生している場合だけ、前記命令
デコーダが発生する割り込み要求信号を割り込みコント
ローラに出力する手段とを有することを特徴とするシー
ケンスコントローラ。
[Scope of Claims] A general-purpose microprocessor, an instruction decoder that decodes data of a sequence program at an address specified by the general-purpose microprocessor and generates an interrupt request signal if the decoded data is a functional instruction; A sequence controller comprising means for performing sequence processing by combining program data and a sequence logic operation circuit, and an interrupt controller that is connected to the general-purpose microprocessor and instructs interrupt processing using the interrupt request signal. A functional instruction execution flag "1" is provided for data of the sequence program that requires execution, a functional instruction execution flag "0" is provided for data that does not require execution of a functional instruction, and the functional instruction execution flag is set to "1". a sequence logic operation circuit having a means for generating an execution signal when the functional instruction execution flag is "0" and not generating an execution signal when the functional instruction execution flag is "0"; and the instruction decoder generating the execution signal only when the execution signal is generated. A sequence controller comprising means for outputting an interrupt request signal to an interrupt controller.
JP14264889A 1989-06-05 1989-06-05 Sequence controller Pending JPH036706A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14264889A JPH036706A (en) 1989-06-05 1989-06-05 Sequence controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP14264889A JPH036706A (en) 1989-06-05 1989-06-05 Sequence controller

Publications (1)

Publication Number Publication Date
JPH036706A true JPH036706A (en) 1991-01-14

Family

ID=15320245

Family Applications (1)

Application Number Title Priority Date Filing Date
JP14264889A Pending JPH036706A (en) 1989-06-05 1989-06-05 Sequence controller

Country Status (1)

Country Link
JP (1) JPH036706A (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63304302A (en) * 1987-06-05 1988-12-12 Fanuc Ltd Programmable controller

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63304302A (en) * 1987-06-05 1988-12-12 Fanuc Ltd Programmable controller

Similar Documents

Publication Publication Date Title
JP2554050B2 (en) Data processing method
US4539635A (en) Pipelined digital processor arranged for conditional operation
JP2970821B2 (en) Data processing device
JPH0527971A (en) Information processor
US5390306A (en) Pipeline processing system and microprocessor using the system
JPS6212529B2 (en)
JPH0776917B2 (en) Micro computer
JPH036706A (en) Sequence controller
JP2694948B2 (en) Micro program processor
JPH036705A (en) Sequence controller
JPS5965310A (en) Arithmetic processor of programmable controller
JP3511691B2 (en) Arithmetic processing unit
JPS6242301B2 (en)
JPS59218510A (en) Sequence controller
JPH05250156A (en) Risc processor
JPH04353927A (en) Micro processor
JP2721610B2 (en) Programmable controller
JPS6380333A (en) Microcomputer circuit
JPH0317135B2 (en)
JP4702004B2 (en) Microcomputer
JPS63293638A (en) Data processing system
JPS5829051A (en) Operation processing device
JPH0241770B2 (en)
JP2926941B2 (en) Instruction decoding device
JP3060917B2 (en) Processor