JPH036705A - Sequence controller - Google Patents

Sequence controller

Info

Publication number
JPH036705A
JPH036705A JP14264789A JP14264789A JPH036705A JP H036705 A JPH036705 A JP H036705A JP 14264789 A JP14264789 A JP 14264789A JP 14264789 A JP14264789 A JP 14264789A JP H036705 A JPH036705 A JP H036705A
Authority
JP
Japan
Prior art keywords
sequence
program
instruction
mpu
nop
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
JP14264789A
Other languages
Japanese (ja)
Inventor
Yoshiaki Sekiya
関谷 良明
Hiromichi Arai
弘道 荒井
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 JP14264789A priority Critical patent/JPH036705A/en
Publication of JPH036705A publication Critical patent/JPH036705A/en
Pending legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

PURPOSE:To shorten the program processing time and to improve the memory efficiency by using a NOP code production circuit which produces forcibly an instruction code and gives it to an MPU to minimize the executing time. CONSTITUTION:A NOP code generating circuit 3 produces a NOP instruction and sends it to a data bus 16 to minimize the executing time when a microprocessor MPU 1 fetches an operation code for an area where a sequence program 4 decided previously to a main program 2 of the MPU 1 is carried out. As a result, a one-step sequence instruction can be carried out within a time when the NOP instruction requiring the minimum executing time is carried out. Thus the high speed performance is secured. Furthermore the memory capacity can be saved because it is not required to store the NOP instruction into the program 2.

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明はシーケンスコントローラに係り、特に汎用のマ
イクロプロセッサ(以下MPUと称す)を使用してシー
ケンスプログラムの処理時間を短縮し、かつメモリ効率
を上げ、さらにはプログラム仕様の融通性を発揮させる
ことのできるシーケンスコントローラに関するものであ
る。
[Detailed Description of the Invention] [Field of Industrial Application] The present invention relates to a sequence controller, and particularly to a sequence controller that uses a general-purpose microprocessor (hereinafter referred to as MPU) to shorten the processing time of a sequence program and improve memory efficiency. The present invention relates to a sequence controller that can increase flexibility in program specifications.

〔従来の技術〕[Conventional technology]

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

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

そこで、本願出願人は前記課題を解決するために特開昭
59−218510号公報においてシーケンスコントロ
ーラを提案している。
Therefore, the applicant of the present application has proposed a sequence controller in Japanese Patent Laid-Open No. 59-218510 in order to solve the above problem.

このシーケンスコントローラは特定な命令、例えば、M
PUのレジスタの内容をシーケンスプログラムエリアに
出力する命令と、その命令の出力の後、MPUのレジス
タの内容をインクリメントする命令とを設けておき、M
PUのレジスタをシーケンス処理用のプログラムカウン
タに使用することで・、シーケンスプログラムのプログ
ラムカウンタを加算する手段を必要としない分だけ、シ
ーケンスプログラムの処理時間を短縮することを目的と
するものである。
This sequence controller has specific commands, e.g.
An instruction to output the contents of the register of the PU to the sequence program area and an instruction to increment the contents of the register of the MPU after outputting that instruction are provided.
By using the register of the PU as a program counter for sequence processing, the purpose is to shorten the processing time of the sequence program by eliminating the need for means for adding up the program counter of the sequence program.

ところで、特開昭59−218510号公報のシーケン
スコントローラは、MPUのプログラムエリア内に特定
な命令、例えば、 LD  A (HL)  ・・・(1)INCHL  
 ・・・(2) LD  A (HL) TNCHL JUMP  XXXX・・・(3) を設けておく。なお、(1)はMPUのアドレスレジス
タの内容rA(HL)Jをシーケンスプログラムエリア
に出力するリード命令を意味し、(2)は前記アドレス
レジスタHLを+1(インクリメント)するためのイン
クリメント命令を意味し、(3)は(1)のリード命令
と(2)のインクリメント命令を交互に多数設けること
によって、MPUのプログラム内のメモリ容量を節約す
るために設けられたジャンプ命令であり、このジャンプ
命令により(1)のリード命令にもどることを意味する
By the way, the sequence controller disclosed in Japanese Patent Application Laid-Open No. 59-218510 has a specific command in the program area of the MPU, for example, LDA (HL) ... (1) INCHL
...(2) LD A (HL) TNCHL JUMP XXXX...(3) is provided. Note that (1) means a read command to output the contents rA(HL)J of the address register of the MPU to the sequence program area, and (2) means an increment command to increment the address register HL by +1. However, (3) is a jump instruction provided in order to save memory capacity in the MPU program by alternately providing a large number of read instructions in (1) and increment instructions in (2). This means returning to the read command in (1).

