JPS62162106A - Program changing method for programmable controller - Google Patents

Program changing method for programmable controller

Info

Publication number
JPS62162106A
JPS62162106A JP61003404A JP340486A JPS62162106A JP S62162106 A JPS62162106 A JP S62162106A JP 61003404 A JP61003404 A JP 61003404A JP 340486 A JP340486 A JP 340486A JP S62162106 A JPS62162106 A JP S62162106A
Authority
JP
Japan
Prior art keywords
program
instruction
nop
processing
words
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
JP61003404A
Other languages
Japanese (ja)
Inventor
Kazuaki Tomita
富田 一彰
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.)
Omron Corp
Original Assignee
Omron Tateisi Electronics Co
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 Omron Tateisi Electronics Co filed Critical Omron Tateisi Electronics Co
Priority to JP61003404A priority Critical patent/JPS62162106A/en
Publication of JPS62162106A publication Critical patent/JPS62162106A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Programmable Controllers (AREA)

Abstract

PURPOSE:To improve general useability and versatility of a PC by making partial change of a user program while continuing controlling without interrupting operation of the PC. CONSTITUTION:A new changed program consisting of four words is prepared in a memory 3, and information to the effect that the program of four words is replaced by one word instruction a of existing program is inputted. No operation instruction is added to the end of the existing program in a memory 5, and the position of NOP instruction is shifted little by little to lower address. The specified position is behind an instruction a of changed position. The valve of increased number of words n is subtracted by 1, and when it does not become zero, one NOP instruction is added further, and the NOP instruction is shifted successively to lower address, and placed behind preceding NOP instruction. Above-mentioned processes are repeated until it becomes n=0, and consequently, three NOP instructions are placed behind the instruction a of changed part of the existing program.

Description

【発明の詳細な説明】 (産業上の利用分野) この発明はプログラマブルコントローラ(以下PCと称
す)に関し、特に、ユーザプログラムの実行動作を中断
させずにプログラムを部分的に変更する方法に関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a programmable controller (hereinafter referred to as a PC), and particularly relates to a method for partially changing a user program without interrupting the execution of the program.

(従来の技術) PCでは、ユーザプログラムを繰返し実行することで、
制御入出力信号群の論理変化および履歴に応じて制御出
力信号群の新たな論理を決定していく。そして、ユーザ
プログラムの実行処理の繰返し周期が短い程、制御入出
力信号間の応谷性が高くなり、より良い制御が行なえる
(Prior art) In a PC, by repeatedly executing a user program,
The new logic of the control output signal group is determined according to the logic changes and history of the control input/output signal group. The shorter the repetition period of the user program execution process, the higher the tolerance between control input and output signals, and the better control can be performed.

ユーザプログラムの実行処理以外にも、プログラミング
コンソールやプリンタとか表示装冒といった周辺機器と
結合し、与えられたコマンドを処理したり、データを授
受したりする号−ビス処理も行なう。また、ウオッチド
グタイマのリセットや、メモリやバスのチェックなどの
システムの監視の処理も行う。さらに機種によっては、
他のPCとの間でデータ授受を行なうものもある。
In addition to executing user programs, it also connects to peripheral devices such as programming consoles, printers, and display devices, and performs signal processing such as processing given commands and exchanging data. It also handles system monitoring such as resetting watchdog timers and checking memory and buses. Furthermore, depending on the model,
Some PCs exchange data with other PCs.

=一般のPCでは、第3図に示すように、ユーザプログ
ラムの実行処理と、サービス処理と、その他の処理とを
順番に高速に繰返す構成となっている。これら全体の1
回の処理時間(TI+T2十「3)がスキへ7ンタイム
と呼ばれている。制御の応答性を決めるユーザプログラ
ムの実行周期はこのスキャンタイムで決まる。したがっ
て、サービス処理の時間T2やその他の処理の時間T3
を短く1れば、スキへ7ンタイムが短くなり、制御の応
答性が向上する。
As shown in FIG. 3, a general PC is configured to repeat user program execution processing, service processing, and other processing in order at high speed. 1 of all of these
The scanning time (TI + T2 + 3) is called the scanning time. The execution cycle of the user program, which determines control responsiveness, is determined by this scan time. Therefore, the time T2 for service processing and other processing time T3
By shortening 1, the gap time will be shortened and control responsiveness will be improved.

