Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3389592B2 - Programmable controller - Google Patents
[go: Go Back, main page]

JP3389592B2 - Programmable controller - Google Patents

Programmable controller

Info

Publication number
JP3389592B2
JP3389592B2 JP01272697A JP1272697A JP3389592B2 JP 3389592 B2 JP3389592 B2 JP 3389592B2 JP 01272697 A JP01272697 A JP 01272697A JP 1272697 A JP1272697 A JP 1272697A JP 3389592 B2 JP3389592 B2 JP 3389592B2
Authority
JP
Japan
Prior art keywords
object code
storage means
code
stored
file
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 - Lifetime
Application number
JP01272697A
Other languages
Japanese (ja)
Other versions
JPH10207512A (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.)
Omron Corp
Original Assignee
Omron Corp
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 Corp filed Critical Omron Corp
Priority to JP01272697A priority Critical patent/JP3389592B2/en
Publication of JPH10207512A publication Critical patent/JPH10207512A/en
Application granted granted Critical
Publication of JP3389592B2 publication Critical patent/JP3389592B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Programmable Controllers (AREA)

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, and more particularly to a programmable controller that additionally modifies a user program or the like without stopping an external device.

【0002】[0002]

【従来の技術】従来のプログラマブルコントローラは、
FA(Factory Automation) 等の外部機器を稼働するた
めのハードチェック処理、ラダープログラム等からなる
ユーザプログラムの命令実行処理、外部機器に対する制
御処理以外の管理処理等の周辺処理を1サイクルとする
スキャン処理を実行している。
2. Description of the Related Art Conventional programmable controllers are
Hard check processing for operating external equipment such as FA (Factory Automation), instruction execution processing of user programs consisting of ladder programs, peripheral processing such as management processing other than control processing for external equipment in one cycle Is running.

【0003】このため、従来のプログラマブルコントロ
ーラは、外部機器を停止させずにユーザプログラム等を
追加変更する場合には、図8に示すように、周辺処理の
短時間において、1命令のみを追加変更するようになっ
ている。
Therefore, in the conventional programmable controller, when the user program or the like is additionally changed without stopping the external device, as shown in FIG. 8, only one instruction is additionally changed in a short time of peripheral processing. It is supposed to do.

【0004】因みに、プログラマブルコントローラを稼
働させるラダープログラムには、所定の機能ごとにモジ
ュール化するという概念がないため、C++言語等の変
数の概念もない。
Incidentally, since the ladder program for operating the programmable controller does not have the concept of modularization for each predetermined function, there is no concept of variables such as C ++ language.

【0005】このため、従来のプログラマブルコントロ
ーラは、命令をアクセスするためにはメモリの該当アド
レスを直接指定しなければならない構成になっている。
For this reason, the conventional programmable controller has a structure in which the corresponding address of the memory must be directly specified in order to access the instruction.

【0006】[0006]

【発明が解決しようとする課題】従来のプログラマブル
コントローラでは、上述したように、外部機器を停止さ
せずにユーザプログラム等を追加変更する場合には、周
辺処理の短時間においてしか行うことができないため
に、1命令のみを追加変更することが可能であっても、
所定の機能ごとにモジュール化したものを追加変更する
ことができないという問題点があった。
In the conventional programmable controller, as described above, when the user program or the like is additionally changed without stopping the external device, the peripheral processing can be performed only in a short time. Even if it is possible to add and change only one instruction,
There is a problem that modularization cannot be added or changed for each predetermined function.

【0007】このため、新たな機能をモジュールごとに
追加変更するには、プログラマブルコントローラを一時
停止せざるを得なく、システムの稼働性を低下させてし
まうという問題点があった。
Therefore, in order to add and change a new function for each module, the programmable controller has to be temporarily stopped, which causes a problem that the operability of the system is deteriorated.

【0008】そこで、本発明は上述の問題点に鑑み、モ
ジュール化可能なプログラム言語を使用するとともに、
ユーザプログラム等を追加変更する際には、モジュール
化してプログラムを追加変更するプログラマブルコント
ローラを提供することを目的とする。
In view of the above problems, the present invention uses a modular programming language, and
It is an object of the present invention to provide a programmable controller that is modularized to additionally change a program when the user program or the like is additionally changed.

【0009】[0009]

【課題を解決するための手段】上述の目的を達成するた
めに、請求項1記載の発明は、外部機器等の制御を複数
のモジュールプログラムのオブジェクトコードで行うプ
ログラマブルコントローラであって、エディットされた
上記モジュールプログラムをコンパイルしてオブジェク
トコードを形成するオブジェクトコード形成手段と、こ
のオブジェクトコード形成手段で形成されたオブジェク
トコードにより上記外部機器等をスキャン制御するラン
タイム制御手段とを具備し、上記ランタイム制御手段
は、上記オブジェクトコード形成手段で形成された上記
エディットされたモジュールプログラムのオブジェクト
コードを格納する第1の格納手段と、第2の格納手段
と、上記第1のオブジェクトコード格納手段と第2のオ
ブジェクトコード格納手段とのうち、どちらに格納され
ているオブジェクトコードを使用するかを示す使用情報
を格納する格納手段選択テーブルと、この格納手段選択
テーブルに基づき、上記第1のオブジェクトコード格納
手段に格納されているオブジェクトコードか、または第
2のオブジェクトコード格納手段に格納されているオブ
ジェクトコードかのいずれか1つを選択して実行するコ
ード実行手段と、上記オブジェクトコード形成手段によ
り、オブジェクトが変更された場合には、上記格納手段
選択テーブルに基づき、上記第1のオブジェクトコード
格納手段に格納されているオブジェクトコードか、また
は第2のオブジェクトコード格納手段に格納されている
オブジェクトコードかのいずれか1つを、上記変更され
たオブジェクトに変更するとともに、上記格納手段選択
テーブル中の変更されたオブジェクトコードが格納され
た格納手段を使用するように使用情報を変更する使用情
報変更手段とを有するようにする。
In order to achieve the above-mentioned object, the invention according to claim 1 is a programmable controller for controlling an external device or the like by object code of a plurality of module programs, which is edited. An object code forming means for compiling the module program to form an object code, and a runtime control means for controlling scan of the external device etc. by the object code formed by the object code forming means , The runtime control means
Is formed by the above object code forming means
Edited module program object
First storage means for storing a code and second storage means
And the first object code storage means and the second object code storage means.
Which is stored in the object code storage means?
Usage information indicating whether to use the object code
Storage means selection table for storing
Stores the first object code based on the table
Object code stored in the means, or
2 stored in the object code storage means
The command to select and execute any one of the
And the object code forming means.
If the object is changed, the above storage means
Based on the selection table, the first object code above
The object code stored in the storage, or
Is stored in the second object code storage means
Any one of the object code is modified above
Change to a different object and select the above storage means
Contains the modified object code in the table
Usage information that changes usage information to use
And a means for changing information .

【0010】請求項2記載の発明は、外部機器等の制御
を複数のモジュールプログラムのオブジェクトコードで
行うプログラマブルコントローラであって、エディット
された上記モジュールプログラムをコンパイルしてオブ
ジェクトコードを形成するオブジェクトコード形成手段
と、このオブジェクトコード形成手段で形成されたオブ
ジェクトコードにより上記外部機器等をスキャン制御す
るランタイム制御手段とを具備し上記ランタイム制御
手段は、上記オブジェクトコード形成手段で形成された
上記エディットされたモジュールプログラムのオブジェ
クトコードを格納する第1の格納手段と、第2の格納手
段と、上記第1のオブジェクトコード格納手段と第2の
オブジェクトコード格納手段とのうち、どちらに格納さ
れているオブジェクトコードを使用するかを示す使用情
報を格納する格納手段選択テーブルと、この格納手段選
択テーブルに基づき、上記第1のオブジェクトコード格
納手段に格納されているオブジェクトコードか、または
第2のオブジェクトコード格納手段に格納されているオ
ブジェクトコードかのいずれか1つを選択して実行する
コード実行手段と、上記オブジェクトコード形成手段に
より、オブジェクトが変更された場合には、上記格納手
段選択テーブルに基づき、上記第1のオブジェクトコー
ド格納手段に格納されているオブジェクトコードか、ま
たは第2のオブジェクトコード格納手段に格納されてい
るオブジェクトコードかのいずれか1つを、上記変更さ
れたオブジェクトに変更するとともに、上記格納手段選
択テーブル中の変更されたオブジェクトコードが格納さ
れた格納手段を使用するように使用情報を変更する使用
情報変更手段とを有し、更に、上記オブジェクトコード
形成手段により形成されたオブジェクトコードをオブジ
ェクトコードファイルとして記憶するコードファイル記
憶手段と電源が落ちる前に上記格納手段選択テーブルに
格納されている内容を記憶する退避記憶手段とを具備す
ることで、上記コードファイル記憶手段および退避記憶
手段に記憶された情報に基づいて、第1のオブジェクト
コード格納手段、第2のオブジェクトコード格納手段お
よび格納手段選択テーブルを電源を落とす前の状態に復
帰できるようにする。
[0010] According to a second aspect of the invention, a programmable controller for controlling the external equipment such as an object code of a plurality of module program, edit
Object code forming means for forming an object code by compiling the module programs, comprising a run-time control means for scanning controlling the external device or the like by the object code that is formed in the object code forming unit, the run-time control
The means is formed by the above object code forming means.
Object of the edited module program
First storing means for storing a code and a second storing means
A row, the first object code storage means, and the second
Which is stored in the object code storage means?
Usage information indicating whether to use the stored object code
Storage means selection table for storing information and this storage means selection table
The first object code case based on the selection table
The object code stored in the payment method, or
The object stored in the second object code storage means
Select and execute any one of the object codes
Code execution means and the above object code forming means
If the object is changed, the above storage
Based on the row selection table, the first object code
Object code stored in the storage means
Or stored in the second object code storage means
Change any one of the object code
Stored object and select the above storage method.
The changed object code in the selection table is stored.
Use to change usage information to use
And an information changing means, and further, the above object code
Object code formed by the forming means
Code file that is stored as a code file
Before the memory and power supply are turned off,
And evacuation storage means for storing the stored contents
The above-mentioned code file storage means and save storage
A first object based on the information stored in the means
Code storage means, second object code storage means
And the storage means selection table to the state before the power was turned off.
Allow me to go home.

