JP2846760B2 - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JP2846760B2
JP2846760B2 JP4019893A JP1989392A JP2846760B2 JP 2846760 B2 JP2846760 B2 JP 2846760B2 JP 4019893 A JP4019893 A JP 4019893A JP 1989392 A JP1989392 A JP 1989392A JP 2846760 B2 JP2846760 B2 JP 2846760B2
Authority
JP
Japan
Prior art keywords
program
area
cpu
dmac
rewriting
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.)
Expired - Fee Related
Application number
JP4019893A
Other languages
Japanese (ja)
Other versions
JPH05216507A (en
Inventor
光明 小林
弘昌 山岡
洋光 菊池
隆一 渡部
孝志 北田
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 Information and Control Systems Inc
Original Assignee
Hitachi Ltd
Hitachi Process Computer Engineering Inc
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 Process Computer Engineering Inc filed Critical Hitachi Ltd
Priority to JP4019893A priority Critical patent/JP2846760B2/en
Publication of JPH05216507A publication Critical patent/JPH05216507A/en
Application granted granted Critical
Publication of JP2846760B2 publication Critical patent/JP2846760B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、プラントの制御等に用
いられるプログラマブルコントローラに関し、特に、プ
ログラマブルコントローラが実行するプログラムの内容
を変更する技術に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a programmable controller used for controlling a plant and the like, and more particularly to a technique for changing the contents of a program executed by the programmable controller.

【0002】[0002]

【従来の技術】従来、プログラマブルコントローラがプ
ラント等を制御するために実行する制御プログラムの変
更は、制御プログラムの実行を、一旦、ストップさせ、
その間にプログラマブルコントローラのメモリに格納さ
れた制御プログラムを書き替えるのが一般的であった。
2. Description of the Related Art Conventionally, a change of a control program executed by a programmable controller to control a plant or the like is performed by temporarily stopping the execution of the control program.
In the meantime, it has been common to rewrite the control program stored in the memory of the programmable controller.

【0003】ここで、図25に、従来のプログラマブル
コントローラの制御プログラムの変更手順を示す。
FIG. 25 shows a procedure for changing a control program of a conventional programmable controller.

【0004】すなわち、まず状態をモニタし(ステップ
251)、制御プログラムの動作に異常があった場合ま
たは制御プログラムの修正を要する場合(ステップ25
2)、アドレスをストップさせることにより、制御プロ
グラムの実行を停止させる(ステップ253)。
That is, first, the state is monitored (step 251), and when there is an abnormality in the operation of the control program or when the control program needs to be corrected (step 25).
2) Stop the execution of the control program by stopping the address (step 253).

【0005】その後、異常制御プログラムを検出し(ス
テップ255)、その制御プログラムを読み出して命令
語の書き込み、挿入、変更、削除等により修正を行う
(ステップ256)。修正完了後はプログラムチェック
機能等を用いて、制御プログラムの文法等のチェックを
行い(ステップ257)、制御プログラムをスタートさ
せる(ステップ258) このように、従来の、プログラマブルコントローラの制
御プログラム変更の技術によれば、図26に示すように
オペレータが制御プログラムの実行をストップさせてか
らメモリの内容を書き替えて再び制御プログラムをスタ
ートする間、すなわちメモリ内容の書き替え時間分制御
プログラムの実行をストップさせなければならなかっ
た。
After that, an abnormal control program is detected (step 255), and the control program is read out and corrected by writing, inserting, changing, deleting or the like (step 256). After the correction is completed, the grammar and the like of the control program are checked using a program check function or the like (Step 257), and the control program is started (Step 258). According to FIG. 26, while the operator stops the execution of the control program and rewrites the contents of the memory and starts the control program again as shown in FIG. 26, the execution of the control program is stopped for the rewriting time of the memory contents. I had to let it.

【0006】[0006]

【発明が解決しようとする課題】ところで、近年、プロ
グラマブルコントローラの制御対象は多様化し、1日2
4時間継続して制御を行う必要のある制御対象も生じて
いる。
By the way, in recent years, the control target of the programmable controller has been diversified, and the number of control objects per day has been increasing.
Some control objects need to be controlled continuously for four hours.

【0007】しかし、前記従来の技術によれば、前述し
たように、プログラマブルコントローラの制御プログラ
ムの変更を行う場合、制御プログラムの実行を一旦停止
しなければならない。
However, according to the prior art, as described above, when the control program of the programmable controller is changed, the execution of the control program must be temporarily stopped.

【0008】そこで、本発明は、プラント等を制御する
制御プログラムの実行を停止することなくプログラムの
変更を行なうことのできるプログラマブルコントローラ
を提供することを目的とする。
Accordingly, an object of the present invention is to provide a programmable controller capable of changing a control program for controlling a plant or the like without stopping execution of the program.

【0009】[0009]

【課題を解決するための手段】前記目的達成のために、
本発明は、メモリ上のプログラムエリアに格納された、
実行の対象となるプログラムを実行し、制御対象物の制
御を行うプログラマブルコントローラにおいて、前記プ
ログラムエリア上の変更対象プログラムを前記メモリと
同一もしくは異なるメモリ上のワークエリアに複写する
第1のステップと、プログラムエリアに格納されたプロ
グラムの実行と並行して、前記ワークエリアに複写され
たプログラムの内容を、ワークエリア上で変更する第2
のステップと、前記変更対象プログラムからワークエリ
アに格納されたプログラムに、実行の対象となるプログ
ラムを切り換える第3のステップとを有することを特徴
とするプログラマブルコントローラのプログラム変更方
法を提供する。
To achieve the above object,
The present invention provides a method for storing a program in a program area on a memory,
A first step of executing a program to be executed and controlling a control object by copying a program to be changed on the program area to a work area on the same or different memory as the memory; In parallel with the execution of the program stored in the program area, the contents of the program copied in the work area are changed on the work area.
And a third step of switching a program to be executed from the program to be changed to the program stored in the work area.

【0010】なお、本方法には、さらに、前記ワークエ
リアのプログラムをプログラムエリアに複写する第4の
ステップと、ワークエリアに格納されたプログラムか
ら、前記プログラムエリアに複写したプログラムに、実
行の対象となるプログラムを切り換える切り換える第5
のステップとを含むようにするのが望ましい。
The method further includes a fourth step of copying the program in the work area to the program area, and a step of executing the program copied from the work area to the program copied in the program area. Fifth program switching
It is desirable to include the following steps.

【0011】また、前記第2、第4のステップを、実行
の対象となるワークエリアに格納されたプログラムもし
くはプログラムエリア上の前記変更対象プログラム以外
のプログラムの実行と並行して実行するようにするのが
望ましい。
Further, the second and fourth steps are executed in parallel with the execution of a program stored in a work area to be executed or a program other than the program to be changed in the program area. It is desirable.

【0012】[0012]

【作用】本発明に係るプログラマブルコントローラのプ
ログラム変更方法によれば、プログラムエリア上の変更
対象プログラムを前記メモリと同一もしくは異なるメモ
リ上のワークエリアに複写し、プログラムエリアに格納
されたプログラムの実行と並行して、前記ワークエリア
上で、プログラムの内容の変更を行い、変更が終了した
後に、変更対象プログラムからワークエリアに格納され
たプログラムに、実行の対象となるプログラムを切り換
える。
According to the program changing method of the programmable controller according to the present invention, the program to be changed on the program area is copied to a work area on the same or different memory as the memory, and the program stored in the program area is executed. At the same time, the content of the program is changed on the work area, and after the change is completed, the program to be executed is switched from the change target program to the program stored in the work area.

【0013】したがい、プログラムの修正や書替等の変
更操作を行う間も、プログラム実行手段は、プログラム
エリア上の変更前のプログラムを用いてプラント等の制
御を継続することができる。
Accordingly, the program execution means can continue control of the plant or the like using the program before the change in the program area, even while performing a change operation such as a correction or rewriting of the program.

【0014】また、前記ワークエリアのプログラムをプ
ログラムエリアに複写し、ワークエリアに格納されたプ
ログラムから、前記プログラムエリアに複写したプログ
ラムに、実行の対象となるプログラムを切り換えること
により、プログラマブルコントローラを初期状態に戻す
ことができる。
The program in the work area is copied to a program area, and a program to be executed is switched from a program stored in the work area to a program copied to the program area, thereby initializing the programmable controller. You can return to the state.

【0015】また、前記第2、第4のステップを、実行
の対象となるプログラムの実行と並行して実行するよう
にすれば、前記第2、第4のステップにおけるプログラ
ムの複写動作の間もプラントの制御を継続することがで
きる。
If the second and fourth steps are executed in parallel with the execution of the program to be executed, the program can be copied during the second and fourth steps. Control of the plant can be continued.

【0016】[0016]

【実施例】以下、本発明に係るプログラマブルコントロ
ーラの一実施例について説明する。
An embodiment of the programmable controller according to the present invention will be described below.