通常の動作では、1−記サービス処理の割当時間丁2は
タイマにより、必要最小限の短い一定時間に決められて
いる。そして1回のサービス処理で処理完了できないコ
マンドに対しては、サービス処理を何回か繰返して処理
する。
In normal operation, the allotted time 2 for service processing 1-2 is determined by a timer to the minimum necessary short constant time. For commands that cannot be completed in one service process, the service process is repeated several times.

以上のような@提条件のPCにおいて、ユーザプログラ
ムの実行中にそのプ[]ダラムを変更する場合、実行エ
リアのプログラムをrlき換えるのは1回のサービス処
理で行なわなければならない。
In a PC with the above-mentioned @conditions, when changing the program while a user program is being executed, the program in the execution area must be changed in one service process.

複数回のサービス処理で徐々にプログラムを書き換えて
いくと、書き換え途中のブタラメ(論理の合っていない
、あるいは論理の流れが途切れた状態)なプログラムが
実行されてしまい、その結果制御対象を意図しない動作
状態に導いてしまい、場合によっては非常に危険である
If a program is gradually rewritten through multiple service processes, a program that is not being rewritten (the logic does not match or the flow of logic is interrupted) will be executed, and as a result, the program that is not intended to be controlled will be executed. This could lead to an operating condition that could be extremely dangerous.

(発明が解決しようとする問題点) 従来のPCにおいて、メモリの空きエリアに変更しよう
とするプログラムを作成する処理を、割当時間内の上記
サービス処理を間欠的に繰返す時分割処理によって行な
うことはできる。しかし、そのように準備した変更プロ
グラムを実行中の既存プログラムに組み込む(書き換え
る)際に問題が生じる。
(Problem to be Solved by the Invention) In a conventional PC, the process of creating a program to change to a free area of memory cannot be performed by time-sharing processing that intermittently repeats the above service process within the allocated time. can. However, a problem arises when incorporating (rewriting) the modified program prepared in this way into an existing program that is currently being executed.

例えば第4図(△)に示すように、既存プログラムのあ
る1語命令aを4語の変更プログラムに冒き換える場合
などに問題が起きる。この変更により3詔の増加が発生
するが、それに応じて、命令a以降のプログラムをすべ
て3語分づつ移動させなければならない。このように多
数の命令語をメモリ上で移動させる処理に多大な時間が
かかつてしまう。この処理がサービス処理の1回の割当
時間より相当に長くなってしまう。
For example, as shown in FIG. 4 (Δ), a problem occurs when a one-word instruction a in an existing program is replaced with a four-word modified program. This change causes an increase of 3 edicts, but all programs after instruction a must be moved by 3 words accordingly. The process of moving a large number of instruction words on memory in this way takes a lot of time. This process takes considerably longer than the allotted time for one service process.

そのため従来は、多くの場合、ユーザプログラムの実行
動作と並行してプログラムを変更することはできず、プ
ログラムの変更に際しては、それが簡単な部分変更であ
っても、ユーザプログラムの実行動作を一時的に中断さ
せなければならなかった。つまりPCの運転を一時停止
させなければならなかった。
Therefore, in the past, in many cases it was not possible to change the program in parallel with the execution of the user program, and when changing the program, even if it was a simple partial change, the execution of the user program was temporarily changed. had to be interrupted. In other words, I had to temporarily stop running my PC.

この発明は上述した従来の問題点に鑑みなされたもので
、その目的は、ユーザプログラムの実行動作を中断させ
ずにプログラムの部分変更処理を行なえるようにしたP
Cのプログラムの変更方法を提供することにある。
This invention was made in view of the above-mentioned conventional problems, and its purpose is to provide a program that allows partial modification of a program without interrupting the execution of the user program.
The purpose of this invention is to provide a method for changing C programs.