【0011】[0011]

【0012】請求項記載の発明は、請求項2記載の発
明において、上記オブジェクトコード形成手段は、オン
ラインエデットしてオブジェクトコードを修正した場
合には、上記コードファイル記憶手段に記憶されている
修正前のオブジェクトコードファイル名を別のファイル
名に変更し、修正後のものを改めて修正前のオブジェク
トコードファイル名とするようにする。
[0012] According to a third aspect, the invention of claim 2, wherein the object code forming means, when modifying the object code by online Ede I Tsu DOO is stored in the code file storage means Change the object code file name before modification to another file name and make the modified object code file name before modification.

【0013】請求項記載の発明は、請求項1乃至3の
いずれか1項に記載の発明において、上記第1の格納手
段および第2の格納手段は、上記オブジェクトコードを
格納するための領域がオブジェクトコード形成手段によ
り決定されるようにする。
According to a fourth aspect of the invention, in the invention according to any one of the first to third aspects, the first retractable hand is provided.
The stage and the second storage means store the above object code.
The area for storing is defined by the object code forming means.
To be decided .

【0014】請求項記載の発明は、請求項2または3
記載の発明において、オンラインエディット実行前の状
態に戻すUndo処理を実行するときには、上記オブジ
ェクトコード形成手段が、上記コードファイル記憶手段
に記憶されているユーザが選択したUndoしたオブジ
ェクトコードのオブジェクトコードファイルを、上記ラ
ンタイム制御手段が処理しないオブジェクトコードファ
イルに変更し、オンラインエディット実行前のオブジェ
クトコードファイルを上記ランタイム制御手段が処理す
るオブジェクトコードファイルに変更し、上記ランタイ
ム制御手段が、上記格納手段選択テーブルの上記使用情
報をオンラインエディット実行前のオブジェクトコード
を格納する格納手段のものとするようにする。
The invention according to claim 5 is the invention according to claim 2 or 3.
In the described invention, the state before execution of online editing
When executing Undo processing to return to the state,
The code code forming means is the code file storing means.
Undo object selected by the user stored in
The object code file of
Object code file that the real-time control means does not process
To the object before online editing.
Process code file is processed by the above-mentioned runtime control means.
Change to the object code file
The system control means uses the storage information in the storage means selection table.
Object code before executing online edit
Is stored in the storage means.

【0015】請求項6記載の発明は、制御機能ごとにモ
ジュール化した複数のモジュールプログラムをオブジェ
クトコードで実行する命令実行処理を含む処理を繰り返
し実行するプログラマブルコントローラの制御方法にお
いて、処理を実行するためのオブジェクトコードを格納
する第1および第2のオブジェクトコード格納手段を設
け、オンラインエディットしてオブジェクトコードを修
正した場合には、第1のオブジェクトコード格納手段ま
たは第2のオブジェクトコード格納手段のうちの現在実
行されていない格納手段のオブジェクトコードを修正後
のオブジェクトコードに書き替えるとともに、この書き
替えに応じて、第1のオブジェクトコード格納手段、第
2のオブジェクトコード格納手段のうち書き替えをした
側に格納したオブジェクトコードを実行するように使用
情報を変更し、次回の命令実行処理から上記使用情報の
変更に基づいてオブジェクトコードを実行することを特
徴とする。 請求項7記載の発明は、制御機能ごとにモジ
ュール化した複数のモジュールプログラムをオブジェク
トコードで実行する命令実行処理を含む処理を繰り返し
実行するプログラマブルコントローラの制御方法におい
て、実行中のオブジェクトコードと、修正前のオブジェ
クトコードとをそれぞれ格納する第1および第2のオブ
ジェクトコード格納手段を設け、上記第1および第2の
オブジェクトコード格納手段のうちどちらが現在実行さ
れているかを示す使用情報を持ち、Undo実行をする
場合には、使用情報を、ふたつの上記オブジェクトコー
ド格納手段のうち現在実行中の格納手段から現在実行し
ていない格納手段に変更することにより、次回の命令実
行処理からUndoされたオブジェクトコードを実行す
るようにしたことを特徴とする。
According to a sixth aspect of the present invention, each control function is modeled.
Objects that are modularized modules
Repeat the process including the instruction execution process executed by the code
The control method of the programmable controller
And store the object code to execute the process
First and second object code storage means for
Edit the object code by editing online.
If correct, the first object code storage means or
Or the current one of the second object code storage means.
After correcting the object code of the storage means that has not been executed
And rewrite it to the object code of
The first object code storage means, the first object code storage means,
The object code storage means of 2 was rewritten
Used to execute the object code stored on the side
Change the information, and use the above usage information from the next instruction execution process.
It specializes in executing object code based on changes.
To collect. The invention according to claim 7 is a module for each control function.
Object modules
Repeat processing including instruction execution processing executed by
The control method of the programmable controller to be executed
The running object code and the unmodified object.
And a second object that stores the
The eject code storing means is provided, and the first and second
Which of the object code storage means is currently being executed
It has the usage information indicating whether it is being executed, and executes Undo
In some cases, the usage information is given in the two object codes above.
Execution from the currently executing storage means
By changing to a storage means that is not
Executes the Undo object code from line processing
It is characterized by doing so.

【0016】本発明によれば、モジュールプログラムが
エディットされ、このエディトされたモジュールプログ
ラムをコンパイルされてオブジェクトコードが形成さ
れ、このオブジェクトコードが実行されるため、外部機
器を停止させずにユーザプログラム等を追加変更するこ
とができる。
According to the present invention, a module program is edited, the edited module program is compiled to form an object code, and the object code is executed. Therefore, a user program or the like can be executed without stopping an external device. Can be added and changed.

【0017】特に、格納手段選択テーブルに、第1の格
納手段に格納されているオブジェクトか、または、第2
の格納手段に格納されているオブジェクトコードのどち
らかを使用するかを示す情報を有しているため、オブジ
ェクトコードの実行方法が間接指定となる。
In particular, in the storage means selection table, either the object stored in the first storage means or the second storage means
Since it has information indicating which one of the object codes stored in the storage means is used, the method of executing the object code is indirectly designated.

【0018】さらに、記憶手段に形成されたオブジェク
トコードがオブジェクトコードファイルとして記憶さ
れ、電源が落ちる前に格納手段選択テーブルに格納され
ている内容が退避記憶手段に記憶されるため、電源が立
ち上がるときに、再び退避記憶手段に記憶されている内
容に基づき、再起動することができる。
Further, since the object code formed in the storage means is stored as an object code file and the contents stored in the storage means selection table before the power is turned off are stored in the save storage means, when the power is turned on. In addition, the system can be restarted again based on the contents stored in the save storage means.

【0019】さらにまた、オンラインエデイットしたオ
ブジェクトコードのオブジェクトコードファイルを、処
理しないオブジェクトコードファイルに変更し、オンラ
インエディット実行前のオブジェクトコードのオブジェ
クトコードファイルを処理するオブジェクトコードファ
イルに変更し、格納手段選択テーブルの使用情報を変更
することにより、Undo処理が行える。
Furthermore, the object code file of the object code edited online is changed to an object code file which is not processed, the object code file of the object code before execution of online editing is changed to a processed object code file, and a storage means is selected. Undo processing can be performed by changing the usage information of the table.

【0020】[0020]

【発明の実施の形態】以下、本発明に係るプログラマブ
ルコントローラの実施形態を図面を参照して説明する。
BEST MODE FOR CARRYING OUT THE INVENTION Embodiments of a programmable controller according to the present invention will be described below with reference to the drawings.

