JPS62162107A - Program changing method for programmable controller - Google Patents

Program changing method for programmable controller

Info

Publication number
JPS62162107A
JPS62162107A JP340586A JP340586A JPS62162107A JP S62162107 A JPS62162107 A JP S62162107A JP 340586 A JP340586 A JP 340586A JP 340586 A JP340586 A JP 340586A JP S62162107 A JPS62162107 A JP S62162107A
Authority
JP
Japan
Prior art keywords
program
execution
service processing
address
time
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
JP340586A
Other languages
Japanese (ja)
Inventor
Keiji Yamamoto
恵二 山本
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 JP340586A priority Critical patent/JPS62162107A/en
Publication of JPS62162107A publication Critical patent/JPS62162107A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To attain partial changing process without interrupting execution of a user program by inserting an instruction to jump to the head of a changed program into a specified address of an existing program by single execution of service processing. CONSTITUTION:When changing a program, an [insertion mode] key on a keyboard of a programming console 4 is depressed. Then, the part of a user program to which a new program is inserted is inputted by a program address, and a [place of insertion designation] key is depressed. The process that prepared the inserted program in a buffer D is executed according to operation of a keyboard dividing it into several times of service processing instead of making all process by service processing of one time prescribed by a timer 9. Thus, a maker of the program can prepare the insertion program confirming it throughly without haste.

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 of partially changing a user program without interrupting its execution.

〈従来の技術〉 PCでは、ユーザプログラムを繰返し実行することで、
制御入出力信号群の論理変化および履歴に応じて制御出
力信号群の新たな論理を決定していく。そして、ユーザ
プログラムの実行処理の繰返し周期が短い程、制御入出
力信号間の応答性が高くなυ、よ)良い制御が行なえる
<Conventional technology> 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 responsiveness between control input and output signals, and the better control can be performed.

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

一般のPCでは、第3図に示すように、ユーザプログラ
ムの実行処理と、サービス処理と、その他の処理とを順
番に高速に繰返す構成となっている。これら全体の1回
の処理時間(Ti+T2十T3)がスキャンタイムと呼
ばれている。制御の応答性を決めるユーザプログラムの
実行周期はこのスキャンタイムで決まる。したがって、
サービス処理の時間T2やその他の処理の時間T3を短
くすれば、スキャンタイムが短くなり、制御の応答性が
向上する。
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. The total one-time processing time (Ti+T2+T3) is called scan time. The execution cycle of the user program, which determines control responsiveness, is determined by this scan time. therefore,
If the service processing time T2 and other processing time T3 are shortened, the scan time will be shortened and control responsiveness will be improved.

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

以上のような前提条件のPCにおいて、ユーザプログラ
ムの実行中にそのプログラムを変更する場合、実行エリ
アのプログラムを薔き換えるのは1回のサービス処理で
行なわなければならない。
In a PC with the above-mentioned prerequisites, when a user program is to be changed while it 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 partially rewritten (the logic does not match, or the flow of logic is interrupted) will be executed, and as a result, the control target may be This can lead to unintended operating conditions, which can be extremely dangerous.

〈発明が解決しようとする問題点〉 通常のPCでは、1回のサービス処理でプログラムの書
き換えを完了することはできない。プログラムの書き換
えに賛する時間はサービス処理の割当時間より相当に長
く、一般的にはサービス処理の割当時間の30倍以上の
時間がかかる。
<Problems to be Solved by the Invention> In a normal PC, rewriting of a program cannot be completed in one service process. The time it takes to rewrite a program is considerably longer than the time allotted for service processing, and generally takes more than 30 times the time allotted for service processing.

そのため従来は、ユーザプログラムの実行動作と並行し
てプログラムを変更することはできず、プログラムの変
更に際しては、それが簡単な部分子fiWであっても、
ユーザプログラムの実行動作を一時的に中断させなけれ
ばならなかった。つ1すPCの運転を一時停止させなけ
ればならなかった。
Therefore, in the past, 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 fiW,
It was necessary to temporarily interrupt the execution of the user program. 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.

く問題点を解決するための手段〉 そこでこの発明では、割当時間内の上記サービス処理を
間欠的に繰返す時分割処理により、ユーザプログラムを
実行しながら、メモリの空きエリアに変更プログラムを
4!備するとともに、その変更プログラムの末尾に実行
中の既存プログラムの所定アドレスへのジャンプ命令を
設定しておき、その後上記サービス処理の1回の実行に
よって上記既存プログラムの所定アドレスに上記変更プ
ログラムの先頭へのジャンプ命令を挿入する方法とした
Means for Solving the Problems> Accordingly, in the present invention, the above service processing is intermittently repeated within the allocated time by time-sharing processing, and while the user program is being executed, the change program is stored in the free area of the memory. At the same time, a jump instruction to a predetermined address of the existing program being executed is set at the end of the modified program, and after that, one execution of the above service processing causes the start of the modified program to be moved to the predetermined address of the existing program. The method was to insert a jump instruction to.