(問題点を解決づるための手段) そこでこの発明では、割当時間内の上記V−ビス処理を
間欠的に繰返す時分割処理によって、メモリの空きエリ
アに変更プログラムを準備するとともに、この変更プロ
グラムを実行中の既存プログラム中に組み込むことによ
って生じる命令語数の増加分だけのノーオペレーション
命令を既存プログラムの末尾に付加して組み込み位置ま
で移動させ、その後上記サービス処理の1回の実行によ
って上記ノーオペレーション命令を含む部分を上記変更
プログラムで書き換える方法とした。
(Means for Solving the Problems) Therefore, in the present invention, a change program is prepared in an empty area of memory by time-sharing processing that intermittently repeats the above V-vis processing within the allocated time, and this change program is Add no-operation instructions corresponding to the increase in the number of instruction words caused by incorporating them into the existing program being executed to the end of the existing program and move them to the embedding position, and then execute the above-mentioned service processing once to add the no-operation instructions to the end of the existing program. The method was to rewrite the part containing the above using the above modification program.

(実施例) この発明に係るPCは、第1図に示ずように、CPU(
演算処理部)1と、システムプログラムメモリ2と、シ
ステムワーキングメモリ3と、プログラミングコンソー
ル4と、ユーザプログラムメモリ5と、データメモリ6
と、入力回路7ど、出力回路8と、タイマ9とを佑える
(Example) As shown in FIG. 1, a PC according to the present invention has a CPU (
arithmetic processing unit) 1, system program memory 2, system working memory 3, programming console 4, user program memory 5, and data memory 6
, an input circuit 7, an output circuit 8, and a timer 9.

入力回路7に多数の制御人力信号源が接続される。出力
回路8は多数の制御出力信号リレーを右し、これに制御
対象機器が接続される。入力回路7に与えられた制御出
力信V;肝はデータメしり6に一度取り込まれて演客)
に供され、ぞの演惇によってデータメモリ61.:生成
された制御出力信号8Tを出力回路8から外部に出力す
る。CP U 1は、メモリ5に格納されたユーザプロ
グラムを繰返し実行することで、制御出力信号)群の論
理変化および履歴に応じた制御出力群の新たな論理変化
を決定していく。
A number of control human signal sources are connected to the input circuit 7. The output circuit 8 has a large number of control output signal relays, to which devices to be controlled are connected. The control output signal V given to the input circuit 7; the important thing is that it is once taken into the data meter 6 and sent to the performer)
The data memory 61. : Output the generated control output signal 8T from the output circuit 8 to the outside. By repeatedly executing the user program stored in the memory 5, the CPU 1 determines a new logical change in the control output group according to the logical change in the control output signal group and the history.