【0017】図1に、本実施例に係るプログラマブルコ
ントローラの構成を示す。
FIG. 1 shows the configuration of a programmable controller according to this embodiment.

【0018】図示するように、プログラマブルコントロ
ーラ1は、中央処理装置(以下、「CPU」と記す)
2、メモリ(以下、「MEM」と記す)3、ダイレクト
メモリアクセスコントローラ(以下、「DMAC」と記
す)4、マンマシンシステムェース(以下、「MCSI
/F」と記す)5およびプロセス入出力インタフェース
(以下、「PIOI/F」と記す)6を有し、プロセス
入出力(以下、「PIO」と記す)7を介してプラント
8と接続されている。MEM3は、プログラムエリアA
とプログラムエリアBを有している。
As shown in the figure, the programmable controller 1 has a central processing unit (hereinafter, referred to as “CPU”).
2, a memory (hereinafter referred to as “MEM”) 3, a direct memory access controller (hereinafter referred to as “DMAC”) 4, a man-machine system base (hereinafter referred to as “MCSI”).
/ F) 5 and a process input / output interface (hereinafter, referred to as “PIOI / F”) 6, which is connected to a plant 8 via a process input / output (hereinafter, referred to as “PIO”) 7. I have. MEM3 is the program area A
And a program area B.

【0019】次に、図2、本実施例に係るプログラマブ
ルコントローラが実行するソフトウェアの構成を示す。
Next, FIG. 2 shows a configuration of software executed by the programmable controller according to the present embodiment.

【0020】図中、オペレーティングシステム(以下、
「OS」と記す)200は、プログラムを管理し、次に
起動すべきプログラムの選択を行い、当該プログラムの
起動および中断後の再開を行うマルチタスクオペレーテ
ィングシステムである。
In the figure, an operating system (hereinafter referred to as an operating system)
The “OS” 200 is a multitasking operating system that manages programs, selects the next program to be started, and starts and restarts the program after interruption.

【0021】各プログラム1〜mは、特定の処理を行う
プログラムであり、OS200からの起動され処理を行
う。また、その内、プログラム1〜nはシステムプログ
ラムであり、DMAC4の起動、MCSI/F5との交
信等の処理を行うプログラムである。一方、プログラム
n+1〜mは、ユーザプログラムであり、プラント8の
制御を行うプログラムである。各プログラム1〜mは、
通常MEM3のプログラムエリアA上に記憶され、CP
U2は、プログラムエリアA上のプログラムを実行す
る。
Each of the programs 1 to m is a program for performing a specific process, and is activated by the OS 200 to perform the process. Among them, programs 1 to n are system programs, which are programs for performing processing such as activation of the DMAC 4 and communication with the MCSI / F 5. On the other hand, programs n + 1 to m are user programs, which are programs for controlling the plant 8. Each program 1-m,
Normally stored in the program area A of the MEM3,
U2 executes the program on the program area A.

【0022】タスクコントロールブロック(以下、「T
CB」と記す)201は、これらプログラム1〜mの個
々の先頭アドレスおよび容量を記録しておくテーブルで
ある。OS200は、プログラムを起動する際、このT
CBを参照して当該プログラムを起動する。
A task control block (hereinafter "T
Reference numeral 201) is a table for recording the head addresses and capacities of the programs 1 to m. When starting the program, the OS 200 sets this T
The program is started with reference to the CB.

【0023】なお、各プログラム1〜mの最終命令はE
NDであり、ENDが発行された場合、OS200が起
動されるる。また、各プログラム中での他プログラム起
動要求命令、タイマー割込み、プラント8からのプロセ
ス割込み要求命令によっても、OS200は起動され
る。
The last instruction of each of the programs 1 to m is E
If it is ND and END is issued, the OS 200 is started. Further, the OS 200 is also activated by another program activation request instruction, a timer interrupt, and a process interruption request instruction from the plant 8 in each program.

【0024】ここで、図3に、プログラマブルコントロ
ーラ1において、ユーザプログラムn+1〜mが、どの
ように実行されるのか、そのようすの一例を示してお
く。
Here, FIG. 3 shows an example of how the user programs n + 1 to m are executed in the programmable controller 1.

【0025】図3は、プログラムn+1実行途中で、プ
ログラムn+2、プログラムn+3、プログラムn+4
がそれぞれ起動され、END命令の後、プログラムn+
1に戻り処理を示している。
FIG. 3 shows a program n + 2, a program n + 3, and a program n + 4 during the execution of the program n + 1.
Are activated, and after the END instruction, the program n +
Returning to 1 shows the processing.

【0026】図3中、プログラムn+1は、ベースプロ
グラムであり、プログラムn+1の先頭からプログラム
n+1ENDまで一貫してプラント8を制御し、終了後
は先頭より処理を再実行する。
In FIG. 3, a program n + 1 is a base program, which controls the plant 8 consistently from the beginning of the program n + 1 to the program n + 1END, and re-executes processing from the beginning after the end.

【0027】プログラムn+2は、プログラムn+1内
のプログラムn+2起動要求により呼び出され、当該処
理を実行するプログラムである。プログラムn+2は、
プログラムn+2END命令で処理を終了する。
The program n + 2 is a program that is called by a program n + 2 start request in the program n + 1 and executes the processing. Program n + 2 is
The processing is terminated by the program n + 2 END instruction.

【0028】プログラムn+3は、周期的又は時刻によ
り発生するタイマーパルスを割込みとするタイマー割込
みにより起動するプログラムである。プログラムn+3
はプログラムn+3END命令で処理を終了する。
The program n + 3 is a program that is started by a timer interrupt using a timer pulse generated periodically or at a time as an interrupt. Program n + 3
Ends the processing with the program n + 3 END instruction.

【0029】プログラムn+4はプラント8からのプロ
セス割込みにより起動するプログラムであり、プログラ
ムn+4END命令で処理を終了する。
The program n + 4 is a program activated by a process interrupt from the plant 8, and the processing is terminated by a program n + 4 END instruction.

【0030】また、プログラムn+1は、プログラムn
+1END命令後、再びプログラムn+1の先頭アドレ
スより実行を開始する。
The program n + 1 is a program n
After the +1 END instruction, execution is started again from the head address of the program n + 1.

【0031】ところで、このようなユーザプログラムの
実行の切り換えはOS200が行う。
The switching of the execution of the user program is performed by the OS 200.

【0032】このOS200によるプログラムの切り換
えのタイムチャートを図4に示す。
FIG. 4 shows a time chart of the program switching by the OS 200.

【0033】図示するように、最初にOS200が起動
する。OS200はTCB201よりベースプログラム
であるプログラムN+1の先頭アドレスを読み出し、プ
ログラムn+1を先頭より起動する。
As shown, the OS 200 starts first. The OS 200 reads the head address of the base program N + 1 from the TCB 201, and starts the program n + 1 from the head.

【0034】この後、プログラムn+1内でプログラム
n+2起動要求が発行されると、前述したようにOSが
起動される。この時、プログラムn+2起動要求の、次
の命令のアドレスを、プログラムn+1再開のためにM
EM3内に記録しておく。
Thereafter, when a program n + 2 activation request is issued within the program n + 1, the OS is activated as described above. At this time, the address of the next instruction of the program n + 2 activation request is changed to M for restarting the program n + 1.
Record in EM3.

【0035】さて、起動したOS200は、要求に応じ
て、プログラムn+2の先頭アドレスをTCBより読み
出し、プログラムn+2を先頭より起動する。プログラ
ムn+2は当該処理を終了した後、プログラムn+2E
ND命令を発行し終了する。
The started OS 200 reads the start address of the program n + 2 from the TCB in response to the request, and starts the program n + 2 from the start. The program n + 2 ends the program n + 2E
Issues an ND instruction and ends.

【0036】これにより、OS200が再び起動され、
先にMEM3内に記憶したプログラムn+1の再開用ア
ドレスをMEM3より読出し、プログラムn+1を当該
アドレスより起動する。
Accordingly, the OS 200 is started again, and
The restart address of the program n + 1 previously stored in the MEM3 is read from the MEM3, and the program n + 1 is started from the address.

【0037】この後、タイマー割込みが発生すると、再
びOS200が起動される。この時も、プログラムn+
1の次に実行すべき命令のアドレスをMEM3に記録す
る。起動したOS200はタイマー割込み処理プログラ
ムであるプログラムn+3の先頭アドレスをTCBより
読み出し、プログラムn+3を先頭より起動する。プロ
グラムn+3は当該処理を終了した後、プログラムn+
3END命令を発行し終了する。
Thereafter, when a timer interrupt occurs, the OS 200 is started again. At this time, the program n +
The address of the instruction to be executed next to 1 is recorded in MEM3. The started OS 200 reads the start address of the program n + 3, which is a timer interrupt processing program, from the TCB, and starts the program n + 3 from the start. After completing the processing, the program n + 3 sets the program n +
Issue 3END instruction and end.

