JPH03214204A - programmable controller - Google Patents

programmable controller

Info

Publication number
JPH03214204A
JPH03214204A JP827090A JP827090A JPH03214204A JP H03214204 A JPH03214204 A JP H03214204A JP 827090 A JP827090 A JP 827090A JP 827090 A JP827090 A JP 827090A JP H03214204 A JPH03214204 A JP H03214204A
Authority
JP
Japan
Prior art keywords
branch
program
address
program counter
control table
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
JP827090A
Other languages
Japanese (ja)
Inventor
Masami Otobo
乙母 正美
Atsushi Ito
厚 伊東
Tsutomu Takada
勉 高田
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
Hitachi KE Systems Ltd
Original Assignee
Hitachi Ltd
Hitachi Keiyo Engineering 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 Ltd, Hitachi Keiyo Engineering Co Ltd filed Critical Hitachi Ltd
Priority to JP827090A priority Critical patent/JPH03214204A/en
Publication of JPH03214204A publication Critical patent/JPH03214204A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)
  • Programmable Controllers (AREA)

Abstract

(57)【要約】本公報は電子出願前の出願データであるた
め要約のデータは記録されません。
(57) [Summary] This bulletin contains application data before electronic filing, so abstract data is not recorded.

Description

【発明の詳細な説明】[Detailed description of the invention]