第2図(A)は本発明を適用したPCの全体的な動作を
示している。第2図(A>におけるステップ201〜2
04が萌述したユーザプログラムの実行処理である。ス
テップ201では入力回路7の制御入力信号をデータメ
モリ6に取り込む。
FIG. 2(A) shows the overall operation of a PC to which the present invention is applied. Steps 201-2 in FIG. 2 (A>
04 is the execution process of the user program described above. In step 201, the control input signal from the input circuit 7 is taken into the data memory 6.

ステップ202ではユーザプログラムの1命令を実行し
、ステップ203でユーザプログラムの最後に設定され
ているEND命令が検出されるまで各命令を順次実行す
る。ユーザプログラムをEND命令まで1遺失行すると
、ステップ204でデータメモリ6の制御出力信号を出
力回路8に転送する。
In step 202, one instruction of the user program is executed, and in step 203, each instruction is sequentially executed until the END instruction set at the end of the user program is detected. When the user program runs one line up to the END command, the control output signal of the data memory 6 is transferred to the output circuit 8 in step 204.

以上のユーザプログラム実行処理を1回終了したら、ス
テップ205でタイマ9を起動し、ステップ206のサ
ービス処理に移行する。上記タイマ9はサービス処理の
割当時間を規定するもので、このタイマ9がタイムアツ
プすると、ステップ207として示づタイマ割込みがか
かり、この時点でサービス処理を中断し、その実行状況
(処理継続用の情報)をステップ208でシステムワー
キングメモリ3にセーブし、ステップ201〜204の
ユーザプログラム実行処理に移行する。
When the above user program execution process is completed once, the timer 9 is started in step 205, and the process moves to the service process in step 206. The above-mentioned timer 9 defines the allotted time for service processing. When timer 9 times out, a timer interrupt is generated as shown in step 207, and the service processing is interrupted at this point. ) is saved in the system working memory 3 in step 208, and the process moves to user program execution processing in steps 201 to 204.

このようにして、ユーザプログラム実行処理とサービス
!l!l PI!とが順番に繰返される。
In this way, user program execution processing and service! l! l PI! are repeated in order.

サービス処理206では、プログラミングコンソール4
から与えられるコマンドを処理する。タイマ9に規定さ
れた1回の割当時間で処理できない仕事は、既に繰返し
説明しているように、何回かのサービス処理に分けて実
行される。
In the service process 206, the programming console 4
Processes commands given from . Work that cannot be processed in one time allotted time specified by the timer 9 is divided into several service processes and executed, as has already been repeatedly explained.

プログラムの変更に際し、まずプログラミングコンソー
ル4のキーボードを操作し、システムワーキングメモリ
3の空きエリアに新たな変更プログラムを作成するとと
もに、その変更プログラムを既存プログラム中のどの部
分に組み込むのかを入力する。
When changing a program, the user first operates the keyboard of the programming console 4 to create a new changed program in an empty area of the system working memory 3, and inputs which part of the existing program the changed program is to be incorporated into.

第4図(A)の例では、4語からなる新たな変更プログ
ラムをメモリ3に作成し、この4語のプログラムを既存
プログラムの1語命令aに置き換える旨を入力する。こ
の入力はサービス処理206で受cノ付けられる。
In the example of FIG. 4A, input is made to create a new change program consisting of four words in the memory 3 and to replace this four-word program with the one-word instruction a of the existing program. This input is accepted by service process 206.

上記の操作の後、コンソール4でブOグラム変更開始の
コマンドを与える。すると第2図(B)で示す処理が第
2図(A)のサービス処理206として実行される。
After the above operation, a command to start changing the program is given on the console 4. Then, the process shown in FIG. 2(B) is executed as the service process 206 in FIG. 2(A).

まずステップ301で、これから行なうプログラム変更
で命令語数が増えるかを判定する。増える場合には、ス
テップ302で増加冊数nを算出する。第4図(A)の
例ではn=3となる。
First, in step 301, it is determined whether the number of command words will increase as a result of the program change to be performed from now on. If the number of books increases, the increased number n of books is calculated in step 302. In the example of FIG. 4(A), n=3.

次にステップ303で、第4図(B)に示すように、メ
七り5中の既存プログラム(実行中である)の末尾にノ
ーオペレーション命令(実質的に何もしない命令で、以
下NOP命令と称する)を付加する。次のステップ30
4で、上記NOP命令の位置を順次アドレスの若い方へ
少しづつ移動させていく。次のステップ305では、N
OP命令が所定位置に達したかを判断し、達していなけ
ればステップ304に戻る。所定位置とは、第4図(B
)の例では、変更個所の命令aの後である。
Next, in step 303, as shown in FIG. 4(B), a no-operation instruction (an instruction that does virtually nothing, hereinafter referred to as a NOP instruction) is added to the end of the existing program (currently being executed) in the program 5. ) is added. next step 30
In step 4, the position of the NOP instruction is sequentially moved to smaller addresses little by little. In the next step 305, N
It is determined whether the OP command has reached the predetermined position, and if it has not reached the predetermined position, the process returns to step 304. The predetermined position is as shown in Figure 4 (B
), this is after the changed instruction a.