〔発明が解決しようとしている課題〕[Problem that the invention is trying to solve]

ところで、従来のシーケンスコントローラは、MPUが
シーケンスプログラムを処理する際に、(1)MPUが
rLD  A (HL)J命令をフェッチする、 (II)MPUがアドレスレジスタHLの内容をシーケ
ンスプログラムエリアに出力する、(III)MPUが
rlNc  HL、命令をフェッチする、 (rV)MPUがr INCHLJの内容をシーケンス
プログラムエリアに出力する、 というようにシーケンスプログラムエリア内の1ステツ
プのシーケンス命令を実行するのに(1)から(IV)
までの4つの処理を行なわねばならず処理の高速性に問
題があった。
By the way, in a conventional sequence controller, when the MPU processes a sequence program, (1) the MPU fetches the rLD A (HL) J instruction, (II) the MPU outputs the contents of the address register HL to the sequence program area. (III) MPU fetches the rlNcHL instruction, (rV) MPU outputs the contents of rINCHLJ to the sequence program area, and so on to execute a one-step sequence instruction in the sequence program area. (1) to (IV)
The above four processes had to be performed, and there was a problem with the high speed of the process.

また、従来のシーケンスコントローラは、MPUのメイ
ンプログラムエリア内に少なくともシーケンス命令を全
て処理する量だけリード命令とインクリメント命令を交
互に多数並べて記憶させておかなければならない。また
、メモリ容量を節約するためにジャンプ命令を使用する
際においても、ジャンプ命令の実行時間をリード命令お
よびインクリメント命令の実行時間に比べて充分小さく
するためには、リード命令とインクリメント命令を多数
並べてプログラムメモリに配列する必要があり、大きな
メモリ容量を必要とするという問題があった。
Further, the conventional sequence controller must store a large number of read instructions and increment instructions alternately arranged in the main program area of the MPU, at least enough to process all sequence instructions. Also, when using jump instructions to save memory capacity, it is necessary to line up many read and increment instructions in order to make the execution time of the jump instruction sufficiently smaller than the execution time of read and increment instructions. There was a problem in that it needed to be arranged in program memory, requiring a large memory capacity.

以上から本発明の目的は、汎用マイクロプロセッサを使
用し、バイトあるいはワード単位の演算を行わせるとと
もに、シーケンスコントローラの主たる仕事であるビッ
ト演算を高速で実行でき、かつメモリ効率を向上させる
ことのできるシーケンスコントローラを提案することで
ある。
From the above, it is an object of the present invention to use a general-purpose microprocessor to perform operations in byte or word units, to perform bit operations, which are the main task of a sequence controller, at high speed, and to improve memory efficiency. The purpose is to propose a sequence controller.

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

前記課題を解決するために、本発明のシーケンスコント
ローラは、MPUI (第1図参照)のメインプログラ
ム2の所定エリアをシーケンスプログラム4を実行する
エリアとして割り当て、MPU1のプログラムカウンタ
(以下、PCと称す)をシーケンスプログラム4のPC
として共用する手段と、メインプログラム2の所定エリ
アがMPU1のPCにより指示されるとき、MPUIに
対して強制的に実行時間が最小となる命令コード(例え
ば、NOP命令)を発生して与えるNOPコード生成回
路3と、PCとシーケンス論理演算回路7と組み合わせ
てシーケンス処理を行い、かつM P U 1に割込コ
ントローラ10を連接して、割り込み処理によって機能
命令を実行する割り込み手段とから構成される。
In order to solve the above problems, the sequence controller of the present invention allocates a predetermined area of the main program 2 of the MPUI (see FIG. 1) as an area for executing the sequence program 4, and uses the program counter of the MPU 1 (hereinafter referred to as PC). ) on the PC of sequence program 4
When a predetermined area of the main program 2 is instructed by the PC of the MPU 1, a NOP code that forcibly generates and gives an instruction code (for example, a NOP instruction) that minimizes the execution time to the MPUI. It is composed of a generation circuit 3, and an interrupt means that performs sequence processing in combination with a PC and a sequence logic operation circuit 7, and connects an interrupt controller 10 to the MPU 1 to execute a functional instruction by interrupt processing. .