〔産業上の利用分野〕 本発明は、プログラムの(1正・変更が容易なプログラ
マフルコントローラに関する。 〔従来の技術〕 従来、実行中のプログラムを停止することなく、プログ
ラムを追加変更する技術として特開昭61−21392
8号に記載のようなプログラム変更方式がある。この方
式は、追加変更のプログラムを現在実行中のプログラム
と別のエリアに作成し、追加変更の際には上記別エリア
のプロゲラl、が実行されないようにしたものである。 〔発明が解決しようとする課題〕 しかし上記従来技術では、プログラムの途中部分の修正
には向いてない。即ち、(修正作業は−通り作り終わ−
)たプロゲラl、を実際に走らせてみてその不具合点を
見付ける訳であるが、不具合点はブロクラムの途中にあ
る。従来技術で変更作業を実行しようとすると、不具合
点をブロクラム本体と別エリアに持ってくるため、別エ
リアの確(7が必要であると共に、変更後にプログラム
を走らせるとき分岐ポイント番地と分岐先番地をレジス
タに保1ヶしてこの内容に従って制御されるので、メモ
リ容量増加が伴うと共に変更のための準備作業、および
制御動作が煩雑になる。変更部分が多数ある場合、その
煩雑さは耐えられないものとなる。 本発明の目的は、現在実行中のプロクラl、を停止する
ことなくプログラムの修正を容易に行えるシーケンスコ
ントローラを提供するものである。 〔課題を解決するための手段〕 上記目的を解決するために、プログラムの修正エリアの
前後部分をそれぞれ示す分岐開始番地と分岐先番地を分
岐制御テーブルに記憶させ、プログラムの修正に際し演
算中のプログラムカウンタの内容と上記分岐制御テーブ
ル内の分岐開始番地とを演算部で比較し、両者が一定の
関係になったときその分岐先番地を上記プログラムカウ
ンタに移してプログラム途中の修正部分を飛び越して演
算を停止することなく連続実行するように構成したもの
である。 さらには、(1!正エリアの前部にフラグを備えた状態
でプログラムをメモリに記憶し、上記1
[Industrial Application Field] The present invention relates to a programmer full controller that allows easy modification and modification of programs. Japanese Patent Publication No. 61-21392
There is a program change method as described in No. 8. In this method, a program for addition and modification is created in a separate area from the program currently being executed, and the program in the separate area is not executed when additions and modifications are made. [Problem to be Solved by the Invention] However, the above-mentioned conventional technology is not suitable for modifying a part in the middle of a program. In other words, (the modification work is completed as expected)
) I tried actually running Progera l, and found the problem, but the problem was in the middle of the block. If you try to execute a change using the conventional technology, the problem will be brought to an area separate from the main body of the block, so you will need a separate area (7), and when you run the program after the change, you will need to specify the branch point address and branch destination. Since addresses are stored in registers and controlled according to the contents, the memory capacity increases and preparation work for changes and control operations become complicated.If there are many parts to change, this complexity becomes unbearable. An object of the present invention is to provide a sequence controller that can easily modify a program without stopping the program currently being executed. In order to solve the purpose, the branch start address and branch destination address, which respectively indicate the front and rear parts of the program modification area, are stored in a branch control table. The branch start address is compared with the branch start address in the arithmetic unit, and when the two have a certain relationship, the branch destination address is transferred to the program counter above, and the program is executed continuously without stopping, skipping the modified part in the middle of the program. Furthermore, (1! The program is stored in memory with a flag at the front of the main area, and the above 1.

【1正エノアの
後部を分岐先番地として分岐制御テーブルの上記フラグ
と対応させた位置(こ記怪し、演算部1テ時に上記フラ
グを検知したとき、このフラグで指示される分岐先番地
を上記分岐制御テーブルから上記プログラムカウンタに
移してプログラム途中の修正部分を飛び越して演算を停
止することなく連続実行するように構成したものである
。 〔作用〕 分岐制御テーブルには1il正する場合だけ1:を正エ
ノアを指定する番地を記tPざぜ、必要に応して複数キ
]記tぎさせろことにより必要な部分をプロゲラJ1の
途中の元の場所で(l杢正することができろ。 また分岐制御テーブル内の分岐番地はプロクラJ1の1
il正時にのみ必要で、該当部分の修正後は削除するた
けて演算実行が開始され、同時に別の新たな11)正の
ために設定が可能となる。さらに、全体のプログラムを
実際に走らせろ時は分岐制御テーブルを介さないため、
動作が単純となる。 〔実施例〕 以下、本発明の詳細な説明する。第1図は本発明の第1
実施例のブロック構成図で、1は各種シーケンス命令を
含むプログラムを格納するブロクラムメモリ、2は実行
すべさ命令のブロクラムメモリ内における格納番地を指
示するプログラムカウンタ、3は実行すべき命令を解読
する命令解読部、4はブロクラムメモリ内におけろ分岐
を開始する番地と分岐先の番地(いづれも後述)を記憶
ずろ分岐制御テーブル、5は破損で囲む各部を含む演算
部、6はプログラムカウンタ2と分岐制御テーブルl■
の分岐開始番地とを比較したり、上記テーブル・1から
分岐先番地を取り出す制御を行う分化・k制御テーブル
制御部、上記制御部6を含み分1tCi令により分岐動
作を行ったり、分岐制御テブルホ11卯部6が取り出し
た分岐先番地をブUクラノ、カウンタ1こ移ず分岐制御
部、8はブロクラム力パノンタを中背するブ[コグラl
、カウンタ更新制御部、51はブロクラムメモリ1から
実行ずへき命令を取り出ゴ命令取出部、IOは演算命令
により演算を行う演算器、11は入力部や内部データメ
モリからデータを読み取り、出力部や内部データメモリ
(こデータを古き込む制御を行うデータ入出力制1ll
11部、12は外部の信号をデータに変換する人力部、
1:3は途中の演W結果を記憶する内部データノモリ、
14はデータを外部の18号に変換する出力部である。 第2図は分岐制御テーブル制御部6内のブロック(ル成
図である。6aは比較部で、プログラムカウンタ2から
の番地と分岐制御テーブル4から涜み出された分岐開始
番地とを比較し、その結果として一致信号と不一致信号
のいずれか一方を出力する。6bは上記テーブル4から
取出すべき分岐開始番地を指定すると共に、上記不一致
信号を受けた時その位置を更新する取出し位置更新部て
ある。6cは」二足取出し位置更新部6bによって指定
された位置から分岐開始$j+!!を取り出す分岐開始
番地取出部で、取り出した分岐開始番地を上記比較部6
aへ順次供給する。6dは、上記比較部C3aて一致し
たときの比較対象となっている分岐開始番地に対応する
分岐先番地を取り出す分岐先番地取出部である。 第3図は」二足メモリと分岐制御テーブル4との閏(!
・を示す説明図である。1aはメモリ1内のm番地の命
令、I bは同しくn番地の命令、lcは同し・< 1
1 + 1番地の命令であり上記m番地とn番地でプロ
グラムの11苫正エリア(変更対象部分)を指定する。 4aは分岐開始番地として上記分岐制御テーブル4に記
憶されたm番地(メモリ1のm番地に対応)、4bは上
記m番地に対応する分岐先番地として−に記分岐先テー
ブル4に記憶されたn番地(メモリlの+1番地に対応
)である。 第・1図はt−記メモリ1内のブログラノ、実1テ動作
時の動作フロー図、第5図は上記メモリ1内プログラム
を実行中(装置の運転中〉てのプログラムの変更((1
x正)のフロー図である。次にメモリ1の実行中のブロ
クラムの一部を(1z正する動作につい゛C説明する。 上記構成において、プログラムメモリ1のm番地から1
1−1番地が変更の対象((j1正エリア)であるもの
とし、011番上n番地は一連のプログラムを実1テす
る上で隣接しても矛盾は発生しないものとずろ。まず分
岐制御テーブル制iaj部6内の比較部C> aが、プ
ログラムカウンタ2と分岐制il!テーブル4ζこ格納
し、である分岐開始番地を全て遂次比較する(第・1図
ステップI 00 )。 もし一致するものがなければ不一致信号を発生し、取出
し部6〔」の動きを禁止して分岐制御テーブル制調部6
はプログラムカウンタに何もしない。 命令取出し部9はプログラムカウンタ2の指示するブ[
コクラムメモリ1の番地から命令を取り出ずくステップ
200)。次に命令取出し部9は命令解読部3を作動さ
せることと並1テしてプログラム力1クンタ更新制御部
8を作動させプログラムカウンタ2を更新し、その結果
プログラムカウンタ2はプログラムメモリ1から取出し
た命令の次の番地を指示するようになる。 もしプログラムカウンタ2がm番地になり分岐開始番地
l↓aに一致した場合、比較部6aは一致信号を発生し
て取出し部6dが動作して分岐制御テーブル4から対応
する分岐先番地4b(n番地)を取出し、分岐制御部7
がこれをプログラムカウンタ2へ移す。命令取出し部9
はそのときのプログラムカウンタ2が指示する番地11
の命令、すなわち分岐先番地のブロクラムメモリの命令
1bを取出す。次に命令取出し部9は命令解読部3を作
動させることと並行してプログラムカウンタ更新ル制御
部8を作動させプログラムカウンタ2を更新し、その結
果プログラムカウンタ2は、ブロクラムメモリ1から取
出した命令1bの次の命令1cの番地n+1を指示する
。このようにしてnlからn−1番地をバイパスして実
行しないようになるのて次にI’nからn−1番地のプ
ログラムの変更を(テう(第5図ステップ300)。変
更を終了したのちブロクラムの文法チエツクを行う(第
5図ステップ400)。もし文法エラーがあった場合は
このまま再度口lからn−1番地のプログラムの編集を
行う。次に文法チエツクを行い、正常に終了した場合は
分岐ル1iallチーフル・1の分岐開始番地4aと分
岐先番地t↓1)を艇効な値、たとえはオール0に書き
かえる(ステップ500)。これによ−)で、mからf
)−1番地を含めてプログラム実行するようになり、運
転中のプログラム変更は終了する。 上記実施例によれはプログラム全体の実1テを止めるこ
となくプログラムの変更を行うことかてき、たとえ不正
にブロクラムが変更された場合でも、異常停止すること
がないという効果がある。 前記実施例では、命令実行待毎回プログラムカウンタ2
の全てと分岐制御テーブル4の分岐開始番地の全てを比
較しているため時間的に無駄かある。そこで、プログラ
ムメモリ1に比較を行うかどうかを1旨示するフラグを
あらかしめ設け、フラグが立−)ているときだけ比較を
行うようにした第2実施例を以下に示す。 7JtJG図は第2実施例における命令の実行動作の流
れ図である。第7図は本実施例におけるブ【コグラムメ
モリ1と分岐、VI#テーブル・・1の関係を示してお
り、1dはI+111番地令、】eは11番地の命令の
フラグ、4cは分岐開始番地として分岐制御テーブル1
1に格納しであるプログラムメモリ1の11111番地
地、4dは分岐先番地として分岐制御テーブル41に格
納しであるプログラムメモリlの11番地の番地である
。 プログラムメモリ1の01番地からn  ]番地か変更
の対象であるとし、m番地とr1番地はブ■コグラムを
隣接して実1了する上で矛盾は発生しないものとする。 まず演算部5内部の命令取出部9〕でプログラムカウン
タ2の指示する番地のプログラムメモリ1から命令を取
出す。命令取出部9は取出した命令にフラグが立ってい
なければそれを命令解読部3へ渡し、命令解読部3を作
動させる。また・これと並行してプログラムカウンタ更
新制御部8を作動させ、プログラムカウンタ2を更新し
、その結果プログラムカウンタ2はプログラムメモリ1
から取出した命令の次の番地を指示するようになる。 プログラムカウンタ2がm番地になった場合は命令取出
部9が取出した命令のフラグ1eが立っているので、命
令の解読、プログラムカウンタ2の更新は1テわず、分
岐制御テーブル制御部6を動作させる。分岐制御テーブ
ル制御部6はプログラムカウンタ2と分岐制御テーブル
4の分岐開始番地を順番に遂次比較し、一致した分岐開
始番地4Cに刻応する分岐先番地l) dを分岐制御テ
ーブル4から取出し、分岐制御部7がプログラムカウン
タ2へ移す。これによって、次に命令取出部9が命令を
取出すプログラムメモリ1の番地はn番地になる。 本実施例によれば、フラグが立っている時だけプログラ
ムカウンタ2と分岐初弾テーブル4の分岐開始番地の比
較を行うため、毎回比較を行う無駄を省くことができる
。 前記2つの実施例では、プログラムカウンタ2と分岐制
御テーブル4の全ての分岐開始番地を比較することによ
って分岐先番地を選択していたが、ン欠の第3実施汐す
ではフ゛ログラムメモリlに複数ビットのフラグを設け
、このフラグが直接分岐11iallテーブル4の分岐
先番地の格納位置を指示するようにして、比較をする必
要をなくした例について示す。 以下では、フラグを3ビットにした例で説明を行う。第
8図は本実施IFJ11における命令の実1テ動作の流
れ図である。第8図は本実施例におけるプログラムメモ
リ2と分岐制御テーブル4の関係を示しており、Ifは
n】番地の命令、1gはm番地の命令のフラグ、4 e
は分岐先番地として分岐*Ji卸テーブル4に格納しで
あるプログラムメモリ1のn番地の番地である。 プログラムメモリ1のm番地からn−1番地が変更対象
であるものとし、m番地とn番地はプログラムを隣接し
実行する上で矛盾は発生しないものとする。m番地の命
令1fの3ビツトのフラグIgをセットし、このフラグ
が指示する分岐制御テーブル4の位置に分岐先番地4e
をセットしておく。 まず演算部5内部の命令取出部9てプログラムカウンタ
2の指示する@II!!のプログラムメモリ1から命令
を取出す。命令取出部9は取出した命令のフラグが1つ
も立っていなければそれを命令解読部3へ濃し、命令解
読部3を作動させる。また、これと並行してプログラム
カウンタ更新ル1陣部8を作動させプログラムカウンタ
2を更新し、その結果プログラムカウンタ2はプログラ
ムメモリIから取出した命令の次の番地を指示するよう
になる。 プログラムカウンタ2がm番地になった場合は、命令取
出部9が取出した命令のフラグ1gが立っているので、
命令の解読、プログラムカウンタ2の更新は行わず分岐
制御テーブル制御部6を作動させる。分岐制御テーブル
制御部6は、フラグの指示する位置に格納されている分
岐制御テーブル4の分岐先番地、本例では2進数で01
1すなわち10進数で3であるから3番目に格納されて
いる分岐先番地4eを取り出し、分岐制御部7がこれを
プログラムカウンタ2へ移す。これによって次に命令取
出部9が命令を取出すプログラムメモリlの番地はn番
地になる。 本第3実施例によれば、プログラムカウンタ2と分岐制
御テーブル4の分岐開始番地を比較することなく、フラ
グによって分岐先番地を直接選択することができ、比較
をさらに効率的に行うことができる。 上記各実施例では、分岐制御テーブル4にはl鞘の分岐
開始番地・分岐先番地あるいは単に1個の分岐先番地を
設置させているが、襠数紐・複数個の設置が可能である
。又、テーブル4に設置するのは、プログラムを修正す
るときのみであるので、(修正後はテーブル4との比較
は不要となる。 さらにテーブル4へはプログラム途中の部分を設置する
のみてその設置部分の実行をスキップずろことができる
ので、途中部分の修正作業がきわめて容易となる。 〔発明の効果〕 本発明によれば、プログラムの実行を止めることなくプ
ログラムの変更をする際に、既に作ったプログラム途中
の修正エリアの番地を分岐制御テーブルに一時的にf呆
持させて、(修正・変更するようにし−ので、1)1正
の準備作業・修正作業がきわめて簡単で、しかも修正後
は同テーブルが不要となって動作が単純となる。
[1 position where the last part of the positive enoa is the branch destination address and corresponds to the above flag in the branch control table The branch control table is moved to the above program counter, and the program is configured so that the correction part in the middle of the program is skipped and the calculation is executed continuously without stopping. Write down the address that specifies the correct enoa, and write down multiple keys if necessary.By doing so, you can correct the necessary part at the original location in the middle of Progera J1. The branch address in the branch control table is 1 of Procla J1.
It is necessary only on the hour, and after the corresponding part is corrected, the calculation execution starts as soon as it is deleted, and at the same time it becomes possible to set another new 11) positive. Furthermore, when actually running the entire program, the branch control table is not used, so
Operation becomes simple. [Example] The present invention will be described in detail below. FIG. 1 shows the first embodiment of the present invention.
In the block configuration diagram of the embodiment, 1 is a block memory that stores programs including various sequence instructions, 2 is a program counter that indicates the storage address in the block memory of instructions to be executed, and 3 is an instruction to be executed. 4 is a branch control table that stores the branch start address and branch destination address (both will be described later) in the block memory; 5 is an arithmetic unit including parts surrounded by corruption; 6 is a Program counter 2 and branch control table l■
It includes a differentiation/k control table control unit that controls the comparison of the branch start address of 11 The branch address taken out by Ube 6 is written to the branch control section, and the counter 1 remains unchanged.
, a counter update control unit, 51 is an instruction extraction unit that takes out instructions without execution from the block memory 1, IO is an arithmetic unit that performs calculations based on arithmetic instructions, and 11 reads data from the input unit and internal data memory and outputs it. section and internal data memory (data input/output system 1ll that controls the old data)
Sections 11 and 12 are human power sections that convert external signals into data;
1:3 is an internal data memory that stores the results of the performance W in progress,
14 is an output unit that converts the data into external No. 18. FIG. 2 is a block diagram of the branch control table control section 6. 6a is a comparison section that compares the address from the program counter 2 and the branch start address extracted from the branch control table 4. , and outputs either a match signal or a mismatch signal as a result. Reference numeral 6b designates the branch start address to be fetched from the table 4, and also updates the position when receiving the mismatch signal. 6c is a branch start address extractor that extracts the branch start $j+!! from the position specified by the two-leg extractor position updater 6b, and the branch start address extractor 6c extracts the branch start address from the position specified by the two-leg extractor position updater 6b.
Sequentially supply to a. Reference numeral 6d denotes a branch destination address extraction unit that extracts a branch destination address corresponding to the branch start address that is a comparison target when a match occurs in the comparison unit C3a. Figure 3 shows the leap between the two-legged memory and the branch control table 4 (!
It is an explanatory diagram showing . 1a is the instruction at address m in memory 1, I b is the instruction at address n, and lc is the same < 1
This is an instruction at address 1 + 1, and the above m and n addresses specify the 11th tomajo area (part to be changed) of the program. 4a is address m (corresponding to address m of memory 1) stored in the branch control table 4 as a branch start address, and 4b is a branch destination address corresponding to address m, which is stored in the branch destination table 4 as a - mark. It is address n (corresponding to address +1 of memory l). Fig. 1 is a flowchart of the operation of the program in the memory 1 in memory 1, and Fig. 5 shows the change in the program during execution of the program in the memory 1 (while the device is running)
x positive) is a flow diagram. Next, we will explain the operation of correcting part of the program memory 1 being executed (1z). In the above configuration, from address m of program memory 1 to
Assume that address 1-1 is the target of change ((j1 primary area), and that no conflict will occur even if the n address at the top of 011 is adjacent when executing a series of programs. First, branch control The comparison unit C>a in the table-based iaj unit 6 stores the program counter 2 and the branch control table 4ζ, and sequentially compares all branch start addresses (step I 00 in FIG. 1). If there is no match, a mismatch signal is generated, the movement of the takeout unit 6 is prohibited, and the branch control table control unit 6
does nothing to the program counter. The instruction fetch unit 9 reads the block commanded by the program counter 2.
Step 200) of retrieving an instruction from an address in Cochram memory 1. Next, the instruction retrieval section 9 activates the instruction decoding section 3 and at the same time activates the program update control section 8 to update the program counter 2. As a result, the program counter 2 is retrieved from the program memory 1. It will point to the next address after the command. If the program counter 2 reaches address m and matches the branch start address l↓a, the comparator 6a generates a match signal and the extractor 6d operates to extract the corresponding branch destination address 4b(n) from the branch control table 4. Address) and branch control unit 7
moves this to program counter 2. Instruction retrieval unit 9
is address 11 indicated by program counter 2 at that time.
, that is, the instruction 1b from the block memory at the branch destination address. Next, the instruction fetch section 9 operates the program counter update control section 8 in parallel with operating the instruction decoding section 3 to update the program counter 2, and as a result, the program counter 2 is read out from the block memory 1. Indicates address n+1 of the instruction 1c following the instruction 1b. In this way, addresses from nl to n-1 will be bypassed and not executed.Next, change the program from addresses I'n to n-1 (step 300 in Figure 5).End the modification. After that, check the syntax of the blockrum (step 400 in Figure 5). If there is a syntax error, edit the program from address 1 to address n-1 again. Next, check the syntax and the program ends normally. If so, the branch start address 4a and branch destination address t↓1) of the branch 1ial 1 are rewritten to valid values, for example all 0 (step 500). With this -), from m to f
)-1 address is included, and the program change during operation is completed. According to the above embodiment, the program can be changed without stopping the execution of the entire program, and even if the block diagram is changed illegally, there is no abnormal stoppage. In the above embodiment, the program counter 2 is
Since all of the branch start addresses in the branch control table 4 are compared with each other, there is a waste of time. Therefore, a second embodiment will be described below in which a flag is preliminarily provided in the program memory 1 to indicate whether the comparison is to be performed, and the comparison is performed only when the flag is set. 7JtJG is a flowchart of the instruction execution operation in the second embodiment. Figure 7 shows the relationship between program memory 1, branch, and VI# table...1 in this embodiment, where 1d is the instruction at address I+111, e is the flag for the instruction at address 11, and 4c is the start of branching. Branch control table 1 as address
4d is the address 11111 of the program memory 1 stored in the branch destination address 1, and 4d is the address 11 of the program memory 1 stored in the branch control table 41 as the branch destination address. It is assumed that addresses 01 to n] of the program memory 1 are to be changed, and that no contradiction occurs when blockograms are executed adjacently at addresses m and r1. First, the instruction fetch section 9 inside the calculation section 5 fetches an instruction from the program memory 1 at the address indicated by the program counter 2. If the instruction fetching section 9 does not have a flag set on the fetched instruction, it passes it to the instruction decoding section 3 and operating the instruction decoding section 3. Also, in parallel with this, the program counter update control section 8 is operated to update the program counter 2, and as a result, the program counter 2 becomes the program memory 1.
This will point to the next address of the instruction retrieved from. When the program counter 2 reaches address m, the flag 1e of the instruction fetched by the instruction fetching section 9 is set, so the instruction is not decoded and the program counter 2 is updated, but the branch control table control section 6 is make it work. The branch control table control unit 6 sequentially compares the branch start addresses of the program counter 2 and the branch control table 4, and takes out the branch destination address l) d corresponding to the matched branch start address 4C from the branch control table 4. , the branch control unit 7 transfers it to the program counter 2. As a result, the next address in the program memory 1 from which the instruction fetching section 9 fetches an instruction becomes address n. According to this embodiment, since the program counter 2 and the branch start address in the branch initial table 4 are compared only when the flag is set, it is possible to eliminate wasteful comparison each time. In the two embodiments described above, the branch destination address was selected by comparing all the branch start addresses in the program counter 2 and the branch control table 4, but in the third embodiment in which the program counter 2 and the branch control table 4 are missing, An example will be described in which a multi-bit flag is provided and this flag directly indicates the storage position of the branch destination address in the branch 11ial table 4, thereby eliminating the need for comparison. In the following, an example will be explained in which the flag is set to 3 bits. FIG. 8 is a flowchart of the actual operation of an instruction in the IFJ 11 of this embodiment. FIG. 8 shows the relationship between the program memory 2 and the branch control table 4 in this embodiment, where If is the instruction at address n], 1g is the flag for the instruction at address m, and 4e is the flag for the instruction at address m.
is the address n of the program memory 1 which is stored in the branch *Ji wholesale table 4 as the branch destination address. It is assumed that addresses m to n-1 of the program memory 1 are to be changed, and that no contradiction occurs when programs are executed adjacently at addresses m and n. The 3-bit flag Ig of the instruction 1f at address m is set, and the branch destination address 4e is placed in the position of the branch control table 4 indicated by this flag.
Set it. First, the instruction fetch unit 9 inside the calculation unit 5 instructs the program counter 2 @II! ! An instruction is retrieved from program memory 1 of . If no flag of the fetched instruction is set, the instruction fetching section 9 transfers it to the instruction decoding section 3, and activates the instruction decoding section 3. In parallel with this, the program counter updater 1 group 8 is activated to update the program counter 2, and as a result, the program counter 2 points to the next address of the instruction taken out from the program memory I. When the program counter 2 reaches address m, the flag 1g of the instruction fetched by the instruction fetch unit 9 is set, so
The branch control table controller 6 is operated without decoding the instruction or updating the program counter 2. The branch control table control unit 6 sets the branch destination address of the branch control table 4 stored at the position indicated by the flag, which is 01 in binary in this example.
1, that is, 3 in decimal notation, the third stored branch destination address 4e is taken out and the branch control unit 7 transfers it to the program counter 2. As a result, the address of the program memory l from which the instruction fetching section 9 will extract the next instruction will be address n. According to the third embodiment, the branch destination address can be directly selected using the flag without comparing the branch start addresses in the program counter 2 and the branch control table 4, and the comparison can be made more efficiently. . In each of the above embodiments, the branch control table 4 has a branch start address, a branch destination address, or just one branch destination address, but it is possible to set a plurality of strings. Also, since it is only installed on table 4 when modifying the program (after modification, comparison with table 4 is not necessary). Since the execution of a part can be skipped, it becomes extremely easy to modify the part in the middle. [Effects of the Invention] According to the present invention, when changing a program without stopping the execution of the program, it is possible to modify the part that has already been created. The address of the correction area in the middle of the program is temporarily stored in the branch control table so that corrections and changes can be made. , the same table is not required and the operation becomes simple.

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

第1図は本発明実施例のブロック図、第2ci]は分岐
制御テーブルル1#部のブロック図、第3図はプログラ
ムメモリの番地と分岐制御テーブルの関係図、第4図は
同じく動作フロー図、第5図は本発明実施例における運
転中プログラム変更の動作フロー図、第6図はフラグが
立っている時たけ比較を行うようにした第2実施例にお
ける命令実行動作のフロー図、第7図は同しくプログラ
ムメモリ番地と分岐制御テーブルの関係図、第8図は比
較の必要をなくした第3実施例における命令実行動作の
フロー図、第9図はプログラムメモリ番地と分岐制御テ
ーブルの1sflvf、図である。 1ニブログラムメモリ、2:フ゛ログラムカウンタ、3
:命令解読部、4=分岐制御テーブル、5:演算部、6
:分岐制御テーブル制御部、7:分岐制御部、8ニブロ
グラム力ウンタ更新制御部、9:命令取出部。 ノそり フ・コ2゛う二つラン、り 分]支宅制御テーブル ジ蜜X(ア 7   、仝井 手り 手デP(下 /θ 演蕩啓 第 図 第 凹 第 乙 閉 第 凹 茅 区 第 図
Fig. 1 is a block diagram of the embodiment of the present invention, 2ci] is a block diagram of the branch control table 1# section, Fig. 3 is a relationship diagram between the program memory address and the branch control table, and Fig. 4 is the same operation flow. 5 is an operational flowchart for changing a program during operation in an embodiment of the present invention, and FIG. 6 is a flowchart for an instruction execution operation in a second embodiment in which comparison is performed only when a flag is set. Figure 7 is a diagram showing the relationship between program memory addresses and branch control tables, Figure 8 is a flowchart of instruction execution operations in the third embodiment that eliminates the need for comparison, and Figure 9 is a diagram showing the relationship between program memory addresses and branch control tables. 1sflvf, figure. 1: Niprogram memory, 2: Program counter, 3
: Instruction decoding unit, 4 = Branch control table, 5: Arithmetic unit, 6
: Branch control table control section, 7: Branch control section, 8 Niprogram counter update control section, 9: Instruction fetch section. Nosorifu Ko 2゛Two runs, Rimin] Branch control table Jitsu X (A7, Yui Handi Hand DeP (Bottom/θ) Ward map

Claims (1)

【特許請求の範囲】 1、各種シーケンス命令を含むプログラムを記憶するメ
モリと、演算実行番地を示すプログラムカウンタと、上
記プログラムの修正エリアの前後部分をそれぞれ分岐開
始番地と分岐先番地として記憶する分岐制御テーブルと
、上記メモリから読み出されたプログラムを実行する演
算部を備え、プログラムの修正に際し上記演算部は演算
中のプログラムカウンタの内容と上記分岐制御テーブル
内の分岐開始番地とを比較し、両者が一定の関係になっ
たときその分岐先番地を上記プログラムカウンタに移し
て演算を実行するように構成されていることを特徴とす
るプログラマブルコントローラ。 2、請求項1において、上記演算部は演算中にプログラ
ムカウンタの値と上記分岐制御テーブル内の分岐先番地
とを比較して両者が一致したときその分岐先番地を上記
プログラムカウンタに移す分岐制御部と、上記プログラ
ムカウンターの内容に従い上記修正エリアを飛び越して
演算実行する演算器を有することを特徴とするプログラ
マブルコントローラ。3、請求項1において、上記メモ
リはプログラムの修正エリアの前後にフラグを記憶し、
上記分岐制御部は演算中に上記フラグを検出したとき上
記プログラムカウンタの内容と上記分岐制御テーブル内
の分岐先番地とを比較するように構成されたことを特徴
とするプログラマブルコントローラ。 4、請求項1において、上記分岐制御テーブルは分岐開
始番地と分岐先番地を複数組記憶し、上記演算部は各組
で指定される複数の修正エリアを飛び越して演算実行す
ることを特徴とするプログラマブルコントローラ。 5、各種シーケンス命令からなり修正エリアの前部にフ
ラグを備えたプログラムを記憶するメモリと、プログラ
ムの実行番地を示すプログラムカウンタと、上記修正エ
リアの後部を示す分岐先番地を上記フラグと対応する位
置に記憶している分岐制御テーブルと、上記メモリから
読み出されたプログラムを実行する演算部を備え、上記
演算部は演算実行時に上記フラグを検知したとき、この
フラグで指示される分岐先番地を上記分岐制御テーブル
から上記プログラムカウンタに移して演算実行するよう
に構成されていることを特徴とするプログラマブルコン
トローラ。
[Claims] 1. A memory that stores a program including various sequence instructions, a program counter that indicates an operation execution address, and a branch that stores the preceding and following parts of the modification area of the program as a branch start address and a branch destination address, respectively. It comprises a control table and an arithmetic unit that executes the program read from the memory, and when modifying the program, the arithmetic unit compares the contents of the program counter being operated with the branch start address in the branch control table, A programmable controller characterized in that, when the two have a certain relationship, the branch destination address is transferred to the program counter and an operation is executed. 2. In claim 1, the arithmetic unit compares the value of the program counter and the branch destination address in the branch control table during the calculation, and when the two match, branch control moves the branch destination address to the program counter. 1. A programmable controller comprising: a program counter; and an arithmetic unit that executes an operation by skipping over the correction area according to the contents of the program counter. 3. In claim 1, the memory stores flags before and after the modification area of the program,
The programmable controller is characterized in that the branch control unit is configured to compare the contents of the program counter and the branch destination address in the branch control table when detecting the flag during calculation. 4. In claim 1, the branch control table stores a plurality of sets of branch start addresses and branch destination addresses, and the arithmetic unit executes arithmetic operations by skipping over a plurality of correction areas designated by each set. programmable controller. 5. A memory for storing a program consisting of various sequence instructions and having a flag at the front of the modification area, a program counter indicating the execution address of the program, and a branch destination address indicating the rear part of the modification area corresponding to the flag. It is equipped with a branch control table stored in a location, and an arithmetic unit that executes a program read from the memory, and when the arithmetic unit detects the flag during execution of an operation, it selects the branch destination address indicated by this flag. A programmable controller characterized in that the programmable controller is configured to transfer the information from the branch control table to the program counter and execute the calculation.
JP827090A 1990-01-19 1990-01-19 programmable controller Pending JPH03214204A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP827090A JPH03214204A (en) 1990-01-19 1990-01-19 programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP827090A JPH03214204A (en) 1990-01-19 1990-01-19 programmable controller

Publications (1)

Publication Number Publication Date
JPH03214204A true JPH03214204A (en) 1991-09-19

Family

ID=11688476

Family Applications (1)

Application Number Title Priority Date Filing Date
JP827090A Pending JPH03214204A (en) 1990-01-19 1990-01-19 programmable controller

Country Status (1)

Country Link
JP (1) JPH03214204A (en)

Similar Documents

Publication Publication Date Title
JP2001516920A (en) Digital signal processor with variable width instructions
JP2560988B2 (en) Information processing apparatus and processing method
EP0447685A2 (en) Programmable controller
JPH03214204A (en) programmable controller
US5586337A (en) Programmable controller with timing control
KR100301391B1 (en) Subroutine branch instruction execution method and device
US4761750A (en) Electronic calculator with a program calculation function
JPH0877021A (en) Interrupt processing apparatus and method
JP2552738B2 (en) Data processing device
US5148531A (en) System for executing a conditional statement without reading program data part that does not satisfy the conditional clause
JPS61147336A (en) Generation management system of load module
JP2778610B2 (en) Pipeline operation control method and system
JPH0695868A (en) Software management system
JP2573391B2 (en) Programmable controller
JPH08194614A (en) Microcomputer
JPH0531170B2 (en)
JPS5843042A (en) Advance controlling system
JPH11327887A (en) Compiler system with automatic parts converting function and recording medium
JPH0281231A (en) Translation information managing system for source program file
JP2607975B2 (en) Debug method
JP2812615B2 (en) Instruction buffer circuit control method
JPH0713946A (en) Program loader
JPH0212332A (en) Processing method for programs containing multiple identical instructions
JPH02297623A (en) Microprocessor
JPH0520053A (en) Micro Processor