[go: up one dir, main page]

JP2000056991A - Micro computer programmable controller provided with multi-task function and its control method - Google Patents

Micro computer programmable controller provided with multi-task function and its control method

Info

Publication number
JP2000056991A
JP2000056991A JP11209271A JP20927199A JP2000056991A JP 2000056991 A JP2000056991 A JP 2000056991A JP 11209271 A JP11209271 A JP 11209271A JP 20927199 A JP20927199 A JP 20927199A JP 2000056991 A JP2000056991 A JP 2000056991A
Authority
JP
Japan
Prior art keywords
program
register
blocks
unit
block
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
JP11209271A
Other languages
Japanese (ja)
Inventor
Totsu Cho
突 張
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.)
GIKA KK
Original Assignee
GIKA KK
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 GIKA KK filed Critical GIKA KK
Publication of JP2000056991A publication Critical patent/JP2000056991A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0421Multiprocessor system
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/054Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/11Plc I-O input output
    • G05B2219/1157I-O used either as input or as output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/12Plc mp multi processor system
    • G05B2219/1204Multiprocessing, several plc's, distributed logic control
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/15Plc structure of the system
    • G05B2219/15079Multitasking, real time multitasking

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Programmable Controllers (AREA)

Abstract

PROBLEM TO BE SOLVED: To prevent the Iack of a register and to simultaneously and efficiently execute a plurality of programs. SOLUTION: This micro computer programmable controller is provided with plurality of program blocks #1-#n, local registers which are detached and arranged, a global I/O register 300 having a global register allocated to an independent memory area which is not affected by the generation/deletion of the respective program blocks #1-#n and an I/O register for making digital input/output, analog input/output and encoder input into registers and processing them, and a multi-task program execution unit 100 outputting a control signal for simultaneously executing programs and controlling input/output. Information used in common in the respective block programs #1-#n is stored in the global register, and local information is stored and managed in the local registers.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、マルチタスク機能
を備えたマイクロコンピュータプログラマブルコントロ
ーラ及びその制御方法に関するものである。
The present invention relates to a microcomputer programmable controller having a multitasking function and a control method therefor.

【0002】[0002]

【従来の技術】従来、産業用の電気・電子分野で使用さ
れるプログラマブルロジックコントローラにおいては、
該プログラマブルロジックコントローラの制御を行うた
めの制御プログラムによって多様な動作が実行されるよ
うになっている。そして、プログラマブルロジックコン
トローラの性能を向上させるために、マルチタスク機能
によって多数のプログラムが同時に実行される。
2. Description of the Related Art Conventionally, in a programmable logic controller used in industrial electric and electronic fields,
Various operations are executed by a control program for controlling the programmable logic controller. Then, in order to improve the performance of the programmable logic controller, a large number of programs are simultaneously executed by the multitask function.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、前記従
来のプログラマブルロジックコントローラにおいては、
使用されるレジスタの数が限られるので、プログラマブ
ルロジックコントローラに多様な動作を実行するための
プログラムを作成しようとすると、レジスタ不足が頻繁
に発生してしまう。
However, in the above-mentioned conventional programmable logic controller,
Since the number of registers used is limited, when trying to create a program for executing various operations in the programmable logic controller, register shortages frequently occur.

【0004】本発明は、前記従来のプログラマブルロジ
ックコントローラの問題点を解決して、レジスタ不足が
発生するのを防止することができ、マルチタスク機能に
よって複数のプログラムを同時に効率的に実行すること
ができるマルチタスク機能を備えたマイクロコンピュー
タプログラマブルコントローラ及びその制御方法を提供
することを目的とする。
The present invention solves the problems of the above-mentioned conventional programmable logic controller, can prevent the shortage of registers, and can efficiently execute a plurality of programs simultaneously by a multitasking function. An object of the present invention is to provide a microcomputer programmable controller having a multitasking function and a control method thereof.

【0005】[0005]

【課題を解決するための手段】そのために、本発明のマ
ルチタスク機能を備えたマイクロコンピュータプログラ
マブルコントローラにおいては、実行しようとする命令
語がそれぞれ格納された複数のプログラムブロックと、
該各プログラムブロックと対応させて、かつ、互いに分
離させてそれぞれ配設され、ローカル情報を管理するロ
ーカルレジスタと、前記各プログラムブロックの生成及
び消滅の影響を受けない独立したメモリ領域に割り当て
られ、各プログラムブロック間で共通に使用される情報
を管理するグローバルレジスタ、並びにディジタル入出
力、アナログ入出力及びエンコーダ入力をレジスタ化し
て処理するためのI/Oレジスタを備えたグローバル・
I/Oレジスタと、前記各プログラムブロックに格納さ
れたプログラムを同時に実行するための制御信号を出力
し、入出力を制御するマルチタスクプログラム実行ユニ
ットとを有する。
For this purpose, a microcomputer programmable controller having a multitasking function according to the present invention comprises a plurality of program blocks each storing an instruction to be executed,
Corresponding to each of the program blocks, and respectively disposed separately from each other, and allocated to a local register that manages local information, and an independent memory area that is not affected by generation and deletion of each of the program blocks, A global register for managing information commonly used between program blocks, and a global register having an I / O register for registering and processing digital input / output, analog input / output, and encoder input.
It has an I / O register and a multitask program execution unit that outputs a control signal for simultaneously executing programs stored in the respective program blocks and controls input / output.