【0021】図1および図2は1131−3基準に準拠
するプログラム言語についての説明図であり、図4は本
発明に係るプログラマブルコントローラの一実施形態の
構成を示すブロック図である。
1 and 2 are explanatory diagrams of a programming language conforming to the 1131-3 standard, and FIG. 4 is a block diagram showing a configuration of an embodiment of a programmable controller according to the present invention.

【0022】(1)この実施形態のプログラマブルコン
トローラ(以下。PLCという)は、IEC(Internat
iona Electrotechnical Commisson )1131−3基準
に準拠するプログラム言語(以下、IEC準拠プログラ
ム言語という)を使用するものであるため、この実施形
態のPLCの構成を述べる前に、IEC準拠プログラム
言語について説明する。
(1) The programmable controller (hereinafter, referred to as PLC) of this embodiment has an IEC (Internat)
Since a programming language compliant with the Iona Electrotechnical Commisson) 1131-3 standard (hereinafter referred to as IEC compliant programming language) is used, the IEC compliant programming language will be described before describing the configuration of the PLC of this embodiment.

【0023】IEC準拠プログラム言語は、POU(Pr
ogram Organization Unit)と呼ばれるプログラム,Fu
nctionおよびFunction Blockで記
述される。
The IEC compliant programming language is POU (Pr
Program called ogram Organization Unit), Fu
It is described by the action and Function Block.

【0024】POUおよびはFunction Blo
ckは、図1に示すように、入力変数,出力変数,内部
変数およびコードからなる定義部で、内部状態を有する
(同じ入力を与えたとき、異なった出力を取り得る)モ
ジュールであるのに対し、Functionは、内部状
態を有しないモジュールである。
POU and are Function Blo
As shown in FIG. 1, ck is a definer consisting of an input variable, an output variable, an internal variable and a code, and is a module having an internal state (it can take different outputs when given the same input). On the other hand, Function is a module that has no internal state.

【0025】ここで、POUおよびはFunction
Blockの宣言部で指定された変数が記憶されてい
るデータメモリ(DM)(後述する)中の箇所をデータ
インスタンスといい、POU,Functionおよび
Function Blockを実行するための各オブ
ジェクトコードが記憶されているコードメモリ(CM)
(後述する)中の箇所をコードインスタンスという。
Here, POU and are Function
A portion in the data memory (DM) (described later) in which the variable specified in the Block declaration section is stored is called a data instance, and each object code for executing POU, Function, and Function Block is stored. Code memory (CM)
The part inside (described later) is called a code instance.

【0026】なお、Functionには、データイン
スタンが存在しないものとされている。
It is assumed that the Function does not have a data instance.

【0027】例えば、図2に示すように、IEC準拠プ
ログラムでなるサブルーチンを3つ有するソースプログ
ラムにおいて、ソースプログラムのコードインスタンス
をPOU1およびそのデータインスタンスをPou1_
Inst1とし、最初のCALL命令で読み出されるサ
ブルーチンのコードインスタンスをPOU2およびその
データインスタンスをPou2_Inst1とし、ま
た、次のCALL命令で読み出されるサブルーチンのコ
ードインスタンスをPOU3およびそのデータインスタ
ンスをPou3_Inst1とPou3_Inst2と
し、さらに、最後のCALL命令で読み出されるサブル
ーチンのコードインスタンスPOU4とすると、POU
1は上述したPOU(Program Organization Unit)と呼
ばれるプログラムであり、POU2およびPOU3は、
Function Blockであり、POU4はFu
nctionである。
For example, as shown in FIG. 2, in a source program having three subroutines consisting of IEC-compliant programs, the code instance of the source program is POU1 and its data instance is Pou1_.
Inst1, the code instance of the subroutine read by the first CALL instruction is POU2 and its data instance is Pou2_Inst1, the code instance of the subroutine read by the next CALL instruction is POU3 and its data instance are Pou3_Inst1 and Pou3_Inst2, and , POU4, which is the code instance POU4 of the subroutine read by the last CALL instruction,
1 is a program called POU (Program Organization Unit) described above, and POU2 and POU3 are
Function Block and POU4 is Fu
ntion.

【0028】上述したように、IEC準拠プログラム
は、ソースプログラム、サブルーチンがそれぞれデータ
インスタンスおよびコードインスタンスを有するとい
う、モジュール化したプログラム言語である。
As described above, the IEC-compliant program is a modularized programming language in which the source program and the subroutine each have a data instance and a code instance.

【0029】因みに、図3はこのようなIEC準拠プロ
グラム言語で記述されたプログラムの1例である。
Incidentally, FIG. 3 shows an example of a program written in such an IEC-compliant programming language.

【0030】この例では、図3(a)ではソースプログ
ラムの定義部を示しており、図3(b)ではニモニック
表示されたソースプログラムのオブジェクトコードの内
容を示しており、図3(c)ではソースプログラムが実
行された際にデータインスタンスおよびコードインスタ
ンスをアクセスする状態の概略を示している。
In this example, FIG. 3A shows the definition part of the source program, FIG. 3B shows the contents of the object code of the source program displayed in mnemonic, and FIG. Shows an outline of the state of accessing the data instance and the code instance when the source program is executed.

【0031】なお、この図の詳細な内容については、本
発明と直接関係がないのでその詳細な説明を省略する。
Since the detailed contents of this figure are not directly related to the present invention, the detailed description thereof will be omitted.

【0032】(2)このようなIEC準拠プログラム言
語を使用するPLCは、図4に示すように、IEC11
31−3プログラミングツール(以下、単にツールとい
う)1と、コミニュケータ2と、コントローラランタイ
ム(以下、ランタイムという)3と、後述するオブジェ
クトコードファイルが記憶されている磁気デスク4と、
後述する退避コードファイルが記憶されている磁気デス
ク5とを備えて構成されている。
(2) As shown in FIG. 4, the PLC using such an IEC compliant programming language has an IEC11
31-3 programming tool (hereinafter, simply referred to as tool) 1, communicator 2, controller runtime (hereinafter, referred to as runtime) 3, magnetic desk 4 in which an object code file described later is stored,
And a magnetic desk 5 in which a save code file to be described later is stored.

【0033】ツール1は、IEC1131−3エディ
タ,コンパイラおよびデガッバ等を備えており、IEC
1131−3コンパイラにおいてソースプログラムから
ランタイム3が解釈実行するオブジェクトコードでなる
オブジェクトコードファイルを磁気ディスク上に形成す
るように構成されている。
The tool 1 includes an IEC1131-3 editor, a compiler, a degabber, etc.
The 1131-3 compiler is configured to form an object code file, which is an object code interpreted and executed by the runtime 3 from a source program, on a magnetic disk.

【0034】ここで、ツール1が磁気ディスクで形成さ
れるオブジェクトコードファイルには、*.objとい
う名称が付されており、*は、オブジェクトコード名で
ある。例えば、POU2.objというオブジェクトコ
ードファイルは、オブジェクトコードPOU2でなるも
のを示している。
Here, in the object code file in which the tool 1 is formed of a magnetic disk, *. The name obj is given, and * is the object code name. For example, POU2. The object code file "obj" indicates the object code POU2.

【0035】また、ツール1は、オンラインエデォット
してオブジェクトコードを修正した場合には、磁気ディ
スク4に記憶されている修正前のオブジェクトコードフ
ァイル*.objを*.orgに変更して磁気ディスク
4に形成し、修正後のものを改めて*.objとして磁
気ディスク4に形成するようになっている。
When the object code is corrected by performing online editing, the tool 1 stores the object code file *. * Before the modification stored in the magnetic disk 4. obj is *. org and formed on the magnetic disk 4, and the modified one is rewritten *. The obj is formed on the magnetic disk 4.

【0036】例えばオブジェクトコードPOU2をオン
ラインエデォットして修正した場合には、磁気ディスク
4に記憶されている修正前のオブジェクトコードファイ
ルPOU2.objをPOU.orgに変更して磁気デ
ィスク4に形成し、修正後のものを改めてPOU2.o
bjとして磁気ディスク4に形成する。
For example, when the object code POU2 is modified by online editing, the object code file POU2. obj to POU. org, the magnetic disk 4 is formed, and the corrected disk is again used as POU2.org. o
It is formed on the magnetic disk 4 as bj.

【0037】コミニュケータ2は、ツール1とランタイ
ム3間のオンライン通信の仲介を果たすミドルウェアで
ある。
The communicator 2 is middleware that acts as an intermediary for online communication between the tool 1 and the runtime 3.

【0038】ランタイム3は、ランタイムコア31,コ
ミニュケーションインタフェース(I/F)32,共有
メモリ33,オンラインエディット実行部34,コード
メモリ(以下、第1のCMという)35,コードメモリ
(以下、第2のCMという)36,データメモリ(以
下、DMという)37およびPOUアドレス変換テーブ
ル(以下、PATという)38から構成されている。
The runtime 3 includes a runtime core 31, a communication interface (I / F) 32, a shared memory 33, an online edit execution section 34, a code memory (hereinafter referred to as a first CM) 35, a code memory (hereinafter referred to as a second memory). CM, data memory (hereinafter, DM) 37, and POU address conversion table (hereinafter, PAT) 38.