〔作用〕[Effect]

MPUIのPCとシーケンスプログラム4を実行するた
めのPCを共用したため、MUPIがPCに初期値(例
えば、rmmmm」)をセットした後、MPUIはオペ
コードフェッチサイクルでNOP命令を読み出し、同時
にPCで示されるアドレスのシーケンス命令が読み出さ
れて論理演算が行われる。MPUIはシーケンス命令の
実行の後、PCを+1 (インクリメント)して、PC
で示されるアドレスの命令を実行する。
Since the PC of MPUI and the PC for executing sequence program 4 were shared, after MUPI sets the initial value (for example, rmmmm") to the PC, MPUI reads the NOP instruction in the opcode fetch cycle, and at the same time A sequence instruction of addresses is read and a logical operation is performed. After executing the sequence command, MPUI increments the PC by +1 and
Execute the instruction at the address indicated by .

〔実施例〕〔Example〕

以下、本発明の実施例を図面に基づいて詳細に説明する
Embodiments of the present invention will be described in detail below with reference to the drawings.

第1図は本発明のシーケンスコントローラの主要部を示
すブロンク線図、第2図および第3図は本発明にかかる
シーケンス用プログラムカウンタ処理により接点命令や
機能命令を処理する内容を説明する流れ図、第4図はシ
ーケンス命令の説明図であり、第4図(a)は基本命令
の説明図、第4図(b)は機能命令の説明図、第5図は
本発明の一実施例のラダーシーケンス図、第6図は第5
図の状態をコーテングした図、第7図はマシンコードの
説明図、第8図はMPUの命令により発せられる各種信
号のタイミングチャート図である。
FIG. 1 is a Bronk diagram showing the main parts of the sequence controller of the present invention, FIGS. 2 and 3 are flowcharts explaining the contents of processing contact commands and function commands by sequence program counter processing according to the present invention, FIG. 4 is an explanatory diagram of sequence commands, FIG. 4(a) is an explanatory diagram of basic commands, FIG. 4(b) is an explanatory diagram of functional commands, and FIG. 5 is a ladder diagram of an embodiment of the present invention. Sequence diagram, Figure 6 is the 5th
FIG. 7 is an explanatory diagram of the machine code, and FIG. 8 is a timing chart of various signals issued by MPU commands.

第1図において、1は汎用マイクロプロセッサ(以下M
PtJと称す)、2はメインプログラム、3は実行時間
が最小となる命令コード(例えば、NOP命令)を生成
するNOPコード生成回路、4はデータエリアとしての
シーケンスプログラム、5はMPIJIが出力するアド
レスをメインプログラム2あるいはシーケンスプログラ
ム4に分配するアドレスデコーダ、6はシーケンスプロ
グラム4から出力されるシーケンス命令が基本命令(第
4図(a))か、あるいは機能命令(第4図(b))か
を解読する命令デコーダ、7は1ビツトの論理演算を行
うシーケンス論理演算回路、8は入力部、9は出力部、
10は演算等の割り込みコントローラ、11はハンファ
、12はデータトランスミッタ、13(ま16ビントの
アドレスバス、14はMP(Jlが出力するリード信号
、15は論理積ゲート、16は8ビツトのデータバス、
17はシーケンスプログラム用の16ビノトのデータラ
イン、C30はメインプログラム2を選(尺するための
セレクト信号、C8Iはシーケンスプログラム4を選択
するためのセレクト信号、18は4ビツトのシーケンス
命令コードライン、19は入出力アドレスラインでビッ
トデータラインも含んでいる。
In Figure 1, 1 is a general-purpose microprocessor (hereinafter referred to as M
(referred to as PtJ), 2 is the main program, 3 is a NOP code generation circuit that generates an instruction code (for example, a NOP instruction) with the minimum execution time, 4 is a sequence program as a data area, 5 is an address output by MPIJI An address decoder 6 distributes the sequence command to the main program 2 or the sequence program 4, and 6 determines whether the sequence command output from the sequence program 4 is a basic command (Fig. 4 (a)) or a functional command (Fig. 4 (b)). 7 is a sequence logic operation circuit that performs a 1-bit logic operation, 8 is an input section, 9 is an output section,
10 is an interrupt controller for calculations, etc., 11 is Hanwha, 12 is a data transmitter, 13 is a 16-bit address bus, 14 is a read signal output by MP (Jl), 15 is an AND gate, and 16 is an 8-bit data bus. ,
17 is a 16-bit data line for the sequence program, C30 is a select signal for selecting (lengthing) main program 2, C8I is a select signal for selecting sequence program 4, 18 is a 4-bit sequence instruction code line, 19 is an input/output address line which also includes a bit data line.

5CLKはシーケンスクロックライン、20は演算処理
等の割り込み信号ライン、21はMPUに対する割り込
み信号である。
5CLK is a sequence clock line, 20 is an interrupt signal line for arithmetic processing, etc., and 21 is an interrupt signal for the MPU.

M P U 1において、MPtJ 1のメインプログ
ラム2の所定エリアをシーケンスプログラム4を実行す
るためのエリアとして割り当て、MPUIのPCをシー
ケンスプログラム4のPCとして共有する手段が設けら
れている。
The MPU 1 is provided with means for allocating a predetermined area of the main program 2 of the MPtJ 1 as an area for executing the sequence program 4 and sharing the PC of the MPUI as the PC of the sequence program 4.

メインプログラム2には、第2図および第3図の流れ図
で示す接点命令や機能命令を処理するプログラムが入っ
ている。さらにメインプログラム2には第4図に示すよ
うなインストラクションを処理するプログラムも入って
いる。
The main program 2 includes programs for processing contact commands and function commands shown in the flowcharts of FIGS. 2 and 3. Furthermore, the main program 2 also includes a program for processing instructions as shown in FIG.

NOPコード生成回路3は、MPUIのメインプログラ
ム2に予め決められたシーケンスプログラム4を実行す
るためのエリアをMPUIがオペコードフェッチする場
合に、NOP命令を生成してデータバス16に送出する
回路である。
The NOP code generation circuit 3 is a circuit that generates a NOP instruction and sends it to the data bus 16 when the MPUI fetches an operation code for an area for executing a sequence program 4 predetermined in the main program 2 of the MPUI. .

次に、本発明のシーケンスコントローラの接点命令の処
理を第2図の流れ図に従って説明する。
Next, the processing of contact commands by the sequence controller of the present invention will be explained according to the flowchart shown in FIG.

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

MPUIのPCにr m m m m Jがセットされ
ると、MPtJlはアドレスrmmmm」が示す命令を
実行するのであるが、その命令部分に、例えば、mmm
m  NOP のようにNOPコード生成回路3からNOP命令がデー
タバス16を介して送出されるから、MPU1はオペコ
ードフェッチサイクルでNOP命令をリードする。なお
、NOP命令の実行とは処理をしないことであるから、
MPUIはNOP命令の実行と同時に、シーケンスプロ
グラム4のアドレスrmmmmJにあるシーケンス命令
をリードし、そのシーケンス命令に基づいて論理演算処
理を行う(ステップ102)。
When r m m m m m J is set in the MPUI PC, MPtJl executes the instruction indicated by the address "rmmmm", but in the instruction part, for example, mmm
Since the NOP instruction like m NOP 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 rmmmmJ of the sequence program 4, and performs logical operation processing based on the sequence instruction (step 102).

アドレスrmmmmJが示す命令が実行されれば、MP
UIはPCを自動的にインクリメント(+1)する。例
えば、PCをrmmm(m+1)」とする(ステップ1
03)。PCをインクリメントした後、MPUIはステ
ップ102以降の処理を繰り返す。
If the instruction indicated by address rmmmmJ is executed, MP
The UI automatically increments (+1) the PC. For example, suppose the PC is rmmm(m+1) (step 1
03). After incrementing PC, the MPUI repeats the process 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.

また、MPUがオペコードフェッチする場合にNOP命
令を生成してデータバス16に送出する回路3を設けた
ことにより、NOP命令をメインプログラム2に記憶さ
せておく必要がないからメモリを節約できる。
Further, by providing the circuit 3 that generates a NOP instruction and sends it to the data bus 16 when the MPU fetches an operation code, it is not necessary to store the NOP instruction in the main program 2, so that memory can be saved.

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

なお、シーケンスプログラム4(第1図参照)には第5
図のラダーシーケンス図で示す内容のラダーシーケンス
プログラム(ラダー言語)が第6図の形でメモリ内に入
っているものとする。また、このラダー言語は、実際に
は、第7図で示されるマシン語(マシンコード)として
実行可能な内容の形式で記憶されている。すなわち、上
位4ビツトがシーケンス命令コードであり、つぎの3ビ
ツトはビット指定データ、残りの9ビツトは入出力アド
レスデータである。なお、ビット指定データは、−1’
IQのMPUIが入出力データをパラレルデータとして
扱ううえで、シーケンス処理の1ビツトデータとして変
換するためのデータである。
Note that the sequence program 4 (see Figure 1) includes the fifth
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 input/output address data. Note that the bit designation data is -1'
This data is used to convert input/output data into 1-bit data for sequence processing when the IQ MPUI treats input/output data as parallel data.

シーケンスの起動により、MPUIのPCにシーケンス
プログラム4のPCの初期値rmmmmJがセットされ
る。
By starting the sequence, the initial value rmmmmJ of the PC of the sequence program 4 is set in the PC of the MPUI.

MPUIのPCにrmmmmJがセットされると、アド
レスrmmmmJがアドレスバス13を介してメインプ
ログラム2に出力される。すると、MPUIはリード信
号14を介してNOPコード生成回路3よりNOP命令
を生成させ、そのN。
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 command via the read signal 14, and the NOP command is generated.

P命令を実行する。一方、アドレスrmmmmJはアド
レスデコーダ5により分配され、セレクト信号C5lを
介してシーケンスプログラム4に出力される。すなわち
、第8図のタイミングチャート図に従って、シーケンス
プログラム4を選択するためのセレクト信号CS、 、
リード信号14、シーケンスクロック5CLK、シーケ
ンスデータライン17によりシーケンス命令、すなわち
、第6図のメモリアドレスrmmmmJにあるrRDo
ol」という内容のシーケンス命令が出力されることに
なる。
Execute P command. On the other hand, address rmmmmJ is distributed by address decoder 5 and output to sequence program 4 via select signal C5l. That is, according to the timing chart of FIG. 8, the select signal CS for selecting the sequence program 4, ,
The read signal 14, sequence clock 5CLK, and sequence data line 17 generate a sequence command, that is, rRDo at memory address rmmmmJ in FIG.
A sequence command with the content "ol" will be output.

このシーケンス命令は、001番地の内容であるニーモ
ニックrRDj (第6図参照)であり、このシーケン
ス命令を命令デコーダ6を通して解読し、基本命令を示
していればシーケンス論理演算回路7にシーケンス命令
rRD、を出力する。
This sequence instruction is the mnemonic rRDj (see FIG. 6) which is the content of address 001. This sequence instruction is decoded through the instruction decoder 6, and if it indicates a basic instruction, the sequence instruction rRD, Output.

そして、シーケンス論理演算回路7の処理の結果を出力
部9を通して外部に出力する。その動作は第8図のシー
ケンスクロック5CLKの立ち下がりから立ち上がりの
間に行われる。
Then, the processing results of the sequence logic operation circuit 7 are outputted to the outside through the output section 9. This operation is performed between the falling edge and rising edge of the sequence clock 5CLK in FIG.

メモリアドレスrmmmmJにある内容のシーケンス命
令を実行すれば、MPUIはPCに+1(インクリメン
ト)を行い、PC4−PC+1とする。すると、PCは
rmmm(m+1 )Jとなる。
When the sequence instruction with the contents at memory address rmmmmJ is executed, the MPUI increments the PC by +1, making it PC4-PC+1. Then, PC becomes rmmm(m+1)J.

再度、MPUIはPCの指し示すNOP命令を実行する
とともに、シーケンスプログラム4にアドレスrmmm
(m+ 1 )Jを出力する。すると、シーケンス命令
rOROO4Jが出力される。このシーケンス命令rO
ROO4」も基本命令を示しているから、第4図(a)
の機能に基づき、前の結果と004番地の論理和をとる
。この動作は+?1記と同様にシーケンスクロック5C
LKの立ち下がりから立ち上がりの間に行われる。
Once again, the MPUI executes the NOP command pointed to by the PC and sends the address rmmm to the sequence program 4.
Output (m+1)J. Then, sequence instruction rOROO4J is output. This sequence instruction rO
ROO4'' also indicates the basic command, so Figure 4(a)
Based on the function of , the previous result and address 004 are logically ORed. Is this behavior +? Sequence clock 5C as in 1.
This is performed between the falling edge and rising edge of LK.

つづいてMPUIはPCに+1を行い、PCはrmmm
(m+2)」となる。
Next, MPUI gives +1 to PC, and PC rmmm
(m+2)".

以上のようなPCの処理動作を繰り返し行ってシーケン
ス処理を実行していく。
The sequence processing is executed by repeatedly performing the processing operations of the PC as described above.

ところで、前述の命令デコーダ6において、解読の結果
、機能命令(第4図(b))を示していれば、割り込み
信号ライン20を介して割り込みコントローラ10に出
力する。すると、割り込みコントローラ10はMPUI
に対して割り込み信号21を発し、MPUIは割り込み
処理に入る。
By the way, if the above-mentioned instruction decoder 6 indicates a functional instruction (FIG. 4(b)) as a result of decoding, it is output to the interrupt controller 10 via the interrupt signal line 20. Then, the interrupt controller 10
An interrupt signal 21 is issued to the MPUI, and the MPUI enters interrupt processing.

すなわち、MPUIはシーケンスプログラム4から割り
込み命令(機能命令)が何の命令かどうかを読み取って
その処理に入る。
That is, the MPUI reads from the sequence program 4 what kind of instruction the interrupt instruction (functional instruction) is, and starts its processing.

例えば第5図のラダーシーケンス図の(II)で示され
る、シーケンスプログラム4であったとする。なお、こ
のシーケンスプログラム4はラダー言語として、第6図
の(II)で示される形でシーケンスプログラム4に入
っているものとする。第2図に示すPCの処理プログラ
ムにより、PCの内容を連続的にカウントアツプし、r
mmm(m+5)」とすると、このPCの内容をMPU
Iはシーケンスプログラム4に出力し、rmmm(m+
5)j番地の内容をシーケンス論理演算回路7に読み込
む。
For example, suppose that it is sequence program 4 shown by (II) in the ladder sequence diagram of FIG. 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. The PC processing program shown in Figure 2 continuously counts up the contents of the PC and r
mmm(m+5)", the contents of this PC are transferred to the MPU
I is output to sequence program 4 and rmmm(m+
5) Read the contents of address j into the sequence logic operation circuit 7.

つき゛にMPUIがpcを+1すると、rmmm(m+
6)」となり、さらにMPUIがPCの内容をシーケン
スプログラム4に出力すると、rmmm(m+6)j番
地の内容は機能命令を示しているから、割り込み信号2
Iが出力されて、割り込み処理に入る。すなわち、MP
UIはrmmmc m+6)」番地の内容が005であ
った時にrmmm(m+7)J番地の(A)の内容をr
mmm(m−)−8)J番地のCB〕へ転送するという
仕事を行う。
If 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 address rmmm(m+6)j indicate a function command, so interrupt signal 2 is output.
I is output and interrupt processing begins. That is, M.P.
The UI displays the contents of (A) at address rmmm(m+7)J when the content of address rmmmc m+6) is 005.
mmm(m-)-8) CB at address J].