次にステップ306で増加語数nの値を1だU減口し、
ステップ307で減算結果がぜ口になったかを判断゛り
る。ぜ口になっていなければステップ303に戻り、ざ
らに1 ([!llのNOP命令を付り加え、そのNO
P命令を順次アドレスの若い方へ移動させ、先のNOP
命令の後につ(プる。
Next, in step 306, the value of the increased number of words n is decreased by 1,
In step 307, it is determined whether the subtraction result is a leak. If it is not an empty mouth, return to step 303 and add a NOP command of 1 ([!ll), and
Move the P instruction to the younger address one by one, and move the previous NOP
After the command.

以上の処理をn=oになるまで繰返す。その結果第4図
の例では、(C)に示づように、既存プログラムの変更
個所の命令aの後に3個のNOP命令が配置される。
The above process is repeated until n=o. As a result, in the example of FIG. 4, as shown in (C), three NOP instructions are placed after the instruction a at the changed location in the existing program.

ここまでの処理はタイマ9による時分割処理で実行され
る。そのため、移動中のNOP命令を含んだユーザプロ
グラム(既存ブ1]グラム)が実行されるが、N Ot
)命令は制御に何ら影響を与えないので問題はない。
The processing up to this point is executed by time-sharing processing using the timer 9. Therefore, the user program (existing program) containing the NOP instruction is executed, but N O
) command has no effect on control, so there is no problem.

ステップ307でYESと判定されたならば、ステップ
308でタイマ9による割込みを禁止してステップ30
9に進み、命令aと3 flW (7) N Ol)命
令の合計4語を!$備された変更プログラムで書き換え
る。その後スデツブ310でタイマ割込みの禁止を解除
する。
If YES is determined in step 307, interrupts by timer 9 are prohibited in step 308, and step 30
Proceed to 9 and write the command a and the 3 flW (7) N Ol) command for a total of 4 words! Rewrite with the provided modification program. After that, the scheduler 310 cancels the prohibition of timer interrupts.

プログラム書き換えルーチン309をタイマ割込みを禁
止した状態で行なうのは、この処理に時間がかかるとい
う意味ではない。変更個所と変更プログラムとの語長を
事前に揃えているので、ルーチン309は短時間で行な
える。しかしタイマ割込みを禁止しなければ、前の処理
の中所点との関係で、ルーチン309の処理中にタイマ
割込みがかかる可能性がある。この可能性を消すために
タイマ割込みを禁止しているのである。
The fact that the program rewriting routine 309 is executed with timer interrupts disabled does not mean that this process takes time. Since the word lengths of the changed part and the changed program are aligned in advance, routine 309 can be performed in a short time. However, if timer interrupts are not prohibited, there is a possibility that a timer interrupt will occur during the processing of routine 309, depending on the midpoint of the previous processing. To eliminate this possibility, timer interrupts are prohibited.

(発明の効果) 以上詳細に説明したように、この発明によれば、PCの
運転を中断することなく、側聞動作を継続したままで、
ユーザプログラムの部分変更を行なえるので、l) C
の汎用性、融通性がさらに向上する。
(Effects of the Invention) As explained in detail above, according to the present invention, the operation of the PC can be continued without interrupting the operation of the PC, and while the side listening operation is continued.
Since it is possible to partially change the user program, l) C
further improves its versatility and flexibility.

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