【0039】ここで、ランタイムコア31は、図5
(a)に示すように、専用PLCの場合では、ランタイ
ムコア31が、所定のサイクルタイムでのスキャン処
理、すなわち外部I/Oに対してデータを出力するアウ
トリフレッシュ処理、外部I/Oからデータを受けるイ
ンリフレッシュ処理、命令実行処理、周辺処理の実行タ
イミングを制御するようになっている。
Here, the runtime core 31 is shown in FIG.
As shown in (a), in the case of a dedicated PLC, the run-time core 31 performs a scan process at a predetermined cycle time, that is, an out-refresh process for outputting data to the external I / O, a data transfer from the external I / O. The execution timings of the in-refresh processing, the instruction execution processing, and the peripheral processing are controlled.

【0040】一方、PLC機能と他のアプリケーション
機能を並行して動くようなPLC、例えば(ソフトPL
C+パソコン)の場合では、図5(b)に示すように、
ランタイムコア31が、上述した専用PLCの場合と同
様、スキャン処理、すなわちアウトリフレッシュ処理、
インリフレッシュ処理、命令実行処理、周辺処理の実行
タイミングを制御するようになっている。
On the other hand, a PLC that allows the PLC function and other application functions to operate in parallel, such as (software PL
In the case of (C + PC), as shown in FIG.
As in the case where the runtime core 31 is the dedicated PLC described above, the scan process, that is, the out refresh process,
The execution timing of in-refresh processing, instruction execution processing, and peripheral processing is controlled.

【0041】しかし、このようなPLCは、ランタイム
コア21が上述したスキャン処理を実行(管理)した
後、サイクルタイム満了までの時間、OS(Operating
System)に他のアプリケーションを実行させ、サイクル
タイムの許容時間に達すると、ランタイムコア21が再
びスキャン処理を行うようになっている。
However, in such a PLC, after the run-time core 21 executes (manages) the above-described scan processing, the time until the cycle time expires, OS (Operating).
System) executes another application, and when the allowable cycle time is reached, the run-time core 21 performs the scan process again.

【0042】コミニュケーションインタフェース(I/
F)32は、コミニュケータ2間の通信インターフェー
スを構成するものである。
Communication interface (I /
F) 32 constitutes a communication interface between the communicators 2.

【0043】共有メモリ33は、コミニュケーションイ
ンタフェース(I/F)32を介して、コミニュケータ
2から受けたオンラインエディットを実行した旨の情報
(以下、エディット実行情報という)とオンラインエデ
ィットするオブジェクトコード名を格納するものであ
る。
The shared memory 33 stores, via the communication interface (I / F) 32, information indicating that online editing has been executed (hereinafter referred to as edit execution information) received from the communicator 2 and an object code name for online editing. It is something to store.

【0044】また、共有メモリ33は、コミニュケーシ
ョンインタフェース(I/F)32を介して、ツール1
が出力したUndo処理を実行した旨の情報(以下、U
ndo実行情報という)を格納するものである。
The shared memory 33 is also stored in the tool 1 via the communication interface (I / F) 32.
Information indicating that the Undo process output by
ndo execution information).

【0045】ここで、Undo処理を実行するとは、オ
ンラインエディット実行前の状態に戻すことをいう。
Here, executing Undo processing means returning to a state before execution of online editing.

【0046】オンラインエディット実行部34は、共有
メモリ33にエディット実行情報が書き込まれたことを
検知すると、共有メモリ33からオンラインエディット
するオブジェクトコード名を読み出すようになってい
る。
Upon detecting that the edit execution information has been written in the shared memory 33, the online edit execution section 34 reads the object code name for online editing from the shared memory 33.

【0047】また、オンラインエディット実行部34
は、共有メモリ33からオンラインエディットするオブ
ジェクトコード名を読み出すと、PAT38を参照して
読み出されたオブジェクトコードが第1のCM35と第
2のCM36とのうち、使用されているものがどれかを
検知するようになっている。
Further, the online edit execution unit 34
When the object code name to be online-edited is read from the shared memory 33, the object code read by referring to the PAT 38 determines which one of the first CM 35 and the second CM 36 is being used. It is designed to detect.

【0048】さらに、オンラインエディット実行部34
は、PAT38を参照して第1のCM35または第2の
CM36のうち、使用されているものを検出すると、共
有メモリ33から読み出したオブジェクトコード名のオ
ブジェクトファイル*.objを磁気ディスク4から読
み出し、現在使用されていないコードメモリ、例えば現
在使用されているものが第1のCM35の場合には第2
のCM36のオブジェクトコードを書き替えるようにな
っている。
Further, the online edit execution unit 34
Detects the used one of the first CM 35 and the second CM 36 by referring to the PAT 38, the object file *. obj is read from the magnetic disk 4 and is not used at present, for example, if the currently used code memory is the first CM 35, the second
The object code of CM 36 is rewritten.

【0049】さらにまた、オンラインエディット実行部
34は、上述したように現在使用されていないコードメ
モリに、共有メモリ33に指示されたオブジェクトコー
ドを書き替えると、PAT38中の後述する使用コード
メモリ領域(後述する)の内容を、先に書き替えたコー
ドメモリに書き替えるようになっている。
Furthermore, when the online edit execution section 34 rewrites the object code instructed in the shared memory 33 to the code memory which is not currently used as described above, the used code memory area (to be described later) in the PAT 38 ( The contents of (described later) are rewritten to the code memory that was rewritten previously.

【0050】例えば、オンラインエディットするオブジ
ェクトコードをPOU2とし、このコードPOU2が第
2のCM36に書き替った場合では、PAT38のコー
ド名領域(図7参照)381中の“POU2”に対応す
る使用コードメモリ領域の内容を第1のCM35から第
2のCM36に変更するようになっている(図7ではC
M2)。
For example, when the object code for online editing is POU2 and this code POU2 is rewritten to the second CM 36, use corresponding to "POU2" in the code name area 381 of the PAT 38 (see FIG. 7). The content of the code memory area is changed from the first CM 35 to the second CM 36 (C in FIG. 7).
M2).

【0051】第1のCM35は、ソースプログラムおよ
びサブルーチンの実行処理に必要なオブジェクトコード
を記憶するものであり、PLCの電源が落ちたときに
は、記憶されていたものがすべて消去するようになって
いる。
The first CM 35 stores the object code necessary for the execution processing of the source program and the subroutine, and when the power of the PLC is turned off, all the stored contents are erased. .

【0052】ここで、前記オブジェクトコードは、ラン
タイムコア31またはオンラインエディット実行部34
が磁気ディスク4に形成されているオブジェクトコード
ファイルを読み出したものである。
Here, the object code is the runtime core 31 or the online edit execution unit 34.
Is an object code file read from the magnetic disk 4.

【0053】例えば、図6(a)に示す例では、第1の
CM35は、上述したソースプログラムおよびサブルー
チンプログラムのPOU1,POU2,POU3,PO
U4等のオブジェクトコードを記憶するものである。
For example, in the example shown in FIG. 6A, the first CM 35 is the source program and the subroutine program POU1, POU2, POU3, PO of the above-mentioned source program.
It stores an object code such as U4.

【0054】第2のCM36は、第1のCM135のも
のと同様、述したソースプログラムおよびサブルーチン
プログラムのPOU1,POU2,POU3,POU4
等のオブジェクトコードを記憶するものであり、PLC
の電源が落ちたときには、記憶されていたものがすべて
消去するようになっている。
The second CM 36 is similar to the first CM 135 in that the source programs and the subroutine programs POU1, POU2, POU3 and POU4 of the above-mentioned source programs and subroutine programs are described.
It stores object codes such as
When the power is turned off, everything that was stored in it will be erased.

【0055】なお、第1のCM35および第2にCM3
6中の“*”が示す領域は、オンラインエディト用の余
裕領域であり、コンパイラによって確保される。そし
て、オンラインエディトによって、修正されたオブジェ
クトコードが“*”を超えるよ場合には、コンパイラが
チェックしてエラーとするようになっている。
The first CM 35 and the second CM 3
The area indicated by "*" in 6 is a spare area for online editing and is reserved by the compiler. When the corrected object code exceeds "*" by the online edit, the compiler checks and gives an error.

【0056】DM37は、ツール1がソースプログラム
をコンパイルすると、ランタイムコア31を介してデー
タインスタンスの箇所が形成されるようになっている。
In the DM 37, when the tool 1 compiles the source program, the data instance portion is formed via the runtime core 31.