つぎに、本発明の機能命令の処理を第3図の流れ図に従
って説明する。
Next, the processing of functional commands according to the present invention will be explained according to the flowchart of FIG.

前記において述べたように、MPUIはPCおよびレジ
スタの内容により待避などの割り込み処理を行う(ステ
ップ201)。
As described above, the MPUI performs interrupt processing such as saving depending on the contents of the PC and registers (step 201).

シーケンスプログラム4よりの割り込み命令がシーケン
スプログラム4の終了を示すEND命令かどうか判断し
くステップ202)、END命令であれば、PC4−m
mmmとしくステップ203)、処理を終了する。一方
、END命令でなければ、機能命令の処理を行い(ステ
ップ204)、割り込み処理より通常のシーケンス処理
にリターンしくステップ205)、割り込み処理を終了
する。
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 202), and if it is an END instruction, the PC 4-m
mmm, step 203), and the process ends. On the other hand, if it is not an END command, the functional command is processed (step 204), the interrupt processing returns to normal sequence processing (step 205), and the interrupt processing ends.

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

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

以上説明したように本発明によれば、MPUのプログラ
ムの所定エリアをシーケンスプログラムを実行するエリ
アとして割り当て、MPUのPCをシーケンスプログラ
ムのPCとして共用する手段と、メインプログラムの所
定エリアがMPUのPCにより指示されるとき、MPU
に対して強制的に実行時間が最小となる命令コードを発
生して与えるNOPコード生成回路と、PCとシーケン
ス論理演算回路と組み合わせてシーケンス処理を行い、
かつMPUに割込コントローラを連接して、割り込み処
理によって機能命令を実行する割り込み手段とにより構
成されるから、プログラムの処理時間を短縮することが
でき、かつ、メモリ効率が向上し、割り込み処理可能な
プログラム処理機能を備えることでプログラム仕様の融
通性に冨んだシーケンスコントローラを提供できるとい
った効果かえられる。その結果工作機械等のシーケンス
コントローラとしての処理効率、処理能力等の向上を達
成することができる。
As explained above, according to the present invention, there is provided a means for allocating a predetermined area of a program of an MPU as an area for executing a sequence program, and a means for sharing a PC of the MPU as a PC of the sequence program; When instructed by the MPU
Sequence processing is performed by combining a NOP code generation circuit that forcibly generates and gives an instruction code that minimizes the execution time, a PC and a sequence logic operation circuit,
In addition, since it is configured with an interrupt controller connected to the MPU and an interrupt means that executes function instructions by interrupt processing, program processing time can be shortened, memory efficiency is improved, and interrupt processing is possible. By providing a program processing function, it is possible to provide a sequence controller with a high degree of flexibility in program specifications. As a result, it is possible to improve processing efficiency, processing capacity, etc. as a sequence controller for machine tools, etc.

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