〈実施例〉 この発明に係る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に与えられた制御入
力信号群はデータメモリ6に一度取り込まれて演算に供
され、その演算によってデータメモリ6に生成された制
御出力信号群を出力回路8から外部に出力する。CPU
Iば、メ七り5に格納されたユーザプログラムを繰返し
実行することで、制御入出力信号群の論理変化および履
歴に応じた制御出力群の新たな論理変化を決定していく
A number of control input 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 input signal group applied to the input circuit 7 is once taken into the data memory 6 and subjected to calculation, and the control output signal group generated in the data memory 6 by the calculation is outputted from the output circuit 8 to the outside. CPU
For example, by repeatedly executing the user program stored in the menu 5, new logical changes of the control output group in accordance with the logical changes of the control input/output signal group and the history are determined.

第2図は本発明を適用した上記PCの動作を示している
。第2図におけるステップ201〜204が前述したユ
ーザプログラムの実行処理である。ステップ201では
入力回路7の制御入力信号をデータメモリ6に取り込む
。ステップ202ではユーザプログラムの1命令を実行
し、ステップ203でユーザプログラムの最後に設定さ
れているEND命令が検出されるまで各命令を順次実行
する。ユーザプログラムをEND命令壕で1遺失行する
と、ステップ204でデータメモリ6の制御出力信号を
出力回路8に転送する。
FIG. 2 shows the operation of the PC to which the present invention is applied. Steps 201 to 204 in FIG. 2 are the aforementioned user program execution processing. In step 201, the control input signal from the input circuit 7 is taken into the data memory 6. 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 executes one error in the END command trench, the control output signal of the data memory 6 is transferred to the output circuit 8 in step 204.

以上のユーザプログラム実行処理を1回終了したら、ス
テップ300でタイマ9を起動し、ステップ301以降
のサービス処理に移行する。上記タイマ9はサービス処
理の割当時間を規定するもので。
When the above user program execution processing is completed once, the timer 9 is started in step 300, and the process moves to the service processing from step 301 onwards. The timer 9 is used to define the allocated time for service processing.

このタイマ9がタイムアンプすると、ステップ40(と
じて示すタイマ割込みがかかり、この時点でステップ2
01 K戻シ、ユーザプログラム実行処理に移行する。
When this timer 9 time amplifies, a timer interrupt occurs at step 40 (shown below), and at this point step 2
01 Return to K and move to user program execution processing.

なおタイマ割込みが発生した時点でサービス処理中であ
れば、継続フラグをセットするとともに、実行状況(処
理継続用の情報)をセーブする(ステップ401−40
2−403 )。セットされた継続フラグは、次回のサ
ービス処理開始時にステップ302でリセットされる。
If service processing is in progress at the time the timer interrupt occurs, a continuation flag is set and the execution status (information for continuing processing) is saved (steps 401-40).
2-403). The set continuation flag is reset in step 302 at the start of the next service process.

このようにして。In this way.

ユーザプログラム実行処理とサービス処理とが順番に繰
返される。
The user program execution process and the service process are repeated in order.

この発明によるプログラム変更を行なう場合、まずプロ
グラミングコンソール4のキーボードの「挿入モード」
キーを押す。するとコンソール4の挿入モード表示ラン
プが点灯する(ステップ320→321)。
When changing a program according to this invention, first select the "insert mode" on the keyboard of the programming console 4.
Press the key. Then, the insertion mode display lamp of the console 4 lights up (steps 320→321).

次に、ユーザプログラムのどの部分に新しいプログラム
を挿入するかをプログラムアドレスで入力し、「挿入個
所指定」キーを押す。そのアドレ、 ス入力はコンソー
ル4で表示されるとともに、シ) ステムワーキングメ
モリ3の挿入個所ポインタ(A)にストアされる(ステ
ップ330 、331 、340 )。
Next, enter the program address in which part of the user program is to insert the new program, and press the "Specify insertion location" key. The address input is displayed on the console 4 and also stored in the insertion point pointer (A) of the system working memory 3 (steps 330, 331, 340).