【0057】例えば、先に挙げた図2中のソースプログ
ラムをコンパイルすると、図6(c)に示すように、グ
ローバル変数を記憶するデータインスタンス,上述した
Pou1_Inst1,Pou2_Inst1,Pou
3_Inst1およびPou3_Inst2等のデータ
インスタンスの箇所が形成される。
For example, when the above-mentioned source program in FIG. 2 is compiled, as shown in FIG. 6C, a data instance storing global variables, the above-mentioned Pou1_Inst1, Pou2_Inst1, Pou.
Data instance locations such as 3_Inst1 and Pou3_Inst2 are formed.

【0058】なお、各データインスタンス中の“*”が
示す領域は、余裕領域でこれを超えた場合には、コンパ
イラがチェックしてエラーとするようになっている。
The area indicated by "*" in each data instance is a margin area, and if it exceeds this area, the compiler checks it and gives an error.

【0059】また、DM37は、PLCの電源が落ちた
ときには、ワーク記憶エリアに記憶されている重要でな
いものは消去するようになっているが、外部機器からの
入出力情報等からなる重要なものは消去しないようにな
っている。
Further, the DM 37 is designed to erase unimportant items stored in the work storage area when the power of the PLC is turned off, but it is an important item consisting of input / output information from an external device. Is designed not to be erased.

【0060】PAT38は、図7に示すように、ランタ
イムコア31がスキャン処理を実行するに際し、オブジ
ェクトコードが格納されているコードインスタンス名の
情報を有するコードインスタンス名領域381と、上述
したコードインスタンスを使用するコードメモリを有す
る使用コードメモリ領域382からなるものであり、P
LCの電源が落ちたときには、記憶されていたものがす
べて消去するようになっている。
As shown in FIG. 7, the PAT 38 stores the code instance name area 381 having the information of the code instance name in which the object code is stored and the above-mentioned code instance when the runtime core 31 executes the scanning process. A used code memory area 382 having a code memory to be used,
When the power of LC is turned off, all the stored contents are erased.

【0061】因みに、ランタイムコア31が実行するコ
ードインスタンスをPOU2とすると、使用されるコー
ドメモリは、第2のCM36(図中でCM2)に格納さ
れているPOU2のものである。
When the code instance executed by the runtime core 31 is POU2, the code memory used is that of POU2 stored in the second CM 36 (CM2 in the figure).

【0062】磁気ディスク5に形成された退避コードフ
ァイル5は、PLCが電源を落とす前に、ランタイムコ
ア31がPAT38から読み出した上述した、コードイ
ンスタンス名領域381のコードインスタンス名と,そ
れに対応する使用コードメモリ領域382の使用コード
メモリとからなる情報を有するファイルである。
The save code file 5 formed on the magnetic disk 5 uses the above-mentioned code instance name in the code instance name area 381 read by the runtime core 31 from the PAT 38 and the corresponding usage before the PLC turns off the power. It is a file having information including the used code memory of the code memory area 382.

【0063】(3)次に、この実施形態のプログラマブ
ルコントローラのオンラインエディット処理の動作を、
サブルーチンプログラムのオブジェクトコードファイル
POU2.objをオンラインエディットした場合を例
に取り説明する。
(3) Next, the operation of the online editing process of the programmable controller of this embodiment will be described.
Subroutine program object code file POU2. An example of online editing of obj will be described.

【0064】ユーザがツール1で該当するサブルーチン
プログラムをエディットし、コンパイルする。
The user edits and compiles the corresponding subroutine program using the tool 1.

【0065】次に、ツール1は、すでに磁気ディスク4
に形成されているオブジェクトコードファイル4を、す
でに格納されているオブジェクトコードファイルPOU
2.objをPOU2.orgに変更して磁気ディスク
4に形成し、今回形成したオブジェクトコードのオブジ
ェクトコードファイルを改めてPOU2.objとして
磁気ディスク4に形成しする。
Next, the tool 1 has already used the magnetic disk 4
The object code file 4 formed in the object code file POU already stored
2. obj to POU2. org and the magnetic disk 4 is formed, and the object code file of the object code formed this time is newly added to POU2. It is formed on the magnetic disk 4 as obj.

【0066】その後、ツール1は、コミニュケータ2お
よびランタイム3のコミニュケーンI/F32を介し
て、共有メモリ33にオンラインエディットがあった旨
のエディット実行情報と、オンラインエディットしたオ
ブジェクトコード名POU2を格納する。
After that, the tool 1 stores the edit execution information indicating that the online edit is performed in the shared memory 33 and the object code name POU2 edited online through the communicator I / F 32 of the communicator 2 and the runtime 3. To do.

【0067】オンラインエディット実行部34は、共有
メモリ33にエディット実行情報が格納されたことを検
知すると、共有メモリ33からオブジェクトコード名P
OU2を読み出す。
When the online edit execution part 34 detects that the edit execution information is stored in the shared memory 33, the object code name P from the shared memory 33 is detected.
Read OU2.

【0068】次に、オンラインエディット実行部34
は、PAT38を参照して読み出されたオブジェクトコ
ード名POU2について、現在使用されているコードメ
モリとして第2のCM36であることを検知する(図7
参照)。
Next, the online edit execution unit 34
Detects that the object code name POU2 read by referring to the PAT 38 is the second CM 36 as the currently used code memory (FIG. 7).
reference).

【0069】続いて、オンラインエディット実行部34
は、磁気ディスク4に格納されているオブジェクトファ
イルPOU2.objを読み出し、現在使用されていな
い第1のコードメモリCM35中のオブジェクトコード
POU2を、読み出したオブジェクトファイルPOU
2.objのオブジェクトコードに書き替える。
Subsequently, the online edit execution unit 34
Is an object file POU2. obj is read, and the object code POU2 in the first code memory CM35 which is not currently used is read, and the read object file POU
2. Rewrite to the object code of obj.

【0070】次に、オンラインエディット実行部34
は、PAT38中の使用コードメモリ領域382中のP
OU2に該当すCM2をCM1に書き替える。
Next, the online edit execution unit 34
Is the P in the used code memory area 382 in the PAT 38.
CM2 corresponding to OU2 is rewritten to CM1.

【0071】以上で、サブルーチンプログラムのオブジ
ェクトコードファイルPOU2.objのオンラインエ
ディット処理が終了する。
As described above, the object code files POU2. The online edit process of obj is completed.

【0072】このような処理を周辺処理中に行うと、次
のスキャン処理においては、ランタイム3がPAT38
を参照して修正した新たなコードの内容が、以降実行さ
れることになる。
If such a process is performed during the peripheral process, the runtime 3 causes the PAT 38 to operate in the next scan process.
The content of the new code modified with reference to will be executed thereafter.

【0073】(4)続いて、この実施形態のPLCがオ
ンラインエディット実行し、プログラマブルコントロー
ラの起動を終了したのち、再起動したとき、オンライン
エディット後の状態でランタイムが再起動させるための
動作を説明する。
(4) Next, the PLC of this embodiment executes an online edit, and after the start of the programmable controller is completed and then restarted, an operation for the runtime to restart in the state after the online edit will be described. To do.

【0074】なぜこのような処理動作が必要かといえ
ば、プログラマブルコントローラの電源を落とすと、メ
モリコード(CM1)25、メモリコード(CM2)2
6、PATの内容がすべて消去してしまい、再起動でき
ないからである。
The reason why such a processing operation is necessary is that when the power of the programmable controller is turned off, the memory code (CM1) 25 and the memory code (CM2) 2
6. This is because the contents of PAT are all erased and it is not possible to restart.

【0075】初めに、PLCの電源を立ち上がると、ラ
ンタイムコア31は、磁気ディスク5に形成されている
退避コードファイルから電源を落とす前に格納されてい
たPAT38の内容を読み出す。
First, when the power of the PLC is turned on, the runtime core 31 reads the contents of the PAT 38 stored before the power is turned off from the save code file formed on the magnetic disk 5.

【0076】次に、ランタイムコア31は、退避コード
ファイル5から読み出したオブジェクトインスタンス名
を基にして、このコードインスタンスで示されるオブジ
ェクトコードファイル*.objを磁気ディスク4から
読み出し、この読み出したオブジェクトコードファイル
*.objのオブジェクトコードを、先に読み出したコ
ードメモリに格納したのち、格納されなかったコードメ
モリに、コードインスタンスで示されるオブジェクトコ
ードファイル*.orgを磁気ディスク4から読み出し
てこれを格納する。
Next, the runtime core 31 uses the object instance name read from the save code file 5 as the basis for the object code file *. obj is read from the magnetic disk 4, and the read object code file *. After the object code of obj is stored in the code memory that has been read out previously, the object code file *. The org is read from the magnetic disk 4 and stored.

【0077】その後、ランタイムコア31は、PAT3
8のコードインスタンス名領域381および使用コード
メモリ領域382に、退避コードファイル5に有するコ
ードインスタンス名および使用コードメモリを登録す
る。
After that, the runtime core 31 executes the PAT3
The code instance name and the used code memory included in the saved code file 5 are registered in the code instance name area 381 and the used code memory area 382 of FIG.