【0006】本発明の他のマルチタスク機能を備えたマ
イクロコンピュータプログラマブルコントローラにおい
ては、さらに、前記各プログラムブロックは、プログラ
ムを実行するためのデータの集合であり、プログラムを
実行するために必要なすべての情報を備え、相互に影響
を与えることなく、独立してプログラムを実行する。
In another microcomputer programmable controller having a multitasking function of the present invention, each of the program blocks is a set of data for executing the program, and all of the data necessary for executing the program. And independently execute programs without affecting each other.

【0007】本発明の更に他のマルチタスク機能を備え
たマイクロコンピュータプログラマブルコントローラに
おいては、さらに、前記各プログラムブロックに対応さ
せて、プログラムカウンタ、ブロックスタートアドレス
及びブロックエンドアドレスが格納されたヘッダ情報格
納部、実行しようとする命令語が格納されたプログラム
ブロック格納部、並びに各プログラムブロックにおいて
必要な情報が格納され管理されるローカルレジスタ格納
部が配設される。
In another embodiment of the microcomputer programmable controller having a multitasking function of the present invention, a header information storing a program counter, a block start address and a block end address corresponding to each program block. A program block storage unit in which a command word to be executed is stored, and a local register storage unit in which necessary information is stored and managed in each program block.

【0008】そして、前記ヘッダ情報格納部、プログラ
ムブロック格納部及びローカルレジスタ格納部は、プロ
グラムブロックと生成及び消滅を共にする。
The header information storage unit, the program block storage unit, and the local register storage unit both generate and delete the program block.

【0009】本発明の更に他のマルチタスク機能を備え
たマイクロコンピュータプログラマブルコントローラに
おいては、さらに、前記マルチタスクプログラム実行ユ
ニットは、マルチタスクを実行するための制御信号を前
記各プログラムブロックに対して出力する中央処理装
置、該中央処理装置によって制御され、各プログラムブ
ロックのうちの実行しようとするプログラムが格納され
たプログラムブロックを指定するプログラムブロックカ
ウンタ、指定されたプログラムブロックを選択するプロ
グラムブロック選択部、選択されたプログラムブロック
に格納された命令語を一時的に格納する実行命令語格納
部、前記中央処理装置によって制御され、前記実行命令
語格納部に格納された命令語を解読する命令語解読部、
前記中央処理装置によって制御され、解読された命令語
を演算する演算部、前記中央処理装置がプログラムの命
令に従って演算又はデータの入出力を制御している間
に、前記I/Oレジスタを使用する必要性が生じたと
き、I/Oレジスタを使用することができるかどうかを
検査するI/Oレジスタ使用可否検査部、及び該I/O
レジスタ使用可否検査部による検査結果に基づいて、前
記中央処理装置が使用しようとするI/Oレジスタの内
容を更新するか又は外部に出力するためのI/Oポート
レジスタ変換部を備える。
In another embodiment of the microcomputer programmable controller having a multi-task function, the multi-task program execution unit outputs a control signal for executing a multi-task to each of the program blocks. A central processing unit, a program block counter that is controlled by the central processing unit, and specifies a program block in which a program to be executed among the program blocks is stored, a program block selecting unit that selects the specified program block, An execution command storage unit that temporarily stores the command stored in the selected program block, and a command decoding unit that is controlled by the central processing unit and decodes the command stored in the execution command storage unit ,
A computing unit controlled by the central processing unit to compute a decoded instruction word, using the I / O register while the central processing unit controls computation or data input / output according to a program instruction An I / O register availability check unit for checking whether the I / O register can be used when the need arises, and the I / O register
An I / O port register conversion unit is provided for updating the contents of an I / O register to be used by the central processing unit or outputting the I / O register to the outside based on a check result by the register availability check unit.

【0010】本発明のマルチタスク機能を備えたマイク
ロコンピュータプログラマブルコントローラの制御方法
においては、複数のプログラムブロックごとに形成され
たプログラムによって制御され、各プログラムブロック
間で共通に使用されるデータが、独立したメモリ領域に
割り当てられたグローバルレジスタに格納され、プログ
ラムブロック内だけで使用されるローカル情報が、対応
するプログラムブロック内のローカルレジスタに格納さ
れて管理され、別の入出力命令を実行することなく、I
/Oポートがレジスタ化されて使用されるマルチタスク
機能を備えたマイクロコンピュータプログラマブルコン
トローラに適用される。
In the method of controlling a microcomputer programmable controller having a multitasking function according to the present invention, data controlled by a program formed for each of a plurality of program blocks, and data commonly used among the program blocks is independent. Local information that is stored in the global register allocated to the specified memory area and used only in the program block is stored and managed in the local register in the corresponding program block, without executing another input / output instruction. , I
The present invention is applied to a microcomputer programmable controller having a multitasking function in which an I / O port is registered and used.

