JPS60220427A - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JPS60220427A
JPS60220427A JP59076504A JP7650484A JPS60220427A JP S60220427 A JPS60220427 A JP S60220427A JP 59076504 A JP59076504 A JP 59076504A JP 7650484 A JP7650484 A JP 7650484A JP S60220427 A JPS60220427 A JP S60220427A
Authority
JP
Japan
Prior art keywords
instruction
program
memory
flag
address
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP59076504A
Other languages
Japanese (ja)
Inventor
Toshio Endo
利雄 遠藤
Tadashi Okamoto
正 岡本
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 Ltd
Original Assignee
Hitachi 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 Ltd filed Critical Hitachi Ltd
Priority to JP59076504A priority Critical patent/JPS60220427A/en
Publication of JPS60220427A publication Critical patent/JPS60220427A/en
Pending legal-status Critical Current

Links

Landscapes

  • Executing Machine-Instructions (AREA)
  • Debugging And Monitoring (AREA)

Abstract

PURPOSE:To reduce the load on a programming tool function which process a job equivalent to a branch instruction by providing condition deciding flag register and a means which perform the processing equivalent to a branch instruction without jumping a program address. CONSTITUTION:An instruction part is decoded by an instruction decoder 5 for an instruction that is read out of a program memory 2 by a program counter 1. The data fed from a data memory 3 are processed by a microprogram counter 6, a microprogram memory 7 and an arithmetic circuit 8. A flag register 10 sets up a flag to decide whether the next instruction is executed or an NOP (no operation) is decided by an instruction which performs the processing equivalent to a branch instruction. An instruction read out of the memory 2 is decoded by the decoder 5 together with the flag of the register 10. Then data are processed by the counter 6, the memory 7 and the circuit 8.

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明はプラントのプロセス制御に用いるプログラマブ
ル・コントローラに係り、プログラミング及びデパック
時に簡単なプログラミング・ツールで好適な処理を行な
うプログラマブル・コントローラの内部回路に関する。
Detailed Description of the Invention [Field of Application of the Invention] The present invention relates to a programmable controller used for plant process control, and relates to an internal circuit of a programmable controller that performs suitable processing with a simple programming tool during programming and depacking. .

〔発明の背景〕[Background of the invention]

従来、プログラムを作成し、デパックや調整の時に、そ
のプログラムに変更が生じた場合、ブランチ命令では命
令の追加、削除等の変更の都度、プログラムアドレスを
変更し、リアセンプルを行なっている。つまり、プログ
ラム作成者、あるいは、プログラミング・ツールがプロ
グラムアドレスの管理を行なっているわけである。
Conventionally, when a program is created and the program is changed during depacking or adjustment, the program address is changed and reassembled using a branch instruction each time there is a change such as addition or deletion of an instruction. In other words, the program creator or programming tool manages program addresses.

〔発明の目的〕[Purpose of the invention]

本発明の目的は、ブランチ命令相当の処理の為のプログ
ラミング・ツール機能を軽減し、高級言語のイメージで
プログラミングが行なえ、システム立上げ時や調整時の
デパック効率を向上させたプログラマブル・コントロー
ラを提供するにある。
The purpose of the present invention is to provide a programmable controller that reduces the programming tool functions for processing equivalent to branch instructions, allows programming using a high-level language image, and improves depacking efficiency during system startup and adjustment. There is something to do.

〔発明の実施例〕[Embodiments of the invention]

プログラムカウンタで、プログラムメモリのアドレス順
に処理を行なうコンピュータの構成を第1図に示す。
FIG. 1 shows the configuration of a computer that uses a program counter to perform processing in the order of program memory addresses.

プログラムカウンタ1でプログラムメモリ2から読み出
された1命令は、その命令部を命令デコーダ5で解読さ
れ、マイクロブログラムカウンタ6、マイクロプログラ
ムメモリ7、及び演算回路8によりデータメモリ3から
のデータの処理を行なう。プログラムアドレスがジャン
プするようなブランチ命令を第2図に示す。
One instruction read from the program memory 2 by the program counter 1 has its instruction part decoded by the instruction decoder 5, and the data is read from the data memory 3 by the microprogram counter 6, microprogram memory 7, and arithmetic circuit 8. Process. FIG. 2 shows a branch instruction in which the program address jumps.