【0078】このようにして、ランタイムコア31が、
退避コードファイル5に格納されていたすべてのものに
ついて、上述したような処理を終了すると、PLCの電
源を落とす前の状態に復帰し、以後、ランタイムコア3
1が復帰した第1のCM35,第2のCM36およびP
AT38を使用して、再起動することができる。
In this way, the runtime core 31
When all the items stored in the save code file 5 are processed as described above, the state before the power of the PLC is turned off is restored, and thereafter, the run-time core 3
The first CM 35, the second CM 36, and the P that have returned 1
It can be rebooted using the AT38.

【0079】(5)続いて、オンラインエディットのU
ndo処理の動作を説明する。
(5) Next, U of online editing
The operation of the ndo process will be described.

【0080】ユーザは、ツール1のエディッタ上で、オ
ンラインエディットを施したオブジェクトコードのう
ち、CRTに表示されたメニューに基づきUndoした
いオブジェクトコードを選択すると、ツール1は、磁気
ディスク4に格納されているオブジェクトファイルのう
ち、*.objのものを、*.obkに変更した後、
*.orgのものを*.objに変更する。
On the editor of the tool 1, the user selects the object code to be Undo based on the menu displayed on the CRT among the object codes subjected to the online editing, and the tool 1 is stored in the magnetic disk 4. Of the existing object files, *. obj is *. After changing to obk,
*. Org *. Change to obj.

【0081】そして、ツール1は、*.obkになった
ファイルを、*.orgに変更して、*.obkのファ
イルを消去する。
Then, the tool 1 uses *. The file which became obk is *. Change to org, *. Delete the obk file.

【0082】従って、磁気ディスク4には、変更前に
*.objであったものが*.orgになり、*.or
gであったものが*.objになっている。
Therefore, the magnetic disk 4 is marked with *. What was obj is *. org, *. or
What was g was *. It is obj.

【0083】ツール1は、磁気ディスク4に格納されて
いるオブジェクトコードファイルのファイル名を変更す
ると、コミニュケータ2およびコミニュケーションI/
F32を介して、共有メモリ33にUndo実行情報を
格納させる。
When the file name of the object code file stored in the magnetic disk 4 is changed, the tool 1 changes the name of the communicator 2 and the communication I / O.
The Undo execution information is stored in the shared memory 33 via F32.

【0084】ランタイムコア31は、共有メモリ33に
格納されているUndo実行情報を検知すると、PAT
38の使用コードメモリ領域382に格納されているコ
ードメモリ、例えばCM1(第1のCM35)をCM2
(第2のCM36)に、CM2(第2のCM36)をC
M1(第1のCM35)に変更する。
When the runtime core 31 detects the Undo execution information stored in the shared memory 33, the PAT
The code memory stored in the used code memory area 382 of 38, for example CM1 (first CM35)
C2 (second CM36) to (second CM36)
Change to M1 (first CM 35).

【0085】こうすることにより、この実施形態のPL
Cでは、次回のスキャンよりUndoされたオブジェク
トコードのものが実行される。
By doing so, the PL of this embodiment is
In C, the object code of the Undo from the next scan is executed.

【0086】この実施形態のPLCでは、オンラインエ
ディット実行部34が周辺処理中に変更修正して予め形
成したオブジェクトコードを、PAT38に基づき、第
1のCM35または第2のCM36中の該当するオブジ
ェクトコードを変更するようにしたので、ランタイムコ
ア31が実行するランタイム処理に影響することをなく
すことができる。
In the PLC of this embodiment, the object code preliminarily formed by the online edit execution unit 34 during the peripheral processing is modified based on the PAT 38 and the corresponding object code in the first CM 35 or the second CM 36. Since it is changed, it is possible to eliminate the influence on the runtime processing executed by the runtime core 31.

【0087】この実施形態のPLCでは、使用プログラ
ミング言語として1131−3基準に準拠するプログラ
ム言語を使用し、かつ、ソースプログラム、サブルーチ
ンのそれぞれについて、データインスタンスおよびコー
ドインスタンスを有するので、サブルーチンがモジュー
ルしたシステムを構成することができる。
In the PLC of this embodiment, a programming language conforming to the 1131-3 standard is used as the programming language to be used, and each source program and subroutine has a data instance and a code instance, so that the subroutine is modular. The system can be configured.

【0088】また、この実施形態のPLCでは、ソース
プログラムやサブルーチンプログラのオブジェクトコー
ドが第1のCM35および第2のCM36にコードイン
スタンスとして分離して格納されており、かつ、ランタ
イムコア31がPAT38に基づき、コードメモリを実
行するという間接指定方式を採用したので、CALL命
令を用いて読み出す側のオブジェクトコードのメンテナ
ンスをしなくてもよいようにすることができる。
In the PLC of this embodiment, the object code of the source program or the subroutine program is separately stored as the code instance in the first CM 35 and the second CM 36, and the runtime core 31 is stored in the PAT 38. On the basis of this, since the indirect designation method of executing the code memory is adopted, it is possible to avoid the maintenance of the object code on the reading side by using the CALL instruction.

【0089】例えば、図2に示すように、CALL命令
で実行されるオブジェクトコードPOU2が上述したよ
うに間接指定方式で読み出されるので、このオブジェク
トコードPOU2がオンラインエディットされて修正さ
れた場合でも、ソースプログラムのコードPOU1を変
更する必要がない。
For example, as shown in FIG. 2, since the object code POU2 executed by the CALL instruction is read by the indirect designation method as described above, even if this object code POU2 is edited online and modified, the source code There is no need to change the code POU1 of the program.

【0090】ただし、この実施形態のPLCでは、読み
出し側のコードの変更を少なくするため、仕様上、入出
力変数のオンラインエディット編集を禁止するものとす
る。
However, in the PLC of this embodiment, on-line edit editing of input / output variables is prohibited by the specification in order to reduce the change of the code on the reading side.

【0091】この実施形態のPLCでは、磁気ディスク
5にPAT退避ファイルを有しいるため、電源を落とし
た後、再起動するに際し、PAT退避ファイルに書かれ
ているコードインスタンス名と使用するコードメモリ
(CM1またはCM2)に基づき、第1のCM35,第
2のCM36およびPAT38を電源を落とす前の状態
に復帰することがでる。
In the PLC of this embodiment, since the magnetic disk 5 has the PAT save file, the code instance name written in the PAT save file and the code memory used when restarting after the power is turned off. Based on (CM1 or CM2), the first CM 35, the second CM 36, and the PAT 38 can be restored to the state before the power was turned off.

【0092】従って、この実施形態のPLCでは、電源
を落とした後、電源を立ち上げたときでも容易に再起動
することができる。
Therefore, the PLC of this embodiment can be easily restarted even when the power is turned on after the power is turned off.

【0093】この実施形態のPLCは、オンラインエデ
ィットを行ったとき、ツール1が先に形成されているオ
ブジェクトコードファイル*.objを*.orgに変
更し、修正したものを改めて*.objとし、ランタイ
ムコア31がPAT38の使用コードメモリ領域382
に格納されているCM1とCM2とをともに反対に書き
替えるようにしたので、オンラインエディットにおいて
Undo処理ができるようになる。
The PLC of this embodiment has the object code file *. obj is *. org, and the modified one again *. obj and the runtime core 31 uses the code memory area 382 of the PAT 38.
Since the CM1 and CM2 stored in the above are rewritten to be opposite to each other, the Undo process can be performed in the online edit.

【0094】[0094]

【発明の効果】以上発明によれば、モジュールプログ
ラムがエディットされ、このエディトされたモジュー
ルプログラムをコンパイルされてオブジェトコードが形
成され、このオブジェトコードが実行されるため、外部
機器を停止させずにユーザプログラム等を追加変更する
ことができる。
According to the present invention as described above, the module program is edited, this InkEdit are compiled in object preparative encoding module program is formed, since the object bets code is executed, to stop the external device The user program and the like can be added and changed without the need.

【0095】また、本発明によれば、格納手段選択テー
ブルに、第1の格納手段に格納されているオブジェクト
か、または、第2の格納手段に格納されているオブジェ
クトコードのどちらかを使用するかを示す情報を有して
いるため、オブジェクトコードの実行方法が間接指定と
なる。
According to the present invention, either the object stored in the first storage means or the object code stored in the second storage means is used in the storage means selection table. Since it has information indicating that, the execution method of the object code is indirectly designated.

【0096】請求項3、4記載の発明によれば、記憶手
段に形成されたオブジェクトコードがオブジェクトコー
ドファイルとして記憶され、電源が落ちる前に格納手段
選択テーブルに格納されている内容が退避記憶手段に記
憶されるため、電源が立ち上がるときに、再び退避記憶
手段に記憶されている内容に基づき、再起動することが
できる。
According to the third and fourth aspects of the present invention, the object code formed in the storage means is stored as an object code file, and the contents stored in the storage means selection table before the power is turned off are saved in the storage means. Therefore, when the power is turned on, it can be restarted again based on the contents stored in the save storage means.