【0038】これによりOS200が起動され、タイマ
ー割込みにより中断した、先に記憶したプログラムn+
1のアドレスをMEM3より読み出し、プログラムn+
1を当該アドレスより起動する。
Thus, the OS 200 is started, and the previously stored program n + interrupted by the timer interrupt is started.
1 is read from MEM3 and the program n +
1 is started from the address.

【0039】この後、プラント8からのプロセス割込み
が発生するとOS200が起動される。この時も、プロ
グラムn+1の次に実行すべき命令のアドレスをMEM
3に記録する。起動したOS200はプロセス割込み処
理プログラムであるプログラムn+4の先頭アドレスを
TCB201より読み出し、プログラムn+4を先頭よ
り起動する。
Thereafter, when a process interrupt from the plant 8 occurs, the OS 200 is started. Also at this time, the address of the instruction to be executed next to the program n + 1 is set to MEM.
Record in 3. The started OS 200 reads the start address of the program n + 4, which is the process interrupt processing program, from the TCB 201, and starts the program n + 4 from the start.

【0040】プログラムn+4は当該処理を終了した
後、プログラムn+4END命令を発行し終了する。こ
れによりOS200が起動され、プロセス割込みにより
中断したプログラムn+1の先に記憶しておいたアドレ
スをMEM3より読み出しプログラムn+1を当該アド
レスより起動する。
After ending the process, the program n + 4 issues a program n + 4 END instruction and ends. As a result, the OS 200 is started, the address stored before the program n + 1 interrupted by the process interrupt is read from the MEM 3, and the program n + 1 is started from the address.

【0041】この後、プログラムn+1が、全ての処理
を終了し、最後にプログラムn+1END命令を発行す
る。これにより、OS200が起動する。OS200
は、他に起動すべきプログラムが存在しない場合、ベー
スプログラムであるプログラムn+1を起動する。な
お、この時、OSは、プログラムn+1の先頭アドレス
をTCBより読み出し、プログラムn+1の先頭より再
び起動する。
Thereafter, the program n + 1 completes all the processing, and finally issues a program n + 1 END instruction. As a result, the OS 200 starts. OS200
Starts the program n + 1, which is the base program, when there is no other program to be started. At this time, the OS reads the start address of the program n + 1 from the TCB and starts again from the start of the program n + 1.

【0042】以上のように、プログラムの終了又は中断
から、次のプログラムの起動までは、OS200が起動
され、起動したOSが各プログラムを管理している。こ
のOSの動作時間は、プラント制御プログラムの動作時
間に較べて充分に小さい時間である。
As described above, from the end or interruption of a program to the start of the next program, the OS 200 is started, and the started OS manages each program. The operating time of the OS is sufficiently shorter than the operating time of the plant control program.

【0043】次に、前記DMAC4(図1参照)の動作
を説明する。
Next, the operation of the DMAC 4 (see FIG. 1) will be described.

【0044】DMAC4はCPU2より起動され、ME
M3のデータの転送を行うものである。
DMAC 4 is started by CPU 2 and
M3 data is transferred.

【0045】CPU2は、DMAC4に対し、転送元デ
ータの先頭アドレス、データ数、転送先の先頭アドレス
を渡し、起動する。DMAC4は起動すると、CPU2
が実行中のプログラムに無関係に当該ブロックの転送を
実行し、終了後、終了割込みをCPU2に発生する。
The CPU 2 passes the start address of the transfer source data, the number of data, and the start address of the transfer destination to the DMAC 4 and starts up. When the DMAC 4 starts, the CPU 2
Executes the transfer of the block irrespective of the program being executed, and generates an end interrupt to the CPU 2 after the end.

【0046】この転送動作は、データ単位に行われる。
図5、6を用いて、この転送動作を説明する。
This transfer operation is performed in data units.
This transfer operation will be described with reference to FIGS.

【0047】図5は、CPU2、DMAC4、MEM3
の接続を示したものである。
FIG. 5 shows the CPU 2, DMAC 4, and MEM3.
FIG.

【0048】図示するように、CPU2とDMAC4間
に、メモリアクセスタイミング信号であるSTB信号1
01に接続し、さらに該STB信号101にはMEM3
を接続している。また、さらにバス要求信号102、バ
ス使用許可信号103、CPU以外がバス使用中信号1
04、を接続し、転送処理終了信号105、および、D
MAC起動要求であるDMACスタート信号110を接
続してる。
As shown, an STB signal 1 as a memory access timing signal is provided between the CPU 2 and the DMAC 4.
01, and the STB signal 101 includes MEM3
Are connected. Further, the bus request signal 102, the bus use permission signal 103, and the bus use signal 1
04, and a transfer processing end signal 105 and D
A DMAC start signal 110 which is a MAC activation request is connected.

【0049】図6は、CPU2よりDMAC4に転送元
アドレス、データ数、転送先アドレスを渡した後の各信
号のようすを示したタイムチャートである。ここでは、
DMAC4による1データの転送についてのみ示してい
る。
FIG. 6 is a time chart showing the state of each signal after the transfer of the transfer source address, the number of data, and the transfer destination address from the CPU 2 to the DMAC 4. here,
Only one data transfer by the DMAC 4 is shown.

【0050】まず、CPU2は、DMAC4に対し、D
MACスタート信号110を発行する。これによりDM
AC4は起動し、メモリアクセスを開始するが、CPU
2のアクセスと重複するとバス上の信号が混信し、正常
動作できないため、単独でバスを使用する必要がある。
First, the CPU 2 sends the DMAC 4 a D
Issues a MAC start signal 110. This allows DM
AC4 starts and starts memory access, but CPU
When the access overlaps with the access of 2, the signals on the bus interfere with each other and normal operation cannot be performed. Therefore, it is necessary to use the bus alone.

【0051】そこで、DMAC4は、まず、バス要求信
号102をCPU2に発行する。CPU2は、自分のメ
モリアクセスが終了するとSTB信号101の発行をや
め、バス使用許可信号103を発行する。該バス使用許
可信号103をDMAC4が受信すると、該DMAC4
は、CPU以外がバス使用中信号104を発行する。C
PU2は自CPU以外がバス使用中信号104を受信し
ている間はバスを使用しないため、メモリアクセスはし
ない。この状態で、DMAC4はバスを単独で使用する
ことができるため、バス要求信号102の発行をやめ
る。これによりCPUはバス使用許可信号103の発行
をやめる。
The DMAC 4 issues a bus request signal 102 to the CPU 2 first. When its own memory access is completed, the CPU 2 stops issuing the STB signal 101 and issues the bus use permission signal 103. When the DMAC 4 receives the bus use permission signal 103, the DMAC 4
Issues a bus busy signal 104 other than the CPU. C
The PU2 does not use the bus while other than the own CPU receives the bus busy signal 104, and therefore does not access the memory. In this state, since the DMAC 4 can use the bus independently, the DMAC 4 stops issuing the bus request signal 102. As a result, the CPU stops issuing the bus use permission signal 103.

【0052】一方、DMAC4はメモリアクセスを行
い、STB信号101を発行する。これにより1データ
のメモリアクセスが完了すると、DMAC4は、STB
信号101の発行をやめ、さらにバス要求信号102、
CPU以外がバス使用中信号104の発行をやめる。こ
の状態をCPU2が受信し、再びCPU2がバスを使用
しはじめる。以上の手続を1データアクセス毎に行う。
On the other hand, the DMAC 4 performs memory access and issues the STB signal 101. As a result, when the memory access of one data is completed, the DMAC 4
Stops issuing signal 101, and further issues bus request signal 102,
Other than the CPU stops issuing the bus busy signal 104. This state is received by the CPU 2, and the CPU 2 starts using the bus again. The above procedure is performed for each data access.

【0053】これによりDMAC4は、転送元データブ
ロックからデータを読み出し、転送先データブロックへ
データを書き込む動作を行い、全データ数分完了すると
終了割込み信号105をCPU2に対し発行する。この
ようにして、CPU2のメモリアクセスとぶつからない
ようにDMAC4は、データを1ステップずつ転送す
る。すなわち、本実施例で説明する各処理、動作におい
て、DMAC4は、サイクルスチールモードで転送を実
行する。
As a result, the DMAC 4 performs an operation of reading data from the transfer source data block and writing data to the transfer destination data block, and issues an end interrupt signal 105 to the CPU 2 upon completion of all data. In this way, the DMAC 4 transfers data one step at a time so as not to conflict with the memory access of the CPU 2. That is, in each processing and operation described in the present embodiment, the DMAC 4 executes the transfer in the cycle steal mode.

【0054】次に、MCSI/F5の動作について説明
する。
Next, the operation of the MCSI / F5 will be described.

【0055】図7にMCSI/F5周辺の構成を示す。FIG. 7 shows the configuration around the MCSI / F5.