第1図は本発明のシーケンスコントローラの主要部を示
すブロック線図、第2図および第3図は本発明にかかる
シーケンス用プログラムカウンタ処理の内容を説明する
流れ図、第4図はシーケンス命令の説明図であり、第4
図(a)は基本命令の説明図、第4図(b)は機能命令
の説明図、第5図は本発明の一実施例のラダーシーケン
ス図、第6図は第5図の状態をコーテングした図、第7
図はマシンコードの説明図、第8図はMPUの命令によ
り発せられる各種信号のタイミングチャート図である。 1・・・マイクロプロセッサ(MPU)、2・・・メイ
ンプログラム、 3・・・NOPコード生成回路、 4・・・シーケンスプログラム、 5・・・アドレスデコーダ、 6・・・命令デコーダ、 7・・・シーケンス論理演算回路、 8・・・入力部、 9・・・出力部、 10・・・割り込みコントローラ、 11・・・バッファ、 12・・・データトランスミッタ。 図面の浄書 第1図 第6図 第5図 9貧コード ビットデータ 人出力アドレスデータ 第8図 手続補正書 (方式) 事件の表示   特願平1 142647号 λ 発明の名称   シーケンスコントローラ3゜ 補正をする者 事件との関係 特許出願人 住 所  千葉県我孫子市我孫子1番地名 称   日
立精機株式会社 代表者 手島五部 4゜
FIG. 1 is a block diagram showing the main parts of the sequence controller of the present invention, FIGS. 2 and 3 are flow charts explaining the contents of sequence program counter processing according to the present invention, and FIG. 4 is an explanation of sequence instructions. Figure 4.
Figure (a) is an explanatory diagram of basic commands, Figure 4 (b) is an explanatory diagram of functional commands, Figure 5 is a ladder sequence diagram of an embodiment of the present invention, and Figure 6 is a coating of the state of Figure 5. Figure 7
The figure is an explanatory diagram of the machine code, and FIG. 8 is a timing chart of various signals issued by MPU commands. DESCRIPTION OF SYMBOLS 1...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... Input section, 9... Output section, 10... Interrupt controller, 11... Buffer, 12... Data transmitter. Engraving of drawings Figure 1 Figure 6 Figure 5 Figure 9 Poor code bit data Human output address data Figure 8 Procedure amendment (method) Indication of incident Patent application No. 142647 λ Title of invention 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)

