JP2015022511A - Programmable controller system, and support device and program thereof - Google Patents

Programmable controller system, and support device and program thereof Download PDF

Info

Publication number
JP2015022511A
JP2015022511A JP2013149942A JP2013149942A JP2015022511A JP 2015022511 A JP2015022511 A JP 2015022511A JP 2013149942 A JP2013149942 A JP 2013149942A JP 2013149942 A JP2013149942 A JP 2013149942A JP 2015022511 A JP2015022511 A JP 2015022511A
Authority
JP
Japan
Prior art keywords
program
variable
information
new
address information
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.)
Granted
Application number
JP2013149942A
Other languages
Japanese (ja)
Other versions
JP6205934B2 (en
Inventor
吉平 宮野
Kichihei Miyano
吉平 宮野
吉原 大助
Daisuke Yoshihara
大助 吉原
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.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP2013149942A priority Critical patent/JP6205934B2/en
Publication of JP2015022511A publication Critical patent/JP2015022511A/en
Application granted granted Critical
Publication of JP6205934B2 publication Critical patent/JP6205934B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Programmable Controllers (AREA)

Abstract

PROBLEM TO BE SOLVED: To allow individual pieces of variable data to be normally rearranged in accordance with program update and to allow operation verification or the like of an update version program to be performed in an environment or the like different from a system being operated.SOLUTION: When compiling a new program, a compiler unit 52 generates memory allocation information of individual variables of the new program and generates unique key information. A new/old variable address information management unit 53 saves variable address information relating to an existing program, as previous variable address information. When a coincidence determination unit 54 determines that key information held on a PLC side and key information given to the previous variable address information coincide with each other, a variable data rearrangement unit 55 rearranges data of individual variables in the PLC.

Description

本発明は、プログラマブルコントローラのプログラム更新に伴う変数のデータの再配置方法等に関する。   The present invention relates to a method for rearranging variable data accompanying program update of a programmable controller.

従来、プログラマブルコントローラと支援装置を有するプログラマブルコントローラシステムが知られている。プログラマブルコントローラ(PLC)は、任意の制御プログラムを保持し、この制御プログラムを例えば定周期で実行することで、任意の制御対象の制御・監視等を実行する。支援装置は、ユーザが任意の制御プログラムのソースコードを作成するのを支援する支援機能や、このソースコードをコンパイルしてPLCで実行可能な形式(機械語オブジェクト)に変換するコンパイラ等の各種機能を有する。コンパイラは、コンパイルの際に、ソースコードに記述される各変数に対して任意のメモリアドレスを割り当てる。   Conventionally, a programmable controller system having a programmable controller and a support device is known. The programmable controller (PLC) holds an arbitrary control program and executes control / monitoring of an arbitrary control target by executing the control program at a fixed cycle, for example. The support device has various functions such as a support function that assists the user in creating the source code of an arbitrary control program, and a compiler that compiles the source code and converts it into a form (machine language object) that can be executed by the PLC. Have The compiler assigns an arbitrary memory address to each variable described in the source code during compilation.

ここで、作成された新規ソースコードが、PLCで運用中の制御プログラムの更新版である場合、新規ソースコードは、既存のソースコードをベースにして作成されるので、既存のソースコードに存在する変数(既存の変数)が含まれる場合が多い。この様な既存の変数に関しては、上記PLCで運用中の制御プログラム実行により、その割当メモリアドレスに何らかのデータが格納されている状態であり、プログラム更新の際にこのデータを引き継ぐ必要がある。   Here, when the created new source code is an updated version of the control program being operated in the PLC, the new source code is created based on the existing source code, and therefore exists in the existing source code. Variables (existing variables) are often included. Such an existing variable is in a state where some data is stored in the allocated memory address by executing the control program being operated in the PLC, and this data needs to be taken over when the program is updated.

これに対して、コンパイルの際の各変数の割当メモリアドレスを記憶しておき、後に制御プログラム更新の際にこの記憶内容を参照することで、既存の変数と同じ変数に関しては、同じメモリアドレスが割り当てられるようにすることが考えられる。しかしながら、何らかの事情により、既存の変数の割当アドレスとは異なるアドレスを割り当てる必要がある場合もある。   On the other hand, by storing the allocated memory address of each variable at the time of compilation and referring to this stored content at the time of control program update later, the same memory address is obtained for the same variable as the existing variable. It can be considered to be assigned. However, for some reason, it may be necessary to assign an address different from the existing variable assignment address.

尚、上記既存のソースコードとは、基本的には、PLCで運用中の制御プログラムのソースコードであるはずであるが、その保証はない。
ユーザが、上記支援装置において、例えば、既存のソースコードに基づいて更新版ソースコードを作成するプログラミングを実施し、更新版ソースコードをコンパイルした結果、変数のアドレス割付けに変更があった場合、この変数に係わるデータを、旧アドレスから新アドレスへと移動する必要がある。この様な従来技術として、例えば特許文献1に記載の従来技術が知られている。
The existing source code should basically be the source code of the control program being operated by the PLC, but there is no guarantee.
When the user performs programming for creating an updated version of the source code based on the existing source code and compiles the updated version of the source code, for example, when the variable address assignment is changed, It is necessary to move the data related to the variable from the old address to the new address. As such a conventional technique, for example, a conventional technique described in Patent Document 1 is known.

特許文献1に開示されている従来技術では、支援装置によるコンパイル毎に、今回の変数割付情報を前回の変数割付情報と比較することにより、変数のアドレス割付けに変更が発生した箇所を検出する。そして、検出箇所毎に、前回の割付アドレスからデータを読み出して、このデータを今回の割付アドレスに書き込むことで、アドレス割付けに変更があった変数に係わるデータを移動する。   In the prior art disclosed in Patent Document 1, for each compilation by the support device, the current variable allocation information is compared with the previous variable allocation information, thereby detecting the location where the variable address allocation has changed. Then, for each detected location, data is read from the previous allocation address, and this data is written to the current allocation address, so that the data related to the variable whose address allocation has been changed is moved.

例えば上記特許文献1等の従来技術の動作は、例えば図7に示すようになると見做せる。図7は、従来のプログラマブルコントローラシステムの概略構成・動作を示す図である。   For example, it can be considered that the operation of the prior art such as Patent Document 1 is as shown in FIG. FIG. 7 is a diagram showing a schematic configuration / operation of a conventional programmable controller system.

図示の例では、支援装置100において、任意のPLCのプロジェクトを更新する毎に、不図示のコンパイラが当該プロジェクトのプログラムをコンパイルする。尚、ここでは特に図示しないが、支援装置100は、複数のPLC110それぞれの制御プログラムを格納・管理している。各PLC毎に、そのPLC用の1または複数の制御プログラムを作成し、これをグループ化して管理しており、このグループ(各PLC用の制御プログラム群)を上記“プロジェクト”と呼ぶ。但し、以下の説明では、「プログラム」は、基本的に、1つの制御プログラムまたは複数の制御プログラム(プロジェクト)を意味するものとし、基本的に“プロジェクト”という用語は記述しないものとする。   In the example shown in the figure, every time the support device 100 updates a project of an arbitrary PLC, a compiler (not shown) compiles the program of the project. Although not particularly illustrated here, the support apparatus 100 stores and manages control programs for each of the plurality of PLCs 110. For each PLC, one or a plurality of control programs for the PLC are created and managed in groups, and this group (control program group for each PLC) is called the “project”. However, in the following description, “program” basically means one control program or a plurality of control programs (projects), and basically the term “project” is not described.

図7において、支援装置100は、各PLCのプログラム毎に、そのプログラムに係わる各変数へのアドレス割当情報である変数アドレス情報に関して、その前回値を保持している。すなわち、支援装置100は、新たな更新版の制御プログラム(そのソースコード)がユーザにより作成されて、それをコンパイルする際に、既存の変数アドレス情報101を退避させて新たな“前回変数アドレス情報”102として保持すると共に、今回のコンパイル処理による変数アドレス割当情報を、新たな変数アドレス情報101として保持する。   In FIG. 7, for each PLC program, the support apparatus 100 holds the previous value of variable address information, which is address assignment information for each variable related to the program. That is, the support apparatus 100 creates a new updated version control program (its source code) by the user and saves the existing variable address information 101 and compiles the new “previous variable address information”. "102" and the variable address allocation information by the current compile process is held as new variable address information 101.

そして、上記新たな制御プログラム(その機械語オブジェクト)をPLC110にダウンロードする際等に、“前回変数アドレス情報”102に基づいて各変数毎にPLC110の不図示のメモリの旧アドレスからデータを読み出す。尚、この様な移動元の変数データの読出しを“バックアップ”と記す。続いて、このバックアップデータを、変数アドレス情報101に基づいて、新アドレスに格納する。尚、この様な移動先への変数データの書込みをリストアと記す。   When the new control program (the machine language object) is downloaded to the PLC 110, data is read from the old address of the memory (not shown) of the PLC 110 for each variable based on the “previous variable address information” 102. Such reading of the source variable data is referred to as “backup”. Subsequently, the backup data is stored at a new address based on the variable address information 101. Such writing of variable data to the destination is referred to as restoration.

尚、制御プログラムのソースコードには、各種変数が含まれており、コンパイルの際には各変数にメモリアドレスを割り当てる。これより、コンパイラは、例えば変数名に対応付けてその変数の割当アドレス等を記録したテーブル等を作成し得るものであり、これが図示の変数アドレス情報である。   The source code of the control program includes various variables, and a memory address is assigned to each variable when compiling. Thus, the compiler can create a table or the like in which the variable assignment address is recorded in association with the variable name, for example, and this is the variable address information shown in the figure.

そして、図示の例の従来例の場合、既存のプログラムの更新版等のような新たなプログラムについてコンパイルする際には、まず、既存のプログラムに係わる既存の上記変数アドレス情報を、新たな“前回変数アドレス情報”102として退避させる。そして、上記更新版等のプログラムに係わる変数アドレス割当情報を、新たな変数アドレス情報101として記憶する。   In the case of the conventional example shown in the figure, when compiling a new program such as an updated version of the existing program, the existing variable address information related to the existing program is first changed to the new “previous”. It is saved as variable address information “102”. Then, the variable address assignment information related to the program such as the updated version is stored as new variable address information 101.

尚、既に述べたように、本説明では、プログラムとは、1つの制御プログラムまたは制御プログラム群(プロジェクト)を意味するものとする。
ここで、図7で説明したような従来の動作は、プログラム更新対象となるPLC110と支援装置100とを接続した状態(オンライン状態)で、プログラム一致確認、プログラム編集、コンパイル、ダウンロード、上記バックアップ、上記リストア等の一連の処理を実行する必要がある。プログラム編集は、ここでは、支援装置100が保持している既存の制御プログラム(そのソースコード)に対して修正・変更等を行うことで、更新版プログラムを作成するものである。
As described above, in this description, the program means one control program or a control program group (project).
Here, the conventional operation as described with reference to FIG. 7 is performed in a state where the PLC 110 to be updated is connected to the support apparatus 100 (online state), program matching confirmation, program editing, compiling, downloading, the above backup, It is necessary to execute a series of processes such as the above restore. Here, the program editing is to create an updated version program by correcting or changing an existing control program (its source code) held by the support apparatus 100.

更に、このような従来の方法では、プログラム編集前に、編集対象の既存のプログラムが、PLC側で運用中のプログラムと同じであるか否かをチェックする必要がある。もし異なるならば、上記“前回変数アドレス情報”102等を用いたデータ移動処理が、正常に行えないからである。   Further, in such a conventional method, it is necessary to check whether the existing program to be edited is the same as the program being operated on the PLC side before editing the program. If they are different, the data movement process using the “previous variable address information” 102 or the like cannot be normally performed.

この様に、従来では、オンライン状態で、上記チェックによりプログラム一致確認したうえで、プログラム編集、コンパイル、ダウンロード、上記バックアップ、上記リストア等の一連の処理を実行する必要がある。この様な従来の処理の一例を図8に示す。   As described above, conventionally, it is necessary to execute a series of processes such as program editing, compiling, downloading, backup, restoration, and the like after confirming a program match by the above check in an online state. An example of such conventional processing is shown in FIG.

図8は、従来の支援装置の処理フローチャート図を示す。
図8の処理は、オンライン状態で実行される。オンライン状態とは、ネットワークを介して支援装置100とPLC110とが接続中の状態である。また、本処理開始時点では、支援装置100側では、未だ、更新版等のプログラムの作成作業自体が、開始されていない。よって、支援装置100側には、既存のプログラムが格納されているが、その更新版のプログラムは未だ存在していない状態である。尚、以下、既存のプログラムをプログラムr、その更新版のプログラムをプログラムwと記すものとする。
FIG. 8 is a process flowchart of the conventional support apparatus.
The process of FIG. 8 is executed in an online state. The online state is a state in which the support apparatus 100 and the PLC 110 are connected via a network. Further, at the start of this processing, the support apparatus 100 side has not yet started work for creating a program such as an updated version. Therefore, although the existing program is stored on the support device 100 side, the updated version of the program does not yet exist. Hereinafter, an existing program is referred to as a program r, and an updated version of the program is referred to as a program w.

上記オンライン状態で、支援装置100は、まず、更新処理対象のPLC110が現在保持・実行しているプログラムが、上記既存のプログラムrと同一であるか否かをチェックする(ステップS51)。同一であるならば、それはPLC側で運用中のプログラム実行による各変数データの格納位置が、上記“前回変数アドレス情報”102が示す各変数データの格納位置と同じであることを意味している。よって、この場合、“前回変数アドレス情報”102に基づいてバックアップ処理を行えば、正常に各変数の現在のデータを取得できることになる。   In the online state, the support apparatus 100 first checks whether the program currently held and executed by the PLC 110 to be updated is the same as the existing program r (step S51). If they are the same, it means that the storage location of each variable data by executing the program being operated on the PLC side is the same as the storage location of each variable data indicated by the “previous variable address information” 102. . Therefore, in this case, if the backup process is performed based on the “previous variable address information” 102, the current data of each variable can be normally acquired.

尚、図示していないが、もし同一ではないならば、何らかの所定の警告メッセージを報知する等して本処理を終了する。
支援装置100は、上記プログラム一致を確認したら、ユーザが既存のプログラムrに基づいてその更新版のプログラムを作成することを許可する。そして、ユーザが任意の更新版のプログラムw(そのソースコード)を作成したら、これをコンパイルすることで、PLCで実行可能な形式である機械語オブジェクトに変換する(ステップS52)。コンパイルの際には、よく知られているように、各変数のメモリアドレス割当てが行われる。
Although not shown in the drawing, if they are not the same, this processing is terminated by notifying some predetermined warning message or the like.
After confirming the program match, the support device 100 permits the user to create an updated version of the program based on the existing program r. When the user creates an arbitrarily updated version of the program w (its source code), the program is compiled and converted into a machine language object that can be executed by the PLC (step S52). When compiling, as is well known, memory addresses are assigned to each variable.

尚、上述したことから、ステップS52の処理も、引き続きオンライン中に行われる。つまり、支援装置100は、ステップS51の処理の時点からずっと、更新処理対象のPLC110と接続中の状態となっている。ステップS51の処理後にオフラインにして更新版のプログラムの作成作業を行うと、ステップS51で照合を行った意味が無くなるからである。   Note that, as described above, the process of step S52 is also continuously performed online. That is, the support apparatus 100 is in a state of being connected to the PLC 110 to be updated from the time point of the process of step S51. This is because if the offline version of the program is created after the processing in step S51, the meaning of the collation in step S51 is lost.

尚、ステップS52の処理が行われることで、支援装置100には、プログラムwのみが存在し、プログラムrは無くなっていることになる。換言すれば、プログラムrがプログラムwへと変更されたことになる。   Note that, by performing the process of step S52, only the program w exists in the support apparatus 100, and the program r does not exist. In other words, the program r is changed to the program w.

また、上記ステップS52のコンパイル処理に伴って、更新版であるプログラムwの各変数のメモリアドレス割当が行われて変数アドレス情報が生成される。その際、上記図7で説明したように、既存の変数アドレス情報101を退避させて新たな前回変数アドレス情報102とすると共に、生成された変数アドレス割当情報を新たな変数アドレス情報101とする。この処理によって、上記一例では、前回変数アドレス情報102はプログラムrに係わるもの(旧アドレス)、変数アドレス情報101はプログラムwに係わるもの(新アドレス)となる。   Further, along with the compiling process in step S52, memory address allocation is performed for each variable of the program w which is an updated version, and variable address information is generated. At this time, as described with reference to FIG. 7, the existing variable address information 101 is saved and used as new previous variable address information 102, and the generated variable address allocation information is used as new variable address information 101. By this processing, in the above example, the previous variable address information 102 is related to the program r (old address), and the variable address information 101 is related to the program w (new address).

尚、上記の通り、新アドレスは旧アドレスとは異なる場合もある。例えば、図8の図上右側に示す例では、変数Aに関しては、旧アドレスは‘0000’であるが、新アドレスは‘0002’となっている。   As described above, the new address may be different from the old address. For example, in the example shown on the right side of FIG. 8, regarding the variable A, the old address is “0000”, but the new address is “0002”.

続いて、バックアップ処理を実行する(ステップS52)。これは、前回変数アドレス情報102に基づいて、PLC110の不図示のメモリ等から、各変数の旧アドレスからデータを取得して一時的に記憶する処理である。   Subsequently, a backup process is executed (step S52). This is a process of acquiring data from the old address of each variable from a memory (not shown) of the PLC 110 based on the previous variable address information 102 and temporarily storing the data.

これは、例えばまず、上記変数アドレス情報101と前回変数アドレス情報102とに基づいて、図示のデータ再配置情報120を作成しておく。但し、この段階では未だ図示の値124にはデータは格納されていない状態となっている。そして、このデータ再配置情報120に基づいてステップS52のバックアップ処理や後述するステップS55のリストア処理を行う。   For example, first, the illustrated data rearrangement information 120 is created based on the variable address information 101 and the previous variable address information 102. However, at this stage, data is not yet stored in the illustrated value 124. Then, based on the data rearrangement information 120, a backup process in step S52 and a restore process in step S55 described later are performed.

ここで、図8の図上右側に示す例のデータ再配置情報120は、変数名121、旧アドレス122、新アドレス123、値124の各データ項目から成る。上記変数アドレス情報101と前回変数アドレス情報102を参照することで、各変数の変数名と旧アドレス、新アドレスが分かるので、これらを変数名121、旧アドレス122、新アドレス123に格納することで、データ再配置情報120の一部が作成できる。   Here, the data relocation information 120 in the example shown on the right side of FIG. 8 includes data items of a variable name 121, an old address 122, a new address 123, and a value 124. By referring to the variable address information 101 and the previous variable address information 102, the variable name, the old address, and the new address of each variable can be known. By storing these in the variable name 121, the old address 122, and the new address 123, A part of the data rearrangement information 120 can be created.

そして、各変数毎に、その旧アドレス122によってPLC110のメモリからのデータ取得を行って、この取得データを値124に格納するという上記バックアップ処理を行うことで、データ再配置情報120が完成する。後に、この完成したデータ再配置情報120を参照して、後述するリストア処理を実行する。尚、上記PLC110のメモリの旧アドレスからデータを取得したら、当該アドレスの記憶領域を‘0’クリア等するようにしてもよい。   Then, for each variable, the data relocation information 120 is completed by performing the backup process of acquiring data from the memory of the PLC 110 using the old address 122 and storing the acquired data in the value 124. Later, referring to the completed data relocation information 120, a restore process described later is executed. If data is acquired from the old address of the memory of the PLC 110, the storage area of the address may be cleared to "0".

続いて、コンパイル後のプログラムw(機械語オブジェクト)を、PLC110にダウンロードする(ステップS54)。これによって、PLC110側では、既存のプログラムrは削除されて、新たなプログラムwに置き換わることになる。   Subsequently, the compiled program w (machine language object) is downloaded to the PLC 110 (step S54). Thus, on the PLC 110 side, the existing program r is deleted and replaced with a new program w.

その後、リストア処理を実行する(ステップS55)。すなわち、各変数毎に上記データ再配置情報120に退避させてあったデータを、その変数の新アドレスに格納する処理を行う。つまり、データ再配置情報120の各レコード毎に、その値124の格納データを、その新アドレス123が示す記憶領域に格納する。   Thereafter, a restore process is executed (step S55). That is, for each variable, the data saved in the data relocation information 120 is stored at the new address of the variable. That is, for each record of the data relocation information 120, the stored data of the value 124 is stored in the storage area indicated by the new address 123.

この様にして、PLCの制御プログラムの更新に伴って変数の割当アドレスが変わっても、当該変数のデータを問題なく引き継ぐことができる。
尚、上記ステップS51〜S55の一連の処理は、オンライン状態で行われる。
In this way, even if the variable assignment address changes as the PLC control program is updated, the data of the variable can be taken over without any problem.
The series of processes in steps S51 to S55 are performed in an online state.

尚、図8の処理中は、更新対象のPLCの制御プログラム実行は中断している。   During the processing in FIG. 8, the execution of the control program of the PLC to be updated is interrupted.

特開2001−255913号公報JP 2001-255913 A

上述したように、従来の方法では、支援装置100において、オンライン状態で、更新対照の既存プログラムがPLC110側のプログラムと同一であることを確認したうえで、引き続き、プログラム編集、コンパイル、ダウンロード、上記バックアップ、上記リストア等の一連の処理を実行する必要がある。この様にすることで、新旧プログラムで変数の割当アドレスが変わっても、旧アドレスから新アドレスへのデータ移動を正しく行うことができ、データ引継ぎが問題なく行われる。   As described above, in the conventional method, in the support apparatus 100, after confirming that the existing program to be updated is the same as the program on the PLC 110 side in the online state, program editing, compiling, downloading, It is necessary to execute a series of processing such as backup and restoration. In this way, even if the variable assignment address changes in the old and new programs, data movement from the old address to the new address can be performed correctly, and data transfer is performed without any problem.

しかしながら、これは、逆に言えば、プログラム編集作業を含めた一連の処理を、支援装置100とPLC110とを常に接続した状態で行って、PLC110側のプログラム更新を完了させなければならない。   However, in other words, it is necessary to complete a program update on the PLC 110 side by performing a series of processes including a program editing operation in a state where the support apparatus 100 and the PLC 110 are always connected.

しかしながら、稼働中のシステムに対するプログラムの更新は、安全のため、稼働中のPLC内のデータをバックアップし、稼働中のシステムとは別の環境で新規作成プログラムの動作検証等を行った後、PLCのプログラム更新を実施する方法が一般的である。   However, for the safety of the program update to the operating system, the data in the operating PLC is backed up and the operation of the newly created program is verified in a different environment from the operating system. A method of performing the program update is generally used.

しかしながら、この方法を上記図7、図8の従来技術に適用することができない。上記の通り、従来では、既存のプログラムrの更新版のプログラムwの作成作業を、上記オンラインの状態で行う必要がある。この為、作成されたプログラムwの検証作業等を別環境で行いたくても、出来なかった。   However, this method cannot be applied to the prior art shown in FIGS. As described above, conventionally, it is necessary to create an updated program w of the existing program r in the online state. For this reason, it was not possible to perform verification work of the created program w in another environment.

つまり、この場合、例えば、上記ステップS52の処理を、事前に、更に場合によっては別環境で行った後、作成した更新版等の新規制御プログラム(上記プログラムw等)について、別環境で上記動作検証等を行った後、オンライン状態で上記図8の処理を行うことになる。但し、この場合、ステップS52の処理は特に行う必要はない。   In other words, in this case, for example, after the processing in step S52 is performed in advance in another environment in some cases, the new operation program such as the updated version (the program w etc.) is operated in another environment. After the verification or the like, the process shown in FIG. 8 is performed in an online state. However, in this case, the process of step S52 need not be performed.

しかしながら、このとき、支援装置100には、新規プログラムwは存在するが、既存のプログラムrは存在していない。この為、ステップS51の照合では、PLC110側のプログラムと一致しない為、それ以降の処理は出来ないことになる。つまり、PLC110側のプログラムを更新することが出来ないことになる。また、仮に、プログラム不一致であっても強制的に上記ステップS53,S54,S55の処理を行ってPLC側のプログラム更新を強行するようにした場合、変数のデータの引継ぎが正しく行われる保証はないことになる。   However, at this time, the new program w exists in the support apparatus 100, but the existing program r does not exist. For this reason, the collation in step S51 does not match the program on the PLC 110 side, and therefore the subsequent processing cannot be performed. That is, the program on the PLC 110 side cannot be updated. Also, even if there is a program mismatch, if the program on the PLC side is forced to be executed by forcibly performing the processes in steps S53, S54, and S55, there is no guarantee that the variable data will be correctly transferred. It will be.

しかしながら、図8の処理方法では、作成したプログラムwの動作検証を行わないまま、稼動中のPLCにプログラムをプログラムwへと更新してそのまま運用させることになり、PLCの動作に何らかの異常が生じる可能性がある。   However, in the processing method of FIG. 8, the operation of the created program w is not performed, but the operating PLC is updated to the program w and operated as it is, which causes some abnormality in the operation of the PLC. there is a possibility.

上述した従来技術の問題を解消することが望まれる。すなわち、例えば、オフライン状態で、既存プログラムに基づく更新版プログラムの編集作業や別環境での上記動作検証等を行ってから、オンライン状態で、変数のデータの引継ぎが正しく行われることを保証しつつPLC側のプログラム更新が行われるようにすることが望まれる。   It is desirable to solve the above-described problems of the prior art. That is, for example, while performing an offline program editing operation based on an existing program or performing the above operation verification in another environment, it is ensured that variable data transfer is performed correctly in the online state. It is desirable to perform program update on the PLC side.

本発明の課題は、オンライン状態で既存プログラムの一致確認と既存プログラムの更新版のプログラムの作成等の一連の処理を行わなくても、プログラム更新に伴う各変数の割当アドレスの変更に対応する変数データの再配置を正常に行うことができ、更に更新版プログラムの動作検証等を別環境等で行うことができるプログラマブルコントローラシステム、その支援装置等を提供することである。   An object of the present invention is to provide a variable corresponding to a change in the assigned address of each variable accompanying program update without performing a series of processes such as confirmation of matching of existing programs and creation of an updated version of existing programs in an online state. To provide a programmable controller system capable of normally rearranging data, and further capable of performing operation verification of an updated program in another environment or the like, its support device, and the like.

本発明のプログラマブルコントローラシステムは、支援装置とプログラマブルコントローラを有するシステムであって、支援装置は、下記の各構成を有する。
・既存のプログラムに基づいて作成された任意の新規プログラムを記憶するプログラム記憶手段;
・前記新規プログラムをコンパイルする際に、該新規プログラムの各変数のメモリ割当情報を生成すると共に、ユニークなキー情報を生成するコンパイラ手段;
・前記既存プログラムに係わる変数アドレス情報を前回変数アドレス情報として退避させると共に、前記キー情報を付与したメモリ割当情報を新たな前記変数アドレス情報として記憶する新旧変数アドレス情報管理手段;
・前記プログラマブルコントローラ側で保持するキー情報が、前記前回変数アドレス情報に付与されているキー情報と一致するか否かを判定する一致判定手段;
・該一致判定手段により前記2つのキー情報が一致すると判定された場合に、前記新たな変数アドレス情報と前記前回変数アドレス情報とに基づいて、前記プログラマブルコントローラにおける前記各変数のデータを再配置する変数データ再配置手段。
The programmable controller system of this invention is a system which has an assistance apparatus and a programmable controller, Comprising: An assistance apparatus has each following structure.
Program storage means for storing any new program created based on an existing program;
Compiler means for generating memory allocation information for each variable of the new program and generating unique key information when compiling the new program;
New and old variable address information management means for saving the variable address information related to the existing program as the previous variable address information and storing the memory allocation information to which the key information is added as the new variable address information;
A match determination means for determining whether or not the key information held on the programmable controller side matches the key information assigned to the previous variable address information;
When the two pieces of key information are determined to match by the match determination means, the data of each variable in the programmable controller is rearranged based on the new variable address information and the previous variable address information. Variable data relocation means.

本発明のプログラマブルコントローラシステム、その支援装置等によれば、オンライン状態で既存プログラムの一致確認と既存プログラムの更新版のプログラムの作成等の一連の処理を行わなくても、プログラム更新に伴う各変数の割当アドレスの変更に対応する変数データの再配置を正常に行うことができ、更に更新版プログラムの動作検証等を別環境等で行うことができる。   According to the programmable controller system of the present invention, its support device, etc., each variable associated with the program update can be performed without performing a series of processes such as confirmation of matching of the existing program and creation of an updated version of the existing program in the online state. Therefore, it is possible to normally rearrange the variable data corresponding to the change of the assigned address, and to perform the operation verification of the updated program in another environment.

本例のプログラマブルコントローラシステムのシステム構成図である。It is a system configuration figure of the programmable controller system of this example. 支援装置の全体処理フローチャート図である。It is a whole process flowchart figure of a support device. 図2のステップS4の詳細フローチャート図である。It is a detailed flowchart figure of step S4 of FIG. 図2のステップS5の詳細フローチャート図である。It is a detailed flowchart figure of step S5 of FIG. 図2のステップS6の詳細フローチャート図である。It is a detailed flowchart figure of step S6 of FIG. 本例の支援装置の機能ブロック図である。It is a functional block diagram of the assistance apparatus of this example. 従来のプログラマブルコントローラシステムの概略構成・動作を示す図である。It is a figure which shows schematic structure and operation | movement of the conventional programmable controller system. 従来の支援装置の処理フローチャート図である。It is a process flowchart figure of the conventional assistance apparatus.

以下、図面を参照して本発明の実施の形態について説明する。
尚、上記従来の説明等と同様、以下の本説明においても、「プログラム」は、基本的に、1つの制御プログラムまたは複数の制御プログラム(プロジェクト)を意味するものとし、基本的に上記“プロジェクト”という用語は記述しないものとする。
Embodiments of the present invention will be described below with reference to the drawings.
In the following description, “program” basically means one control program or a plurality of control programs (projects), and basically the above “project”. The term "" shall not be described.

図1は、本例のプログラマブルコントローラシステムのシステム構成図である。
本例においても、従来例と同様に、プログラマブルコントローラシステムは、基本的に、支援装置10とPLC(プログラマブルコントローラ)20を有する。
FIG. 1 is a system configuration diagram of the programmable controller system of this example.
Also in this example, as in the conventional example, the programmable controller system basically includes the support device 10 and a PLC (programmable controller) 20.

ここで、支援装置10は、例えばパソコン等の汎用コンピュータにより実現される。支援装置10は、一般的なパソコン等の構成を有する。すなわち、支援装置10は、ハードウェア構成としては、例えば、不図示のCPU等の演算プロセッサ、メモリ、ハードディスク等の記憶部、キーボード、マウス等の入力操作部、ディスプレイ等の表示部、通信機能部等を有している。不図示の通信機能部は、不図示の通信線/ネットワーク等に接続している。PLC20も不図示の通信線/ネットワークに接続している。これより、不図示の通信線/ネットワークを介して、支援装置10とPLC20とが通信できる。   Here, the support apparatus 10 is realized by a general-purpose computer such as a personal computer. The support device 10 has a configuration of a general personal computer or the like. That is, the support device 10 includes, for example, an arithmetic processor such as a CPU (not shown), a storage unit such as a memory and a hard disk, an input operation unit such as a keyboard and a mouse, a display unit such as a display, and a communication function unit. Etc. A communication function unit (not shown) is connected to a communication line / network (not shown). The PLC 20 is also connected to a communication line / network (not shown). Thereby, the support apparatus 10 and PLC20 can communicate via a communication line / network not shown.

また、支援装置10の上記不図示の記憶部には、予め所定のアプリケーションプログラムが記憶されている。支援装置10の上記不図示のCPU等が、このアプリケーションプログラムを実行することにより、後述する支援装置10の各種処理機能、特に図2〜図5の各フローチャート図の処理、図6に示す各機能部の処理機能などが、実現される。尚、図6に示す各種処理機能は、後述するが、例えば、プログラム記憶部51、コンパイラ部52、新旧変数アドレス情報管理部53、一致判定部54、変数データ再配置部55、ダウンロード部56、プログラム作成支援部57等である。   A predetermined application program is stored in advance in the storage unit (not shown) of the support apparatus 10. When the CPU (not shown) of the support device 10 executes this application program, various processing functions of the support device 10 to be described later, in particular, the processes in the flowcharts of FIGS. 2 to 5 and the functions shown in FIG. The processing function of the unit is realized. 6 will be described later. For example, the program storage unit 51, the compiler unit 52, the old and new variable address information management unit 53, the coincidence determination unit 54, the variable data relocation unit 55, the download unit 56, A program creation support unit 57 or the like.

また、PLC20も、プログラマブルコントローラとしての一般的なハードウェア構成を有しており、例えば不図示のCPU、メモリ等の記憶部、通信機能部等を有している。この記憶部に予め記憶されているアプリケーションプログラムを、CPUが実行することにより、後述するPLC20の処理機能、例えば図6に示す記憶部61、制御部62等の処理機能が、実現される。   The PLC 20 also has a general hardware configuration as a programmable controller, and includes, for example, a CPU (not shown), a storage unit such as a memory, a communication function unit, and the like. When the CPU executes the application program stored in advance in the storage unit, processing functions of the PLC 20 described later, for example, processing functions such as the storage unit 61 and the control unit 62 shown in FIG. 6 are realized.

支援装置10は、基本的な機能は、上記従来の支援装置100と略同様と見做してもよい。すなわち、支援装置10は、上記ユーザによる任意の制御プログラムのソースコードの作成を支援する機能や、このソースコードをコンパイルして機械語オブジェクトに変換すると共に、その際の変数アドレス割当情報を管理するコンパイラ等を有する。   The support device 10 may be regarded as having substantially the same basic function as the conventional support device 100 described above. That is, the support apparatus 10 functions to support the creation of the source code of an arbitrary control program by the user, compiles the source code and converts it into a machine language object, and manages variable address assignment information at that time Has a compiler.

そして、本例の支援装置10では、更に、このコンパイル処理に伴って、既存の変数アドレス情報11を退避させて新たな“前回変数アドレス情報”12として保持すると共に、コンパイルによる新たな変数のアドレス割当情報を、新たな変数アドレス情報11として保持する機能なども有する。   Further, in the support apparatus 10 of this example, the existing variable address information 11 is saved and stored as new “previous variable address information” 12 along with this compilation process, and the address of the new variable by compilation is also stored. It also has a function of holding allocation information as new variable address information 11.

そして、本例の支援装置10は、上記処理機能に加えて、キー情報に係わる各種処理・管理を行うものである。すなわち、支援装置10は、例えば、各制御プログラム(そのソースコード)をコンパイルする毎に、ユニークなキー情報を生成して、このキー情報を上記新たな変数のアドレス割当情報に付与する。よって、上記のことから、変数アドレス情報11にはキー情報が付与されていることになり、既存の変数アドレス情報11を退避させて成る上記“前回変数アドレス情報”12にもキー情報が付与されていることになる。ユニークなキー情報であるので、ある時点における変数アドレス情報11のキー情報と“前回変数アドレス情報”12のキー情報とは、相互に異なることになる。また、支援装置10は、上記コンパイルの際に生成したキー情報を、当該コンパイル結果である機械語オブジェクトと共にPLC20にダウンロードして記憶させる。   The support apparatus 10 of this example performs various processes and management related to key information in addition to the above processing functions. That is, for example, each time the control program (its source code) is compiled, the support apparatus 10 generates unique key information and assigns this key information to the address allocation information of the new variable. Therefore, the key information is given to the variable address information 11 from the above, and the key information is also given to the “previous variable address information” 12 formed by saving the existing variable address information 11. Will be. Since the key information is unique, the key information of the variable address information 11 and the key information of the “previous variable address information” 12 at a certain point in time are different from each other. Further, the support device 10 downloads and stores the key information generated at the time of the compilation into the PLC 20 together with the machine language object that is the compilation result.

上述した動作について、図1の図上左側には、ダウンロード操作時&コンパイル時の動作を示す。これについて、上記従来で説明したプログラムr、プログラムwを例にして説明する。   Regarding the operation described above, the operation at the time of download operation & compilation is shown on the left side of the diagram of FIG. This will be described using the program r and program w described above as an example.

図1の図上左側には、プログラムrのダウンロード時と、その後にプログラムrに基づいて作成された更新版のプログラムwのコンパイル時とが、混在して示されている。
まず、プログラムrに応じたキー情報として図示のキー情報“Key_r”が生成されたものとする。図には示していないが、このとき、プログラムrのコンパイル処理に伴う各変数のメモリアドレス割当情報にキー情報“Key_r”が付与されて、新たな変数アドレス情報11として保持されることになる。また、コンパイル結果である“プログラムrの機械語オブジェクト”をPLC20にダウンロードする際に、このキー情報“Key_r”も一緒にダウンロードして保持させる。これより、PLC20側には図示のようにキー情報“Key_r”が保持された状態となっている。尚、特に図示していないが、当然、ダウンロード後は、PLC20側ではプログラムrによって制御実行している状態となっている。
The left side of FIG. 1 shows a mixture of the time when the program r is downloaded and the time when the updated version of the program w created based on the program r is compiled.
First, it is assumed that the illustrated key information “Key_r” is generated as key information corresponding to the program r. Although not shown in the drawing, at this time, key information “Key_r” is given to the memory address allocation information of each variable accompanying the compiling process of the program r, and is held as new variable address information 11. Further, when downloading the “machine language object of program r”, which is a compilation result, to the PLC 20, the key information “Key_r” is also downloaded and held together. Thus, the key information “Key_r” is held on the PLC 20 side as shown in the figure. Although not particularly shown, naturally, after downloading, the PLC 20 side is in a state of being controlled and executed by the program r.

その後、任意のときに、プログラムrの更新版のプログラムwが作成されたものとする。そして、このプログラムwのコンパイル処理の際に、既存の変数アドレス情報11が退避されて新たな前回変数アドレス情報12として保持される。このときの既存の変数アドレス情報11は、上記プログラムrに係わるものであり上記の通りキー情報“Key_r”が付与されているので、上記退避後には前回変数アドレス情報12は図示の状態となっている。つまり、前回変数アドレス情報12は、上記プログラムrに係わる変数アドレス情報となっており、よって、キー情報“Key_r”が付与されたものとなっている。   Thereafter, it is assumed that an updated version of the program w is created at any time. Then, during the compiling process of the program w, the existing variable address information 11 is saved and held as new previous variable address information 12. Since the existing variable address information 11 at this time relates to the program r and the key information “Key_r” is given as described above, the previous variable address information 12 is in the state shown in FIG. Yes. That is, the previous variable address information 12 is variable address information related to the program r, and thus key information “Key_r” is added.

更に、上記更新版のプログラムwに対しては、キー情報“Key_w”が生成されたものとする。これより、プログラムwのコンパイル処理に伴う各変数のメモリアドレス割当情報にキー情報“Key_w”が付与されて、新たな変数アドレス情報11として保持されることになる。つまり、図示の状態となることになる。   Further, it is assumed that key information “Key_w” is generated for the updated program w. As a result, the key information “Key_w” is given to the memory address allocation information of each variable accompanying the compilation process of the program w, and is held as new variable address information 11. That is, the state shown in FIG.

ここで、本手法では、上記プログラムwの作成やそのコンパイル処理等は、オフライン状態で行っても構わない。オフライン状態とは、PLC20と支援装置10とが接続されていない状態である。従って、別環境においてプログラムwの動作検証等を行うこともできる。その後、例えば、動作検証済みのプログラムwを保持していると共に、変数アドレス情報11と前回変数アドレス情報12が図1の図上左側に示す状態となっている支援装置10を、オンライン状態する。オンライン状態とは、PLC20と支援装置10とが接続されている状態である。そして、オンライン状態で、図1の図上右側に示す「バックアップ&リストア操作時」の動作を行って、変数のデータの再配置を行うと共に、プログラムwを上記キー情報“Key_w”と共にPLC20にダウンロードすることになる。   Here, in this method, the creation of the program w and the compilation process thereof may be performed in an offline state. The offline state is a state where the PLC 20 and the support device 10 are not connected. Therefore, the operation verification of the program w can be performed in another environment. Thereafter, for example, the support device 10 that holds the operation-verified program w, and in which the variable address information 11 and the previous variable address information 12 are in the state shown on the left side of FIG. 1 is brought online. The online state is a state where the PLC 20 and the support device 10 are connected. Then, in the online state, the “backup & restore operation” operation shown on the right side of FIG. 1 is performed to rearrange the variable data and download the program w to the PLC 20 together with the key information “Key_w”. Will do.

尚、図1の図上右側に示す「バックアップ&リストア」動作の際、PLC20側の状態は、図上右下側に示すように、最初はプログラムrが保持され、これに伴って図示のようにキー情報“Key_r”が保持された状態になっている。その後、新たなプログラムwがダウンロードされると、プログラムwが保持され、これに伴って図示のようにキー情報“Key_w”が保持された状態になる。また、図上右下側には、「バックアップ&リストア」動作に伴うPLC20のメモリの変数割当アドレスの格納データの状態変化も示すが、これについては後述する。   Incidentally, during the “backup and restore” operation shown on the right side of FIG. 1, the state on the PLC 20 side initially holds the program r as shown in the lower right side of the figure, and as shown in FIG. Is held in the key information “Key_r”. Thereafter, when a new program w is downloaded, the program w is held, and accordingly, the key information “Key_w” is held as shown in the figure. Further, the lower right side of the figure also shows a change in the state of data stored in the variable assignment address of the memory of the PLC 20 due to the “backup & restore” operation, which will be described later.

図上右側に示す「バックアップ&リストア」動作では、まず最初に、前回変数アドレス情報12のキー情報が、PLC20側で保持しているキー情報と一致するか否かをチェックする。図示の例では上記の通りPLC20側ではキー情報“Key_r”が保持されており、前回変数アドレス情報12のキー情報は“Key_r”であるので、キー情報は一致することになる。   In the “backup & restore” operation shown on the right side of the figure, first, it is checked whether or not the key information of the previous variable address information 12 matches the key information held on the PLC 20 side. In the illustrated example, the key information “Key_r” is held on the PLC 20 side as described above, and the key information of the previous variable address information 12 is “Key_r”, so the key information matches.

キー情報が一致する場合には、PLC20側における現在の各変数のデータ格納位置は、現在の“前回変数アドレス情報”12が示すデータ格納位置と一致しているものと見做してよいことになる。従って、キー情報が一致する場合には、“前回変数アドレス情報”12に基づいてバックアップ処理を実行すれば、正常にデータ取得が出来ることになる。“前回変数アドレス情報”12は、従来の“前回変数アドレス情報”102と同様、各変数名に旧アドレスが対応付けられているので、この旧アドレスからデータを取得する。尚、バックアップ処理自体は、従来と略同様である。   If the key information matches, the current data storage position of each variable on the PLC 20 side may be considered to match the data storage position indicated by the current “previous variable address information” 12. Become. Therefore, when the key information matches, if the backup process is executed based on the “previous variable address information” 12, data can be normally acquired. In the “previous variable address information” 12, as in the conventional “previous variable address information” 102, the old address is associated with each variable name, so data is acquired from this old address. Note that the backup process itself is substantially the same as the conventional one.

尚、図示のバックアップデータ14は、上記バックアップ処理によって取得したデータでは無い。バックアップデータ14は、PLC20の不図示のメモリの全データのコピー等であり、上記バックアップ処理の前に作成しておくものである。これによって、上記バックアップ処理の際に、逐一PLC20のメモリから該当データを取得する必要なく、バックアップデータ14から該当データを取得すれば済むことになる。   The illustrated backup data 14 is not data acquired by the backup process. The backup data 14 is a copy of all data in a memory (not shown) of the PLC 20 or the like, and is created before the backup process. As a result, it is not necessary to acquire the corresponding data from the memory of the PLC 20 at the time of the backup process, and it is only necessary to acquire the corresponding data from the backup data 14.

上記バックアップ処理の後、リストア処理を実行する。このリストア処理自体も、従来と略同様である。つまり、変数アドレス情報11は、各変数名に新アドレスが対応付けられており、上記バックアップ処理で各変数名に対応するデータを取得しているので、このデータを新アドレスに格納する。   After the backup process, a restore process is executed. This restoration process itself is substantially the same as the conventional one. That is, in the variable address information 11, a new address is associated with each variable name, and data corresponding to each variable name is acquired in the backup process, so this data is stored in the new address.

尚、PLC20側には変数名の情報は存在していない。換言すれば、ソースコードには変数名が記述され、機械語オブジェクトには各変数に割り当てられたアドレスが記述されることになる。よって、PLC20側では、各割当アドレスとその現在のデータを知ることは出来るが、どのアドレスがどの変数(変数名)に対応するものであるかまでは分からない。   Note that there is no variable name information on the PLC 20 side. In other words, a variable name is described in the source code, and an address assigned to each variable is described in the machine language object. Therefore, on the PLC 20 side, it is possible to know each assigned address and its current data, but it is not known which address corresponds to which variable (variable name).

尚、上記従来のデータ再配置情報120と同様の図示のデータ再配置情報30を作成し、これに基づいて上記バックアップ&リストア処理を実行するようにしてもよい。データ再配置情報30は、変数名31、旧アドレス32、新アドレス33、値34等から成り、バックアップ処理で旧アドレス32からの取得データを値34に格納し、リストア処理では値34のデータを新アドレス33に格納する。   The illustrated data rearrangement information 30 similar to the conventional data rearrangement information 120 may be created, and the backup and restore process may be executed based on the data rearrangement information 30. The data relocation information 30 includes a variable name 31, an old address 32, a new address 33, a value 34, and the like. The acquired data from the old address 32 is stored in the value 34 in the backup process, and the data of the value 34 is stored in the restore process. Store in the new address 33.

勿論、これは一例であり、必ずしもデータ再配置情報30を作成しなくてもよい。旧アドレスからデータを取得してこのデータを新アドレスに格納することが出来れば、方法は何でも良い。   Of course, this is only an example, and the data rearrangement information 30 does not necessarily have to be created. Any method can be used as long as the data can be acquired from the old address and stored in the new address.

上記「バックアップ&リストア」動作によって、例えば図上下側に示すように、例えば旧アドレス‘0x0000’のデータ‘1’は、新アドレス‘0x0010’に移動することになる。
尚、図上右下側に示すように、PLC20側の状態は、バックアップ処理の際にはキー情報“Key_r”があるのでプログラムrが保持されており、リストア処理の後にはキー情報“Key_w”があるのでプログラムwが保持された状態になっていることになる。つまり、従来と略同様に、バックアップ処理の後あるいはリストア処理の後などに、プログラムwとそのキー情報“Key_w”が、PLC20にダウンロードされている。尚、逐一述べないが、当然、PLC20側にダウンロードされて保持されるプログラムは、コンパイル後、すなわち機械語オブジェクトである。
By the “backup & restore” operation, for example, as shown in the upper and lower sides of the figure, for example, data “1” of the old address “0x0000” is moved to the new address “0x0010”.
Note that, as shown in the lower right side of the figure, the state on the PLC 20 side holds the program r because there is key information “Key_r” at the time of backup processing, and key information “Key_w” after the restoration processing. As a result, the program w is held. That is, the program w and its key information “Key_w” are downloaded to the PLC 20 after the backup process or the restore process, as in the conventional case. Although not described one by one, of course, the program downloaded and held on the PLC 20 side is a compiled language, that is, a machine language object.

図2〜図5に、支援装置10の処理フローチャート図を示す。
図2は、支援装置10の全体処理フローチャート図である。
ここで、図2に示すステップS1の処理は、図2の処理に含まれないものと見做してもよい。すなわち、ステップS1の処理は、例えばプログラムの初期版に係わる処理である。初期版であるので、PLC20側には未だプログラムは存在していない。これより、特にチェック等は必要なく、変数データを引継ぐ必要もないのでバックアップ&リストア処理等も必要なく、ユーザは任意の環境下で自由に初期版のプログラムの作成や検証等を行うことができ、そのコンパイル処理も行うことができる。そして、支援装置10を処理対象のPLC20に接続してオンライン状態にして、コンパイル後のプログラムを当該PLC20にダウンロードして保持させる。PLC20は、このプログラムを用いて各種制御を実行する。
2 to 5 show process flowcharts of the support device 10.
FIG. 2 is an overall process flowchart of the support device 10.
Here, the process of step S1 shown in FIG. 2 may be regarded as not included in the process of FIG. That is, the process of step S1 is a process related to the initial version of the program, for example. Since it is an initial version, there is no program on the PLC 20 side yet. As a result, there is no need for checking, etc., and there is no need to take over variable data, so there is no need for backup and restore processing, and the user can freely create and verify the initial version of the program in any environment. The compilation process can also be performed. Then, the support apparatus 10 is connected to the PLC 20 to be processed and brought into an online state, and the compiled program is downloaded and held in the PLC 20. The PLC 20 executes various controls using this program.

上記初期版に係る処理に関して、従来と異なる点は、上記コンパイル処理に伴ってユニークなキー情報を生成して、このキー情報が付与された変数アドレス情報11が生成される点である。尚、このときは未だ、前回変数アドレス情報12は存在していない。   Regarding the processing related to the initial version, the point different from the conventional one is that unique key information is generated along with the compiling processing, and variable address information 11 to which the key information is assigned is generated. At this time, the previous variable address information 12 does not exist yet.

尚、更新版の場合も、コンパイル処理に伴って作成される上述した変数アドレス割当情報に上述した新たなキー情報を付与したものを、新たな変数アドレス情報11として記憶するが、その前に、上記のように、既存の変数アドレス情報11を退避させて新たな前回変数アドレス情報12として記憶する。   In addition, also in the case of the updated version, the above-described variable address assignment information created along with the compilation process is added with the above-described new key information and stored as new variable address information 11, but before that, As described above, the existing variable address information 11 is saved and stored as new previous variable address information 12.

ここで、本手法では、コンパイル処理に伴って新たな変数アドレス情報を生成する毎に、ユニークなキー情報を生成して、これを生成した変数アドレス情報に付随させる。キー情報は、同じものが生成されないようにすれば何でもよい。このキー情報は、PLC20にダウンロードするプログラムにも付随させる。尚、PLC20にダウンロードするプログラムは、当然、上記コンパイル処理によって得られる機械語オブジェクトである。   Here, in this method, every time new variable address information is generated in accordance with the compilation process, unique key information is generated and attached to the generated variable address information. The key information may be anything as long as the same information is not generated. This key information is also attached to the program downloaded to the PLC 20. The program downloaded to the PLC 20 is naturally a machine language object obtained by the above compilation process.

上記ステップS1の処理によって初期版に係る各種処理が実行され、その後、任意のときに、新たな更新版プログラムを作成する際に、ステップS2やステップS3〜S6の処理が実行される。   Various processes relating to the initial version are executed by the process of step S1, and thereafter, the process of steps S2 and S3 to S6 is executed when creating a new update program at any time.

ここで、本説明では、図1の例を利用して、ステップS2では、その時点での既存のプログラムrに基づいて、その更新版等である新たなプログラムwが作成されるものとする。プログラムrは、例えばステップS1で作成された初期版であるかもしれないし、前回の図2の処理実行時にステップS2で作成されたプログラムかもしれない。また、図1と同様、プログラムrに対してはキー情報“Key_r”が生成されており、プログラムwに対してはキー情報“Key_w”が生成されるものとする。   Here, in this description, using the example of FIG. 1, in step S2, a new program w, such as an updated version, is created based on the existing program r at that time. The program r may be, for example, the initial version created in step S1, or may be the program created in step S2 at the time of the previous execution of the process of FIG. As in FIG. 1, key information “Key_r” is generated for the program r, and key information “Key_w” is generated for the program w.

そして、基本的には、以前に、プログラムrがキー情報“Key_r”と共にPLC20にダウンロードされており、PLC20側ではその時点からプログラムrにより運用開始したはずである。しかしながら、現在もPLC20側ではプログラムrにより運用中であるという保証はない。尚、図1には正常な場合を示しているので、PLC20にキー情報“Key_r”が保持されている状態を示してある。つまり、本手法では、正常な状態であれば、以下に説明するステップS2〜S6の処理を実行する際には、PLC20側にはキー情報“Key_r”が記憶された状態となっている。   Basically, the program r has been previously downloaded to the PLC 20 together with the key information “Key_r”, and the operation should have started by the program r from that point on the PLC 20 side. However, at present, there is no guarantee that the PLC 20 is operating with the program r. Since FIG. 1 shows a normal case, the PLC 20 holds the key information “Key_r”. In other words, in this method, when the process is normal, the key information “Key_r” is stored on the PLC 20 side when the processes of steps S2 to S6 described below are executed.

上記のように、PLC20側で現在運用中のプログラムが、支援装置10側の上記既存のプログラムrと同一であるという保証は無い。その為、従来では上記ステップS51のチェック処理を行ったが、本手法では上記キー情報を用いた後述するステップS3のチェック処理を行う。詳しくは後述する。   As described above, there is no guarantee that the program currently being operated on the PLC 20 side is the same as the existing program r on the support apparatus 10 side. For this reason, the check process of step S51 is performed conventionally, but in this method, the check process of step S3 described later using the key information is performed. Details will be described later.

また、ステップS2の処理開始前の段階では、支援装置10側にはプログラムrが格納されていると共に、キー情報“Key_r”が付随された変数アドレス情報は、図1とは異なり、未だ「前回変数アドレス情報」12にはなっておらず、上記変数アドレス情報11として記憶されている状態となっている。尚、プログラムrが初期版である例では、ステップS2の処理開始前の段階では、「前回変数アドレス情報」12は存在しておらず、キー情報“Key_r”が付随された変数アドレス情報11のみが存在していることになる。   Further, in the stage before the start of the processing in step S2, the program r is stored on the support device 10 side, and the variable address information accompanied by the key information “Key_r” is different from FIG. The variable address information “12” is not stored, but the variable address information 11 is stored. In the example in which the program r is the initial version, the “previous variable address information” 12 does not exist in the stage before the start of processing in step S2, and only the variable address information 11 accompanied by the key information “Key_r” exists. Will exist.

上記ステップS1の初期版に係わる処理後、任意のときに、プログラムの更新等を行う際に、その都度、ステップS2〜S6の処理が行われる。
まず、本処理では更新の際に上記ステップS51の処理は行わない。よって、支援装置10において、オフラインの状態でユーザが所望のプログラム編集を行って、更新版等の新たなプログラムwを作成するものであってよい。また、別環境で、新たなプログラムwの動作検証等を行って、新たなプログラムwが問題なく動作することを確認するようにしてもよい。
After the processing related to the initial version in step S1, the processing in steps S2 to S6 is performed whenever the program is updated at any time.
First, in this process, the process of step S51 is not performed at the time of update. Therefore, in the support apparatus 10, the user may edit a desired program in an offline state to create a new program w such as an updated version. Further, the operation verification of the new program w may be performed in another environment to confirm that the new program w operates without any problem.

このように、ステップS2では、例えばオフラインで、上記プログラム編集や動作検証を行って、正常に動作することが確認された上記プログラムwが、ユーザによって作成されることになる。更に、作成したプログラムwをコンパイルして、PLC20で実行可能な形式(機械語オブジェクト)に変換する。また、これに伴って、プログラムwに対応するキー情報“Key_w”が生成されたうえで変数アドレス情報の更新を行うことで、変数アドレス情報は例えば図1の上記「バックアップ&リストア操作」時の状態になるものとする。   As described above, in step S2, the user edits the program w and verifies the operation, and the program w confirmed to operate normally is created by the user. Further, the created program w is compiled and converted into a format (machine language object) that can be executed by the PLC 20. Accordingly, the variable address information is updated after the key information “Key_w” corresponding to the program w is generated and the variable address information is updated, for example, at the time of the “backup and restore operation” in FIG. Shall be in a state.

すなわち、現在の変数アドレス情報11を「前回変数アドレス情報」12として退避させて、新たなプログラムwに係わる変数アドレス情報を新たな現在の変数アドレス情報11とする。これは、本例では、例えば図1の図上左側に示すように、キー情報“Key_r”付随の変数アドレス情報を新たな「前回変数アドレス情報」12として退避させて、キー情報“Key_w”付随の変数アドレス情報を、新たな現在の変数アドレス情報11として記憶することになる。   That is, the current variable address information 11 is saved as “previous variable address information” 12, and the variable address information related to the new program w is set as the new current variable address information 11. In this example, as shown on the left side of FIG. 1, for example, the variable address information associated with the key information “Key_r” is saved as new “previous variable address information” 12 and the key information “Key_w” is associated. Is stored as new current variable address information 11.

その後、任意のときに、オンライン状態、すなわち支援装置を更新対象のPLC20に接続して通信可能な状態にして、ステップS3〜S6の処理を実行する。
まず、「前回変数アドレス情報」12のキー情報(本例では“Key_r”)を読出すと共に、PLC20側のキー情報を読出して両者が一致するか否かを確認する(ステップS3)。尚、特に図示していないが不一致の場合には、警告メッセージを報知する等して本処理を終了する。つまり、この場合、PLC20の変数データ再配置やプログラム更新は行えない。一方、キー情報が一致する場合には、本例ではPLC20側で現時点において運用中のプログラムが、プログラムrであると見做してよい。よって、PLC20内の不図示のメモリにおける各変数データの格納位置も、「前回変数アドレス情報」12が示す各アドレスとなっていると見做してよい。
Thereafter, at any time, the online state, that is, the support device is connected to the PLC 20 to be updated to be in a communicable state, and the processes of steps S3 to S6 are executed.
First, the key information (“Key_r” in this example) of the “previous variable address information” 12 is read, and the key information on the PLC 20 side is read to check whether or not they match (step S3). Although not particularly shown, if there is a mismatch, the process is terminated by notifying a warning message or the like. That is, in this case, PLC 20 variable data rearrangement and program updating cannot be performed. On the other hand, when the key information matches, in this example, the program currently being operated on the PLC 20 side may be regarded as the program r. Therefore, the storage position of each variable data in a memory (not shown) in the PLC 20 may be regarded as each address indicated by the “previous variable address information” 12.

本例ではステップS2においてプログラムrに基づいてその更新版であるプログラムwを作成しているが、この作成に伴ってプログラムrは無くなっている。従って、ステップS3の処理の時点では、従来のステップS51に相当する処理は行えない。しかし、「前回変数アドレス情報」12のキー情報を用いることで、ステップS51の略同様の確認が行える。すなわち、支援装置10に現在存在するプログラムwが、PLC20側の現在のプログラムの更新版等であることが確認できる。   In this example, the updated program w is created on the basis of the program r in step S2, but the program r disappears with this creation. Therefore, the process corresponding to the conventional step S51 cannot be performed at the time of the process of step S3. However, by using the key information of “previous variable address information” 12, substantially the same confirmation as in step S 51 can be performed. That is, it can be confirmed that the program w currently existing in the support apparatus 10 is an updated version of the current program on the PLC 20 side.

ステップS3で一致確認したら、続いて、バックアップ処理を実行する(ステップS4)。ここで、ステップS4のバックアップ処理の詳細例を、図3に示す。尚、図3に示す例では、キー情報は上述した図1に示す例を用いている。   When the match is confirmed in step S3, the backup process is subsequently executed (step S4). Here, a detailed example of the backup process in step S4 is shown in FIG. In the example shown in FIG. 3, the key information uses the example shown in FIG.

まず、「前回変数アドレス情報」12のキー情報“Key_r”を読出す(ステップS21)。更に、PLC20からキー情報を読み出す(ステップS22)。但し、PLC20にキー情報が存在しない場合には(ステップS23、NO)、更新不可等を示す所定の警告を報知して(ステップS26)、本処理を終了する。   First, the key information “Key_r” of “previous variable address information” 12 is read (step S21). Further, key information is read from the PLC 20 (step S22). However, when the key information does not exist in the PLC 20 (step S23, NO), a predetermined warning indicating that updating is not possible is notified (step S26), and this process is terminated.

一方、PLC20にキー情報が存在して(ステップS23,YES)これをステップS22で取得できた場合には、当該PLC20側のキー情報が、上記「前回変数アドレス情報」12のキー情報“Key_r”と一致するか否かを判定する(ステップS24)。図1に示す例では、一致するはずであるが、もし、キー情報が不一致ならば(ステップS24,NO)上記ステップS26の処理を実行して本処理を終了する。   On the other hand, if the key information exists in the PLC 20 (step S23, YES) and can be acquired in step S22, the key information on the PLC 20 side is the key information “Key_r” of the “previous variable address information” 12. (Step S24). In the example shown in FIG. 1, they should match, but if the key information does not match (step S24, NO), the process of step S26 is executed and the process is terminated.

キー情報が一致することを確認したら(ステップS24,YES)、前回変数アドレス情報12に登録されている各アドレス(旧アドレス)に基づいて、PLC20内の不図示のメモリの旧アドレスからデータを読み出して、これを旧アドレスと新アドレスとに対応付けて一時的に記憶する(ステップS25、S27、S28)。これは、上記従来のデータ再配置情報120の生成処理と略同様の処理を実行するものと見做してもよい。尚、本説明では、データ再配置情報の具体例は、上記従来のデータ再配置情報120と同様のデータ再配置情報30を用いるものとする。   When it is confirmed that the key information matches (step S24, YES), data is read from the old address of the memory (not shown) in the PLC 20 based on each address (old address) registered in the previous variable address information 12 This is temporarily stored in association with the old address and the new address (steps S25, S27, S28). This may be regarded as performing substantially the same process as the conventional process for generating the data relocation information 120. In this description, the data relocation information 30 similar to the conventional data relocation information 120 is used as a specific example of the data relocation information.

尚、上記新アドレスとは、変数アドレス情報11に登録されている各アドレスのことである。尚、変数アドレス情報11の各レコードは、上述したように、変数名に応じた割当アドレス等から成り、本例では現在のプログラムwに係わる各変数の変数名と割当アドレスが格納されることになる。また、前回変数アドレス情報12は、既存の変数アドレス情報11を退避させたものであるので、そのデータ構造自体は変数アドレス情報11と同じである。   The new address refers to each address registered in the variable address information 11. As described above, each record of the variable address information 11 includes an allocation address corresponding to the variable name. In this example, the variable name and the allocation address of each variable related to the current program w are stored. Become. Further, since the previous variable address information 12 is saved from the existing variable address information 11, the data structure itself is the same as the variable address information 11.

上記ステップS25、S27等の処理について、以下、図2等に示すデータ再配置情報30を用いて、一例について具体的に説明する。
例えば、前回変数アドレス情報12の各レコードを順次処理対象として、ステップS25,S27の処理を実行する。
An example of the processing of steps S25 and S27 will be specifically described below using data relocation information 30 shown in FIG.
For example, the processing of steps S25 and S27 is executed with each record of the previous variable address information 12 being sequentially processed.

まず、前回変数アドレス情報12における処理対象レコードの変数名と割当アドレス(上記旧アドレス)を取得する(ステップS25)。そして、PLC20内の不図示のメモリから当該旧アドレスの格納データを読み出して、この読出データを上記処理対象レコードの変数名と割当アドレス(旧アドレス)に紐付けて記憶する。つまり、処理対象レコードの変数名と割当アドレス(旧アドレス)と読出データを、データ再配置情報30の新規追加レコードの変数名31と旧アドレス32と値34とにそれぞれ格納する(ステップS27)。   First, the variable name and assigned address (the old address) of the process target record in the previous variable address information 12 are acquired (step S25). Then, the stored data of the old address is read from a memory (not shown) in the PLC 20, and the read data is stored in association with the variable name and the assigned address (old address) of the processing target record. That is, the variable name, allocation address (old address), and read data of the processing target record are stored in the variable name 31, old address 32, and value 34 of the newly added record of the data relocation information 30, respectively (step S27).

ステップS27では、更に、変数アドレス情報11における上記変数名31に対応する割当アドレス(新アドレス)を取得して、これを上記新規追加レコードの新アドレス33に格納する処理も行う。これによって、データ再配置情報30の1レコードが作成完了することになる。   In step S27, an assignment address (new address) corresponding to the variable name 31 in the variable address information 11 is further acquired and stored in the new address 33 of the newly added record. As a result, the creation of one record of the data relocation information 30 is completed.

前回変数アドレス情報12の全てのレコードについて上記ステップS25、S27の処理を実行するまで、上記ステップS25、S27の処理を繰り返す。そして、全レコードについて処理実行したら(ステップS28,YES)本処理を終了する。   The processes in steps S25 and S27 are repeated until the processes in steps S25 and S27 are executed for all the records of the previous variable address information 12. Then, when processing is executed for all records (step S28, YES), this processing is terminated.

尚、図3の処理の開始前に、例えば図1に示すようにPLC20側の保持データを取得してバックアップデータ14として支援装置10側に保持しておき、ステップS22、S27の処理では、PLC20からデータを取得するのではなく、バックアップデータ14からデータ取得するようにしてもよい。   Before starting the process of FIG. 3, for example, as shown in FIG. 1, the data held on the PLC 20 side is acquired and held as backup data 14 on the support apparatus 10 side. In the processes of steps S22 and S27, the PLC 20 The data may be acquired from the backup data 14 instead of acquiring the data from the backup data 14.

上記ステップS4の処理によってデータ再配置情報30の作成が完了したら、上記更新版等の新たなプログラムwを、そのキー情報(本例では“Key_w”)と共に、PLC20にダウンロードする(ステップS5)。   When the creation of the data rearrangement information 30 is completed by the process of step S4, the new program w such as the updated version is downloaded to the PLC 20 together with the key information (in this example, “Key_w”) (step S5).

図4に、ステップS5の詳細フローチャート図を示す。
上記更新版等のプログラムwを、キー情報“Key_w”を付してPLC20にダウンロードする(ステップS11)。これは、例えば、上記ステップS2で作成された更新版等のプログラムwを、当該ステップS2のコンパイル処理に伴って生成した上記キー情報“Key_w”を付してPLC20にダウンロードする。
FIG. 4 shows a detailed flowchart of step S5.
The program w such as the updated version is attached to the PLC 20 with key information “Key_w” (step S11). For example, the program w such as the updated version created in step S2 is downloaded to the PLC 20 with the key information “Key_w” generated in the compiling process in step S2.

これによって、次回のプログラム更新の際には、例えば図3の処理を実行する時点では、「前回変数アドレス情報」12は、上記キー情報“Key_w”付随の変数アドレス情報になっていると共に、正常であればPLC20側のキー情報も“Key_w”であるはずである。   As a result, when the program is updated next time, for example, at the time when the processing of FIG. 3 is executed, the “previous variable address information” 12 is variable address information associated with the key information “Key_w” and is normal. If so, the key information on the PLC 20 side should be "Key_w".

上記ステップS5のダウンロード処理後、リストア処理を行う(ステップS6)。
図5は、ステップS6の詳細フローチャート図である。
図5において、まず、変数アドレス情報11に付随のキー情報(本例では“Key_w”)を読出すと共に(ステップS31)、PLC20からキー情報を読み出す(ステップS32)。図4の処理により、PLC20側に特に異常が無ければ、PLC20側で保持するキー情報は、“Key_w”となっているはずである。しかし、PLC20側に何らかの異常があって、PLC20側にキー情報が存在しなかったり(ステップS33,NO)、PLC20側のキー情報が、ステップS31で読み出したキー情報“Key_w”と不一致の場合には(ステップS34,NO)、リストア操作不可である旨の警告を報知する等して(ステップS36)、本処理を終了する。
After the download process in step S5, a restore process is performed (step S6).
FIG. 5 is a detailed flowchart of step S6.
In FIG. 5, first, key information (“Key_w” in this example) associated with the variable address information 11 is read (step S31), and key information is read from the PLC 20 (step S32). If there is no abnormality on the PLC 20 side by the process of FIG. 4, the key information held on the PLC 20 side should be “Key_w”. However, when there is some abnormality on the PLC 20 side, the key information does not exist on the PLC 20 side (step S33, NO), or the key information on the PLC 20 side does not match the key information “Key_w” read in step S31. (NO in step S34), a warning to the effect that the restore operation is not possible is given (step S36), and the process is terminated.

一方、PLC20側のキー情報が、上記変数アドレス情報11に付随のキー情報“Key_w”と一致することを確認したならば(ステップS34,YES)、上記データ再配置情報30の各レコードを順次参照して、リストア処理を実行する。   On the other hand, if it is confirmed that the key information on the PLC 20 side matches the key information “Key_w” associated with the variable address information 11 (step S34, YES), the records of the data rearrangement information 30 are sequentially referred to. Then, restore processing is executed.

すなわち、データ再配置情報30の任意のレコードを参照して(ステップS35)、そのレコードの値34のデータを、当該レコードの新アドレス33の記憶領域に格納する(ステップS37)。当該ステップS35、S37の処理を、データ再配置情報30の全レコードについて順次実行していき、全レコードについて実行完了したら(ステップS38,YES)本処理を終了する。   That is, referring to an arbitrary record of the data rearrangement information 30 (step S35), the data of the value 34 of the record is stored in the storage area of the new address 33 of the record (step S37). The processes in steps S35 and S37 are sequentially executed for all the records of the data rearrangement information 30, and when the execution is completed for all the records (step S38, YES), this process is terminated.

尚、オンライン状態にしてステップS3でキー情報一致を確認したら、引き続きオンライン状態のままでステップS4、S5、S6の処理を実行する。尚、ステップS5の実行タイミングは、図2に示す例に限らず、例えばステップS6の処理後に実行してもよい。但し、その場合には、ステップS11,S12の「新たなキー情報生成と該キー情報を変数アドレス情報11に付与する処理」は、例えばステップS2の処理の際に行っておく。   When the key information coincides with the online state in step S3, the processes of steps S4, S5, and S6 are executed while the online state is maintained. Note that the execution timing of step S5 is not limited to the example shown in FIG. 2, and may be executed after the process of step S6, for example. In this case, however, “new key information generation and processing for assigning the key information to the variable address information 11” in steps S11 and S12 are performed, for example, in the process of step S2.

また、上記ステップS31〜S34の処理は、必ずしも必要ないものである。すなわち、上記ステップS31〜S34の処理は、ダウンロード処理後にリストア処理を行う例に対応するものであり、ダウンロードが正常に行われたことを確認する為の処理である。よって、必ずしも必要ない処理であり、更に例えばリストア処理後にダウンロード処理を行う例の場合には必要ない処理である。   Moreover, the process of said step S31-S34 is not necessarily required. That is, the processes in steps S31 to S34 correspond to an example in which the restore process is performed after the download process, and is a process for confirming that the download has been performed normally. Therefore, this process is not necessarily required. Further, for example, this process is not necessary in the case where the download process is performed after the restore process.

図6は、本例の支援装置10とPLC20の機能ブロック図である。
まず、支援装置10は、プログラム記憶部51、コンパイラ部52、新旧変数アドレス情報管理部53、一致判定部54、変数データ再配置部55、ダウンロード部56等を有する。支援装置10は、更に、プログラム作成支援部57等を有するものであってもよい。
FIG. 6 is a functional block diagram of the support device 10 and the PLC 20 of this example.
First, the support apparatus 10 includes a program storage unit 51, a compiler unit 52, an old and new variable address information management unit 53, a coincidence determination unit 54, a variable data relocation unit 55, a download unit 56, and the like. The support device 10 may further include a program creation support unit 57 and the like.

プログラム記憶部51は、既存のプログラムに基づいて作成された任意の新規プログラムを記憶する。
コンパイラ部52は、上記新規プログラムをコンパイルする。すなわち、新規プログラムのソースコードをコンパイルして機械語オブジェクトに変換する。更に、このコンパイル処理に伴って、該新規プログラムの各変数のメモリ割当情報を生成すると共に、ユニークなキー情報を生成する。
The program storage unit 51 stores an arbitrary new program created based on an existing program.
The compiler unit 52 compiles the new program. That is, the source code of the new program is compiled and converted into a machine language object. Further, along with this compilation processing, memory allocation information for each variable of the new program is generated and unique key information is generated.

新旧変数アドレス情報管理部53は、上記既存プログラムに係わる変数アドレス情報を前回変数アドレス情報として退避させると共に、上記キー情報を付与したメモリ割当情報を新たな上記変数アドレス情報として記憶する。尚、この様に、変数アドレス情報はキー情報が付与されているので、これを退避させて成る上記前回変数アドレス情報にも、当然、キー情報が付与されていることになる。ユニークなキー情報であるので、当然、前回変数アドレス情報に付与されているキー情報は、新たな変数アドレス情報に付与されているキー情報とは、異なることになる。   The old and new variable address information management unit 53 saves the variable address information related to the existing program as the previous variable address information, and stores the memory allocation information to which the key information is added as new variable address information. Since the key information is assigned to the variable address information as described above, the key information is naturally assigned to the previous variable address information obtained by saving the variable address information. Since the key information is unique, naturally, the key information assigned to the previous variable address information is different from the key information assigned to the new variable address information.

一致判定部54は、PLC20側で保持するキー情報が、上記前回変数アドレス情報に付与されているキー情報と一致するか否かを判定する。
変数データ再配置部55は、一致判定部54により上記2つのキー情報が一致すると判定された場合に、上記新たな変数アドレス情報と上記前回変数アドレス情報とに基づいて、PLC20内の不図示のメモリにおける各変数のデータを再配置する。
The coincidence determination unit 54 determines whether or not the key information held on the PLC 20 side matches the key information given to the previous variable address information.
When the match determination unit 54 determines that the two pieces of key information match, the variable data rearrangement unit 55 is not shown in the PLC 20 based on the new variable address information and the previous variable address information. Relocate data for each variable in memory.

ダウンロード部56は、上記一致判定部54により上記2つのキー情報が一致すると判定された場合に、上記コンパイル後の新規プログラムを上記生成したキー情報と共にPLC20にダウンロードして記憶させる。   When the match determination unit 54 determines that the two key information matches, the download unit 56 downloads and stores the compiled new program in the PLC 20 together with the generated key information.

プログラム作成支援部57は、上記既存のプログラムに基づく任意の新規プログラムの作成作業を支援する。この機能自体は既存の一般的な機能である。
そして、プログラム作成支援部57による新規プログラムの作成作業や、その動作検証作業等は、PLC20と接続していないオフライン状態で実施される。その一方で、一致判定部54の上記判定処理と変数データ再配置部55による上記各変数のデータを再配置する処理は、PLC20と接続したオンライン状態で例えば連続して実行される。
The program creation support unit 57 supports creation of an arbitrary new program based on the existing program. This function itself is an existing general function.
Then, the creation work of the new program by the program creation support unit 57, the operation verification work thereof, and the like are performed in an offline state not connected to the PLC 20. On the other hand, the determination process of the match determination unit 54 and the process of rearranging the data of each variable by the variable data rearrangement unit 55 are executed, for example, continuously in an online state connected to the PLC 20.

また、上記新たな変数アドレス情報と上記前回変数アドレス情報は、何れも、各変数に応じたPLC20内のメモリへの割当アドレスを有している。ここでは、各変数毎に、上記新たな変数アドレス情報における割当アドレスを新アドレス、上記前回変数アドレス情報における割当アドレスを旧アドレスとする。上記各変数のデータの再配置は、例えば、PLC20内の上記メモリについて旧アドレスから読み出したデータを新アドレスに書き込む処理である。   Each of the new variable address information and the previous variable address information has an allocation address to the memory in the PLC 20 corresponding to each variable. Here, for each variable, the allocation address in the new variable address information is a new address, and the allocation address in the previous variable address information is an old address. The rearrangement of the data of each variable is, for example, a process of writing data read from the old address to the new address for the memory in the PLC 20.

また、例えば、上記新規プログラムは、上記既存プログラムの更新版であり、該新規プログラムが作成されることで該既存プログラムは無くなる。つまり、新規プログラムが作成済みの状態では、既存プログラムは支援装置10には記憶されていない。但し、このとき、既存プログラムは、PLC20には記憶されており動作中かもしれない。そうであれば、PLC20側における各変数の格納アドレスは、実質的に上記前回変数アドレス情報に応じたものとなっていることになる。よって、上記旧アドレスからデータを読み出せば、各変数に応じた現状の正常なデータが取得できることになる。   Further, for example, the new program is an updated version of the existing program, and the existing program disappears when the new program is created. That is, in a state where a new program has been created, the existing program is not stored in the support device 10. However, at this time, the existing program is stored in the PLC 20 and may be operating. If so, the storage address of each variable on the PLC 20 side substantially corresponds to the previous variable address information. Therefore, if the data is read from the old address, the current normal data corresponding to each variable can be acquired.

また、PLC20は、例えば、記憶部61、制御部62等を有する。
記憶部61は、上記ダウンロード部56によりダウンロードされる上記コンパイル後の新規プログラムと上記キー情報とを記憶する。
Moreover, PLC20 has the memory | storage part 61, the control part 62, etc., for example.
The storage unit 61 stores the new program after compilation downloaded by the download unit 56 and the key information.

制御部62は、記憶部61に記憶された上記コンパイル後の新規プログラムを実行することで所定の制御を行う。
尚、PLC20に関しては、記憶部61に記憶されるプログラムに、キー情報が付与されている点を除けば、従来と同様と見做してよいので、これ以上は説明しない。
The control unit 62 performs predetermined control by executing the new program after compilation stored in the storage unit 61.
The PLC 20 may be regarded as the same as the conventional one except that the key information is added to the program stored in the storage unit 61, and will not be described further.

上述したように、本手法によれば、支援装置10側でオフライン状態で更新版プログラムの作成等を行う場合でも、現在のPLC20側のプログラムが、更新元のプログラムと同一であるか否かを、キー情報に基づいて判別できる。換言すれば、現在のPLC20側における各変数のメモリ割当てが、「前回変数アドレス情報」12と同一であることを、キー情報が一致することによって確認できる。キー情報が一致するならば、「前回変数アドレス情報」12に基づいてPLC20のメモリの各旧アドレスのデータを読み出して、このデータを新たな変数アドレス情報11に基づいて新アドレスに書き込むことで、各変数に係わるデータの移動を正常に行うことができる。つまり、割当アドレスが変わっても、データの引継ぎを正常に行えることになる。そして、更新版プログラムをPLC20にダウンロードして実行させることになる。   As described above, according to the present method, even when the update version program is created in the offline state on the support apparatus 10 side, it is determined whether or not the current program on the PLC 20 side is the same as the update source program. Can be determined based on the key information. In other words, it can be confirmed by matching the key information that the current memory allocation of each variable on the PLC 20 side is the same as the “previous variable address information” 12. If the key information matches, the data of each old address in the memory of the PLC 20 is read based on the “previous variable address information” 12 and this data is written to the new address based on the new variable address information 11. Data related to each variable can be moved normally. In other words, even if the assigned address changes, data transfer can be performed normally. Then, the updated version program is downloaded to the PLC 20 and executed.

そして、上記のように更新版プログラムの作成は、オフライン状態で行うことができるので、従って作成したプログラムの動作検証等も別環境などで行うことができる。よって、動作検証済みの更新版プログラムをPLC20にダウンロードすることができ、PLC20側で更新後の動作が異常になることを防止できる。   Since the update program can be created offline as described above, the operation verification of the created program can be performed in another environment. Therefore, an updated version program whose operation has been verified can be downloaded to the PLC 20, and it is possible to prevent the operation after the update from becoming abnormal on the PLC 20 side.

従来では、プログラム一致確認、プログラム編集、ダウンロード、データのバックアップおよびリストアといった一連の操作を、オンライン状態のまま継続して行う必要があった。この対して、本手法では上記のように、オンライン状態で既存プログラムの一致確認と既存プログラムに基づく更新版のプログラムの作成等の上記一連の処理を行わなくても、プログラム更新に伴う各変数の割当アドレスの変更に対応する変数データの再配置を正常に行うことができ、更にオフライン状態で別環境等で、プログラム編集や動作検証等を行うことができる。オフラインで更新版プログラムの動作検証を行った後に、その更新元のプログラムにて稼働中のPLC20に対して更新処理を行える。このように、PLC内のデータ更新を安全に行えるようになるとともに、エンジニアリングの効率化を図れるという効果を有する。   Conventionally, it has been necessary to continuously perform a series of operations such as program matching confirmation, program editing, downloading, data backup and restoration in an online state. On the other hand, in this method, as described above, each variable associated with the program update can be performed without performing the above-described series of processes such as confirmation of matching of the existing program and creation of an updated version program based on the existing program. The relocation of the variable data corresponding to the change of the assigned address can be normally performed, and further, the program editing and the operation verification can be performed in another environment or the like in the offline state. After the operation verification of the updated version program is performed offline, the update process can be performed on the PLC 20 that is operating in the update source program. As described above, the data in the PLC can be updated safely, and the efficiency of engineering can be improved.

尚、PLC20のプログラムの更新やそれに伴う変数データ再配置は、更新対象のPLCの稼動中に行われるが、ステップS3〜S6の処理中は、更新対象のPLC20の制御プログラム実行は中断している。   The program update of the PLC 20 and the accompanying variable data rearrangement are performed while the PLC to be updated is in operation, but the execution of the control program of the PLC 20 to be updated is interrupted during the processing of steps S3 to S6. .

10 支援装置
11 変数アドレス情報
12 前回変数アドレス情報
14 バックアップデータ
20 PLC(プログラマブルコントローラ)
30 データ再配置情報
31 変数名
32 旧アドレス
33 新アドレス
34 値
51 プログラム記憶部
52 コンパイラ部
53 新旧変数アドレス情報管理部
54 一致判定部
55 変数データ再配置部
56 ダウンロード部
57 プログラム作成支援部
61 記憶部
62 制御部
10 Support Device 11 Variable Address Information 12 Previous Variable Address Information 14 Backup Data 20 PLC (Programmable Controller)
30 data relocation information 31 variable name 32 old address 33 new address 34 value 51 program storage unit 52 compiler unit 53 old and new variable address information management unit 54 match determination unit 55 variable data relocation unit 56 download unit 57 program creation support unit 61 storage Unit 62 Control unit

Claims (8)

支援装置とプログラマブルコントローラを有するシステムであって、
前記支援装置は、
既存のプログラムに基づいて作成された任意の新規プログラムを記憶するプログラム記憶手段と、
前記新規プログラムをコンパイルする際に、該新規プログラムの各変数のメモリ割当情報を生成すると共に、ユニークなキー情報を生成するコンパイラ手段と、
前記既存プログラムに係わる変数アドレス情報を前回変数アドレス情報として退避させると共に、前記キー情報を付与したメモリ割当情報を新たな前記変数アドレス情報として記憶する新旧変数アドレス情報管理手段と、
前記プログラマブルコントローラ側で保持するキー情報が、前記前回変数アドレス情報に付与されているキー情報と一致するか否かを判定する一致判定手段と、
該一致判定手段により前記2つのキー情報が一致すると判定された場合に、前記新たな変数アドレス情報と前記前回変数アドレス情報とに基づいて、前記プログラマブルコントローラにおける前記各変数のデータを再配置する変数データ再配置手段と、
を有することを特徴とするプログラマブルコントローラシステム。
A system having a support device and a programmable controller,
The support device includes:
Program storage means for storing any new program created based on an existing program;
Compiler means for generating memory allocation information for each variable of the new program and generating unique key information when compiling the new program;
Variable address information related to the existing program is saved as previous variable address information, and memory allocation information to which the key information is added is stored as new variable address information.
Match determination means for determining whether the key information held on the programmable controller side matches the key information assigned to the previous variable address information;
A variable for rearranging the data of each variable in the programmable controller based on the new variable address information and the previous variable address information when the match determination means determines that the two key information matches. Data relocation means;
A programmable controller system comprising:
前記支援装置は、
前記一致判定手段により前記2つのキー情報が一致すると判定された場合に、前記コンパイル後の新規プログラムを前記生成したキー情報と共に前記プログラマブルコントローラにダウンロードして記憶させるダウンロード手段を更に有することを特徴とする請求項1記載のプログラマブルコントローラシステム。
The support device includes:
Downloading means for downloading and storing the compiled new program together with the generated key information in the programmable controller when the match determination means determines that the two key information matches. The programmable controller system according to claim 1.
前記支援装置は、前記既存のプログラムに基づく任意の新規プログラムの作成を支援するプログラム作成支援手段を更に有し、
該プログラム作成支援手段による新規プログラムの作成は、前記プログラマブルコントローラと接続していないオフライン状態で実施され、
前記一致判定手段の判定処理と前記変数データ再配置手段による前記各変数のデータを再配置する処理は、前記プログラマブルコントローラと接続したオンライン状態で実行されることを特徴とする請求項1または2記載のプログラマブルコントローラシステム。
The support apparatus further includes program creation support means for supporting creation of an arbitrary new program based on the existing program,
Creation of a new program by the program creation support means is performed in an offline state not connected to the programmable controller,
The determination process of the match determination unit and the process of rearranging the data of each variable by the variable data rearrangement unit are executed in an online state connected to the programmable controller. Programmable controller system.
前記新たな変数アドレス情報と前記前回変数アドレス情報は、何れも、各変数に応じた前記プログラマブルコントローラ内のメモリへの割当アドレスを有し、
前記各変数のデータの再配置は、前記各変数毎に、前記新たな変数アドレス情報における前記割当アドレスを新アドレス、前記前回変数アドレス情報における前記割当アドレスを旧アドレスとして、前記プログラマブルコントローラ内の前記メモリについて旧アドレスから読み出したデータを新アドレスに書き込む処理であることを特徴とする請求項1〜3の何れかに記載のプログラマブルコントローラシステム。
The new variable address information and the previous variable address information both have addresses assigned to the memory in the programmable controller according to each variable,
The rearrangement of the data of each variable is performed for each of the variables by setting the allocation address in the new variable address information as a new address and the allocation address in the previous variable address information as an old address. The programmable controller system according to any one of claims 1 to 3, wherein the memory is a process of writing data read from an old address to a new address.
前記新規プログラムは前記既存プログラムの更新版であり、該新規プログラムが作成されることで該既存プログラムは無くなることを特徴とする請求項1〜4の何れかに記載のプログラマブルコントローラシステム。   The programmable controller system according to claim 1, wherein the new program is an updated version of the existing program, and the existing program disappears when the new program is created. 前記プログラマブルコントローラは、
前記ダウンロード手段によりダウンロードされる前記コンパイル後の新規プログラムと前記キー情報とを記憶する記憶手段と、
該記憶手段に記憶された前記コンパイル後の新規プログラムを実行することで所定の制御を行う制御手段と、
を有することを特徴とする請求項2記載のプログラマブルコントローラシステム。
The programmable controller is
Storage means for storing the new program after compilation and the key information downloaded by the download means;
Control means for performing predetermined control by executing the new program after compilation stored in the storage means;
The programmable controller system according to claim 2, further comprising:
支援装置とプログラマブルコントローラを有するシステムにおける該支援装置であって、
既存のプログラムに基づいて作成された任意の新規プログラムを記憶するプログラム記憶手段と、
前記新規プログラムをコンパイルする際に、該新規プログラムの各変数のメモリ割当情報を生成すると共に、ユニークなキー情報を生成するコンパイラ手段と、
前記既存プログラムに係わる変数アドレス情報を前回変数アドレス情報として退避させると共に、前記キー情報を付与したメモリ割当情報を新たな前記変数アドレス情報として記憶する新旧変数アドレス情報管理手段と、
前記プログラマブルコントローラ側で保持するキー情報が、前記前回変数アドレス情報に付与されているキー情報と一致するか否かを判定する一致判定手段と。
該一致判定手段により前記2つのキー情報が一致すると判定された場合に、前記新たな変数アドレス情報と前記前回変数アドレス情報とに基づいて、前記プログラマブルコントローラにおける前記各変数のデータを再配置する変数データ再配置手段と、
を有することを特徴とするプログラマブルコントローラシステムの支援装置。
The support device in a system having a support device and a programmable controller,
Program storage means for storing any new program created based on an existing program;
Compiler means for generating memory allocation information for each variable of the new program and generating unique key information when compiling the new program;
Variable address information related to the existing program is saved as previous variable address information, and memory allocation information to which the key information is added is stored as new variable address information.
Match determination means for determining whether key information held on the programmable controller side matches key information assigned to the previous variable address information;
A variable for rearranging the data of each variable in the programmable controller based on the new variable address information and the previous variable address information when the match determination means determines that the two key information matches. Data relocation means;
An apparatus for supporting a programmable controller system, comprising:
支援装置とプログラマブルコントローラを有するシステムにおける該支援装置のコンピュータを、
既存のプログラムに基づいて作成された任意の新規プログラムを記憶するプログラム記憶手段と、
前記新規プログラムをコンパイルする際に、該新規プログラムの各変数のメモリ割当情報を生成すると共に、ユニークなキー情報を生成するコンパイラ手段と、
前記既存プログラムに係わる変数アドレス情報を前回変数アドレス情報として退避させると共に、前記キー情報を付与したメモリ割当情報を新たな前記変数アドレス情報として記憶する新旧変数アドレス情報管理手段と、
前記プログラマブルコントローラ側で保持するキー情報が、前記前回変数アドレス情報に付与されているキー情報と一致するか否かを判定する一致判定手段と。
該一致判定手段により前記2つのキー情報が一致すると判定された場合に、前記新たな変数アドレス情報と前記前回変数アドレス情報とに基づいて、前記プログラマブルコントローラにおける前記各変数のデータを再配置する変数データ再配置手段、
として機能させる為のプログラム。
A computer of the support device in a system having the support device and a programmable controller,
Program storage means for storing any new program created based on an existing program;
Compiler means for generating memory allocation information for each variable of the new program and generating unique key information when compiling the new program;
Variable address information related to the existing program is saved as previous variable address information, and memory allocation information to which the key information is added is stored as new variable address information.
Match determination means for determining whether key information held on the programmable controller side matches key information assigned to the previous variable address information;
A variable for rearranging the data of each variable in the programmable controller based on the new variable address information and the previous variable address information when the match determination means determines that the two key information matches. Data relocation means,
Program to function as.
JP2013149942A 2013-07-18 2013-07-18 Programmable controller system, its support device, program Active JP6205934B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013149942A JP6205934B2 (en) 2013-07-18 2013-07-18 Programmable controller system, its support device, program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013149942A JP6205934B2 (en) 2013-07-18 2013-07-18 Programmable controller system, its support device, program

Publications (2)

Publication Number Publication Date
JP2015022511A true JP2015022511A (en) 2015-02-02
JP6205934B2 JP6205934B2 (en) 2017-10-04

Family

ID=52486909

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013149942A Active JP6205934B2 (en) 2013-07-18 2013-07-18 Programmable controller system, its support device, program

Country Status (1)

Country Link
JP (1) JP6205934B2 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6452924B1 (en) * 2018-05-11 2019-01-16 三菱電機株式会社 Compiler and programming support device
JP2019075098A (en) * 2017-09-13 2019-05-16 フィッシャー−ローズマウント システムズ,インコーポレイテッド Assistant application for modular control system
JP7130178B1 (en) * 2022-02-10 2022-09-02 三菱電機株式会社 Programmable controller system, development support device, memory allocation method and program

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001255913A (en) * 2000-03-14 2001-09-21 Fuji Electric Co Ltd Device for supporting programmable controller
JP2008282362A (en) * 2007-05-14 2008-11-20 Keyence Corp Program editing support device, computer program, program editing support method, and plc system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001255913A (en) * 2000-03-14 2001-09-21 Fuji Electric Co Ltd Device for supporting programmable controller
JP2008282362A (en) * 2007-05-14 2008-11-20 Keyence Corp Program editing support device, computer program, program editing support method, and plc system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019075098A (en) * 2017-09-13 2019-05-16 フィッシャー−ローズマウント システムズ,インコーポレイテッド Assistant application for modular control system
JP7398189B2 (en) 2017-09-13 2023-12-14 フィッシャー-ローズマウント システムズ,インコーポレイテッド Methods, computing devices and systems
JP6452924B1 (en) * 2018-05-11 2019-01-16 三菱電機株式会社 Compiler and programming support device
WO2019215919A1 (en) * 2018-05-11 2019-11-14 三菱電機株式会社 Compiler and programming assistance device
US10802808B2 (en) 2018-05-11 2020-10-13 Mitsubishi Electric Corporation Compiler and programming support device
JP7130178B1 (en) * 2022-02-10 2022-09-02 三菱電機株式会社 Programmable controller system, development support device, memory allocation method and program
WO2023152890A1 (en) * 2022-02-10 2023-08-17 三菱電機株式会社 Programmable controller system, development support device, memory allocation method, and program

Also Published As

Publication number Publication date
JP6205934B2 (en) 2017-10-04

Similar Documents

Publication Publication Date Title
JP5095013B2 (en) Programmable controller system and development system
JP4973867B2 (en) PLC control program development device and program
JP5583305B2 (en) Programmable logic controller, programming tool, and program parameter editing system
JP2008282362A (en) Program editing support device, computer program, program editing support method, and plc system
JP6786984B2 (en) Program processing equipment and programs
CN106970806B (en) System for updating a control program that is controlling an industrial process
US10295976B2 (en) System development device, system development method, and system development program
JP2013168031A (en) Programmable controller system, support device thereof, and program
JP6205934B2 (en) Programmable controller system, its support device, program
JP2016506559A (en) Method and device for changing objects in an HMI device
JP2007102625A (en) Method and device for updating control program of nc machine tool
JP5849592B2 (en) Programmable controller system, programming device thereof, programmable controller, program, and debugging method
JP6541902B1 (en) Program management system, programming support apparatus, program management method, and programming support program
JP6299095B2 (en) Shared data definition support system, its master device, local terminal, program
CN110647349B (en) Method for realizing continuous delivery of iOS APP
JP2016001376A (en) Programmable controller system, and support device of the same
JP6520241B2 (en) Control system, its management server device, support device
JP6455096B2 (en) Control system, its support device, programmable control device
JP2000284815A (en) Program generating device
JP5205988B2 (en) PLC global variable definition method
JP5978775B2 (en) PROGRAMMABLE CONTROLLER, ITS SUPPORT DEVICE, PROGRAM, PROGRAM TRANSFER METHOD
US20150346713A1 (en) Method for Processing an Automation Project Using a Plurality of Processing Stations
JP2010176594A (en) Source code version management program and source code version managing method
JP6287093B2 (en) Software development support apparatus, software development support method and program
JP2016151973A (en) Management control system, development support device therefor, and management device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160614

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170704

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20170721

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20170808

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20170821

R150 Certificate of patent or registration of utility model

Ref document number: 6205934

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250