【0011】そして、マルチタスクプログラム実行ユニ
ットにおいて前記各プログラムブロックのうちの一つの
プログラムブロックを選択し、選択されたプログラムブ
ロックに格納された命令を前記マルチタスクプログラム
実行ユニットに送り、該マルチタスクプログラム実行ユ
ニットにおいて前記命令に従って演算及び制御を行い、
演算及び制御のための命令が入出力と関係がある内容で
あるかどうかを確認し、入出力と関係がある内容である
場合、前記マルチタスクプログラム実行ユニットにおい
てI/Oレジスタが使用されているかどうかを判断し、
使用されている場合、使用されているI/Oレジスタの
内容を更新するか又は外部に出力した後、I/Oレジス
タに対する演算及び制御を行う。
In the multi-task program execution unit, one of the program blocks is selected, and an instruction stored in the selected program block is sent to the multi-task program execution unit. Performing and controlling according to the instruction in the execution unit,
Check whether the instruction for operation and control has contents related to input / output, and if the contents are related to input / output, check whether the I / O register is used in the multitask program execution unit. Judge whether
If used, the contents of the used I / O register are updated or output to the outside, and then the operation and control on the I / O register are performed.

【0012】[0012]

【発明の実施の形態】以下、本発明の実施の形態につい
て図面を参照しながら詳細に説明する。
Embodiments of the present invention will be described below in detail with reference to the drawings.

【0013】図1は本発明の実施の形態におけるマルチ
タスク機能を備えたマイクロコンピュータプログラマブ
ルコントローラの制御部のブロック図、図2は本発明の
実施の形態におけるマルチタスク機能を備えたマイクロ
コンピュータプログラマブルコントローラの制御部の詳
細図である。
FIG. 1 is a block diagram of a control section of a microcomputer programmable controller having a multitask function according to an embodiment of the present invention. FIG. 2 is a microcomputer programmable controller having a multitask function according to an embodiment of the present invention. FIG. 3 is a detailed diagram of a control unit.

【0014】図に示されるように、制御部は、複数のプ
ログラムブロック#1〜#n、及び該各プログラムブロ
ック#1〜#nと対応させて、かつ、互いに分離させて
それぞれ配設され、ローカル情報を管理するローカルレ
ジスタを備えたプログラムブロック部200、グローバ
ル・I/Oレジスタ300、並びに前記各プログラムブ
ロック#1〜#nに格納されたプログラムを同時に実行
するための制御信号を出力し、入出力を制御するマルチ
タスクプログラム実行ユニット100を有する。前記各
プログラムブロック#1〜#nには、実行しようとする
命令、すなわち、機械語で作成された命令語がプログラ
ム化され、ブロック化されて格納される。そして、前記
グローバル・I/Oレジスタ300は、各プログラムブ
ロック#1〜#n間で共通に使用される情報等を管理
し、各プログラムブロック#1〜#nの生成及び消滅の
影響を受けない独立したメモリ領域に割り当てられたグ
ローバルレジスタ301、並びにディジタル入出力、ア
ナログ入出力及びエンコーダ入力をレジスタ化して処理
するためのI/Oレジスタ302を有する。なお、該I
/Oレジスタ302は、中央処理装置105によって必
要に応じて生成され、消滅させられる。
As shown in the figure, the control unit is provided in correspondence with a plurality of program blocks # 1 to #n and each of the program blocks # 1 to #n and separately from each other. A program block unit 200 having a local register for managing local information, a global I / O register 300, and a control signal for simultaneously executing programs stored in the program blocks # 1 to #n are output. It has a multitask program execution unit 100 that controls input and output. In each of the program blocks # 1 to #n, an instruction to be executed, that is, an instruction word created in a machine language is programmed, stored in blocks, and stored. The global I / O register 300 manages information and the like commonly used among the program blocks # 1 to #n, and is not affected by generation and disappearance of the program blocks # 1 to #n. It has a global register 301 assigned to an independent memory area, and an I / O register 302 for registering and processing digital input / output, analog input / output, and encoder input. The I
The / O register 302 is generated and deleted as needed by the central processing unit 105.

【0015】前記プログラムブロック#1〜#nは、プ
ログラムを実行するためのデータの集合であり、プログ
ラムを実行するのに必要なすべての情報を含み、相互に
影響を与えず、独立してプログラムを実行するようにな
っている。そして、各プログラムブロック#1〜#n間
で共通に使用される情報は、前記グローバルレジスタ3
01に格納され、各プログラムブロック#1〜#n内に
おいてだけ使用されるローカル情報は、ローカルレジス
タに格納される。
Each of the program blocks # 1 to #n is a set of data for executing the program, includes all information necessary for executing the program, does not affect each other, and is independent of the program. Is to be executed. The information commonly used among the program blocks # 1 to #n is stored in the global register 3.
01 and used only in each of the program blocks # 1 to #n is stored in a local register.