【特許請求の範囲】 汎用マイクロプロセッサを用いたシーケンスコントロー
ラにおいて、 汎用マイクロプロセッサのプログラム内の所定エリアを
シーケンスプログラムを実行するためのエリアとして割
り当て、汎用マイクロプロセッサのプログラムカウンタ
をシーケンスプログラムを実行するためのプログラムカ
ウンタとして共用する手段と、 前記プログラム内の所定エリアが汎用マイクロプロセッ
サのプログラムカウンタにより指示されるとき、汎用マ
イクロプロセッサに対して強制的に実行時間が最小とな
る命令コードを発生して与える命令コード生成回路と、 前記プログラムカウンタとシーケンス論理演算部と組み
合わせてシーケンス処理を行い、かつ前記汎用マイクロ
プロセッサに割込コントローラを連接して、割り込み処
理によって機能命令を実行する割り込み手段とからなる
ことを特徴とするシーケンスコントローラ。
[Claims] In a sequence controller using a general-purpose microprocessor, a predetermined area within a program of the general-purpose microprocessor is allocated as an area for executing the sequence program, and a program counter of the general-purpose microprocessor is used for executing the sequence program. means for common use as a program counter of the general-purpose microprocessor; and when a predetermined area in the program is specified by the program counter of the general-purpose microprocessor, generating and providing an instruction code that forcibly minimizes the execution time to the general-purpose microprocessor. comprising an instruction code generation circuit, and an interrupt means that performs sequence processing in combination with the program counter and the sequence logic operation section, and connects an interrupt controller to the general-purpose microprocessor to execute a functional instruction through interrupt processing. A sequence controller featuring:
JP14264789A 1989-06-05 1989-06-05 Sequence controller Pending JPH036705A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14264789A JPH036705A (en) 1989-06-05 1989-06-05 Sequence controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP14264789A JPH036705A (en) 1989-06-05 1989-06-05 Sequence controller