【0097】請求項5および請求項7記載の発明によれ
ば、オンラインエデイットしたオブジェクトコードのオ
ブジェクトコードファイルを、処理しないオブジェクト
コードファイルに変更し、オンラインエディット実行前
のオブジェクトコードのオブジェクトコードファイルを
処理するオブジェクトコードファイルに変更し、格納手
段選択テーブルの使用情報を変更することにより、Un
do処理が行える。
According to the fifth and seventh aspects of the invention, the object code file of the object code edited online is changed to the object code file which is not processed, and the object code file of the object code before the online edit is processed. By changing the object code file to be used and changing the usage information in the storage means selection table.
Do processing can be performed.

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

【図1】IEC1131−3基準に準拠するプログラム
言語についての説明図。
FIG. 1 is an explanatory diagram of a programming language conforming to the IEC1131-3 standard.

【図2】IEC1131−3基準に準拠するプログラム
言語についての説明図。
FIG. 2 is an explanatory diagram of a programming language conforming to the IEC1131-3 standard.

【図3】IEC1131−3基準に準拠するプログラム
言語で記述されたプログラムの1例図。
FIG. 3 is an example diagram of a program written in a programming language conforming to the IEC1131-3 standard.

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

【図5】図4中のランタイムコアの機能についての説明
図。
5 is an explanatory diagram of functions of a runtime core in FIG.

【図6】図4中の第1のコードメモリ,第2のコードメ
モリおよびデータメモリの構成を示すブロック図。
FIG. 6 is a block diagram showing the configurations of a first code memory, a second code memory and a data memory in FIG.

【図7】図4中のPOUアドレステーブルの構成を示す
ブロック図。
7 is a block diagram showing the structure of a POU address table in FIG.

【図8】従来のプログラムコントローラのプログラム修
正についての説明図。
FIG. 8 is an explanatory diagram of program correction of a conventional program controller.

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

1 IEC1131−1プログラミングツール 2 コミニュケータ 3 コントローラランタイム 31 ランタイムコア 32 コミニュケータ 33 共有メモリ 34 オンラインエデイィット実行部 35 第1のコードメモリ(CM) 36 第2のコードメモリ(CM) 37 データメモリ(DM) 38 POUアドレステーブル(PAT) 4 磁気ディスク 5 磁気ディスク 1 IEC1131-1 programming tool 2 Communicator 3 Controller runtime 31 Runtime Core 32 Communicator 33 shared memory 34 Online Edit Execution Department 35 First Code Memory (CM) 36 Second Code Memory (CM) 37 Data memory (DM) 38 POU Address Table (PAT) 4 magnetic disk 5 magnetic disk

フロントページの続き (56)参考文献 特開 平3−74703(JP,A) 特開 平4−118705(JP,A) 特開 平8−6616(JP,A) 特開 昭60−229106(JP,A) 特開 平2−5103(JP,A) 特開 平7−64614(JP,A) (58)調査した分野(Int.Cl.7,DB名) G05B 19/05 Continuation of front page (56) Reference JP-A-3-74703 (JP, A) JP-A-4-118705 (JP, A) JP-A-8-6616 (JP, A) JP-A-60-229106 (JP , A) JP-A-2-5103 (JP, A) JP-A-7-64614 (JP, A) (58) Fields investigated (Int.Cl. 7 , DB name) G05B 19/05