第2図のようなブランチ命令は、条件を判定しこれが成
立した時は、プログラムAを実行し、不成立の時はプロ
グラムBを実行するもので、そのプログラム例を第3図
に示す。第3図の高級言語によるプログラムは、条件成
立時(THEN)はプログラムAを実行し、プログラム
Bを行なわない、つまり、ノーオペレーション(以下”
NOP”と轄す)として、次のプログラムへ進む。また
、条件不成立時(ELSE)は逆に、プログラムAをN
OPとし、プログラムBを実行することを表わす。
The branch instruction shown in FIG. 2 determines a condition, and when the condition is satisfied, program A is executed, and when the condition is not satisfied, program B is executed. An example of the program is shown in FIG. The program in the high-level language shown in Figure 3 executes program A and does not execute program B when the condition is met (THEN), that is, a no-operation (hereinafter referred to as "
NOP”) and proceed to the next program.In addition, if the condition is not satisfied (ELSE), program A is
OP indicates that program B is to be executed.

第3図のプログラムを実際にプログラムメモリヘスドア
する機械語プログラムに変換すると第4図になる。
When the program shown in FIG. 3 is converted into a machine language program that is actually stored in the program memory, the result is shown in FIG.

ここで、ブランチ命令はプログラムアドレスがジャンプ
するため、プログラム上に実際のジャンプ先アドレスを
指定することになる。たとえば、第4図のアドレス10
01番地のデータはジャンプ先アドレス”1100”と
なる。そこで、たとえば、第5図に示すように、第4図
のプログラムに変更が生じた場合、プログラムBに一個
の命令が追加されるとプログラムAの先頭アドレスは1
100番地から(1100+ 1 )番地となり、プロ
グラム作成者が1001番地のデータ(ジャンプ先アド
レス)も1101に変更することになる。また同様に、
(命令の削除によっても第5図に示すように1100番
地のデータ(ジャンプ先アドレス)の変更が生じる。
Here, since the branch instruction causes the program address to jump, the actual jump destination address is specified on the program. For example, address 10 in Figure 4
The data at address 01 becomes the jump destination address "1100". For example, as shown in FIG. 5, if a change occurs to the program in FIG. 4, and one instruction is added to program B, the start address of program A will be
Address 100 becomes address (1100+1), and the program creator also changes the data at address 1001 (jump destination address) to 1101. Similarly,
(Deletion of an instruction also causes a change in the data at address 1100 (jump destination address) as shown in FIG.

このように、ブランチ命令ではプログラムがアドレス順
に処理されないため、デパックを行なう時に、プログラ
ムを修正すると、プログラム作成者によるアドレス管理
が必要であった。
As described above, since the program is not processed in address order with the branch instruction, if the program is modified during depacking, address management by the program creator is required.

そこで、ブランチ命令相当の処理を行なう命令において
プログラムアドレスがジャンプしない本発明を第6図に
示す。
FIG. 6 shows the present invention in which the program address does not jump in an instruction that performs processing equivalent to a branch instruction.

これは、第3図の高級言語のプログラムが上から下へ処
理が進むのと同様に、IF命令で条件判定し、成立した
ならば処理Aを行、、、、、、、)、不成立ならば処理
Bを行なう。つまり、処理Aでは、T HE Nのプロ
グラムAを実行し、ELSEのプログラムBをNOPと
する。また、処理BではTHEHのプログラムAをNO
Pとして処理し、ELSHのプログラムBを実行する。
This is similar to the high-level language program shown in Figure 3 where the processing progresses from top to bottom.The IF command is used to determine the condition, and if it is true, execute process A. In this case, process B is performed. That is, in process A, program A of T HE N is executed, and program B of ELSE is set to NOP. Also, in process B, program A of THEH is set to NO.
P and executes ELSH program B.

第7図は、第1図に本発明のフラグレジスタを追加した
構成を示す。
FIG. 7 shows a configuration in which the flag register of the present invention is added to FIG. 1.

本発明の特徴であるフラグレジスタ10は、ブランチ命
令相当の処理を行なう命令で次の命令を実行するか、N
OPとするかを判断するフラグを立てるレジスタである
。プログラムメモリ2から読み出された命令は、命令デ
コーダ5で、フラグレジスタ10のフラグといっしょに
解読され、マイクロプログラムカウンタ6、マイクロプ
ログラムメモリ7、演算回路8によりデータの処理が行
なわれる。なお、図中4は命令レジスタ、9はデータレ
ジスタである。ここで、フラグと命令を解読する命令デ
コーダ5の構成を第8図に示す。
The flag register 10, which is a feature of the present invention, is used to determine whether the next instruction is executed with an instruction that performs processing equivalent to a branch instruction, or whether N
This is a register that sets a flag to determine whether it is set as OP. The instruction read from the program memory 2 is decoded together with the flag in the flag register 10 by the instruction decoder 5, and the data is processed by the microprogram counter 6, microprogram memory 7, and arithmetic circuit 8. Note that in the figure, 4 is an instruction register, and 9 is a data register. Here, the configuration of the instruction decoder 5 for decoding flags and instructions is shown in FIG.

フラグレジスタと命令レジスタの内容を解読する命令デ
コーダでは、フラグレジスタが1の時、ロード命令LD
、ストア命令STなどの各命令を読み出す。フラグレジ
スタが0の時は”NOP”命令とみなす。また、” E
 LS IE ”命令はフラグレジスタの内容を反転す
る命令とし、フラグレジスタが1の時は0にし、フラグ
レジスタが0の時は1とする命令である。
In the instruction decoder that decodes the contents of the flag register and instruction register, when the flag register is 1, the load instruction LD
, store instruction ST, etc. are read. When the flag register is 0, it is regarded as a "NOP" instruction. Also, “E
The LS IE'' instruction is an instruction that inverts the contents of the flag register; when the flag register is 1, it is set to 0, and when the flag register is 0, it is set to 1.

これにより、第6図のフローチャートは、第9図のよう
にプログラムされ、実行される。1000番地の条件判
定命令(IF)により、フラグLl 117(条件成立
)の時はプログラムAを実行し、フラグ反転命令(EL
SE)によりフラグの内容をre O71とし、プログ
ラムBをNOPとする。また、フラグが’o”(条件不
成立)の時は、プログラムAをNOPとしフラグ反転命
令(ELSE)でフラグをtr 1 nとしてプログラ
ムBを実行する。以上の命令が終了後は、フラグレジス
タにy 1 rrをセットし、次の命令を実行する。こ
のように、ブランチ命令の相当の処理がプログラムアド
レスのジャンプ無しに、上から下へと行なわれる。
As a result, the flowchart of FIG. 6 is programmed and executed as shown in FIG. 9. According to the condition judgment instruction (IF) at address 1000, when the flag Ll is 117 (condition satisfied), program A is executed and a flag inversion instruction (EL
SE) sets the contents of the flag to re O71 and sets program B to NOP. Also, when the flag is 'o' (condition not satisfied), program A is set to NOP and program B is executed with the flag set to tr 1 n using a flag inversion instruction (ELSE). After the above instructions are completed, the flag register is Set y 1 rr and execute the next instruction.In this way, the equivalent processing of the branch instruction is performed from top to bottom without jumping the program address.

このため、たとえば、第10図に示すように、プログラ
ムの中に命令の追加及び削除が生じても、プログラム作
成者はジャンプ先のアドレスを気にすることなく、プロ
グラムの修正ができる。
Therefore, for example, as shown in FIG. 10, even if instructions are added or deleted in a program, the program creator can modify the program without worrying about the jump destination address.

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

本発明によれば、ブランチ命令相当の処理において、ア
ドレス管理が不要となり、プログラミング・ツールの機
能の軽減が図れる。また、プランマ゛ トのシステム立上げ時や調整時のデパックもプロへ ダラムを作成する人への負担が軽減され、デパック効率
が向上する。
According to the present invention, address management is not required in processing equivalent to a branch instruction, and the functions of a programming tool can be reduced. In addition, the burden on the person who creates the professional duram for depacking when starting up or adjusting the Planmato system is reduced, and the depacking efficiency is improved.

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

第1図はマイクロコンピュータの構成図、第2図ないし
5図は従来のプログラム例を示す図、第6図は本発明の
詳細な説明図、第7図、第8図は本発明のハード構成図
、第9図、第10図は本発明によるプログラム例を示す
図である。 4・・・命令レジスタ、5・・・命令デコーダ、6・・
・マイクロプログラムカウンタ、10・・・フラグレジ
スタ。 代理人 弁理士 高橋明夫 設 / M カZ詔 テ : 肴 汀 矛 Z m
FIG. 1 is a configuration diagram of a microcomputer, FIGS. 2 to 5 are diagrams showing examples of conventional programs, FIG. 6 is a detailed explanatory diagram of the present invention, and FIGS. 7 and 8 are hardware configurations of the present invention. 9 and 10 are diagrams showing examples of programs according to the present invention. 4...Instruction register, 5...Instruction decoder, 6...
- Micro program counter, 10...Flag register. Agent: Patent Attorney Akio Takahashi / M

Claims (1)

【特許請求の範囲】 ■、プログラム・カウンタでプログラムメモリの命令を
読み出し、命令デコーダで命令を解読し、演算回路によ
り、データメモリの処理を行なうコンピュータを使用し
たプログラマブル・コントローラにおいて。 条件判定フラグレジスタと、プログラムアドレスをジャ
ンプさせることなくブランチ命令相当の処理を行なう手
段とからなることを特徴とするプログラマブル・コント
ローラ。
[Claims] (1) In a programmable controller using a computer, in which a program counter reads instructions from a program memory, an instruction decoder decodes the instructions, and an arithmetic circuit processes the data memory. A programmable controller comprising a condition determination flag register and means for performing processing equivalent to a branch instruction without jumping a program address.
JP59076504A 1984-04-18 1984-04-18 Programmable controller Pending JPS60220427A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59076504A JPS60220427A (en) 1984-04-18 1984-04-18 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59076504A JPS60220427A (en) 1984-04-18 1984-04-18 Programmable controller

Publications (1)

Publication Number Publication Date
JPS60220427A true JPS60220427A (en) 1985-11-05

Family

ID=13607064

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59076504A Pending JPS60220427A (en) 1984-04-18 1984-04-18 Programmable controller

Country Status (1)

Country Link
JP (1) JPS60220427A (en)

Similar Documents

Publication Publication Date Title
JP2554050B2 (en) Data processing method
JPS6250934A (en) Interrupting control system of processor
JPS60220427A (en) Programmable controller
JPH0218729B2 (en)
JPS58200349A (en) Microprogram controller
JPS58139254A (en) Programmable controller
JPH0793151A (en) Instruction supplying device
JPS61213928A (en) Alteration system for program
JPS5842891B2 (en) Meirei Seigiyohoushiki
JPS60186934A (en) Integrated circuit
JPS59135550A (en) Address qualifying device
JPH08221269A (en) Micro program controlling method
JPS63311436A (en) Program patch system
JPH03127171A (en) Vector processor
JPS5999550A (en) Microprogram controller
JPS605302A (en) Programming method of sequence controller
JPH0636161B2 (en) Information processing equipment
JPS6116333A (en) Microprocessor
JPS61276027A (en) Memory system for operating system
JPS60107136A (en) Information processor
JPS6224328A (en) Program counter circuit
JPS6227827A (en) Branch control system for microprogram
JPS6014330A (en) Microprogram controller
JPH04139533A (en) Remodeling system for common routine group
JPS63245524A (en) Microprocessor