【0016】また、前記プログラムブロック#1〜#n
によってプログラムブロック格納部202が形成され、
該プログラムブロック格納部202に対応させて、プロ
グラムカウンタ(PC#1〜PC#n)、ブロックスタ
ートアドレス(BSA#1〜BSA#n)及びブロック
エンドアドレス(BEA#1〜BEA#n)が格納され
たヘッダ情報格納部201、並びに前記各プログラムブ
ロック#1〜#nにおいて必要な情報が格納され管理さ
れるローカルレジスタから成るローカルレジスタ格納部
203が配設される。
The program blocks # 1 to #n
Forms a program block storage unit 202,
A program counter (PC # 1 to PC # n), a block start address (BSA # 1 to BSA # n) and a block end address (BEA # 1 to BEA # n) are stored in correspondence with the program block storage unit 202. A header information storage unit 201 and a local register storage unit 203 including a local register for storing and managing necessary information in each of the program blocks # 1 to #n are provided.

【0017】前記プログラムブロック#1〜#nは、プ
ログラムの作成によって生成され消滅させられる。そし
て、プログラムカウンタ、ブロックスタートアドレス、
ブロックエンドアドレス及びローカルレジスタも、対応
するプログラムブロック#1〜#nと共に生成され消滅
させられる。
The program blocks # 1 to #n are generated and deleted by creating a program. And the program counter, block start address,
The block end address and the local register are also generated and deleted together with the corresponding program blocks # 1 to #n.

【0018】この場合、前記各ローカルレジスタは、対
応するプログラムブロック#1〜#nと生成及び消滅を
共にするので、各プログラムブロック#1〜#nだけで
有効になる。したがって、相互に異なるプログラムブロ
ック#1〜#n内のローカルレジスタが同じ名称を有し
ていても、前記ローカルレジスタは、相互に影響を与え
ない個別のレジスタとして使用される。
In this case, since each of the local registers is generated and erased together with the corresponding program block # 1 to #n, it is effective only in each of the program blocks # 1 to #n. Therefore, even if local registers in different program blocks # 1 to #n have the same name, the local registers are used as individual registers that do not affect each other.

【0019】一方、前記グローバル・I/Oレジスタ3
00は、すべてのプログラムブロック#1〜#nで有効
であり、各プログラムブロック#1〜#nは、グローバ
ル・I/Oレジスタ300を参照してデータの加工及び
演算を行う。
On the other hand, the global I / O register 3
00 is valid in all the program blocks # 1 to #n. Each of the program blocks # 1 to #n refers to the global I / O register 300 to process and operate data.

【0020】前記マルチタスクプログラム実行ユニット
100は、マルチタスクを実行するための制御信号を前
記各プログラムブロック#1〜#nに対して出力する中
央処理装置105、該中央処理装置105によって制御
され、各プログラムブロック#1〜#nのうちの実行し
ようとするプログラムが格納されたプログラムブロック
#1〜#nを指定するプログラムブロックカウンタ10
4、指定されたプログラムブロック#1〜#nを選択す
るプログラムブロック選択部103、選択されたプログ
ラムブロック#1〜#nに格納された命令語を一時的に
格納する実行命令語格納部101、前記中央処理装置1
05によって制御され、前記実行命令語格納部101に
格納された命令語を解読する命令語解読部102、前記
中央処理装置105によって制御され、解読された命令
語を演算する演算部106、I/Oレジスタ使用可否検
査部107、及びI/Oポートレジスタ変換部108か
ら成る。
The multitask program execution unit 100 outputs a control signal for executing a multitask to each of the program blocks # 1 to #n, and is controlled by the central processing device 105. A program block counter 10 for designating program blocks # 1 to #n in which a program to be executed among the program blocks # 1 to #n is stored.
4. a program block selection unit 103 for selecting the designated program blocks # 1 to #n; an execution instruction storage unit 101 for temporarily storing the instructions stored in the selected program blocks # 1 to #n; Central processing unit 1
05, a command decoding unit 102 for decoding the command stored in the execution command storage unit 101, an arithmetic unit 106 controlled by the central processing unit 105 to calculate the decoded command, an I / O It comprises an O register availability check unit 107 and an I / O port register conversion unit 108.

【0021】前記I/Oレジスタ使用可否検査部107
は、前記中央処理装置105がプログラムの命令に従っ
て演算又はデータの入出力を制御している間に、I/O
レジスタ302を使用する必要性が生じたとき、該I/
Oレジスタ302を使用することができるかどうかを検
査する。そして、前記I/Oポートレジスタ変換部10
8は、前記I/Oレジスタ使用可否検査部107による
検査結果に基づいて、前記中央処理装置105が使用し
ようとするI/Oレジスタ302の内容を更新するか又
は外部に出力する。
The I / O register availability check section 107
While the central processing unit 105 controls operations or input / output of data in accordance with instructions of a program,
When it becomes necessary to use the register 302, the I / O
Check if the O register 302 can be used. The I / O port register conversion unit 10
Reference numeral 8 updates the contents of the I / O register 302 to be used by the central processing unit 105 or outputs the contents to the outside based on the inspection result by the I / O register availability checking unit 107.

【0022】次に、前記マルチタスク機能を備えたマイ
クロコンピュータプログラマブルコントローラの制御方
法について説明する。
Next, a control method of the microcomputer programmable controller having the multitask function will be described.

【0023】まず、複数のプログラムを同時に実行する
場合、機械語で作成された命令語がプログラム化され、
ブロック化されてプログラムブロック#1〜#nに格納
される。そして、各プログラムブロック#1〜#nが形
成されると、前記中央処理装置105は、マルチタスク
機能を実行するために、前記プログラムブロックカウン
タ104の値を順に増加させることによって、プログラ
ムブロック#1〜#n内からプログラムブロックを指定
し、指定されたプログラムブロックがプログラムブロッ
ク選択部103によって選択される。
First, when a plurality of programs are to be executed at the same time, instruction words created in machine language are programmed,
It is divided into blocks and stored in program blocks # 1 to #n. When each of the program blocks # 1 to #n is formed, the central processing unit 105 sequentially increases the value of the program block counter 104 in order to execute the multitask function. To #n, and the specified program block is selected by the program block selection unit 103.

【0024】該プログラムブロック選択部103は、対
応するプログラムブロック内においてプログラムカウン
タによって指定され、実行待機中である機械語を実行命
令語格納部101に移動させる。そして、前記プログラ
ムカウンタは、次の命令語を実行するためにポインタ値
を増加させる。
The program block selecting section 103 moves the machine language designated by the program counter in the corresponding program block and waiting for execution to the execution instruction word storage section 101. Then, the program counter increases the pointer value to execute the next command.

【0025】このとき、前記中央処理装置105は、プ
ログラムブロックカウンタ104の値を更新することに
よって次のプログラムブロックを指定する。これによ
り、各プログラムがプログラムブロック#1〜#nの数
だけ順に実行され、マルチタスクが実行される。
At this time, the central processing unit 105 specifies the next program block by updating the value of the program block counter 104. Thereby, each program is sequentially executed by the number of program blocks # 1 to #n, and a multitask is executed.

【0026】一方、前記実行命令語格納部101に移動
させられた命令語は、前記命令語解読部102によって
解読された後、前記中央処理装置105によって実行さ
れ、その結果、演算又はデータの入出力の制御が行われ
る。そのために、前記I/Oレジスタ302は、単にデ
ータを格納する機能だけでなく、入出力の機能を備えた
機能性レジスタによって構成される。
On the other hand, the instruction word moved to the execution instruction word storage unit 101 is decoded by the instruction word decoding unit 102, and then executed by the central processing unit 105. As a result, an operation or input of data is performed. Output control is performed. To this end, the I / O register 302 is constituted by a functional register having not only a function of storing data but also an input / output function.

【0027】そして、ユーザプログラムによってI/O
レジスタ302にデータを書き込んだり(入力)、I/
Oレジスタ302からデータを読み出したり(出力)す
ることができるように、I/Oレジスタ302は、それ
に該当する固有の機能を有する。
Then, I / O is performed by a user program.
Writing data to the register 302 (input),
The I / O register 302 has a specific function so that data can be read or output from the O register 302.

【0028】また、前記中央処理装置105による演算
又は入出力の制御が行われている間に、I/Oレジスタ
302の内容の変更等を行う必要が生じた場合、前記I
/Oレジスタ302は、前記中央処理装置105がI/
Oレジスタ302の値を変更する前に、前記I/Oレジ
スタ使用可否検査部107の検査結果に基づいて、内容
の変更又は出力のための処理を自動的に行う。
If it is necessary to change the contents of the I / O register 302 while the arithmetic processing or input / output control is being performed by the central processing unit 105,
The / O register 302 indicates that the central processing unit 105 has an I / O
Before the value of the O register 302 is changed, processing for changing or outputting the content is automatically performed based on the inspection result of the I / O register availability check unit 107.

【0029】すなわち、前記中央処理装置105がI/
Oレジスタ302を使用する必要が生じると、前記I/
Oレジスタ使用可否検査部107は、I/Oレジスタ3
02が使用中であるかどうかを判断する。そして、I/
Oレジスタ302が使用中であると判断されると、中央
処理装置105は、直ちに、I/Oポートレジスタ変換
器108によって、I/Oレジスタ302の内容を、入
力レジスタについては変更し、出力レジスタについては
新しい命令語を受けることができるように外部に出力す
る。
That is, the central processing unit 105 controls the I / O
When it becomes necessary to use the O register 302, the I / O
The O-register availability check unit 107 outputs the I / O register 3
02 is being used. And I /
When it is determined that the O register 302 is in use, the central processing unit 105 immediately changes the contents of the I / O register 302 for the input register by the I / O port register converter 108, and Is output to the outside so that a new command can be received.

【0030】この場合、入/出力されるデータがI/O
レジスタ302に格納されるだけでハードウェアによる
入/出力が自動的に制御されるので、別の入出力命令が
実行されなくても、I/Oポートレジスタ変換部108
におけるハードウェアのI/Oポートがレジスタ化され
て使用される。したがって、I/Oレジスタ302とハ
ードウェアとは、I/Oポートレジスタ変換部108を
介して直接入/出力のやりとりが行われる。
In this case, the input / output data is I / O
Since input / output by hardware is automatically controlled only by being stored in the register 302, the I / O port register conversion unit 108 can be executed even if another input / output instruction is not executed.
The hardware I / O port is registered and used. Therefore, the I / O register 302 and the hardware directly exchange input / output via the I / O port register conversion unit 108.

【0031】また、プログラムブロック#1〜#nごと
に形成されたプログラムによって制御が行われ、各プロ
グラムブロック#1〜#n間で共通に使用されるデータ
が、独立したメモリ領域に割り当てられたグローバルレ
ジスタ301に格納され、各プログラムブロック#1〜
#n内だけで使用されるローカル情報が、対応するプロ
グラムブロック#1〜#n内のローカルレジスタに格納
され管理されるようになっているので、レジスタ不足が
発生するのを防止することができるだけでなく、プログ
ラムの作成及び実行時におけるシステムの効率を高くす
ることができる。
Further, control is performed by a program formed for each of the program blocks # 1 to #n, and data commonly used among the program blocks # 1 to #n is allocated to an independent memory area. Each program block # 1 is stored in the global register 301.
Since local information used only in #n is stored and managed in local registers in the corresponding program blocks # 1 to #n, it is possible to prevent shortage of registers as much as possible. Instead, the efficiency of the system at the time of creating and executing a program can be increased.

【0032】そして、ディジタル入出力、アナログ入出
力及びエンコーダ入力をレジスタ化して処理するための
I/Oレジスタ302が配設されるので、別の入出力命
令を実行する必要がない。
Since the I / O register 302 for registering and processing digital input / output, analog input / output, and encoder input is provided, there is no need to execute another input / output instruction.

【0033】なお、本発明は前記実施の形態に限定され
るものではなく、本発明の趣旨に基づいて種々変形させ
ることが可能であり、それらを本発明の範囲から排除す
るものではない。
The present invention is not limited to the above embodiment, but can be variously modified based on the gist of the present invention, and they are not excluded from the scope of the present invention.

【0034】[0034]

【発明の効果】以上詳細に説明したように、本発明によ
れば、マルチタスク機能を備えたマイクロコンピュータ
プログラマブルコントローラにおいては、実行しようと
する命令語がそれぞれ格納された複数のプログラムブロ
ックと、該各プログラムブロックと対応させて、かつ、
互いに分離させてそれぞれ配設され、ローカル情報を管
理するローカルレジスタと、前記各プログラムブロック
の生成及び消滅の影響を受けない独立したメモリ領域に
割り当てられ、各プログラムブロック間で共通に使用さ
れる情報を管理するグローバルレジスタ、並びにディジ
タル入出力、アナログ入出力及びエンコーダ入力をレジ
スタ化して処理するためのI/Oレジスタを備えたグロ
ーバル・I/Oレジスタと、前記各プログラムブロック
に格納されたプログラムを同時に実行するための制御信
号を出力し、入出力を制御するマルチタスクプログラム
実行ユニットとを有する。
As described above in detail, according to the present invention, in a microcomputer programmable controller having a multitasking function, a plurality of program blocks each storing an instruction word to be executed, Corresponding to each program block, and
A local register which is provided separately from each other and manages local information, and information which is allocated to an independent memory area which is not affected by generation and extinction of each of the program blocks, and which is commonly used among the program blocks. Global I / O register having an I / O register for registering and processing digital input / output, analog input / output and encoder input, and a program stored in each of the program blocks. A multi-task program execution unit that outputs control signals for simultaneous execution and controls input / output.

【0035】この場合、プログラムブロックごとに形成
されたプログラムによって制御され、各プログラムブロ
ック間で共通に使用される情報が、独立したメモリ領域
に割り当てられたグローバルレジスタに格納され、プロ
グラムブロック内だけで使用されるローカル情報が、対
応するプログラムブロック内のローカルレジスタに格納
され管理されるようになっているので、レジスタ不足が
発生するのを防止することができるだけでなく、プログ
ラムの作成及び実行時におけるシステムの効率を高くす
ることができる。
In this case, information controlled by a program formed for each program block and commonly used among the program blocks is stored in a global register allocated to an independent memory area. Since the local information to be used is stored and managed in a local register in the corresponding program block, it is possible not only to prevent a shortage of registers from occurring, but also to create and execute a program at the time of program creation and execution. The efficiency of the system can be increased.

【0036】また、ディジタル入出力、アナログ入出力
及びエンコーダ入力をレジスタ化して処理するためのI
/Oレジスタが配設されるので、別の入出力命令を実行
する必要がない。
An I / O for registering and processing digital input / output, analog input / output and encoder input.
Since the / O register is provided, there is no need to execute another input / output instruction.

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

【図1】本発明の実施の形態におけるマルチタスク機能
を備えたマイクロコンピュータプログラマブルコントロ
ーラの制御部のブロック図である。
FIG. 1 is a block diagram of a control unit of a microcomputer programmable controller having a multitask function according to an embodiment of the present invention.

【図2】本発明の実施の形態におけるマルチタスク機能
を備えたマイクロコンピュータプログラマブルコントロ
ーラの制御部の詳細図である。
FIG. 2 is a detailed diagram of a control section of a microcomputer programmable controller having a multitask function according to the embodiment of the present invention.

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

100 マルチタスクプログラム実行ユニット 101 実行命令語格納部 102 命令語解読部 103 プログラムブロック選択部 104 プログラムブロックカウンタ 105 中央処理装置 106 演算部 107 I/Oレジスタ使用可否検査部 108 I/Oポートレジスタ変換部 201 ヘッダ情報格納部 202 プログラムブロック格納部 203 ローカルレジスタ格納部 300 グローバル・I/Oレジスタ 301 グローバルレジスタ 302 I/Oレジスタ REFERENCE SIGNS LIST 100 multitask program execution unit 101 execution instruction word storage unit 102 instruction word decoding unit 103 program block selection unit 104 program block counter 105 central processing unit 106 operation unit 107 I / O register availability check unit 108 I / O port register conversion unit 201 Header information storage unit 202 Program block storage unit 203 Local register storage unit 300 Global I / O register 301 Global register 302 I / O register

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 (a)実行しようとする命令語がそれぞ
れ格納された複数のプログラムブロックと、(b)該各
プログラムブロックと対応させて、かつ、互いに分離さ
せてそれぞれ配設され、ローカル情報を管理するローカ
ルレジスタと、(c)前記各プログラムブロックの生成
及び消滅の影響を受けない独立したメモリ領域に割り当
てられ、各プログラムブロック間で共通に使用される情
報を管理するグローバルレジスタ、並びにディジタル入
出力、アナログ入出力及びエンコーダ入力をレジスタ化
して処理するためのI/Oレジスタを備えたグローバル
・I/Oレジスタと、(d)前記各プログラムブロック
に格納されたプログラムを同時に実行するための制御信
号を出力し、入出力を制御するマルチタスクプログラム
実行ユニットとを有することを特徴とするマルチタスク
機能を備えたマイクロコンピュータプログラマブルコン
トローラ。
(A) a plurality of program blocks each storing an instruction word to be executed; and (b) a plurality of program blocks each corresponding to each of the program blocks and separated from each other. (C) a global register which is allocated to an independent memory area which is not affected by the generation and erasure of each program block, and which manages information commonly used among the program blocks; and A global I / O register having an I / O register for registering and processing input / output, analog input / output, and encoder input; and (d) for simultaneously executing programs stored in the program blocks. It has a multitask program execution unit that outputs control signals and controls input / output. A microcomputer programmable controller having a multitasking function.
【請求項2】 前記各プログラムブロックは、プログラ
ムを実行するためのデータの集合であり、プログラムを
実行するために必要なすべての情報を備え、相互に影響
を与えることなく、独立してプログラムを実行する請求
項1に記載のマルチタスク機能を備えたマイクロコンピ
ュータプログラマブルコントローラ。
2. Each of the program blocks is a set of data for executing the program, includes all information necessary for executing the program, and independently executes the program without affecting each other. A microcomputer programmable controller having a multitasking function according to claim 1 to execute.
【請求項3】 (a)前記各プログラムブロックに対応
させて、プログラムカウンタ、ブロックスタートアドレ
ス及びブロックエンドアドレスが格納されたヘッダ情報
格納部、実行しようとする命令語が格納されたプログラ
ムブロック格納部、並びに各プログラムブロックにおい
て必要な情報が格納され管理されるローカルレジスタ格
納部が配設され、(b)前記ヘッダ情報格納部、プログ
ラムブロック格納部及びローカルレジスタ格納部は、プ
ログラムブロックと生成及び消滅を共にする請求項1又
は2に記載のマルチタスク機能を備えたマイクロコンピ
ュータプログラマブルコントローラ。
3. A header information storage unit storing a program counter, a block start address and a block end address, and a program block storage unit storing an instruction to be executed, corresponding to each of the program blocks. And a local register storage unit in which necessary information is stored and managed in each program block is provided. (B) The header information storage unit, the program block storage unit, and the local register storage unit are generated and erased as program blocks. A microcomputer programmable controller having a multitasking function according to claim 1 or 2, further comprising:
【請求項4】 前記マルチタスクプログラム実行ユニッ
トは、マルチタスクを実行するための制御信号を前記各
プログラムブロックに対して出力する中央処理装置、該
中央処理装置によって制御され、各プログラムブロック
のうちの実行しようとするプログラムが格納されたプロ
グラムブロックを指定するプログラムブロックカウン
タ、指定されたプログラムブロックを選択するプログラ
ムブロック選択部、選択されたプログラムブロックに格
納された命令語を一時的に格納する実行命令語格納部、
前記中央処理装置によって制御され、前記実行命令語格
納部に格納された命令語を解読する命令語解読部、前記
中央処理装置によって制御され、解読された命令語を演
算する演算部、前記中央処理装置がプログラムの命令に
従って演算又はデータの入出力を制御している間に、前
記I/Oレジスタを使用する必要性が生じたとき、I/
Oレジスタを使用することができるかどうかを検査する
I/Oレジスタ使用可否検査部、及び該I/Oレジスタ
使用可否検査部による検査結果に基づいて、前記中央処
理装置が使用しようとするI/Oレジスタの内容を更新
するか又は外部に出力するためのI/Oポートレジスタ
変換部を備える請求項1に記載のマルチタスク機能を備
えたマイクロコンピュータプログラマブルコントロー
ラ。
4. The multi-task program execution unit outputs a control signal for executing a multi-task to each of the program blocks, and is controlled by the central processing device. A program block counter for designating a program block in which a program to be executed is stored; a program block selector for selecting the designated program block; and an execution instruction for temporarily storing a command stored in the selected program block Word storage,
A command decoding unit that is controlled by the central processing unit and decodes a command stored in the execution command storage unit; an arithmetic unit that is controlled by the central processing unit and calculates the decoded command; When the necessity of using the I / O register arises while the device controls operations or input / output of data according to the instructions of the program,
An I / O register availability checking unit for checking whether the O register can be used, and an I / O register to be used by the central processing unit based on a check result by the I / O register availability checking unit. 2. The microcomputer programmable controller having a multitasking function according to claim 1, further comprising an I / O port register converter for updating the content of the O register or outputting the content to the outside.
【請求項5】 複数のプログラムブロックごとに形成さ
れたプログラムによって制御され、各プログラムブロッ
ク間で共通に使用されるデータが、独立したメモリ領域
に割り当てられたグローバルレジスタに格納され、プロ
グラムブロック内だけで使用されるローカル情報が、対
応するプログラムブロック内のローカルレジスタに格納
されて管理され、別の入出力命令を実行することなく、
I/Oポートがレジスタ化されて使用されるマルチタス
ク機能を備えたマイクロコンピュータプログラマブルコ
ントローラの制御方法において、(a)マルチタスクプ
ログラム実行ユニットにおいて前記各プログラムブロッ
クのうちの一つのプログラムブロックを選択し、(b)
選択されたプログラムブロックに格納された命令を前記
マルチタスクプログラム実行ユニットに送り、(c)該
マルチタスクプログラム実行ユニットにおいて前記命令
に従って演算及び制御を行い、(d)演算及び制御のた
めの命令が入出力と関係がある内容であるかどうかを確
認し、(e)入出力と関係がある内容である場合、前記
マルチタスクプログラム実行ユニットにおいてI/Oレ
ジスタが使用されているかどうかを判断し、使用されて
いる場合、使用されているI/Oレジスタの内容を更新
するか又は外部に出力した後、I/Oレジスタに対する
演算及び制御を行うことを特徴とするマルチタスク機能
を備えたマイクロコンピュータプログラマブルコントロ
ーラの制御方法。
5. Data controlled by a program formed for each of a plurality of program blocks and commonly used among the program blocks is stored in a global register allocated to an independent memory area. The local information used by is stored and managed in a local register in the corresponding program block, without executing another input / output instruction,
In a control method of a microcomputer programmable controller having a multitasking function in which an I / O port is registered and used, (a) selecting one of the program blocks from the program blocks in a multitasking program execution unit , (B)
Sending the instructions stored in the selected program block to the multi-task program execution unit, (c) performing operations and controls in accordance with the instructions in the multi-task program execution unit, and (d) executing instructions for the operations and controls. (E) If the content is related to input / output, determine whether the I / O register is used in the multitask program execution unit; A microcomputer having a multitasking function for updating and / or outputting the contents of an I / O register being used, and then performing operations and control on the I / O register; Control method of programmable controller.
JP11209271A 1998-07-25 1999-07-23 Micro computer programmable controller provided with multi-task function and its control method Pending JP2000056991A (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR1019980030002A KR100294655B1 (en) 1998-07-25 1998-07-25 How to Control a My Programmable Controller That Performs a Multitask Function
KR1998-30002 1998-07-25

Publications (1)

Publication Number Publication Date
JP2000056991A true JP2000056991A (en) 2000-02-25

Family

ID=19545179

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11209271A Pending JP2000056991A (en) 1998-07-25 1999-07-23 Micro computer programmable controller provided with multi-task function and its control method

Country Status (3)

Country Link
JP (1) JP2000056991A (en)
KR (1) KR100294655B1 (en)
CN (1) CN1119744C (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111309482B (en) * 2020-02-20 2023-08-15 浙江亿邦通信科技有限公司 Hash algorithm-based block chain task allocation system, device and storable medium

Also Published As

Publication number Publication date
KR20000009522A (en) 2000-02-15
CN1119744C (en) 2003-08-27
CN1267021A (en) 2000-09-20
KR100294655B1 (en) 2001-07-12

Similar Documents

Publication Publication Date Title
KR0138468B1 (en) Micro computer
EP0148478A2 (en) A data processor with control of the significant bit lenghts of general purpose registers
US5600807A (en) Programmable controller capable of updating a user program during operation by switching between user program memories
JPS6122817B2 (en)
JPS5941209B2 (en) Bi-programmable electronic accounting system
JP2000056991A (en) Micro computer programmable controller provided with multi-task function and its control method
JP3490005B2 (en) Instruction control apparatus and method
US5893928A (en) Data movement apparatus and method
JPH08249018A (en) Multiprocessor arithmetic device and programmable controller having the device
JPH11259308A (en) Programmable controller
JPH0348333A (en) Processor and plotting processor
JPH0713758A (en) Instruction decoding method
JPH0319570B2 (en)
JPS6152748A (en) Trace selection method for microcomputer development equipment
JPH05282143A (en) Main storage access control circuit
JP2862369B2 (en) Image display control device
JP2000029508A (en) Programmable controller
JPH0772908A (en) Programmable controller
JPS6158042A (en) Microprogram control system
JPS603656B2 (en) Computer memory expansion method
JPH0778730B2 (en) Information processing equipment
JPS59119413A (en) Programmable controller
JPH08297583A (en) Interrupt handling apparatus and method thereof
JP2001184339A (en) Vector arithmetic unit
JPS62147545A (en) Transfer command processing method in information processing equipment