【0056】図示するように、CPU2にバスを介し接
続されたMCSI/F5があり、さらに、マンマシンシ
ステム(MCS)710がありMCSI/F5と交信し
ている。MCS710はオペレータからの入力をMCS
I/F5に送信し、MCSI/F5からの受信をオペレ
ータに応答している。
As shown in the figure, there is an MCSI / F5 connected to the CPU 2 via a bus, and a man-machine system (MCS) 710 for communicating with the MCSI / F5. MCS 710 receives the input from the operator as MCS
The data is transmitted to the I / F 5 and the reception from the MCSI / F 5 is returned to the operator.

【0057】MCSI/F5内には受信レジスタ702
と送信レジスタ703があり、CPU1は、バスを介し
てこれらのレジスタの読み出し、書き込みを行う。ま
た、MCSI/F5は、MCS710より入力を受信す
ると、入力を受信レジスタ707に格納し、CPU2に
対し、受信割込み信号701を出力する。また、送信レ
ジスタ703にCPU1によって書き込まれた内容をM
CS710に出力する。
The reception register 702 is provided in the MCSI / F5.
And a transmission register 703. The CPU 1 reads and writes these registers via a bus. When receiving an input from the MCS 710, the MCSI / F 5 stores the input in the reception register 707 and outputs a reception interrupt signal 701 to the CPU 2. The content written by the CPU 1 into the transmission register 703 is represented by M
Output to CS710.

【0058】この動作タイミングを、図8に示す。FIG. 8 shows the operation timing.

【0059】オペレータがMCS710に入力すると、
MCS710はMCSI/F5に該入力を送信する。該
入力を受信したMCSI/F5は該入力を受信レジスタ
702にセットし、受信割込み信号701を出力する。
When the operator inputs to the MCS 710,
The MCS 710 sends the input to the MCSI / F5. The MCSI / F5 that has received the input sets the input in the reception register 702 and outputs the reception interrupt signal 701.

【0060】CPU2は該受信割込み信号701を受信
すると、他処理を中断し、受信割込処理を実行する。C
PU2は該受信割込処理中で受信レジスタ702内の入
力を読み出す。
When receiving the reception interrupt signal 701, the CPU 2 interrupts the other processing and executes the reception interrupt processing. C
PU2 reads the input in the reception register 702 during the reception interrupt processing.

【0061】また、CPU2は必要に応じ、応答をMC
SI/F5の送信レジスタ703に書き込む。MCSI
/F5は、送信レジスタ703に書き込まれた応答をM
CS710に送信する。
The CPU 2 sends the response to the MC if necessary.
Write to the transmission register 703 of SI / F5. MCSI
/ F5 converts the response written in the transmission register 703 into M
Send to CS710.

【0062】MCS710は応答を受信すると、該応答
をオペレータに対し表示する。
Upon receiving the response, MCS 710 displays the response to the operator.

【0063】なお、オペレータより、MCS710、M
CSI/F5を介してCPU2におくられる入力には、
プログラム名、プログラム書替指令、プログラム切り換
え指令がある。プログラム書替指令の、フォーマットは
図9に示すようになっており、書替データ相対ステップ
数、書替データ、書替コマンドより構成される。
It should be noted that the MCS 710, M
Inputs sent to CPU 2 via CSI / F5 include:
There are a program name, a program rewriting command, and a program switching command. The format of the program rewrite command is as shown in FIG. 9, and is composed of rewrite data relative step numbers, rewrite data, and a rewrite command.

【0064】さて、CPU2において、このような、オ
ペレータよりの入力を処理するのが、システムプログラ
ムである。
The CPU 2 processes such an input from the operator by a system program.

【0065】以下、システムプログラム1〜n(図2参
照)の詳細を説明する。
The details of the system programs 1 to n (see FIG. 2) will be described below.

【0066】システムプログラムには、受信割込処理プ
ログラム、コピープログラム、DMAC終了割込み処理
プログラム、TCB書替プログラムがある。
The system programs include a reception interrupt processing program, a copy program, a DMAC end interrupt processing program, and a TCB rewriting program.

【0067】図10、11に受信割込み処理プログラム
の処理手順を示す。
FIGS. 10 and 11 show the processing procedure of the reception interrupt processing program.

【0068】本受信割込み処理プログラムは、MCSI
/F5より受信割込みが発生するとOS200により起
動される。
This reception interrupt processing program is executed by MCSI
When a reception interrupt occurs from / F5, the OS 200 is started.

【0069】図10、11に示すように、本プログラム
は起動するとMCSI/F5の受信レジスタ702より
入力を読み出し(ステップ1000)、分析する(ステ
ップ10019。そして、入力内容に対応した以下の各
処理を実行する。
As shown in FIGS. 10 and 11, when this program is started, the input is read from the reception register 702 of the MCSI / F5 (step 1000) and analyzed (step 10019). Execute

【0070】(1)プログラム名入力の場合1010 当該プログラム名をコピープログラムに渡し、OS20
0に対しコピープログラムの起動要求を発行する(ステ
ップ1011)。
(1) In the case of inputting the program name 1010 The program name is passed to the copy program, and the OS 20
Then, a request to start the copy program is issued to 0 (step 1011).

【0071】(2)プログラム書替用ステップ数入力の
場合1030 入力ステップ数データをMEM3内に記録する(ステッ
プ1031)。
(2) In the case of inputting the number of steps for program rewriting 1030 The input step number data is recorded in the MEM 3 (step 1031).

【0072】(3)プログラム書替用データ、書替用命
令入力の場合1040 当該入力データをMEM3に記録する(ステップ104
1)。
(3) In case of inputting program rewriting data or rewriting command 1040 The input data is recorded in MEM3 (step 104).
1).

【0073】(4)プログラム書替コマンド入力の場合
1020 後述するように、コピープログラムによってプログラム
エリアBに転送されたプログラムを書替対象プログラム
とし、当該プログラムの先頭アドレスと、MEM3内に
先に記録したプログラム書替用ステップ数より書替対象
アドレスを算出し(ステップ1021)、先に入力され
た書替用データ、命令をMEM3内から読み出し、当該
アドレスに書き込み(ステップ1022)、送信レジス
タ703に書替完了応答を書き込む(ステップ102
3)。
(4) Program rewrite command input 1020 As will be described later, the program transferred to the program area B by the copy program is set as the rewrite target program, and the start address of the program and the MEM3 are recorded first. The rewriting target address is calculated from the program rewriting step number (step 1021), the previously input rewriting data and instruction are read out from the MEM 3 and written to the address (step 1022), and the transmission register 703 Write the rewrite completion response (step 102
3).

【0074】(5)プログラム切り換え指令入力の場合
1050 後述するように、コピープログラムによってプログラム
エリアBに転送されたプログラムを切り換え対象プログ
ラムとし、当該プログラムのプログラム名をTCB20
1書替プログラムに渡し(ステップ1051)、OS2
00に対し、ベースプログラムn+1終了後、TCB書
替プログラムを起動するよう要求を発行する(ステップ
1052)。
(5) In case of program switching command input 1050 As will be described later, the program transferred to the program area B by the copy program is set as a switching target program, and the program name of the program is set to TCB20.
1 Rewriting program (step 1051), OS2
After the base program n + 1 is completed, a request is issued to start the TCB rewriting program (step 1052).

【0075】さて、以上の処理の後、受信割り込み処理
プログラムはENDを発行し処理を終了する。
After the above processing, the reception interrupt processing program issues END and ends the processing.

【0076】次に、図12にコピープログラムの処理手
順を示す。
FIG. 12 shows a processing procedure of the copy program.

【0077】コピープログラムは、プログラム名が入力
された場合に起動される。
The copy program is started when a program name is input.

【0078】コピープログラムはOS200より起動さ
れると、受信割込み処理プログラムより渡されたコピー
対象プログラム名より、該コピー対象プログラムの先頭
アドレスと容量をTCB201より読み出し(ステップ
1201)、DMAC4に渡すとともに、プログラムエ
リアBのコピー先アドレスを渡し(ステップ120
2)、DMACスタート信号101をオンし、DMAC
を起動する(ステップ1203)。
When the copy program is started by the OS 200, the start address and the capacity of the copy target program are read from the TCB 201 from the copy target program name passed from the reception interrupt processing program from the TCB 201 (step 1201), and passed to the DMAC 4, The copy destination address of the program area B is passed (step 120).
2) Turn on the DMAC start signal 101, and
Is started (step 1203).

【0079】次に、図13にDMAC終了割込み処理プ
ログラムの処理手順を示す。
FIG. 13 shows a processing procedure of the DMAC end interrupt processing program.

【0080】本プログラムは、DMAC4から発行され
るコピー終了割込みにより、OS200より起動され
る。本プログラムは送信レジスタ703にコピー完了応
答を書き込み、オペレータにコピー完了を知らせる(ス
テップ1301)。
This program is started by the OS 200 in response to a copy end interrupt issued from the DMAC 4. The program writes a copy completion response to the transmission register 703 and notifies the operator of the completion of the copy (step 1301).

【0081】次に、図14にTCB書替プログラムの処
理手順を示す。
Next, FIG. 14 shows the processing procedure of the TCB rewriting program.