第1図はこの発明に係るPCのブロック図、第2図(A
)、(B)は上記PCの動作を示すフローチA7−ト、
第3図は一般的なPCの作用を示づ図、第4図(A)、
(B)、(C)はプログラム変更例の説明図である。 1・・・CPLJ、3・・・システムワーキングメモリ
、4・・・プログラミングコンンール、5・・・ユーザ
プログラムメモリ、9・・・タイマ。 特許出願人   立石電機株式会社 代理人 弁理士 岩0百二(他1名) 第4 図 肥[4)bり゛ラム
Figure 1 is a block diagram of a PC according to the present invention, and Figure 2 (A
), (B) is a flowchart A7-chart showing the operation of the above PC,
Figure 3 shows the operation of a general PC, Figure 4 (A),
(B) and (C) are explanatory diagrams of examples of program changes. 1...CPLJ, 3...System working memory, 4...Programming console, 5...User program memory, 9...Timer. Patent Applicant Tateishi Electric Co., Ltd. Agent Patent Attorney Iwa Hyakuji (1 other person) 4th Zuhi [4) B Riram

Claims (1)

【特許請求の範囲】[Claims] (1)ユーザプログラムの実行処理とプログラミングコ
ンソールからのコマンドを処理するサービス処理とを順
番に高速で繰返すプログラマブルコントローラにおいて
、割当時間内の上記サービス処理を間欠的に繰返す時分
割処理によって、メモリの空きエリアに変更プログラム
を準備するとともに、この変更プログラムを実行中の既
存プログラム中に組み込むことによって生じる命令語数
の増加分だけのノーオペレション命令を既存プログラム
の末尾に付加して組み込み位置まで移動させ、その後上
記サービス処理の1回の実行によって上記ノーオペレー
ション命令を含む部分を上記変更プログラムで書き変え
ることを特徴とするプログラマブルコントローラにおけ
るプログラム変更方法。
(1) In a programmable controller that repeats user program execution processing and service processing that processes commands from a programming console in sequence at high speed, free memory is created by time-sharing processing that intermittently repeats the above service processing within the allocated time. Prepare a modified program in the area, add no-operation instructions to the end of the existing program corresponding to the increase in the number of command words caused by incorporating this modified program into the existing program being executed, and move it to the embedding position. A method for changing a program in a programmable controller, characterized in that the portion including the no-operation instruction is then rewritten by the changing program by executing the service process once.
JP61003404A 1986-01-13 1986-01-13 Program changing method for programmable controller Pending JPS62162106A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP61003404A JPS62162106A (en) 1986-01-13 1986-01-13 Program changing method for programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP61003404A JPS62162106A (en) 1986-01-13 1986-01-13 Program changing method for programmable controller

Publications (1)

Publication Number Publication Date
JPS62162106A true JPS62162106A (en) 1987-07-18

Family

ID=11556441

Family Applications (1)

Application Number Title Priority Date Filing Date
JP61003404A Pending JPS62162106A (en) 1986-01-13 1986-01-13 Program changing method for programmable controller

Country Status (1)

Country Link
JP (1) JPS62162106A (en)

Similar Documents

Publication Publication Date Title
JP2001265412A (en) Programmable controller
EP0190358A1 (en) System for controlling a programmable controller
US5715439A (en) Bi-directional co-processor interface
JPS62162106A (en) Program changing method for programmable controller
US5963725A (en) Simulation system and method for microcomputer program
JP2649034B2 (en) Control device
JPS63214804A (en) Processor for plc and plc
JP4494701B2 (en) Method for generating an instruction word when controlling a functional unit in a processor
JPS59114602A (en) Programmable controller
JPS62162107A (en) Program changing method for programmable controller
JPS6217803A (en) Control system for programmable controller
KR100258893B1 (en) Numerical controller performance method with unified controller
JP3331357B2 (en) Programmable controller
JPH025104A (en) Arithmetic processing unit
JPS60124746A (en) Data processing unit
JP3024719B2 (en) Arithmetic processing method of programmable controller
JPS5922145A (en) Interruption control system
JPS61156307A (en) Sequence controller
JPS59119413A (en) Programmable controller
JPH05297913A (en) Programmable controller
JP3111372B2 (en) Programmable controller
JPS63159905A (en) Forcible on/off system for input/output of programmable controller
JPH04191906A (en) User program execution control system for programmable controller
JPS61241843A (en) Information processor
JPH04151706A (en) Cpu reset circuit