Claims (7)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 外部機器等の制御を複数のモジュールプ
ログラムのオブジェクトコードで行うプログラマブルコ
ントローラであって、エディットされた 上記モジュールプログラムをコンパイ
ルしてオブジェクトコードを形成するオブジェクトコー
ド形成手段と、 このオブジェクトコード形成手段で形成されたオブジェ
クトコードにより上記外部機器等をスキャン制御するラ
ンタイム制御手段とを具備し、 上記ランタイム制御手段は、 上記オブジェクトコード形成手段で形成された上記エデ
ィットされたモジュールプログラムのオブジェクトコー
ドを格納する第1の格納手段と、第2の格納手段と、 上記第1のオブジェクトコード格納手段と第2のオブジ
ェクトコード格納手段とのうち、どちらに格納されてい
るオブジェクトコードを使用するかを示す使用情報を格
納する格納手段選択テーブルと、 この格納手段選択テーブルに基づき、上記第1のオブジ
ェクトコード格納手段に格納されているオブジェクトコ
ードか、または第2のオブジェクトコード格納手段に格
納されているオブジェクトコードかのいずれか1つを選
択して実行するコード実行手段と、 上記オブジェクトコード形成手段により、オブジェクト
が変更された場合には、上記格納手段選択テーブルに基
づき、上記第1のオブジェクトコード格納手段に格納さ
れているオブジェクトコードか、または第2のオブジェ
クトコード格納手段に格納されているオブジェクトコー
ドかのいずれか1つを、上記変更されたオブジェクトに
変更するとともに、上記格納手段選択テーブル中の変更
されたオブジェクトコードが格納された格納手段を使用
するように使用情報を変更する使用情報変更手段と、 を有する ことを特徴とするプログラマブルコントロー
ラ。
1. A plurality of module controls for controlling external equipment and the like.
Programmable co
A controller,Edited Compile the above module program
Object code to create an object code
Forming means, The object formed by this object code forming means
Code that controls the scan of the above-mentioned external devices, etc.
With on-time control meansThen The runtime control means is The editor formed by the object code forming means
Object code of the installed module program
A first storage means for storing the code, a second storage means, The first object code storage means and the second object
Which is stored in the
The usage information indicating whether to use the object code
A storage means selection table to be stored, Based on this storage means selection table, the first object
Object code stored in the project code storage means
Or a second object code storage means
Select one of the stored object codes
Code execution means to select and execute, By the object code forming means, the object
If is changed, it is based on the above storage means selection table.
First, it is stored in the first object code storage means.
The object code that is stored, or the second object
Object code stored in the code storage means
Any one of these to the modified object above
Change and change in the above storage means selection table
The storage means that stores the stored object code
Usage information changing means for changing the usage information so that Have Programmable controller characterized by
La.
【請求項2】 外部機器等の制御を複数のモジュールプ
ログラムのオブジェクトコードで行うプログラマブルコ
ントローラであって、エディットされた 上記モジュールプログラムをコンパイ
ルしてオブジェクトコードを形成するオブジェクトコー
ド形成手段と、 このオブジェクトコード形成手段で形成されたオブジェ
クトコードにより上記外部機器等をスキャン制御するラ
ンタイム制御手段とを具備し上記ランタイム制御手段は、 上記オブジェクトコード形成手段で形成された上記エデ
ィットされたモジュールプログラムのオブジェクトコー
ドを格納する第1の格納手段と、第2の格納手段と、 上記第1のオブジェクトコード格納手段と第2のオブジ
ェクトコード格納手段とのうち、どちらに格納されてい
るオブジェクトコードを使用するかを示す使用情報を格
納する格納手段選択テーブルと、 この格納手段選択テーブルに基づき、上記第1のオブジ
ェクトコード格納手段に格納されているオブジェクトコ
ードか、または第2のオブジェクトコード格納手段に格
納されているオブジェクトコードかのいずれか1つを選
択して実行するコード実行手段と、 上記オブジェクトコード形成手段により、オブジェクト
が変更された場合には、上記格納手段選択テーブルに基
づき、上記第1のオブジェクトコード格納手段に格納さ
れているオブジェクトコードか、または第2のオブジェ
クトコード格納手段に格納されているオブジェクトコー
ドかのいずれか1つを、上記変更されたオブジェクトに
変更するとともに、上記格納手段選択テーブル中の変更
されたオブジェクトコードが格納された格納手段を使用
するように使用情報を変更する使用情報変更手段と、 を有し、 更に、上記オブジェクトコード形成手段により形成され
たオブジェクトコードをオブジェクトコードファイルと
して記憶するコードファイル記憶手段と電源が落ちる前
に上記格納手段選択テーブルに格納されている内容を記
憶する退避記憶手段とを具備することで、 上記コードファイル記憶手段および退避記憶手段に記憶
された情報に基づいて、第1のオブジェクトコード格納
手段、第2のオブジェクトコード格納手段および格納手
段選択テーブルを電源を落とす前の状態に復帰できるよ
うにした ことを特徴とするプログラマブルコントロー
ラ。
2. The control of external equipment is controlled by a plurality of module programs.
Programmable co
A controller,Edited Compile the above module program
Object code to create an object code
Forming means, The object formed by this object code forming means
Code that controls the scan of the above-mentioned external devices, etc.
On-time control meansEquipped with,The runtime control means is The editor formed by the object code forming means
Object code of the installed module program
A first storage means for storing the code, a second storage means, The first object code storage means and the second object
Which is stored in the
The usage information indicating whether to use the object code
A storage means selection table to be stored, Based on this storage means selection table, the first object
Object code stored in the project code storage means
Or a second object code storage means
Select one of the stored object codes
Code execution means to select and execute, By the object code forming means, the object
If is changed, it is based on the above storage means selection table.
First, it is stored in the first object code storage means.
The object code that is stored, or the second object
Object code stored in the code storage means
Any one of these to the modified object above
Change and change in the above storage means selection table
The storage means that stores the stored object code
Usage information changing means for changing the usage information so that Have Further, it is formed by the above object code forming means.
The object code as an object code file
Code file storage means to store and before power down
Describes the contents stored in the storage means selection table above.
By providing a saving storage means to remember, Stored in the code file storage means and save storage means
First object code storage based on the obtained information
Means, second object code storage means and storage means
The stage selection table can be restored to the state before the power was turned off.
Sick Programmable controller characterized by
La.
【請求項3】 上記オブジェクトコード形成手段は、 オンラインエデットしてオブジェクトコードを修正し
た場合には、上記コードファイル記憶手段に記憶されて
いる修正前のオブジェクトコードファイル名を別のファ
イル名に変更し、修正後のものを改めて修正前のオブジ
ェクトコードファイル名とする請求項2記載のプログラ
マブルコントローラ。
Wherein said object code forming means, online edetate I Tsu when modifying the object code was collected, the object code file name of another file name before correction stored in the code file storage means The programmable controller according to claim 2 , wherein the object code file name before modification is changed to the object code file name after modification.
【請求項4】 上記第1の格納手段および第2の格納手
段は、上記オブジェクトコードを格納するための領域が
オブジェクトコード形成手段により決定されることを特
徴とする請求項1乃至3のいずれか1項に記載のプログ
ラマブルコントローラ。
4. The first storing means and the second storing means
The column has an area for storing the above object code.
4. The programmable controller according to claim 1, wherein the programmable controller is determined by an object code forming means .
【請求項5】 オンラインエディット実行前の状態に戻
すUndo処理を実行するときには、上記オブジェクト
コード形成手段が、上記コードファイル記憶手段に記憶
されているユーザが選択したUndoしたオブジェクト
コードのオブジェクトコードファイルを、上記ランタイ
ム制御手段が処理しないオブジェクトコードファイルに
変更し、オンラインエディット実行前のオブジェクトコ
ードファイルを上記ランタイム制御手段が処理するオブ
ジェクトコードファイルに変更し、上記ランタイム制御
手段が、上記格納手段選択テーブルの上記使用情報をオ
ンラインエディット実行前のオブジェクトコードを格納
する格納手段のものとすることを特徴とする請求項2ま
たは3記載のプログラマブルコントローラ。
5. The state before the online edit is executed is restored.
When performing Undo processing, the above object
The code forming means stores in the code file storage means.
Undo object selected by the user
Change the object code file of the code
The object code file that the
Change the object code before executing online edit.
Object file that the runtime control means processes.
Change to the project code file and run time control above
Means stores the usage information in the storage means selection table.
Stores object code before online editing
3. The storage means according to claim 2, characterized in that
Or the programmable controller described in 3 .
【請求項6】 制御機能ごとにモジュール化した複数の
モジュールプログラムをオブジェクトコードで実行する
命令実行処理を含む処理を繰り返し実行するプログラマ
ブルコントローラの制御方法において、 処理を実行するためのオブジェクトコードを格納する第
1および第2のオブジェクトコード格納手段を設け、 オンラインエディットしてオブジェクトコードを修正し
た場合には、第1のオブジェクトコード格納手段または
第2のオブジェクトコード格納手段のうちの現在実行さ
れていない格納手段のオブジェクトコードを修正後のオ
ブジェクトコードに書き替えるとともに、この書き替え
に応じて、第1のオブジェクトコード格納手段、第2の
オブジェクトコード格納手段のうち書き替えをした側に
格納した オブジェクトコードを実行するように使用情報
を変更し、 次回の命令実行処理から上記使用情報の変更に基づいて
オブジェクトコードを実行することを特徴とするプログ
ラマブルコントローラの制御方法。
6.Multiple control modules for each control function
Execute module program with object code
A programmer who repeatedly executes processing including instruction execution processing
In the control method of the bull controller, The first which stores the object code for executing the process
First and second object code storage means are provided, Edit online and modify the object code
The first object code storage means or
Currently executed of the second object code storage means
After modifying the object code of the storage means
Rewrite this with the object code
According to the first object code storage means, the second object code storage means
On the side that has rewritten the object code storage means
Stored Use information to run object code
Change Based on the change in the above usage information from the next instruction execution process
A program characterized by executing object code
Control method of ramable controller.
【請求項7】 制御機能ごとにモジュール化した複数の
モジュールプログラムをオブジェクトコードで実行する
命令実行処理を含む処理を繰り返し実行するプログラマ
ブルコントローラの制御方法において、 実行中のオブジェクトコードと、修正前のオブジェクト
コードとをそれぞれ格納する第1および第2のオブジェ
クトコード格納手段を設け、 上記第1および第2のオブジェクトコード格納手段のう
ちどちらが現在実行されているかを示す使用情報を持
ち、Undo実行をする場合には、使用情報を、ふたつ
の上記オブジェクトコード格納手段のうち現在実行中の
格納手段から現在実行していない格納手段に変更するこ
とにより、次回の命令実行処理からUndoされたオブ
ジェクトコードを実行するようにしたことを特徴とする
プログラマブルコントローラの制御方法。
7.Multiple control modules for each control function
Execute module program with object code
A programmer who repeatedly executes processing including instruction execution processing
In the control method of the bull controller, Object code being executed and object before modification
A first and a second object which respectively store a code and
A code storage means, the aboveThe first and second object code storage means
With usage information that indicates which is currently running
When using Undo, enter the usage information in two
Of the above object code storage means of
It is possible to change from the storage means to the storage means not currently being executed
Causes the object that was undone from the next instruction execution process to be
Characterized by executing the eject code
Programmable controller control method.
JP01272697A 1997-01-27 1997-01-27 Programmable controller Expired - Lifetime JP3389592B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP01272697A JP3389592B2 (en) 1997-01-27 1997-01-27 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP01272697A JP3389592B2 (en) 1997-01-27 1997-01-27 Programmable controller

Publications (2)

Publication Number Publication Date
JPH10207512A JPH10207512A (en) 1998-08-07
JP3389592B2 true JP3389592B2 (en) 2003-03-24

Family

ID=11813448

Family Applications (1)

Application Number Title Priority Date Filing Date
JP01272697A Expired - Lifetime JP3389592B2 (en) 1997-01-27 1997-01-27 Programmable controller

Country Status (1)

Country Link
JP (1) JP3389592B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4760607B2 (en) * 2006-08-10 2011-08-31 株式会社明電舎 Programmable controller
JP4849033B2 (en) * 2007-03-19 2011-12-28 富士電機株式会社 Programmable controller
JP4853370B2 (en) * 2007-04-24 2012-01-11 株式会社明電舎 Programmable logic controller and programmable logic controller memory management method
JP5233544B2 (en) * 2008-09-18 2013-07-10 株式会社明電舎 POU mounting method
JP5790128B2 (en) * 2011-04-28 2015-10-07 富士電機株式会社 Programmable controller system and its support device

Also Published As

Publication number Publication date
JPH10207512A (en) 1998-08-07

Similar Documents

Publication Publication Date Title
US9235381B2 (en) Method and device for the programming and configuration of a programmable logic controller
US5970243A (en) Online programming changes for industrial logic controllers
US6256598B1 (en) Method and system for creating a control-flow structure which represents control logic, reconfigurable logic controller having the control logic, method for designing the controller and method for changing its control logic
US7110837B2 (en) Control system and method for on-line editing of user program
CN109918081B (en) Compiling method and compiler
JP6786984B2 (en) Program processing equipment and programs
CN101776877A (en) Program editing system and method for programmable logic controller
JP3389592B2 (en) Programmable controller
KR20170046864A (en) Optimization method for compiling programmable logic controller command
JP2005141435A (en) tool
JP6408044B2 (en) Programmable controller
TWI442316B (en) Program edit system and method for plc
JP2011170419A (en) Control program creation device
JP2000020297A (en) Control device
KR100642182B1 (en) C & C system using single C
JP7794950B2 (en) System program optimization device, system program optimization system, and computer-readable storage medium
CN119556951B (en) PLC increment downloading method and system
JPH05334096A (en) Debugging device using language translation program and its output result
JP2005326909A (en) Plant engineering system
KR102755756B1 (en) Error tracking method for motion controller
US20230134007A1 (en) Support device, non-transitory computer-readable storage medium, and support method
JPH11259308A (en) Programmable controller
KR100423742B1 (en) Exclusive control system by sequential function chart
Ndenoka et al. Synthèse multi-cible des systèmes de contrôle-commande à l'aide de l'approche IDM
Falk Parsing and translating ISO 6983 CNC G-code between dialects

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20021216

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090117

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090117

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100117

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100117

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110117

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110117

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120117

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130117

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20140117

Year of fee payment: 11

EXPY Cancellation because of completion of term