【0082】本プログラムは、受信割込処理プログラム
のプログラム切り換え指令入力処理により起動要求を受
けたOS200が、プラント8制御ベースプログラムn
+1が終了した時点で起動する。本プログラムは、前記
コピープログラムがプログラムエリアAに転送し切り換
え対象プログラムとなったプログラムのTCB内の先頭
アドレス、容量を、プログラムエリアA内の先頭アドレ
ス、容量から、前記コピープログラムが転送した先プロ
グラムエリアB内の前記コピープログラムが転送した先
の先頭アドレス、容量へ書き替える(ステップ140
1)。
This program is executed by the OS 200, which has received a start request by the program switching command input processing of the reception interrupt processing program, by the plant 8 control base program n.
It starts when +1 ends. This program determines the start address and the capacity in the TCB of the program which has been transferred to the program area A by the copy program and is the target program to be switched from the start address and the capacity in the program area A to the destination program transferred by the copy program. Rewriting to the start address and capacity of the destination transferred by the copy program in area B (step 140)
1).

【0083】以上、各システムプログラムの詳細につい
て説明した。ところで、これらのシステムプログラムに
よって行われる動作を各入力に対応して、まとめて説明
すると次のようになる。
The details of each system program have been described above. By the way, the operations performed by these system programs will be collectively described as follows for each input.

【0084】まず、プログラム名が入力された場合の動
作をまとめて説明する。
First, the operation when a program name is input will be described.

【0085】まず、オペレータによってプログラム名が
MCS710より入力されると、プログラム名は、MC
SI/F5に送信され、受信レジスタ702にプログラ
ム名がセットされ、受信割込み信号701がオンする。
これにより、CPU2において、受信割込み処理プログ
ラムが起動され、プログラム名がコピープログラムに渡
され、コピープログラムが起動される。
First, when the program name is input from the MCS 710 by the operator, the program name is
The program is transmitted to the SI / F5, the program name is set in the reception register 702, and the reception interrupt signal 701 is turned on.
As a result, in the CPU 2, the reception interrupt processing program is started, the program name is passed to the copy program, and the copy program is started.

【0086】さらにコピープログラムは当該プログラム
の先頭アドレスと容量をTCBより読み出し、DMAC
4にコピー元先頭アドレスとデータ数として渡すととも
に、コピー先であるプログラムエリアB内の先頭アドレ
スを渡し、DMACスタート信号オンし、DMAC4を
起動する。
Further, the copy program reads the start address and capacity of the program from the TCB, and
4 is passed as the copy source start address and the number of data, and the start address in the program area B, which is the copy destination, is passed.

【0087】DMAC4は、バス要求信号102、バス
使用許可信号103、CPU以外がバス使用中信号10
4をCPU2と連絡しつつ、サイクルスチールモード
で、CPU2のメモリアクセスとぶつからないように1
ステップずつ転送する。図15は、このプログラム転送
処理の流れを示したものである。さて、全データコピー
完了すると、終了割込み105をオンする。
The DMAC 4 includes a bus request signal 102, a bus use permission signal 103, and a bus busy signal
4 in communication with the CPU 2 and in the cycle steal mode, 1
Transfer step by step. FIG. 15 shows the flow of the program transfer process. When all data copying is completed, the end interrupt 105 is turned on.

【0088】これにより、DMAC終了割込みプログラ
ムが起動し、送信レジスタ703にコピー完了応答を書
き込む。該応答はMCS710に送信され、オペレータ
に対する応答としてMCS710により表示される。
As a result, the DMAC end interrupt program is started, and a copy completion response is written to the transmission register 703. The response is sent to MCS 710 and displayed by MCS 710 as a response to the operator.

【0089】なお、以上の動作中も、CPU2はプログ
ラムエリアAのプログラムの実行を継続し、プラント8
制御をストップしない。
During the above operation, the CPU 2 continues to execute the program in the program area A,
Do not stop control.

【0090】次に、プログラム書替指令が入力された場
合の動作をまとめて説明する。
Next, the operation when a program rewrite command is input will be described.

【0091】プログラム書替指令は、先に図9に示した
ように、書替対象データの相対ステップ数、書替用デー
タまたは書替用命令、書替コマンドの順にMCS710
より入力される。最初に相対ステップ数がMCS710
に入力すると、MCSI/F5に送信され、受信レジス
タ702に入力データセットされるとともに受信割込み
が発する。これによりCPU2において、受信割込み処
理プログラムが起動し、入力データが、MEM3内に記
録される。次に書替用データも同様の経路で、MEM3
内に記録される。
As shown in FIG. 9, the program rewrite command is executed by the MCS 710 in the order of the relative number of steps of the data to be rewritten, the rewrite data or rewrite command, and the rewrite command.
Input from First, the relative step number is MCS710.
Is transmitted to the MCSI / F5, input data is set in the reception register 702, and a reception interrupt is issued. As a result, the reception interrupt processing program is started in the CPU 2, and the input data is recorded in the MEM 3. Next, the rewriting data is also transferred along the same route as MEM3.
Is recorded within.

【0092】次に、書替コマンドが入力されると、受信
割込みプログラムで分析され、先の相対ステップ数から
プログラムエリアB内の書替対象プログラムの書替対象
データ、命令のアドレスが算出され、書替対象プログラ
ムに、書替用データ、命令が書き込まれ、さらに、MC
S710に書替完了応答が出力される。図18は、この
書替動作の流れを示したものである。
Next, when a rewrite command is input, the rewrite command is analyzed by the reception interrupt program, and the rewrite target data and the instruction address of the rewrite target program in the program area B are calculated from the relative number of steps. Rewriting data and instructions are written to the rewriting target program, and
A rewrite completion response is output to S710. FIG. 18 shows the flow of this rewriting operation.

【0093】ところで、以上の動作においては、、受信
割込みのCPU2への受付は、CPU2のメモリアクセ
ス終了まで待たされた後、受付けられ、その後1ステッ
プ毎に書替が実行される。なお、以上の動作において
も、CPU2は、プログラムエリアAのプログラムの実
行を継続し、プラント8制御をストップしない。
In the above operation, the reception of the reception interrupt to the CPU 2 is performed after the CPU 2 waits until the memory access of the CPU 2 is completed, and thereafter, the rewriting is executed for each step. In the above operation, the CPU 2 continues to execute the program in the program area A and does not stop the control of the plant 8.

【0094】次に、プログラム切り換え指令が入力され
た場合の動作をまとめて説明する。
Next, the operation when a program switching command is input will be described.

【0095】プログラム切り換え指令は、MCS710
より入力され、前記コマンドと同様MCSI/F5の受
信レジスタ702を経て、受信割込み処理プログラムに
読み出される。これにより、切り換え対象プログラム名
が、TCB書替プログラムに渡され、ベースプログラム
n+1終了時、当該切り換え対象プログラムの先頭アド
レスが、TCB書替プログラムによりプログラムエリア
A内の先頭アドレスからプログラムエリアB内の先頭ア
ドレスに書替えられる。図17は、このTCB書替処理
の流れを示したものである。
[0095] The program switching command is transmitted from the MCS 710.
And is read out to the reception interrupt processing program via the reception register 702 of the MCSI / F5 similarly to the command. As a result, the switching target program name is passed to the TCB rewriting program, and when the base program n + 1 ends, the start address of the switching target program is changed from the start address in the program area A by the TCB rewriting program in the program area B. Rewritten to the start address. FIG. 17 shows the flow of the TCB rewriting process.

【0096】なお、以上の動作中においても、CPU2
は、プラント8制御を継続している。 以下、プラント
を制御するプログラムの追加修正を行う場合の動作を示
す。
During the above operation, the CPU 2
Continues the plant 8 control. Hereinafter, an operation when the program for controlling the plant is additionally modified will be described.

【0097】図18に、この動作のようすを示す。FIG. 18 shows this operation.

【0098】図中、(a)はオペレータの操作、(b)
はDMAC動作、(c)はCPUの状態、(d)はME
M内プログラムエリアAの内容、(e)はMEM内プロ
グラムエリアBの内容を示す。
In the figure, (a) is the operation of the operator, (b)
Is the DMAC operation, (c) is the state of the CPU, (d) is the ME
(E) shows the contents of the program area B in the MEM.

【0099】図示するように、まず最初にオペレータが
書き替え対象のプログラム名を入力すると同時に、DM
AC4が図15に示すようにMEM3のプログラムエリ
アAからプログラムエリアBへCPU2がMEMをアク
セス中でないことをチェックしながら1ステップずつコ
ピーを開始し、全コピー終了後オペレータに対し応答す
る。このときCPU2はMEM3内プログラムエリアA
のプログラムにて動作中となる。
As shown in the figure, the operator first inputs the name of the program to be rewritten,
As shown in FIG. 15, the AC 4 starts copying one step at a time from the program area A of the MEM 3 to the program area B while checking that the CPU 2 is not accessing the MEM, and responds to the operator after the completion of all copying. At this time, the CPU 2 sets the program area A in the MEM 3
It is operating with the program of.