Publications (1)

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

Family

ID=15320219

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JPH036705A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5940405A (en) * 1995-10-16 1999-08-17 Nec Corporation High-speed two-way multiplex data communication system and data communication device used therein
JP2015210628A (en) * 2014-04-25 2015-11-24 ファナック株式会社 Programmable controller in which no external memory access for calculated data reading occur

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS573139A (en) * 1980-06-06 1982-01-08 Mitsubishi Electric Corp Operation processor
JPS6148001A (en) * 1984-08-15 1986-03-08 Hitachi Ltd Programmable controller

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS573139A (en) * 1980-06-06 1982-01-08 Mitsubishi Electric Corp Operation processor
JPS6148001A (en) * 1984-08-15 1986-03-08 Hitachi Ltd Programmable controller

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5940405A (en) * 1995-10-16 1999-08-17 Nec Corporation High-speed two-way multiplex data communication system and data communication device used therein
JP2015210628A (en) * 2014-04-25 2015-11-24 ファナック株式会社 Programmable controller in which no external memory access for calculated data reading occur

Similar Documents

Publication Publication Date Title
KR100266337B1 (en) Data processing circuit, semiconductor integrated circuit device, microcomputer, and electronic equipment
US4539635A (en) Pipelined digital processor arranged for conditional operation
US5651123A (en) Program execution control device having addressability in accordance with M series pseudo-random number sequence
US5938759A (en) Processor instruction control mechanism capable of decoding register instructions and immediate instructions with simple configuration
US5757685A (en) Data processing system capable of processing long word data
US5991872A (en) Processor
US5301338A (en) System including central processing unit
US5390306A (en) Pipeline processing system and microprocessor using the system
US4598358A (en) Pipelined digital signal processor using a common data and control bus
JP3289704B2 (en) Microcomputer
JPH036705A (en) Sequence controller
US4398247A (en) Control device for directing execution of forced operations in a data processing system
JPH0560629B2 (en)
JP2000284962A (en) Microcomputer
US6704853B1 (en) Digital signal processing apparatus and method for controlling the same
JPH036706A (en) Sequence controller
US5220670A (en) Microprocessor having ability to carry out logical operation on internal bus
JP7482751B2 (en) Register Control Unit
JPS6242301B2 (en)
KR100388943B1 (en) Apparatus for processing immediate data on a DSP
JPH0619700B2 (en) Arithmetic unit
KR950006585B1 (en) Micro program control apparatus and control method thereof
US5864691A (en) Central processing unit with a selector that bypasses circuits where processing is not required
JPS5896346A (en) Hierarchical arithmetic system
JP2693598B2 (en) Program execution controller for digital signal processor