続いてコンソール4のキーボードを操作し、システムワ
ーキングメモリ3のバッファ(D) K挿入プログラム
を作成する(ステップ330 、331 、332゜3
40)。このときバッファエントリポイ7/(B)およ
びプログラム書込ポインタ(C)が使用される。
Next, operate the keyboard of the console 4 to create a buffer (D) K insertion program in the system working memory 3 (steps 330, 331, 332°3).
40). At this time, buffer entry point 7/(B) and program write pointer (C) are used.

ここで注意すべきことは、挿入プログラムをバッファ(
D) K作成する処理は、タイマ9で規定された1回の
サービス処理ですべて行なうのではなく、何回ものサー
ビス処理に分けて、またキーボードの操作に応じて行な
われる点である。したがってプログラム作成者は何らあ
わてる必要はなく、じつく)と確認しながら挿入プログ
ラムを作成すればよい。なお、作成した挿入プログラム
のチェックを時分割のサービス処理で行なうこともでき
る。
The thing to note here is that you can run the insert program into a buffer (
D) The process of creating K is not performed entirely in one service process specified by the timer 9, but is divided into many service processes and is performed in response to keyboard operations. Therefore, there is no need for the program creator to panic, just make sure that the insertion program is correct. Note that the created insertion program can also be checked by time-sharing service processing.

挿入プログラムをバッファ(D)に作成したならば、「
挿入指示」キーを押す。すると、ステップ311〜31
6の処理Pが実行される。との処理Pはタイマ9で規定
されたサービス処理の割当時間より若干長くなる可能性
があるので、まずステップ311でタイマ割込みを禁止
し、ステップ312〜315の処理を終了した時点でス
テップ316にてタイマ割込みの禁止を解除する。
If you create an insertion program in the buffer (D),
Press the "Insert instruction" key. Then, steps 311-31
Process P of 6 is executed. Since the processing P with P may be slightly longer than the allotted time for the service processing specified by timer 9, timer interrupts are first prohibited in step 311, and upon completion of the processing in steps 312 to 315, the process proceeds to step 316. to disable timer interrupts.

ステップ312では、ポインタ(C)の示すアドレス、
すなわちバッファ(D)の挿入プログラムの末尾に、ポ
インタ(A)の示すアドレスADHに1を加算したアド
レス(ADR+1 )へのジャンプ命令を書き込む。ス
テップ313では、ポインタ(A)の示すアドレスAD
R(既在プログラムの挿入個所)に、ポインタ(B)の
示すアドレス、すなわち挿入プログラムの先頭アドレス
へのジャンプ命令を書き込む。以上のジャンプ命令の関
係を第4図に図解している。
In step 312, the address indicated by the pointer (C),
That is, at the end of the buffer (D) insertion program, a jump instruction to the address (ADR+1) obtained by adding 1 to the address ADH indicated by the pointer (A) is written. In step 313, the address AD indicated by the pointer (A) is
A jump instruction to the address indicated by pointer (B), that is, the start address of the inserted program, is written to R (insertion location of the existing program). The relationship between the jump commands described above is illustrated in FIG.

次のステップ314でコンソール4の挿入表示ランプを
点灯し、ステップ315で挿入モード表示ランプを消灯
する。
In the next step 314, the insertion indicator lamp of the console 4 is turned on, and in step 315, the insertion mode indicator lamp is turned off.

以上のようにジャンプ命令が書き込まれた結果、次のユ
ーザプログラム実行処理では、アドレスADHでバッフ
ァ(D)の挿入プログラムにジャンプし、その末尾から
アドレス(ADH+1 )にジャンプして戻ってくる。
As a result of writing the jump instruction as described above, in the next user program execution process, the program jumps to the insertion program in the buffer (D) at address ADH, and then jumps back to address (ADH+1) from the end.

つまシ、アドレスADHに挿入プログラムが挿入された
のとまったく同じ制御が行なわれる。
In other words, exactly the same control as if the insertion program were inserted at address ADH is performed.

なお、この例は完全な挿入であるが、既存プログラムの
めるアドレスXから挿入プログラムにジャンプし、既存
プログラムのアドレスYK戻るようにすれば、既存プロ
グラムのアドレスXかうYまでは挿入プログラムに置き
換ったことになる。
Note that this example is a complete insertion, but if you jump to the inserted program from address X where the existing program is inserted and return to address YK of the existing program, the inserted program will replace the existing program from address X to Y. That means that.

前述のように、処理Pは1回のサービス処理ですべて行
なう必要があり、その処理時間がタイマ9の設定時間を
超える可能性がある。しかし超過時間は極〈僅かであり
、はとんど問題にはならない。
As described above, all of the processing P must be performed in one service processing, and the processing time may exceed the set time of the timer 9. However, the excess time is so small that it hardly becomes a problem.

〈発明の効果〉 以上詳細に説明したように、この発明によれば、PCの
運転を中断することなく、制御動作を継続したままで、
ユーザプログラムの部分変更を行なえるので、PCの汎
用性、融通性がさらに向上する。
<Effects of the Invention> As explained in detail above, according to the present invention, the control operation can be continued without interrupting the operation of the PC.
Since the user program can be partially changed, the versatility and flexibility of the PC is further improved.

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

第1図はこの発明に係るPCのブロック図、第2図は上
記PCの動作を示すフローチャート、第3図は一般的な
PCの作用を示す図、第4図はプログラム変更例の説明
図である。 ■・・・CPU、3・・・システムワーキングメモリ、
4・・・プログラミングコンソール、5・・・ユーザプ
ログラムメモリ、9・・・タイマ。
Fig. 1 is a block diagram of a PC according to the present invention, Fig. 2 is a flowchart showing the operation of the above-mentioned PC, Fig. 3 is a diagram showing the action of a general PC, and Fig. 4 is an explanatory diagram of an example of program change. be. ■...CPU, 3...System working memory,
4...Programming console, 5...User program memory, 9...Timer.

Claims (1)

【特許請求の範囲】[Claims] (1)ユーザプログラムの実行処理とプログラミングコ
ンソールからのコマンドを処理するサービス処理とを順
番に高速で繰返すプログラマブルコントローラにおいて
、割当時間内の上記サービス処理を間欠的に繰返す時分
割処理により、ユーザプログラムを実行しながら、メモ
リの空きエリアに変更プログラムを準備するとともに、
その変更プログラムの末尾に実行中の既存プログラムの
所定アドレスへのジャンプ命令を設定しておき、その後
上記サービス処理の1回の実行によって上記既存プログ
ラムの所定アドレスに上記変更プログラムの先頭へのジ
ャンプ命令を挿入することを特徴とするプログラマブル
コントローラにおけるプログラム変更方法。
(1) In a programmable controller that repeats the execution process of a user program and the service process of processing commands from a programming console in sequence at high speed, the user program is executed by time-sharing processing that intermittently repeats the above service process within the allocated time. Along with preparing the program, change it to a free area of memory while running.
A jump instruction to a predetermined address of the existing program being executed is set at the end of the modified program, and then a jump instruction to the beginning of the modified program is set at the predetermined address of the existing program by one execution of the above service process. A method for changing a program in a programmable controller, characterized by inserting a.
JP340586A 1986-01-13 1986-01-13 Program changing method for programmable controller Pending JPS62162107A (en)

Priority Applications (1)

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

Applications Claiming Priority (1)

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

Publications (1)

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

Family

ID=11556472

Family Applications (1)

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

Country Status (1)

Country Link
JP (1) JPS62162107A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01288904A (en) * 1988-05-17 1989-11-21 Matsushita Electric Ind Co Ltd Sequence program switching device
JP2011238079A (en) * 2010-05-12 2011-11-24 Mitsubishi Electric Corp Control program development assist device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01288904A (en) * 1988-05-17 1989-11-21 Matsushita Electric Ind Co Ltd Sequence program switching device
JP2011238079A (en) * 2010-05-12 2011-11-24 Mitsubishi Electric Corp Control program development assist device

Similar Documents

Publication Publication Date Title
JP5270330B2 (en) Multicore microcomputer system simulation method and simulation apparatus
US5042002A (en) Programmable controller with a directed sequencer
US20150058828A1 (en) Plc simulation system, plc simulator, recording medium, and simulation method
JP3024422B2 (en) Programmable controller and method of operating programmable controller
JP6874706B2 (en) How to generate application programs, devices, programs
KR100286197B1 (en) Programming method of data processing system
JPS62162107A (en) Program changing method for programmable controller
US5963725A (en) Simulation system and method for microcomputer program
EP0749068A1 (en) Simulation method and simulation system
CA2193466C (en) Game apparatus and method for debugging game program
CN111813702B (en) Debugging system, debugging method, device, and computer-readable storage medium
JP3331357B2 (en) Programmable controller
JP3413860B2 (en) Debug method
JP3328714B2 (en) Programmable controller
JP2001236247A (en) Software simulator and simulation processing method
JPS62162106A (en) Program changing method for programmable controller
JPS5916054A (en) Microprocessor
JPS6011946A (en) Programmable controller
JP2000029508A (en) Programmable controller
JPS5835648A (en) Program execution controlling system
JPS5922145A (en) Interruption control system
JP2844624B2 (en) Data processing device
JPS61235955A (en) Program debugging system
JPS6238746B2 (en)
JPH02284205A (en) Simulation system for pc