【0100】応答が返ったら、オペレータは該MEM3
内のプログラムエリアBのメモリ内容を書き替える。書
き替えは該DMAC4が、図16に示すように、CPU
2が該MEM3をアクセス中でないことをチェックしな
がら、1ステップずつ該MEM3プログラムエリアBの
メモリ内容書き替えを実行する。このときも該CPU2
は該MEM3内プログラムエリアAのプログラムにて動
作中となる。書き替え終了後該DMAC4はオペレータ
に対し応答を返す。
When a response is returned, the operator checks the MEM3
Rewrite the contents of the memory of the program area B. The DMAC 4 is rewritten by the CPU as shown in FIG.
2 rewrites the memory contents of the MEM3 program area B step by step while checking that the MEM3 is not accessing the MEM3. At this time, the CPU 2
Is in operation by the program in the program area A in the MEM3. After rewriting is completed, the DMAC 4 returns a response to the operator.

【0101】書き替え終了後、オペレータがプログラム
切り換え指令が発行されると、図17に示したようにプ
ログラムENDかどうかを判断して、ENDであればタ
スクコントロールブロックの先頭アドレスを該MEM3
内のプログラムエリアA内のアドレスからプログラムエ
リアB内のアドレスに書き替える。これにより該プラン
トを制御する制御プログラムが、該MEM3のプログラ
ムエリアA内のものから、プログラムエリアB内のもの
に切り換えられる。結果、該CPU2をSTOPさせる
ことなく、プログラムの修正や、修正後のプログラムへ
のプログラムの変更できる。
After the rewriting is completed, when the operator issues a program switching command, it is determined whether or not the program is END as shown in FIG. 17, and if END, the head address of the task control block is set to the MEM3.
Is rewritten from the address in the program area A to the address in the program area B. As a result, the control program for controlling the plant is switched from the program in the program area A of the MEM 3 to the program in the program area B. As a result, the program can be modified or the program can be changed to the modified program without causing the CPU 2 to stop.

【0102】また、さらに、MEM3のプログラムエリ
アB上で書き替えたプログラムを、DMAC4が、プロ
グラムエリアBからプログラムエリアAへサイクルスチ
ールモードで1ステップずつコピーを行い、その後OS
200によりタスクコントロールブロックの先頭アドレ
スを、該MEM3のプログラムエリアB内の先頭アドレ
スから、転送した先プログラムエリアAの先頭アドレス
に書き替えることにより、CPU2が実行するプログラ
ムをMEM3のプログラムエリアBからプログラムエリ
アAに戻し、初期状態に戻すことができる。
Further, the program rewritten in the program area B of the MEM 3 is copied by the DMAC 4 from the program area B to the program area A one step at a time in the cycle steal mode.
By rewriting the start address of the task control block from the start address in the program area B of the MEM 3 to the start address of the transferred destination program area A by 200, the program executed by the CPU 2 is rewritten from the program area B of the MEM 3 It is possible to return to the area A and return to the initial state.

【0103】結果、プラント制御に影響を与えることな
くオンライン中にプログラムの追加訂正ができたことに
なる。
As a result, the program can be additionally corrected online without affecting the plant control.

【0104】以下、以上示した図18の動作中における
OS200、プログラムの実行タイミングを説明する。
Hereinafter, the execution timing of the OS 200 and the program during the operation of FIG. 18 described above will be described.

【0105】まず、図19にプログラムエリアA内のプ
ログラムから、プログラムエリアB内のプログラムへの
切り換えの前後のタイムチャートを示す。
First, FIG. 19 shows a time chart before and after switching from the program in the program area A to the program in the program area B.

【0106】本図はベースプログラムn+1内にて、プ
ログラムmを処理を行う構成を示しており、該プログラ
ムmについて、プログラムエリアA内のプログラムか
ら、プログラムエリアB内のプログラムへ切り換える動
作を示している。
This figure shows a configuration for processing the program m in the base program n + 1, and shows the operation of switching the program m from the program in the program area A to the program in the program area B. I have.

【0107】図中、前半はプログラムn+1の途中で、
プログラムエリアA内のプログラムmが動作している。
これはTCB内のプログラムmの先頭アドレスがプログ
ラムエリアA内のプログラムmの先頭アドレスを示して
いるためである。そして、プログラムn+1がENDに
より終了した後で、TCB書替プログラムが起動し、T
CB内のプログラムmの先頭アドレスを、プログラムエ
リアA内のプログラムmの先頭アドレスからプログラム
エリアB内のプログラムmの先頭アドレスに書き替えて
いる。
In the figure, the first half is in the middle of program n + 1,
The program m in the program area A is running.
This is because the start address of the program m in the TCB indicates the start address of the program m in the program area A. Then, after the program n + 1 is terminated by END, the TCB rewriting program starts, and
The start address of the program m in the CB is rewritten from the start address of the program m in the program area A to the start address of the program m in the program area B.

【0108】この後、再びベースプログラムn+1が起
動するが、この後に呼出されるプログラムmは、プログ
ラムエリアB内のプログラムmである。これは、TCB
内のプログラムmの先頭アドレスがプログラムエリアB
内のプログラムmの先頭アドレスを示しているためであ
る。
Thereafter, the base program n + 1 is started again, and the program m called thereafter is the program m in the program area B. This is TCB
The start address of program m in program area B
This is because the start address of the program m is indicated.

【0109】以上により、プログラムエリアAのプログ
ラムmからプログラムエリアBのプログラムmに切り換
わったが、TCB書替プログラムの実行時間は、プラン
ト制御プログラムに較べて充分に小さいので、プラント
制御は実質上ストップしていない。
As described above, the program is switched from the program m in the program area A to the program m in the program area B. However, the execution time of the TCB rewriting program is sufficiently shorter than that of the plant control program. Not stopped.

【0110】次に、図20はプログラムエリアBから、
プログラムエリアAへのプログラムコピーのタイムチャ
ートを示している。
Next, FIG.
4 shows a time chart of a program copy to a program area A.

【0111】図19に示したように、TCB内のプログ
ラムmの先頭アドレスを、プログラムエリアBのプログ
ラムmに切り換え、書き替え後のプログラムエリアBの
プログラムmを動作するが、その後、ベースプログラム
n+1のEND命令が発行された時点で、OS200
は、図21に処理手順を示す正常判定プログラムにより
プログラムが正常か異常かを判定し(図21、ステップ
2101、2102)、正常であり他に起動すべきプロ
グラムが存在しなければ、コピープログラムを起動し
(ステップ2103)、TCBよりプログラムエリアB
のプログラムの先頭アドレスと容量を読み出し、DMA
C4に渡すとともに、プログラムエリアAのコピー先ア
ドレスを渡し、DMACスタート信号をオンし、DMA
C4を起動する。また、その後、ベースプログラムであ
るプログラムn+1を起動する。
As shown in FIG. 19, the start address of the program m in the TCB is switched to the program m in the program area B, and the program m in the rewritten program area B is operated. Thereafter, the base program n + 1 When the END instruction is issued, the OS 200
Determines whether the program is normal or abnormal using a normality determination program whose processing procedure is shown in FIG. 21 (FIG. 21, steps 2101 and 2102). If the program is normal and there is no other program to be started, the copy program is Activate (step 2103), and program area B from TCB
Read the start address and capacity of the program
C4, the copy destination address of the program area A is passed, and the DMAC start signal is turned on.
Start C4. Thereafter, the program n + 1 which is the base program is started.

【0112】もし、異常であれば、CPU2が、修正ま
えのプログラムにて動作するよう、TCB書替プログラ
ムを起動し(ステップ2104)、TCB内プログラム
mの先頭アドレスをプログラムエリアA内のプログラム
mの先頭アドレスに書き替える。
If abnormal, the CPU 2 activates the TCB rewriting program so as to operate with the program before correction (step 2104), and changes the start address of the program m in the TCB to the program m in the program area A. To the start address of

【0113】さて、プログラムエリアBのプログラム
の、プログラムエリアAへの転送が終了したら、OS2
00は、TCB書替プログラムを起動し、CPU2が実
行するプログラムを、プログラムエリアBのものからか
らプログラムエリアAへ転送したものに切り換える。
When the transfer of the program in the program area B to the program area A is completed, the OS 2
00 starts the TCB rewriting program and switches the program executed by the CPU 2 from the program area B to the program area A transferred.

【0114】この切り換えの前後のタイムチャートを図
22に示す。
FIG. 22 shows a time chart before and after the switching.

【0115】図中、前半はプログラムn+1の途中で、
プログラムエリアB内にあるプログラムmが動作してい
る。これはTCB内のプログラムmの先頭アドレスがプ
ログラムエリアB内のプログラムmの先頭アドレスを示
しているためである。ここで、プログラムn+1がEN
Dにより終了した後で、TCB書替プログラムを起動
し、TCB内のプログラムmの先頭アドレスをプログラ
ムエリアB内の先頭アドレスからプログラムエリアA内
のプログラムmの先頭アドレスに書き替える。この後、
再びベースプログラムn+1が起動するが、この後に呼
び出されるプログラムmはプログラムエリアA内のプロ
グラムmである。これはTCB内のプログラムmの先頭
アドレスがプログラムエリアA内のプログラムmの先頭
アドレスを示しているためである。
In the figure, the first half is in the middle of program n + 1,
The program m in the program area B is operating. This is because the start address of the program m in the TCB indicates the start address of the program m in the program area B. Here, the program n + 1 is EN
After the termination by D, the TCB rewriting program is started, and the head address of the program m in the TCB is rewritten from the head address in the program area B to the head address of the program m in the program area A. After this,
The base program n + 1 is started again, and the program m called thereafter is the program m in the program area A. This is because the start address of the program m in the TCB indicates the start address of the program m in the program area A.

【0116】以上によりプログラムエリアBのプログラ
ムmからプログラムエリアAのプログラムmに切り換わ
ったが、TCB書替プログラムの実行時間は、プラント
制御プログラムに時間を較べて充分に小さいので、実質
上プラント制御はストップしない。
As described above, the program is switched from the program m in the program area B to the program m in the program area A. However, the execution time of the TCB rewriting program is sufficiently shorter than that of the plant control program. Does not stop.

【0117】ところで、本実施例に係るプログラマブル
コントローラ1は、図23に示すように、先に図1に示
したの構成にオンライン/オフライン制御回路9、オフ
ラインメモリ10を組み合せて構成してもよい。
As shown in FIG. 23, the programmable controller 1 according to the present embodiment may be configured by combining the online / offline control circuit 9 and the offline memory 10 with the configuration shown in FIG. .

【0118】このようにプログラマブルコントローラ1
を構成することにより、書替、変更したプログラムにつ
いては、オフライン化し、オフラインメモリ10内のダ
ミーデータで入出力テストを行うことができる。すなわ
ち、プラントに影響を与えることなくプログラムのデバ
ッグができる。結果、オンライン中のプログラム追加、
変更時の信頼性の向上が図れる。
Thus, the programmable controller 1
With this configuration, a rewritten or changed program can be taken offline and an input / output test can be performed using dummy data in the offline memory 10. That is, the program can be debugged without affecting the plant. As a result, adding programs online,
The reliability at the time of change can be improved.

【0119】ところで、本実施例においては、前述した
ように、プログラム名を入力した時点で、DMAC4が
MEM3内プログラムエリアAからプログラムエリアB
へのプログラムコピーを行う。
In the present embodiment, as described above, when the program name is input, the DMAC 4 changes from the program area A in the MEM 3 to the program area B.
Make a program copy to.

【0120】これは、従来のはじめにコマンドを入力
し、そのうしろにオペランドとしてプログラム名を入力
する図24bに示すような手順とすると、書き替え時間
が大きいため、本実施例では、図24aに示すように、
最初にプログラム名を入力し、そのうしろにコマンド
(コピー、リード、ライト)を入力する手順とし、コマ
ンドの種類に関係なくプログラム名を入力した時点で、
DMAC4がMEM3内プログラムエリアAからプログ
ラムエリアBへプログラムのコピーを行うようにしたも
のである。
This is because, if a procedure as shown in FIG. 24B is used in which a command is first input at the beginning and a program name is input as an operand after that, the rewriting time is long. As shown,
First, enter the program name, and then enter the command (copy, read, write) after that. When the program name is entered regardless of the type of command,
The DMAC 4 copies the program from the program area A in the MEM 3 to the program area B.

【0121】このようにすることにより、プログラマブ
ルコントローラ1の内部処理とオペレータのコマンド入
力処理を並列的に実行するため、図24cに示すよう
に、書き替え時間の短縮、特にオペレータの待ち時間短
縮を図ることができる。
In this manner, since the internal processing of the programmable controller 1 and the command input processing of the operator are executed in parallel, as shown in FIG. Can be planned.

【0122】この反面、リード等のようにプログラムの
コピ−が必要ないコマンドについてもコピ−を行ってし
まうことになる。しかし、前述したように、コピ−実行
中でもプラントの制御は並行して実行されるので支障は
生じない。
On the other hand, a command that does not need to be copied, such as a read command, is also copied. However, as described above, even during the copying, the control of the plant is executed in parallel, so that no problem occurs.

【0123】以上のように、本実施例によれば、プラン
ト制御に影響を与えることなくオンライン中にプログラ
ムの追加訂正ができる。また、内部で並列処理を行うた
め、書き替え時間の短縮、特にオペレータの待ち時間の
短縮を図ることができる。
As described above, according to this embodiment, a program can be additionally corrected online without affecting the plant control. Further, since the parallel processing is performed internally, the rewriting time can be reduced, and in particular, the waiting time of the operator can be reduced.

【0124】なお、本実施例においては、DMACをサ
イクルスチルモードで動作させたが、たとえば、プラン
トの制御において、さほど高速な応答性を要しないシス
テムにおいては、DMACをバーストモードで動作させ
るようにしてもよい。
In this embodiment, the DMAC is operated in the cycle still mode. However, for example, in a system that does not require a very high-speed response in controlling the plant, the DMAC is operated in the burst mode. You may.

【0125】また、各プログラムについてプログラムメ
モリとワークメモリの容量を等しくしておけば、ワーク
メモリ上で書き替えたプログラムを、ワークメモリに戻
せなくなることはない。
If the capacities of the program memory and the work memory are equal for each program, the program rewritten on the work memory cannot be returned to the work memory.

【0126】[0126]

【発明の効果】以上のように、本発明によれば、プラン
ト等を制御する制御プログラムの実行を停止することな
くプログラムの変更を行なうことのできるプログラマブ
ルコントローラを提供することができる。
As described above, according to the present invention, it is possible to provide a programmable controller capable of changing a control program for controlling a plant or the like without stopping execution of the program.

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

【図1】本発明の一実施例に係るプログラマブルコント
ローラの構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a programmable controller according to one embodiment of the present invention.

【図2】本発明の一実施例において中央処理装置が実行
するソフトウェアの構成を示す説明図である。
FIG. 2 is an explanatory diagram showing a configuration of software executed by a central processing unit in one embodiment of the present invention.

【図3】本発明の一実施例におけるユーザプログラムの
実行状態をしめす説明図である。
FIG. 3 is an explanatory diagram showing an execution state of a user program in one embodiment of the present invention.

【図4】本発明の一実施例における各ソフトウェアの実
行動作を示すタイムチャートである。
FIG. 4 is a time chart showing an execution operation of each software in one embodiment of the present invention.

【図5】本発明に一実施例に係るダイレクトメモリアク
セスコントローラの周辺の詳細構成を示すブロック図で
ある。
FIG. 5 is a block diagram showing a detailed configuration around a direct memory access controller according to an embodiment of the present invention.

【図6】本発明に一実施例に係るダイレクトメモリアク
セスコントローラの転送動作を示すタイムチャートであ
る。
FIG. 6 is a time chart showing a transfer operation of the direct memory access controller according to one embodiment of the present invention.

【図7】本発明に一実施例に係るマンマシンシステムイ
ンタフェース周辺の構成を示すブロック図である。
FIG. 7 is a block diagram illustrating a configuration around a man-machine system interface according to an embodiment of the present invention.

【図8】本発明の一実施例におけるオペレータ入力とC
PU動作の関係を示すタイムチャートである。
FIG. 8 shows an operator input and C in one embodiment of the present invention.
6 is a time chart showing a relationship between PU operations.

【図9】本発明の一実施例に係るプログラム書替指令の
入力フォーマットを示す説明図である。
FIG. 9 is an explanatory diagram showing an input format of a program rewriting command according to one embodiment of the present invention.

【図10】本発明の一実施例に係る受信割り込み処理プ
ログラムの処理手順を示すフローチャートの前半部分で
ある。
FIG. 10 is a first half of a flowchart showing a processing procedure of a reception interrupt processing program according to one embodiment of the present invention.

【図11】本発明の一実施例に係る受信割り込み処理プ
ログラムの処理手順を示すフローチャートの後半部分で
ある。
FIG. 11 is a latter half of a flowchart showing a processing procedure of a reception interrupt processing program according to one embodiment of the present invention.

【図12】本発明の一実施例に係るコピープログラムの
処理手順を示すフローチャートである。
FIG. 12 is a flowchart illustrating a processing procedure of a copy program according to an embodiment of the present invention.

【図13】本発明の一実施例に係る終了割込み処理プロ
グラムの処理手順を示すフローチャートである。
FIG. 13 is a flowchart illustrating a processing procedure of a termination interrupt processing program according to an embodiment of the present invention.

【図14】本発明の一実施例に係るTCB書替プログラ
ムの処理手順を示すフローチャートである。
FIG. 14 is a flowchart illustrating a processing procedure of a TCB rewriting program according to an embodiment of the present invention.

【図15】本発明の一実施例におけるプログラムコピー
動作の手順を示すフローチャートである。
FIG. 15 is a flowchart showing a procedure of a program copy operation in one embodiment of the present invention.

【図16】本発明の一実施例におけるメモリ書替動作の
手順を示すフローチャートである。
FIG. 16 is a flowchart showing a procedure of a memory rewriting operation in one embodiment of the present invention.

【図17】本発明の一実施例におけるTCB書替動作の
手順を示すフローチャートである。
FIG. 17 is a flowchart illustrating a procedure of a TCB rewriting operation according to an embodiment of the present invention.

【図18】本発明の一実施例におけるプログラムの変更
動作を示すタイムチャートである。
FIG. 18 is a time chart showing a program change operation in one embodiment of the present invention.

【図19】本発明の一実施例におけるプログラム切り換
え動作を示すフローチャートである。
FIG. 19 is a flowchart showing a program switching operation in one embodiment of the present invention.

【図20】本発明の一実施例における書替後プログラム
のコピー動作を示すタイムチャートである。
FIG. 20 is a time chart showing a copy operation of a rewritten program in one embodiment of the present invention.

【図21】本発明の一実施例に係る正常判定プログラム
の処理手順を示すフローチャートである。
FIG. 21 is a flowchart illustrating a processing procedure of a normality determination program according to an embodiment of the present invention.

【図22】本発明の一実施例における初期状態復帰のた
めのプログラム切り換え動作を示すタイムチャートであ
る。
FIG. 22 is a time chart showing a program switching operation for returning to an initial state in one embodiment of the present invention.

【図23】本発明の一実施例に係るプログラマブルコン
トローラの他の構成を示すブロック図である。
FIG. 23 is a block diagram showing another configuration of the programmable controller according to one embodiment of the present invention.

【図24】本発明の一実施例に係るプログラムコピー指
令の入力フォーマットを示す説明図である。
FIG. 24 is an explanatory diagram showing an input format of a program copy command according to one embodiment of the present invention.

【図25】従来のプログラマブルコントローラにおける
プログラム変更処理手順を示すフローチャートである。
And FIG. 25 is a flowchart showing a program change processing procedure in a conventional programmable controller.

【図26】従来のプログラマブルコントローラにおける
プログラム変更動作を示すタイムチャートである。
FIG. 26 is a time chart showing a program change operation in a conventional programmable controller.

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

1 プログラマブルコントローラ 2 中央処理装置(CPU) 3 メモリ(MEM) 4 ダイレクトメモリアクセスコントローラ(DMA
C) 5 マンマシンシステムインタフェース(MCSI/
F) 6 プロセス入出力インタフェース(PIOI/F) 7 プロセス入出力(PIO) 8 プラント 9 オンライン/オフライン制御回路 10 オフラインメモリ
DESCRIPTION OF SYMBOLS 1 Programmable controller 2 Central processing unit (CPU) 3 Memory (MEM) 4 Direct memory access controller (DMA
C) 5 Man-machine system interface (MCSI /
F) 6 Process input / output interface (PIOI / F) 7 Process input / output (PIO) 8 Plant 9 Online / offline control circuit 10 Offline memory

───────────────────────────────────────────────────── フロントページの続き (72)発明者 菊池 洋光 茨城県日立市大みか町五丁目2番1号 株式会社 日立製作所 大みか工場内 (72)発明者 渡部 隆一 茨城県日立市大みか町五丁目2番1号 日立プロセスコンピュータエンジニアリ ング株式会社内 (72)発明者 北田 孝志 茨城県日立市大みか町五丁目2番1号 日立プロセスコンピュータエンジニアリ ング株式会社内 (56)参考文献 特開 平4−25904(JP,A) 特開 昭60−229106(JP,A) 特開 昭62−152002(JP,A) 特開 昭59−114602(JP,A) 特開 平3−28905(JP,A) 特開 昭62−99804(JP,A) 特開 昭62−266604(JP,A) (58)調査した分野(Int.Cl.6,DB名) G05B 19/05──────────────────────────────────────────────────続 き Continued on the front page (72) Inventor Hiromitsu Kikuchi 5-2-1 Omika-cho, Hitachi City, Ibaraki Prefecture Inside the Omika Plant, Hitachi, Ltd. (72) Ryuichi Watanabe 5-2-2 Omika-cho, Hitachi City, Ibaraki Prefecture 1 Hitachi Process Computer Engineering Co., Ltd. (72) Inventor Takashi Kitada 5-2-1 Omika-cho, Hitachi City, Ibaraki Prefecture Hitachi Process Computer Engineering Co., Ltd. (56) References JP-A-4-25904 (JP, A) JP-A-60-229106 (JP, A) JP-A-62-152002 (JP, A) JP-A-59-114602 (JP, A) JP-A-3-28905 (JP, A) JP-A-62-99804 (JP, A) JP-A-62-266604 (JP, A) (58) Fields investigated (Int. Cl. 6 , DB name) G05B 19/05

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】1または複数のプログラムを格納するプロ
グラムエリアと、ワークエリアと、実行対象となるプロ
グラムを管理する管理テーブルと、管理テーブルに実行
対象として管理されている1または複数のプログラム中
のプログラムを処理に応じて実行するプログラム実行手
段と、前記プログラムエリア上のプログラムをワークエ
リアに複写する手段と、ワークエリア上に複写されたプ
ログラムを、ワークエリア上で変更する手段と、プログ
ラムエリアに格納されている複写元プログラムに代えて
ワークエリアに格納されたプログラムに実行対象が切り
換わるように前記管理テーブルの管理内容を変更する切
り換え手段とを有し、 前記複写する手段は、前記プログラムエリア上のプログ
ラムをワークエリアに、前記プログラム実行手段のプロ
グラムの実行と並行して、サイクルスチルモードのダイ
レクトメモリアクセス転送によって複写する、ダイレク
トメモリアクセスコントローラである ことを特徴とする
プログラマブルコントローラ。
1. A program area for storing one or more programs, a work area, a management table for managing a program to be executed, and one or more programs in one or more programs managed as execution targets in the management table. Means for executing a program in accordance with processing, means for copying a program on the program area to a work area, means for changing the program copied on the work area on the work area, instead of the copy source program stored possess a switching means for changing the management contents of the management table to switch the execution target program stored in the work area, said means for copying, the program area Top blog
The program in the work area,
In parallel with the execution of the program, the cycle still mode die
Direct copy by direct memory access transfer
A programmable controller characterized by being a memory access controller.
JP4019893A 1992-02-05 1992-02-05 Programmable controller Expired - Fee Related JP2846760B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4019893A JP2846760B2 (en) 1992-02-05 1992-02-05 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4019893A JP2846760B2 (en) 1992-02-05 1992-02-05 Programmable controller

Publications (2)

Publication Number Publication Date
JPH05216507A JPH05216507A (en) 1993-08-27
JP2846760B2 true JP2846760B2 (en) 1999-01-13

Family

ID=12011877

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4019893A Expired - Fee Related JP2846760B2 (en) 1992-02-05 1992-02-05 Programmable controller

Country Status (1)

Country Link
JP (1) JP2846760B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100464251B1 (en) * 1997-12-17 2005-05-03 엘지산전 주식회사 How to modify program during PLC
US6850973B1 (en) * 1999-09-29 2005-02-01 Fisher-Rosemount Systems, Inc. Downloadable code in a distributed process control system
JP5747584B2 (en) * 2011-03-15 2015-07-15 オムロン株式会社 Control device and system program
US9377769B2 (en) 2011-03-15 2016-06-28 Omron Corporation Control apparatus for updating a user program while processing is being performed and recording medium

Also Published As

Publication number Publication date
JPH05216507A (en) 1993-08-27

Similar Documents

Publication Publication Date Title
JPH0430053B2 (en)
JPH0496163A (en) Dma controller
JPH04133102A (en) Programmable controller and its control method
JPS6131485B2 (en)
JP2846760B2 (en) Programmable controller
US6182207B1 (en) Microcontroller with register system for the indirect accessing of internal memory via auxiliary register
JPH0793101A (en) Data backup device
JPS63138403A (en) Data transfer system
JPS6240736B2 (en)
US20050102575A1 (en) Apparatus and method for using variable end state delay to optimize JTAG transactions
JPH07295761A (en) Mirroring magnetic disk device
JPH0619827A (en) Peripheral controller
JPH0635621A (en) Dual disk storage device having dual restoring function
JPH10240569A (en) Tracing device for computer
JPS62168246A (en) Memory writing control system
JPS58129525A (en) Data input and output controlling method of data processing system
JPS597971B2 (en) I/O device control method
JPH0527146B2 (en)
JPH0481939A (en) Control system for microcomputer
JPH08123725A (en) Write-back type cache system
JPH0424733B2 (en)
JPS60189060A (en) Multiprocessor system
JPS596411B2 (en) Channel data transfer control method
JPS63201839A (en) Logical simulation device
JPH0782447B2 (en) DMA data transfer control device

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees