JP6292096B2 - Programmable controller system and its support device - Google Patents

Programmable controller system and its support device Download PDF

Info

Publication number
JP6292096B2
JP6292096B2 JP2014197564A JP2014197564A JP6292096B2 JP 6292096 B2 JP6292096 B2 JP 6292096B2 JP 2014197564 A JP2014197564 A JP 2014197564A JP 2014197564 A JP2014197564 A JP 2014197564A JP 6292096 B2 JP6292096 B2 JP 6292096B2
Authority
JP
Japan
Prior art keywords
variable
common memory
data
task
shared
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.)
Active
Application number
JP2014197564A
Other languages
Japanese (ja)
Other versions
JP2015215865A (en
Inventor
吉原 大助
大助 吉原
純郎 北村
純郎 北村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
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 JP2014197564A priority Critical patent/JP6292096B2/en
Publication of JP2015215865A publication Critical patent/JP2015215865A/en
Application granted granted Critical
Publication of JP6292096B2 publication Critical patent/JP6292096B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Description

本発明は、複数のプログラマブルコントローラ間でのデータ連携をコモンメモリ経由で実施するシステムに関する。   The present invention relates to a system that performs data linkage between a plurality of programmable controllers via a common memory.

複数のプログラマブルコントローラ(PLC)間でデータを連携する方法として、コモンメモリ経由で他のPLCのデータを参照する方法がある。例えば、特許文献1において従来の技術として、この様なコモンメモリ方式が説明されている。そして、特許文献1の場合、連携するデータ量が多くなるとデータ転送処理の負荷が増加する。   As a method of linking data between a plurality of programmable controllers (PLCs), there is a method of referring to data of another PLC via a common memory. For example, Patent Document 1 describes such a common memory system as a conventional technique. In the case of Patent Document 1, if the amount of data to be linked increases, the load of data transfer processing increases.

この様な問題に対して、負荷を抑制する方式として、例えば特許文献1の発明では、常にすべてのコモンメモリのデータを転送するのではなく、必要な分だけ指定してデータ転送を実施する。すなわち、コモンメモリ方式により他装置とデータの授受を行うデータ伝送装置において、コモンメモリ上で他装置がデータを書き込むエリアのなかで、プログラマブルコントローラ側で必要なデータのみを提供するデータ提供手段を提供している。当該必要なデータのみ提供することは、プログラマブルコントローラがデータ伝送装置に対して、例えば「コモンメモリ25Aのアドレスm番地からnワード分を転送」等と通知することで実現される。   As a method for suppressing such a problem, for example, in the invention of Patent Document 1, data transfer is performed by designating only a necessary amount instead of always transferring all common memory data. In other words, in a data transmission device that exchanges data with other devices using a common memory system, a data providing means is provided that provides only necessary data on the programmable controller side in an area where other devices write data on the common memory. doing. Providing only the necessary data is realized when the programmable controller notifies the data transmission device, for example, “transfers n words from the address m of the common memory 25A”.

特開2002−297210号公報JP 2002-297210 A

上記特許文献1の発明では、上記必要なデータのコモンメモリ25A上での格納領域を、例えばユーザ等が認識していて予め設定する必要がある。
また、上記特許文献1の発明では、コモンメモリに係わるデータ転送の領域の指定の仕組みの提供だけであり、内部のデータの配置(後述する内部メモリへの変数のアドレス割り付け等)については、何等考慮されていない。また、別の観点から言えば、特許文献1の発明は、受信側としての動作に係わるものであり、送信側としての動作に係わるものではない。これらについて、以下、更に詳しく説明する。
In the invention of Patent Document 1, the storage area of the necessary data on the common memory 25A needs to be set in advance, for example, by the user or the like.
Further, the invention of the above-mentioned Patent Document 1 only provides a mechanism for designating a data transfer area related to the common memory, and what is the internal data arrangement (address allocation of variables to the internal memory, which will be described later)? Not considered. From another point of view, the invention of Patent Document 1 relates to the operation as the reception side, and does not relate to the operation as the transmission side. These will be described in more detail below.

まず、上記コモンメモリ方式により他装置と授受するデータは、複数のプログラマブルコントローラ間でのデータ連携を実施する為のデータであり、共有データ(共有変数に係わるデータ)等と呼ばれる。複数のプログラマブルコントローラが、それぞれ、他コントローラのコモンメモリの格納データ(共有データ)を利用する。   First, data exchanged with other devices by the common memory method is data for performing data linkage between a plurality of programmable controllers, and is referred to as shared data (data related to shared variables) or the like. Each of the plurality of programmable controllers uses data stored in common memory (shared data) of other controllers.

また、プログラマブルコントローラのアプリケーションで扱う各種変数データの全てが、共有データとなるわけではない。例えば各種変数が大別してローカル変数とグローバル変数に分類される例では、通常、グローバル変数が共有変数として扱われ、ローカル変数は共有変数とはならない。   Also, not all variable data handled by the programmable controller application is shared data. For example, in an example in which various variables are roughly classified into a local variable and a global variable, the global variable is usually treated as a shared variable, and the local variable is not a shared variable.

プログラマブルコントローラには、上記アプリケーション実行に伴って上記各種変数データが格納・更新される内部メモリが備えられており、通常、この内部メモリには上記各ローカル変数のデータと、上記各グローバル変数のデータとが、混在して格納される。これより、内部メモリから各グローバル変数のデータだけをコモンメモリに転送する必要がある。これは、上記特許文献1の構成の場合、グローバル変数に属する各変数のデータだけを、伝送装置用メモリエリア4内の送信データエリアに、転送して格納させる必要があることになる。   The programmable controller is provided with an internal memory in which the various variable data is stored / updated as the application is executed. Normally, the internal memory stores the data of the local variables and the data of the global variables. Are stored together. Thus, it is necessary to transfer only the data of each global variable from the internal memory to the common memory. In the case of the configuration of Patent Document 1, only the data of each variable belonging to the global variable needs to be transferred and stored in the transmission data area in the transmission device memory area 4.

従来では、上記動作を実現させる為に、予めユーザ等が上記内部メモリ上での各グローバル変数の格納アドレスを認識したうえで、手作業で、必要な設定やプログラマミング等を行う必要があり、非常に手間が掛かっていた。   Conventionally, in order to realize the above operation, it is necessary for a user or the like to recognize a storage address of each global variable in the internal memory in advance, and to perform necessary settings and programming manually, It was very troublesome.

近年ではPLCで扱うデータ量が飛躍的に増加しているため、共有データのアドレス割り付けを考慮しながらプログラミングすることは、ユーザのエンジニアリング作業量の増加、複雑化する課題がある。   In recent years, the amount of data handled by the PLC has increased dramatically, and programming with consideration of address assignment of shared data has the problem of increasing the amount of engineering work for the user and complicating it.

本発明の課題は、各々がコモンメモリを有する複数のプログラマブルコントローラがネットワークに接続されたシステムに関して、共有変数データのコモンメモリへの転送を容易に実現させるプログラマブルコントローラシステム等を、提供することである。   An object of the present invention is to provide a programmable controller system and the like that can easily realize transfer of shared variable data to a common memory with respect to a system in which a plurality of programmable controllers each having a common memory are connected to a network. .

本発明のプログラマブルコントローラシステムは、各々が内部メモリとコモンメモリを有する複数のプログラマブルコントローラがネットワークに接続されており、該複数のプログラマブルコントローラが前記コモンメモリの格納データを共有するシステムであって、下記の各構成を有する。   A programmable controller system of the present invention is a system in which a plurality of programmable controllers each having an internal memory and a common memory are connected to a network, and the plurality of programmable controllers share data stored in the common memory, It has each composition of.

まず、任意の前記プログラマブルコントローラに対応して、そのプログラムのソースコードを任意に作成させる支援装置を更に有する。
上記支援装置は、前記ソースコードをコンパイルするコンパイル手段を有する。
First, it further includes a support device that arbitrarily creates a source code of the program corresponding to the arbitrary programmable controller.
The support apparatus includes a compiling unit that compiles the source code.

そして、該コンパイル手段は、下記の各構成を有する。
・前記コンパイルの際に、前記ソースコードの各変数に前記内部メモリの任意のアドレスを割当てると共に、該内部メモリの割当アドレスとその変数が共有変数であるか否かを示す情報を含む変数情報を生成する変数情報作成手段;
・前記変数情報の各共有変数毎に、前記コモンメモリの任意のアドレスを割り当てて、該コモンメモリの割当アドレスを前記変数情報に前記内部メモリの割当アドレスに対応付けて追加記録するコモンメモリ割当手段。
The compiling unit has the following configurations.
Variable information including information indicating whether the internal memory allocation address and the variable is a shared variable, as well as assigning an arbitrary address of the internal memory to each variable of the source code at the time of the compilation Variable information creation means to be generated;
Common memory allocation means for allocating an arbitrary address of the common memory for each shared variable of the variable information, and additionally recording the allocated address of the common memory in association with the allocated address of the internal memory in the variable information .

また、前記プログラマブルコントローラは、前記変数情報に基づいて、前記内部メモリに格納される前記各変数のデータのうち、前記共有変数のデータを前記コモンメモリの割当アドレスへ転送・格納する転送処理手段を有する。   Further, the programmable controller includes transfer processing means for transferring and storing the data of the shared variable among the data of each variable stored in the internal memory based on the variable information to the allocated address of the common memory. Have.

本発明のプログラマブルコントローラシステム等によれば、各々がコモンメモリを有する複数のプログラマブルコントローラがネットワークに接続されたシステムに関して、各プログラマブルコントローラにおける共有変数データのコモンメモリへの転送を容易に実現させることができる。特に、共有変数データのコモンメモリへの転送処理の為のユーザの作業負担を軽減できる。この転送処理は、特に、共有変数データだけでなく他の変数データも混在して格納される内部メモリから、共有変数データをコモンメモリに転送させる処理である。   According to the programmable controller system and the like of the present invention, it is possible to easily realize transfer of shared variable data to a common memory in each programmable controller in a system in which a plurality of programmable controllers each having a common memory are connected to a network. it can. In particular, it is possible to reduce the work burden on the user for transferring shared variable data to the common memory. This transfer process is a process for transferring the shared variable data to the common memory from the internal memory in which not only the shared variable data but also other variable data are mixedly stored.

本例のプログラマブルコントローラ・システムの構成・機能図である。It is a structure and functional diagram of the programmable controller system of this example. (a)、(b)は、PLCプログラムに係わる各変数の定義情報の一例である。(A), (b) is an example of the definition information of each variable concerning a PLC program. 図2(b)の例に応じた、内部メモリへの変数割当て結果例である。It is an example of the variable allocation result to the internal memory according to the example of FIG. 図2(b)の例に応じた変数情報管理表の具体例である。It is a specific example of the variable information management table according to the example of FIG. コンパイラ部によるコモンメモリにおけるアドレス割当て処理の処理フローチャート図である。It is a process flowchart figure of the address allocation process in the common memory by a compiler part. 図4の例に対して図5の処理を実行した後の変数情報管理表の状態を示す図である。It is a figure which shows the state of the variable information management table after performing the process of FIG. 5 with respect to the example of FIG. コモンメモリに対する共有変数のアドレス割当ての具体例である。It is a specific example of address assignment of a shared variable for a common memory. (a)、(b)は、タスクに関する設定情報の一例を示す図である。(A), (b) is a figure which shows an example of the setting information regarding a task. 実施例2のプログラマブルコントローラ・システムの構成・機能図である。It is a structure and functional diagram of the programmable controller system of Example 2. 変数情報管理表(未完成)の具体例を示す図である。It is a figure which shows the specific example of a variable information management table | surface (incomplete). 実施例2のコンパイラ部によるコモンメモリのアドレス割当て処理の処理フローチャート図である。FIG. 10 is a process flowchart of common memory address assignment processing by a compiler unit according to the second embodiment. (a)〜(c)は、実施例2におけるコモンメモリのデータ格納例である。(A)-(c) is a data storage example of the common memory in Example 2. FIG. 図12との比較の為、実施例1のコモンメモリのデータ格納例を示す図である。FIG. 13 is a diagram illustrating a data storage example of the common memory according to the first embodiment for comparison with FIG. 12. 変数情報管理表(完成)の具体例を示す図である。It is a figure which shows the specific example of a variable information management table (completion). 共有変数コモンメモリ割付情報の具体例を示す図である。It is a figure which shows the specific example of shared variable common memory allocation information. 送信側の転送処理実行タイミングを示す図である。It is a figure which shows the transfer process execution timing of a transmission side.

以下、図面を参照して、本発明の実施の形態について説明する。
図1は、本例のプログラマブルコントローラ・システムの構成・機能図である。
本システムは、コンピュータ上で動作する開発環境を有する。開発環境とは、例えば図示の開発支援装置(ローダ)10である。開発支援装置10は、ユーザに任意のプログラムのソースコードを作成させる為の既存のインタフェース機能部11を有する。更に、ユーザが作成したソースコードをターゲット上で動作する機械語オブジェクトに変換するコンパイラ機能を有する。また、生成された機械語オブジェクトをターゲットに送信する通信機能を有する。尚、ターゲットとは、例えば、図示のPLC20である。
Embodiments of the present invention will be described below with reference to the drawings.
FIG. 1 is a configuration / function diagram of the programmable controller system of this example.
The system has a development environment that runs on a computer. The development environment is, for example, the illustrated development support apparatus (loader) 10. The development support apparatus 10 includes an existing interface function unit 11 for allowing a user to create a source code of an arbitrary program. Furthermore, it has a compiler function for converting the source code created by the user into a machine language object that operates on the target. Also, it has a communication function for transmitting the generated machine language object to the target. The target is, for example, the illustrated PLC 20.

尚、本説明では、プログラマブルコントローラを略してPLCと記す場合もあるものとする。
本例のPLCシステムは、各々がコモンメモリ21を有する複数のPLC(プログラマブルコントローラ)20と、このPLC20用のプログラムをユーザが任意に作成できるように支援する機能等を有する開発支援装置(ローダ)10を有する。本例のPLCシステムは、複数のプログラマブルコントローラ20間でのデータ連携をコモンメモリ21経由で実施する。換言すれば、本例のPLCシステムは、上記コモンメモリ方式のシステムである。つまり、複数のプログラマブルコントローラがコモンメモリ21の格納データを共有するシステムである。各コントローラは、他のコントローラのコモンメモリ21の格納データを参照する。上記の通り、例えば共有変数のデータが、コモンメモリ21に格納される。
In this description, the programmable controller may be abbreviated as PLC.
The PLC system of this example is a development support apparatus (loader) having a plurality of PLCs (programmable controllers) 20 each having a common memory 21 and a function for supporting a user to arbitrarily create a program for the PLC 20. 10 The PLC system of this example performs data linkage among the plurality of programmable controllers 20 via the common memory 21. In other words, the PLC system of this example is the above-mentioned common memory system. That is, this is a system in which a plurality of programmable controllers share data stored in the common memory 21. Each controller refers to data stored in the common memory 21 of another controller. As described above, for example, shared variable data is stored in the common memory 21.

上記PLC20用のプログラムは、PLCプログラム等と呼ぶが、上記のようにユーザが任意に作成できること等から、ユーザプログラム等と呼ばれる場合もある。また、当該ユーザプログラムの一例が、PLC20の制御プログラム等である。尚、制御プログラムは、PLCが不図示の各種制御対象機器を制御する為のプログラム等である。   The program for the PLC 20 is called a PLC program or the like, but may be called a user program or the like because the user can arbitrarily create it as described above. An example of the user program is a control program for the PLC 20. The control program is a program for the PLC to control various devices to be controlled (not shown).

開発支援装置(ローダ)10は、インタフェース機能部11、コンパイラ部12、通信機能部13等の各種機能部等を有し、また不図示の記憶部等を有する。また、ユーザに上記任意のユーザプログラム等を作成させるための画面等を表示するディスプレイや、キーボード/マウス等の入力装置等も有する。また、特に図示しないが、開発支援装置(ローダ)10は、CPU/MPU等の演算処理プロセッサも有している。   The development support apparatus (loader) 10 includes various function units such as an interface function unit 11, a compiler unit 12, and a communication function unit 13, and also includes a storage unit (not shown). It also has a display for displaying a screen for allowing the user to create the arbitrary user program and the like, an input device such as a keyboard / mouse, and the like. Although not particularly shown, the development support apparatus (loader) 10 also has an arithmetic processing processor such as a CPU / MPU.

また、上記不図示の記憶部は、例えばハードディスク、メモリ等である。この記憶部には、予め不図示のアプリケーションプログラムが記憶されている。上記不図示のCPU/MPU等が、このアプリケーションプログラムを読み出し・実行することにより、上記各種機能部11,12、13の機能等が実現される。   The storage unit (not shown) is, for example, a hard disk or a memory. In this storage unit, an application program (not shown) is stored in advance. When the CPU / MPU (not shown) reads and executes the application program, the functions of the various functional units 11, 12, 13 are realized.

また、不図示の記憶部には、図示の各種データ/プログラム等が記憶される。
すなわち、不図示の記憶部には、ユーザによって作成された任意のユーザプログラムのソースコード14、このソースコード14をコンパイラ部12によってコンパイルした結果である機械語オブジェクト16等が格納される。更に、不図示の記憶部には、図示のソースコード識別番号対応表15、変数情報管理表17、タスク情報18等が、記憶される。但し、ソースコード識別番号対応表15は、本手法には関係ないので、説明しない。
Also, various data / programs shown are stored in a storage unit (not shown).
That is, a storage unit (not shown) stores a source code 14 of an arbitrary user program created by a user, a machine language object 16 that is a result of compiling the source code 14 by the compiler unit 12, and the like. Further, a source code identification number correspondence table 15, a variable information management table 17, task information 18 and the like are stored in a storage unit (not shown). However, the source code identification number correspondence table 15 is not described because it is not related to this method.

インタフェース機能部11は、上記の通り、ユーザに任意のユーザプログラム(そのソースコード14)を作成させるように支援する機能部であり、既存の構成であるので、ここでは特に説明しない。尚、ソースコード14は、新規作成されたもの、あるいは既存のソースコードの更新/修正版等である。また、通信機能部13も、不図示の通信線を介してPLC20や他の開発支援装置10との通信を行う既存の機能部であるので、ここでは特に説明しない。   As described above, the interface function unit 11 is a function unit that assists the user in creating an arbitrary user program (its source code 14), and since it has an existing configuration, it is not particularly described here. The source code 14 is a newly created one or an updated / modified version of an existing source code. The communication function unit 13 is also an existing function unit that communicates with the PLC 20 and other development support apparatuses 10 via a communication line (not shown), and is not particularly described here.

コンパイラ部12は、基本的には、ユーザによって任意に作成されたユーザプログラム(そのソースコード14)を、コンパイルして機械語プログラム(機械語オブジェクト16)に変換する機能部である。その際に、ユーザプログラムの各変数に、PLC20の内部メモリ25の任意のアドレスを割り当てる。この様なコンパイル機能自体は既存の機能である。但し、本例のコンパイラ部12は、更に、図示の変数情報管理表17等を生成する処理等も行う。詳しくは後述する。   The compiler unit 12 is basically a functional unit that compiles a user program (its source code 14) arbitrarily created by the user and converts it into a machine language program (machine language object 16). At that time, an arbitrary address of the internal memory 25 of the PLC 20 is assigned to each variable of the user program. Such a compilation function itself is an existing function. However, the compiler unit 12 of this example also performs processing for generating the illustrated variable information management table 17 and the like. Details will be described later.

尚、上記機械語オブジェクト16は、上記通信機能部13によってPLC20にダウンロードされる。PLC20は、このダウンロードされた機械語プログラムを、図示の機械語オブジェクト27として記憶する。尚、通信機能部13によってPLC20にダウンロードされるプログラム/データは、後述するように、機械語オブジェクト16に限らない。   The machine language object 16 is downloaded to the PLC 20 by the communication function unit 13. The PLC 20 stores the downloaded machine language program as a machine language object 27 shown in the figure. The program / data downloaded to the PLC 20 by the communication function unit 13 is not limited to the machine language object 16 as will be described later.

PLC20は、内部メモリ25とコモンメモリ21を備えるプログラマブルコントローラである。内部メモリ25は、ユーザプログラム(機械語オブジェクト27)の実行に伴ってその各変数のデータが格納・更新されるメモリであり、プログラマブルコントローラの一般的な構成である。そして、本例のPLC20は、更にコモンメモリ21も備える。コモンメモリ21には、複数のPLC20で共有するデータが格納されるものであり、共有変数のデータが格納されるものと言える。   The PLC 20 is a programmable controller including an internal memory 25 and a common memory 21. The internal memory 25 is a memory in which data of each variable is stored / updated as the user program (machine language object 27) is executed, and has a general configuration of a programmable controller. The PLC 20 of this example further includes a common memory 21. The common memory 21 stores data shared by a plurality of PLCs 20, and can be said to store shared variable data.

これより、内部メモリ25に格納される各変数のデータのなかで共有変数のデータをコモンメモリ21に転送して格納する必要がある。本手法では、この様な処理の為のユーザの作業負担を、軽減できることになる。詳しくは後述する。尚、これは、送信側としての処理であり、受信側としての処理については、必ずしもコモンメモリ21から内部メモリ25へデータ転送する必要はなく、コモンメモリ21の格納データを直接参照するようにしてもよい。尚、受信側としての処理では、コモンメモリ21における他コントローラ20のデータを、参照することになる。   Accordingly, it is necessary to transfer the shared variable data to the common memory 21 among the data of each variable stored in the internal memory 25 and store it therein. With this method, the work burden on the user for such processing can be reduced. Details will be described later. Note that this is processing on the transmission side, and it is not always necessary to transfer data from the common memory 21 to the internal memory 25 for the processing on the reception side, and the stored data in the common memory 21 is referred to directly. Also good. In the processing on the receiving side, the data of the other controller 20 in the common memory 21 is referred to.

PLC20は、プログラム実行管理機能部23、通信機能部22、転送処理部24等の各種機能部を有する。また、特に図示しないが、PLC20は、図示の各メモリ25,21以外の不図示の記憶部や、不図示のCPU/MPU等の演算処理プロセッサも有している。尚、逐一述べないが、開発支援装置10との通信処理は、図示の通信機能部22と、開発支援装置10の通信機能部13とによって行われる。   The PLC 20 includes various function units such as a program execution management function unit 23, a communication function unit 22, and a transfer processing unit 24. Although not particularly illustrated, the PLC 20 includes a storage unit (not illustrated) other than the illustrated memories 25 and 21 and an arithmetic processing processor such as a CPU / MPU (not illustrated). Although not described one by one, communication processing with the development support apparatus 10 is performed by the communication function unit 22 illustrated and the communication function unit 13 of the development support apparatus 10.

不図示の記憶部には、予め不図示のアプリケーションプログラムが記憶されている。上記CPU/MPU等が、このアプリケーションプログラムを読み出し・実行することにより、上記各種機能部22,23,24の機能処理が実現される。   An application program (not shown) is stored in advance in a storage unit (not shown). The CPU / MPU or the like reads out and executes the application program, thereby realizing the functional processing of the various functional units 22, 23, and 24.

通信機能部22は、上記開発支援装置10との通信を行って、例えば上記ダウンロードされる機械語オブジェクト16の受信を行い、これを図示の機械語オブジェクト27として上記不図示の記憶部に記憶する。   The communication function unit 22 communicates with the development support apparatus 10 to receive, for example, the downloaded machine language object 16 and stores it in the storage unit (not shown) as the machine language object 27 shown. .

PLC20では、プログラム実行管理機能部23が、機械語オブジェクト27を実行することで、例えば制御対象の各種機器を制御する。ここで、この機械語オブジェクト27の実行に伴って、内部メモリ25の各変数のデータが更新される。つまり、上記コンパイルの際に各変数には内部メモリ25における任意の記憶領域が割り当てられており、機械語オブジェクト27の実行に伴って、これら各割当領域の格納データが更新される場合があることになる。そして、共有変数に係わる格納データについては、コモンメモリ21にデータ転送して、コモンメモリ21の格納データも更新させる必要がある。これより、他のコントローラ20も、更新後のデータを参照/利用できることになる。   In the PLC 20, the program execution management function unit 23 controls the various devices to be controlled by executing the machine language object 27, for example. Here, as the machine language object 27 is executed, the data of each variable in the internal memory 25 is updated. That is, an arbitrary storage area in the internal memory 25 is allocated to each variable at the time of the above compilation, and the storage data of each allocation area may be updated as the machine language object 27 is executed. become. The stored data related to the shared variable needs to be transferred to the common memory 21 to update the stored data in the common memory 21. As a result, the other controllers 20 can refer to / use the updated data.

ここで、本例のPLC20は、転送処理部24を備える。転送処理部24は、図示の変数情報管理表26等を用いて、内部メモリ25の格納データのなかで、コモンメモリ21に転送・格納させるべきデータを判別して、これをコモンメモリ21に転送する。これについては後述するが、変数情報管理表26は、上記開発支援装置10で生成された変数情報管理表17が、PLC20にダウンロードされて記憶されたものである。尚、機械語オブジェクト27や変数情報管理表26は、不図示の記憶部に記憶される。   Here, the PLC 20 of this example includes a transfer processing unit 24. The transfer processing unit 24 uses the illustrated variable information management table 26 and the like to determine data to be transferred / stored in the common memory 21 among the stored data in the internal memory 25, and transfers this to the common memory 21. To do. As will be described later, the variable information management table 26 is obtained by downloading and storing the variable information management table 17 generated by the development support apparatus 10 into the PLC 20. The machine language object 27 and the variable information management table 26 are stored in a storage unit (not shown).

ここで、以下、上記コンパイラ部12による上記変数情報管理表17の生成処理について説明する。これについて、まず、この生成処理を実現する為に事前に行うことについて説明する。   Here, processing for generating the variable information management table 17 by the compiler unit 12 will be described below. Regarding this, first, what is performed in advance to realize this generation processing will be described.

まず、一例としては、ユーザが、ソースコード14の変数宣言部分において、例えば図2(a)に示すような記述を行っておく。すなわち、各変数毎に、図示のように変数名、型、アドレス等を定義すると共に、更に各種属性情報を定義する。尚、アドレスは、PLC20の内部メモリ25において当該変数のデータ格納領域として割当てるアドレスである。但し、アドレスは、ユーザが指定する方法に限らず、コンパイラ部12が自動的に割り当てる方式であってもよい。   First, as an example, the user makes a description as shown in FIG. 2A in the variable declaration part of the source code 14, for example. That is, for each variable, a variable name, type, address, etc. are defined as shown, and various attribute information is further defined. The address is an address assigned as a data storage area for the variable in the internal memory 25 of the PLC 20. However, the address is not limited to the method specified by the user, but may be a method in which the compiler unit 12 automatically assigns the address.

そして、上記各種属性情報として、図示の例では一例として「保持」や「共有」を示してある。このうち、「保持」は既存の属性情報であり本手法には特に関係しないので、説明しないものとする。「共有」は、本手法の為に新たに追加される属性情報であり、その変数が共有変数(共有データに係わる変数)であるか否かを示すフラグ等である。ここでは、フラグONの場合には共有変数であり、フラグOFFの場合には共有変数ではないことを意味するものとするが、この例に限らない。   As the various attribute information, “hold” and “share” are shown as an example in the illustrated example. Of these, “hold” is existing attribute information and is not particularly relevant to the present method, and therefore will not be described. “Shared” is attribute information newly added for this method, and is a flag or the like indicating whether or not the variable is a shared variable (a variable related to shared data). Here, when the flag is ON, it is a shared variable, and when the flag is OFF, it means that it is not a shared variable. However, the present invention is not limited to this example.

あるいは、上記図2(a)の例に限らず、ソースコード14とは別に、例えば図2(b)に示すような共有変数宣言情報30が、事前にユーザによって任意に作成されていてもよい。共有変数宣言情報30は、各ユーザプログラムで使用する各変数に関して所定の設定が行われたものであり、図示の例では、プログラム名31、変数名32、データ型33、共有変数34から成る。   Alternatively, the shared variable declaration information 30 as shown in FIG. 2B, for example, may be arbitrarily created in advance by the user in addition to the example of FIG. . The shared variable declaration information 30 is set for each variable used in each user program. In the illustrated example, the shared variable declaration information 30 includes a program name 31, a variable name 32, a data type 33, and a shared variable 34.

プログラム名31はユーザプログラムの識別情報(名称等)であり、このユーザプログラムで使用する変数の名称等が変数名32に設定される。また、変数名32の変数のデータ型等がデータ型33に設定されると共に、この変数が共有変数であるか否かが共有変数34に設定される。尚、共有変数とは、複数のPLC20で共有する変数であり、上記の通り一例は例えばグローバル変数である。そして、共有変数データは、コモンメモリ21に格納すべき変数データであるとも言える。   The program name 31 is identification information (name etc.) of the user program, and the variable name used in the user program is set in the variable name 32. In addition, the data type of the variable of the variable name 32 is set to the data type 33, and whether or not this variable is a shared variable is set to the shared variable 34. The shared variable is a variable shared by a plurality of PLCs 20, and an example is a global variable as described above. The shared variable data can be said to be variable data to be stored in the common memory 21.

尚、図では、図示の「共有する」が、共有変数であることを意味している。
一例としては、例えばディスプレイ上に図2(b)に示す共有変数宣言情報30の入力画面が表示され(但し、図示の各種データは未だ設定されていない)、この入力画面上でユーザが所望のデータを入力することで、共有変数宣言情報30が作成される。
In the figure, “shared” in the figure means a shared variable.
As an example, for example, an input screen of the shared variable declaration information 30 shown in FIG. 2B is displayed on the display (however, the various data shown in the figure are not yet set), and the user can select the desired screen on this input screen. By inputting data, shared variable declaration information 30 is created.

ここで、上記コンパイラ部12は、上記ソースコード14のコンパイル処理の際に、上記変数宣言された各変数に対して、内部メモリ25内の任意の記憶領域を割り当てる。この処理自体は既存の処理であり、例えば図2(b)の例に応じた内部メモリ25における変数割当て結果例を図3に示すが、これについては特に説明しない。   Here, the compiler unit 12 allocates an arbitrary storage area in the internal memory 25 to each variable declared variable when the source code 14 is compiled. This process itself is an existing process. For example, FIG. 3 shows an example of a variable assignment result in the internal memory 25 corresponding to the example of FIG. 2B, but this is not particularly described.

コンパイラ部12は、更に、上記変数宣言/共有変数宣言情報30や、メモリ割当て結果等を用いて、変数情報管理表17を生成する。
図4に、上記図2(b)の共有変数宣言情報30の例に応じた変数情報管理表17の例を示す。但し、この状態では変数情報管理表17は未だ完成していない。
The compiler unit 12 further generates the variable information management table 17 using the variable declaration / shared variable declaration information 30 and the memory allocation result.
FIG. 4 shows an example of the variable information management table 17 corresponding to the example of the shared variable declaration information 30 in FIG. However, in this state, the variable information management table 17 is not yet completed.

図示の例では、変数情報管理表17は、管理ID41、プログラム名42、変数名43、データ型44、「PLC内メモリのアドレス」45、共有変数46、「コモンメモリへのデータ格納先アドレス」47等の各データ項目を有する。尚、これらのうち、共有変数46及び「コモンメモリへのデータ格納先アドレス」47以外のデータ項目は、既存のデータ項目と見做しても良い。つまり、従来でも変数情報管理表17の一部は作成していたと見做しても構わない。   In the illustrated example, the variable information management table 17 includes a management ID 41, a program name 42, a variable name 43, a data type 44, an “address in the PLC memory” 45, a shared variable 46, and a “data storage destination address in the common memory”. Each data item such as 47 is included. Of these, data items other than the shared variable 46 and the “data storage destination address in the common memory” 47 may be regarded as existing data items. That is, it may be considered that a part of the variable information management table 17 has been created conventionally.

上記変数情報管理表17の作成方法は、例えば上記共有変数宣言情報30に基づいて、各変数の変数名32、データ型33、共有変数34を、変数名43、データ型44、共有変数46に格納すると共に、その変数に割り当てた内部メモリ25の記憶領域のアドレスを「PLC内メモリのアドレス」45に格納する。つまり、「PLC内メモリのアドレス」45は、変数名43の変数の内部メモリ25における割当アドレスである。また、変数名43の変数を使用するプログラムのプログラム名31が、プログラム名42に格納される。   The variable information management table 17 is created based on, for example, the shared variable declaration information 30, by changing the variable name 32, data type 33, and shared variable 34 of each variable to variable name 43, data type 44, and shared variable 46. The address of the storage area of the internal memory 25 assigned to the variable is stored in “PLC memory address” 45. That is, “PLC memory address” 45 is an allocation address in the internal memory 25 of the variable of the variable name 43. The program name 31 of the program that uses the variable of the variable name 43 is stored in the program name 42.

尚、管理ID41は、上記変数情報管理表17の各レコードに任意に割り当てられる識別番号等であり、例えばシリアル番号等である。
以上のように、「コモンメモリへのデータ格納先アドレス」47以外のデータ項目については、上記共有変数宣言情報30やアドレス割当結果等に基づいて、上記各データが格納される。尚、逐一述べないが、この様なコンパイル処理に係わる各種処理は、基本的に、コンパイラ部12が実行するものである。そして、コンパイラ部12は、更に、「コモンメモリへのデータ格納先アドレス」47についてもデータ登録する。つまり、他のPLC20とデータを共有する変数(共有変数)については、コモンメモリ21についても、データ格納領域を割り当てる。この処理の一例を、図5に示す。
The management ID 41 is an identification number arbitrarily assigned to each record of the variable information management table 17, for example, a serial number.
As described above, the data items other than the “data storage destination address in the common memory” 47 are stored based on the shared variable declaration information 30, the address allocation result, and the like. Although not described one by one, the various processes related to such a compile process are basically executed by the compiler unit 12. Then, the compiler unit 12 further registers data for the “data storage destination address in the common memory” 47. In other words, a data storage area is also assigned to the common memory 21 for variables that share data with other PLCs 20 (shared variables). An example of this processing is shown in FIG.

図5は、コンパイラ部12によるコモンメモリにおけるアドレス割当て処理の処理フローチャート図である。
また、図6には、上記図4の例に対して図5の処理を実行した後の変数情報管理表17の状態を示す。
FIG. 5 is a processing flowchart of address allocation processing in the common memory by the compiler unit 12.
FIG. 6 shows the state of the variable information management table 17 after the processing of FIG. 5 is performed on the example of FIG.

図5の処理例では、上記変数情報管理表17を用いて、その各レコードを順次処理対象としてステップS13〜S17の処理を繰り返し実行する。最初の処理対象は、例えば、変数情報管理表17の先頭レコード(管理ID41=‘1’のレコード)に設定する(ステップS11)。更に、“割付先コモンメモリ”の初期値を設定する。これは、例えば、コモンメモリ21の該当記憶領域の先頭アドレス(本例では‘0’とする)が、予め登録されており、これを“割付先コモンメモリ”の初期値に設定する(ステップS12)。   In the processing example of FIG. 5, using the variable information management table 17, the processes of steps S <b> 13 to S <b> 17 are repeatedly executed with each record being sequentially processed. The first processing target is set, for example, in the first record (management ID 41 = “1” record) in the variable information management table 17 (step S11). Furthermore, an initial value of “allocation destination common memory” is set. For example, the head address (in this example, “0”) of the corresponding storage area of the common memory 21 is registered in advance, and this is set as the initial value of “allocation destination common memory” (step S12). ).

尚、上記コモンメモリ21の該当記憶領域とは、例えば特許文献1の図3に示す「自装置データ」の領域である。
そして、上記処理対象レコードに基づいて、まず、当該処理対象の変数が、共有変数であるか否かを、共有変数46から判定する(ステップS13)。そして、共有変数である場合には(ステップS13,YES)、処理対象レコードの「コモンメモリへのデータ格納先アドレス」47に、現在の“割付先コモンメモリ”の値を格納する(ステップS14)。本例では上記先頭レコードに関してはステップS13の判定がYESとなり、更に、上記の通り“割付先コモンメモリ”の初期値は‘0’であるので、図6に示すように先頭レコードの「コモンメモリへのデータ格納先アドレス」47には‘0’が格納されることになる。
The corresponding storage area of the common memory 21 is, for example, an “own device data” area shown in FIG.
Then, based on the processing target record, first, it is determined from the shared variable 46 whether the processing target variable is a shared variable (step S13). If it is a shared variable (YES in step S13), the current “assignment destination common memory” value is stored in “data storage destination address in common memory” 47 of the processing target record (step S14). . In this example, the determination in step S13 is YES for the first record, and since the initial value of “allocation destination common memory” is “0” as described above, the “common memory” of the first record as shown in FIG. "0" is stored in the data storage destination address "47".

そして、“割付先コモンメモリ”の値を更新する。これは、まず処理対象レコードのデータ型43から、当該データ型に応じたサイズを求めて、このサイズを現在の“割付先コモンメモリ”に加算する(ステップS15)。つまり、
“割付先コモンメモリ”=“割付先コモンメモリ”+サイズ
によって、“割付先コモンメモリ”の値を更新する。
Then, the value of “allocation destination common memory” is updated. First, a size corresponding to the data type is obtained from the data type 43 of the processing target record, and this size is added to the current “allocation destination common memory” (step S15). That means
Update "assignment destination common memory" value according to "assignment destination common memory" = "assignment destination common memory" + size.

尚、特に図示しないが、予め、各データ型毎に、それに対応するサイズが登録されている。
そして、次の処理対象レコードを決定して(ステップS16)、ステップS13に戻る。但し、次の処理対象レコードが無い場合には(ステップS17,NO)、本処理を終了する。尚、上記ステップS13の判定がNOの場合には、そのままステップS16の処理へ移行する。
Although not particularly illustrated, a size corresponding to each data type is registered in advance.
Then, the next processing target record is determined (step S16), and the process returns to step S13. However, when there is no next processing target record (step S17, NO), this processing ends. If the determination in step S13 is NO, the process proceeds to step S16 as it is.

上記図5の処理によって変数情報管理表17は例えば図6に示す状態となり、以って変数情報管理表17が完成したことになる。
尚、図6に示す例の場合、コモンメモリ21における各共有変数のアドレス割当て結果は、例えば図7に示すようになる。図6の例の場合、図7に示すように、変数1、変数3、変数5、変数7について、それぞれ、コモンメモリ21内の所定のデータ格納領域が、割付けられることになる。そして、これら各変数に係わる内部メモリ25の格納データが、コモンメモリ21内の所定のデータ格納領域に、転送・格納されることになる。その一方で、変数2、変数4、変数6、変数8に関しては、コモンメモリ21への割当ては行われない。変数2、変数4、変数6、変数8は、共有変数ではないので(例えばローカル変数であるので)、これで正しいことになる。
The variable information management table 17 is brought into the state shown in FIG. 6, for example, by the processing of FIG. 5, and thus the variable information management table 17 is completed.
In the case of the example shown in FIG. 6, the address allocation result of each shared variable in the common memory 21 is as shown in FIG. In the case of the example of FIG. 6, as shown in FIG. 7, predetermined data storage areas in the common memory 21 are assigned to the variables 1, 3, 5, and 7, respectively. Then, the data stored in the internal memory 25 relating to these variables is transferred and stored in a predetermined data storage area in the common memory 21. On the other hand, the variable 2, the variable 4, the variable 6, and the variable 8 are not assigned to the common memory 21. Since the variable 2, the variable 4, the variable 6, and the variable 8 are not shared variables (because they are local variables, for example), they are correct.

そして、開発支援装置10は、例えば、完成した変数情報管理表17を、PLC20にダウンロードして、上記変数情報管理表26として記憶させる。PLC20側では、転送処理部24が、例えば変数情報管理表26に基づいて、内部メモリ25の各変数データのうち、共有変数に係わるデータのみを、コモンメモリ21内の所定のデータ格納領域に、転送・格納させる。図6の例の場合、例えば変数7に関しては、内部メモリ25のアドレス‘7’の格納データを、コモンメモリ21のアドレス‘3’へ転送・格納することになる。   Then, for example, the development support apparatus 10 downloads the completed variable information management table 17 to the PLC 20 and stores it as the variable information management table 26. On the PLC 20 side, the transfer processing unit 24, for example, based on the variable information management table 26, only the data related to the shared variable among the variable data in the internal memory 25 is stored in a predetermined data storage area in the common memory 21. Transfer and store. In the case of the example of FIG. 6, for example, with respect to the variable 7, the stored data at the address “7” in the internal memory 25 is transferred and stored to the address “3” in the common memory 21.

尚、上記の例に限らない。例えば、変数情報管理表17をPLC20にダウンロードする代わりに、変数情報管理表17に基づいて転送用プログラムを生成して、この転送用プログラムをPLC20にダウンロードするようにしてもよい。この例の場合、PLC20側では、転送処理部24は、この転送用プログラムを実行することで、上記コモンメモリ21への変数データ転送処理を実現する。   In addition, it is not restricted to said example. For example, instead of downloading the variable information management table 17 to the PLC 20, a transfer program may be generated based on the variable information management table 17 and the transfer program may be downloaded to the PLC 20. In the case of this example, on the PLC 20 side, the transfer processing unit 24 implements the variable data transfer process to the common memory 21 by executing the transfer program.

転送用プログラムは、例えば予め登録された所定の雛形に、上記変数情報管理表17の所定データを当て嵌めることで、生成される。所定の雛形とは、例えば下記のものである。   The transfer program is generated, for example, by fitting predetermined data of the variable information management table 17 to a predetermined template registered in advance. The predetermined template is, for example, the following.

%MW16.* := 変数名
変数情報管理表17の各レコードのなかで共有変数に係わる各レコード毎に、その変数名43を上記雛形の変数名に当て嵌め、その「コモンメモリへのデータ格納先アドレス」47を上記雛形の*に当て嵌めることで、転送用プログラムが生成される。これより、この例の場合、図6に示す例に応じて、例えば下記のような転送用プログラムが生成されることになる。
% MW16. *: = Variable name For each record related to the shared variable in each record of the variable information management table 17, the variable name 43 is applied to the variable name of the above template, and the "data storage destination address in the common memory" A transfer program is generated by fitting 47 to * of the above template. Thus, in the case of this example, the following transfer program is generated according to the example shown in FIG.

%MW16.0 := 変数1
%MW16.1 := 変数3
%MW16.2 := 変数5
%MD16.3 := 変数7
尚、この例の場合、PLC20側では、各変数の内部メモリ25における割当アドレスは、変数名が分かれば判別できるものとする。
% MW 16.0: = variable 1
% MW16.1: = variable 3
% MW16.2: = variable 5
% MD16.3: = variable 7
In the case of this example, on the PLC 20 side, the allocation address of each variable in the internal memory 25 can be determined if the variable name is known.

既存の機能により、コモンメモリ21の各格納データは、制御LANの機能によって、制御LAN1に接続した他のPLC20でも参照することができる。これに関して、複数のPLC20間でデータ連携する仕組みについては、一般的なことであり、例えば上記特許文献1等に開示されているので、ここでは特に説明しない。但し、簡単に説明するならば、例えば上記コモンメモリ21のアドレス‘3’の格納データは、制御LAN1を介して他のPLC20へ転送されて、当該他のPLC20のコモンメモリ21に格納される。格納位置は、通常、同じアドレス、すなわちアドレス‘3’となるようにしている。   With the existing function, each stored data of the common memory 21 can be referred to by other PLCs 20 connected to the control LAN 1 by the function of the control LAN. In this regard, a mechanism for data cooperation between a plurality of PLCs 20 is general, and is disclosed in, for example, the above-described Patent Document 1 and the like, and thus will not be particularly described here. However, to explain briefly, for example, the stored data of the address “3” of the common memory 21 is transferred to another PLC 20 via the control LAN 1 and stored in the common memory 21 of the other PLC 20. The storage location is normally set to the same address, that is, address '3'.

ここで、他のPLC20側では、例えば、上記コモンメモリ21のアドレス‘3’の格納データが、変数7に係わるデータであることを認識する必要がある。その為に、開発支援装置10は、上記生成した変数情報管理表17あるいは転送用プログラムを、他の開発支援装置10にも送信するようにしてもよい。尚、開発支援装置10は、例えば各PLC20毎に対応させて設けられていてもよく、図1では図示のPLC1に対応する開発支援装置10のみ示すが、他にも例えば図示のPLC2に対応する不図示の開発支援装置10も設けられていてもよい。そして、例えば、各開発支援装置10同士は、不図示のネットワークを介して、通信可能な構成となっている。   Here, on the other PLC 20 side, for example, it is necessary to recognize that the stored data at the address “3” of the common memory 21 is data related to the variable 7. For this purpose, the development support apparatus 10 may transmit the generated variable information management table 17 or the transfer program to other development support apparatuses 10. The development support apparatus 10 may be provided corresponding to each PLC 20, for example. FIG. 1 shows only the development support apparatus 10 corresponding to the illustrated PLC 1, but also corresponds to, for example, the illustrated PLC 2. A development support apparatus 10 (not shown) may also be provided. For example, the development support apparatuses 10 can communicate with each other via a network (not shown).

上記生成した変数情報管理表17あるいは転送用プログラムを受信した他の開発支援装置10側では、例えば、これらの受信した情報/プログラムを参照することで、各共有変数のコモンメモリ21上の割当アドレスを認識できるので、これに基づいて自己のユーザプログラムを作成できる。例えば変数7のデータを参照・利用するユーザプログラムを作成する場合、コモンメモリ21におけるアクセス先アドレスを上記アドレス‘3’に設定できることになる。   On the other side of the development support apparatus 10 that has received the generated variable information management table 17 or the transfer program, for example, by referring to the received information / program, the allocation address of each shared variable on the common memory 21 is assigned. Therefore, the user program can be created based on this. For example, when creating a user program that references / uses the data of the variable 7, the access destination address in the common memory 21 can be set to the address "3".

但し、この例に限らない。例えば図1に示す開発支援装置10は、図示のPLC1だけでなくPLC2のプログラムも作成させるものであってもよい。つまり、任意の1台の開発支援装置10が、複数のPLC20に対応して設けられていても良い。   However, the present invention is not limited to this example. For example, the development support apparatus 10 shown in FIG. 1 may create not only the illustrated PLC 1 but also a PLC 2 program. That is, any one development support apparatus 10 may be provided corresponding to the plurality of PLCs 20.

また、上記転送処理部24によるデータ転送処理は、例えば任意のタスク実行完了毎に行うようにする。そして、その際、実行完了したタスクに係わるプログラムに係わる共有変数データのみを、転送対象とする。これによって、データ転送量を削減できる。この様な処理について、以下、説明する。   Further, the data transfer process by the transfer processing unit 24 is performed, for example, every time an arbitrary task execution is completed. At that time, only the shared variable data related to the program related to the completed task is set as the transfer target. Thereby, the data transfer amount can be reduced. Such processing will be described below.

まず、PLC20におけるタスク管理について、既存の一般的な方式について以下に説明する。
図8(a)、(b)に、タスクに関する設定情報の一例を示す。
First, an existing general method for task management in the PLC 20 will be described below.
FIGS. 8A and 8B show examples of setting information related to tasks.

例えば図8(a)に示すように、一般的に、タスクには、優先順位、タスクの種類(定周期、イベント、デフォルト)の設定がある。優先順位は、タスク間でどのタスクを優先して実行するかを指定する。タスクの種類が、定周期の場合、設定した周期で、タスクに登録されたプログラムを実行する。イベントの場合は、イベントとして登録された変数の立ち上がりで、タスクに登録されたプログラムを実行する。デフォルトは、一番低い優先度であり、他のタスクで実行するプログラムが存在しない場合に、登録されたプログラムを実行する。   For example, as shown in FIG. 8A, in general, a task has a priority order and a task type (fixed period, event, default). The priority order specifies which task is to be executed with priority among tasks. When the task type is a fixed cycle, the program registered in the task is executed at the set cycle. In the case of an event, the program registered in the task is executed at the rise of the variable registered as the event. The default is the lowest priority, and the registered program is executed when there is no program to be executed by another task.

図8(a)の例では、タスクが4つ設定されてある。タスク名の定周期1は、優先度1、定周期は200msでプログラムを実行する。イベント1は、優先度3、イベントで、FLGの値が、FLASEからTRUEに変更になった場合に、プログラムを実行する。   In the example of FIG. 8A, four tasks are set. The task name fixed cycle 1 is a priority 1 and the fixed cycle is 200 ms. Event 1 is a priority 3 event, and the program is executed when the FLG value is changed from FLASE to TRUE.

上記タスクの設定情報は、例えば開発支援装置10側でユーザによって任意に作成されて、PLC20に転送されて保持される。そして、PLC20側では、この設定情報に従って、各タスクに係わるプログラム等を実行する。   The task setting information is arbitrarily created by the user on the development support apparatus 10 side, for example, and transferred to the PLC 20 to be held. On the PLC 20 side, a program related to each task is executed in accordance with the setting information.

ここで、各タスクに対して、そのタスクに係わる任意のプログラムが、登録されている。その一例を図8(b)に示す。これは、例えば、開発支援装置10側でユーザによる任意の登録作業によって作成されるものである。   Here, for each task, an arbitrary program related to the task is registered. An example is shown in FIG. This is created, for example, by an arbitrary registration operation by the user on the development support apparatus 10 side.

ユーザは、例えば、任意のユーザプログラムを作成する毎に、このユーザプログラムを所望のタスクに関連付けて登録する。図8(b)の例では、タスク「定周期1」に関してはプログラム1とプログラム2とが登録されている。タスク「定周期2」に関しては、プログラム3が登録されている。タスク「デフォルト」に関しては、プログラム4が登録されている。タスク「イベント1」に関しては、プログラムは登録されていない。   For example, every time a user creates an arbitrary user program, the user registers the user program in association with a desired task. In the example of FIG. 8B, program 1 and program 2 are registered for the task “fixed period 1”. For the task “fixed period 2”, the program 3 is registered. For the task “default”, the program 4 is registered. No program is registered for the task “event 1”.

例えば図1に示すタスク情報18の一例が、上記図8(a)、(b)に示す情報である。そして、図1には示していないが、タスク情報18は、PLC20にダウンロードして保持させるようにしてもよい。   For example, an example of the task information 18 shown in FIG. 1 is the information shown in FIGS. 8 (a) and 8 (b). Then, although not shown in FIG. 1, the task information 18 may be downloaded and held in the PLC 20.

そして、転送処理部24は、上記変数情報管理表26等だけでなく、更に、上記タスク情報18も用いて、コモンメモリ21への変数データ転送処理を実行するようにしてもよい。これは、任意のタスクを実行完了する毎に、そのタスクに関連するプログラムを、上記タスク情報18を参照して判別する。そして、更に、変数情報管理表26を参照することで、このタスクに関連するプログラムに係わる共有変数を判別し、この共有変数の内部メモリ25における割当アドレスを判別する。これによって、上記実行完了したタスクに係わる共有変数のデータのみを、内部メモリ25からコモンメモリ21へ転送する。   The transfer processing unit 24 may execute variable data transfer processing to the common memory 21 by using not only the variable information management table 26 and the like but also the task information 18. Each time an execution of an arbitrary task is completed, a program related to the task is determined with reference to the task information 18. Further, by referring to the variable information management table 26, the shared variable related to the program related to this task is determined, and the allocation address of the shared variable in the internal memory 25 is determined. As a result, only the data of the shared variable related to the task that has been executed is transferred from the internal memory 25 to the common memory 21.

例えば、タスク「定周期2」を実行完了した場合には、図8(b)の例の場合、このタスクに関連するのはプログラム3である。よって、変数情報管理表26より、プログラム3に係わる共有変数は変数7であると判別できるので、変数7のデータのみを内部メモリ25からコモンメモリ21へ転送する。   For example, when the execution of the task “fixed period 2” is completed, the program 3 is related to this task in the example of FIG. Therefore, it can be determined from the variable information management table 26 that the shared variable related to the program 3 is the variable 7, so only the data of the variable 7 is transferred from the internal memory 25 to the common memory 21.

内部メモリ25における各変数のデータは、基本的に、その変数に係わるプログラムが実行されていないならば、変更されていないはずである。従って、上記例の場合、変数7以外の他の変数のデータは、変更されていないはずである。よって、これら他の変数のデータは、コモンメモリ21に転送する必要はないことになる。   Basically, the data of each variable in the internal memory 25 should not be changed unless the program related to the variable is executed. Therefore, in the above example, the data of variables other than the variable 7 should not be changed. Therefore, it is not necessary to transfer the data of these other variables to the common memory 21.

以上のことから、上記の例の場合、変数7のデータのみをコモンメモリ21へ転送するだけで、コモンメモリ21の格納データを最新の状態とすることができる。また、この例の場合、例えば、タスク「イベント1」を完了時には、コモンメモリ21へのデータ転送は、必要ないことになる。   From the above, in the case of the above example, the data stored in the common memory 21 can be updated by only transferring the data of the variable 7 to the common memory 21. In this example, for example, when the task “event 1” is completed, data transfer to the common memory 21 is not necessary.

この様に、必要最低限のデータ転送処理を行えるようにすることができ、データ転送に係わる処理負担を軽減できるという効果も得られる。
上述したように、本例のPLCシステムによれば、その開発支援装置のユーザにとっては、「自己が任意に作成するPLCプログラムの各変数が、共有変数であるか否かを指定する作業」が、増えるだけである。これによって、自動的に、全ての共有変数について、コモンメモリのデータ格納領域が割り当てられると共に、内部メモリにおける割当アドレスと対応付けられる。尚、必ずしも全ての共有変数を指定する必要はなく、共有変数のなかでユーザが必要と考える共有変数だけを指定することも可能である。
In this way, the minimum necessary data transfer processing can be performed, and the processing load related to data transfer can be reduced.
As described above, according to the PLC system of this example, for the user of the development support apparatus, “operation to specify whether or not each variable of the PLC program that is arbitrarily created by the self is a shared variable” is performed. It only increases. As a result, the data storage area of the common memory is automatically assigned to all the shared variables and is associated with the assigned address in the internal memory. Note that it is not always necessary to specify all the shared variables, and it is possible to specify only the shared variables that the user thinks necessary among the shared variables.

これより、コントローラ側では、各共有変数のデータを、内部メモリからコモンメモリへ転送することができ、以ってネットワーク(制御LANなど)に接続している他のコントローラとデータの共有が簡単に実現できる。この実現の為のユーザのエンジニアリングの作業工数の削減が実現できる。また、ユーザが設定した必要な共有変数のデータだけをコモンメモリに転送するため、転送処理負荷の軽減にもなる。   As a result, on the controller side, the data of each shared variable can be transferred from the internal memory to the common memory, which makes it easy to share data with other controllers connected to the network (such as the control LAN). realizable. It is possible to reduce the number of user engineering work for realizing this. Further, since only necessary shared variable data set by the user is transferred to the common memory, the transfer processing load is reduced.

更に、コントローラ側では、任意のタスク実行完了毎に、そのタスクに関係するPLCプログラムに係わる共有変数のみを転送対象として、そのデータを内部メモリからコモンメモリへ転送することができる。つまり、そのデータの内容が変わった可能性がある共有変数のみを、転送対象とすることができ、転送処理負荷を更に軽減することができる。   Further, on the controller side, every time execution of an arbitrary task is completed, only the shared variable related to the PLC program related to the task can be transferred, and the data can be transferred from the internal memory to the common memory. That is, only shared variables whose data contents may have changed can be transferred, and the transfer processing load can be further reduced.

この例に限らず、例えば任意のPLCプログラムの実行完了時に、そのPLCプログラムに係わる共有変数のみを転送対象として、そのデータを内部メモリからコモンメモリへ転送するようにしてもよい。尚、この処理は、変数情報管理表26を参照すれば実現できる。   The present invention is not limited to this example. For example, when execution of an arbitrary PLC program is completed, only the shared variable related to the PLC program may be transferred, and the data may be transferred from the internal memory to the common memory. This process can be realized by referring to the variable information management table 26.

上記のようにして、本手法では、その都度、必要な分だけコモンメモリにデータを転送することができる。
あるいは、例えば、内部メモリの所定の記憶領域範囲を指定して当該範囲内の全データをコモンメモリへ転送する方式の場合、この範囲内に全ての共有変数を手作業で割り当てる必要があり、ユーザの作業負担が大きかった。本手法では、この様な問題を解消できる。
As described above, according to this method, data can be transferred to the common memory as much as necessary.
Or, for example, in the case of a method in which a predetermined storage area range of the internal memory is specified and all data within the range is transferred to the common memory, all shared variables must be manually allocated within this range, The work burden of was heavy. This method can solve such problems.

尚、特に図示しないが、上記コンパイラ部12や後述するコンパイラ部12’は、下記の不図示の各処理機能部(変数情報作成部、コモンメモリ割当部)を、有するものと見做しても良い。
・コンパイル処理の際に、ソースコード14の各変数に内部メモリ25の任意のアドレスを割当てると共に、該内部メモリ25の割当アドレスとその変数が共有変数であるか否かを示す情報を含む変数情報(例えば変数情報管理表17の一部(図4等)等)を生成する変数情報作成部;
・上記変数情報の各共有変数毎に、コモンメモリ21の任意のアドレスを割り当てて、該コモンメモリ21の割当アドレスを上記変数情報に上記内部メモリ25の割当アドレスに対応付けて追加記録するコモンメモリ割当部;これによって、例えば上記のように変数情報管理表17が完成する(図6の状態となる)。
Although not particularly illustrated, the compiler unit 12 and a later-described compiler unit 12 ′ may be regarded as having the following processing function units (variable information creation unit, common memory allocation unit) (not shown). good.
Variable information including information indicating whether an arbitrary address of the internal memory 25 is assigned to each variable of the source code 14 and whether the variable is a shared variable or not in the compilation process. A variable information creation unit for generating a part of the variable information management table 17 (for example, FIG. 4);
A common memory in which an arbitrary address of the common memory 21 is allocated for each shared variable of the variable information, and the allocated address of the common memory 21 is additionally recorded in the variable information in association with the allocated address of the internal memory 25 As a result, the variable information management table 17 is completed as described above, for example (as shown in FIG. 6).

また、例えば、上記変数情報には更に各変数のデータ型が含まれており、上記コモンメモリ割当部は、予め設定される所定アドレスと、上記各共有変数のデータ型とに基づいて、各共有変数のコモンメモリ21上の割当アドレスを決定する。   Further, for example, the variable information further includes a data type of each variable, and the common memory allocating unit determines each shared data based on a predetermined address set in advance and the data type of each shared variable. The allocation address of the variable on the common memory 21 is determined.

あるいは、開発支援装置10は、不図示のタスク情報生成機能部を更に有するものであってもよい。このタスク情報生成機能部は、例えば上記タスク情報18を生成するものである。上記のように、タスク情報18には、各タスクに対する任意のユーザプログラムの割り当て情報などが含まれる。また、上記のように、タスク情報18は、例えばユーザが任意に設定・入力するものであるが、この例に限らない。   Alternatively, the development support apparatus 10 may further include a task information generation function unit (not shown). This task information generation function unit generates the task information 18, for example. As described above, the task information 18 includes allocation information of an arbitrary user program for each task. As described above, the task information 18 is set and input arbitrarily by the user, for example, but is not limited to this example.

また、上記PLC20や後述するPLC20’は、上記変数情報に基づいて、内部メモリ25に格納される各変数のデータのうち、上記共有変数のデータを上記コモンメモリ21の割当アドレスへ転送・格納する転送処理部(不図示)を有する。尚、これより、開発支援装置10は、上記変数情報をPLC20等にダウンロードするダウンロード部(不図示)も有する。   Further, the PLC 20 and the PLC 20 ′ described later transfer / store the shared variable data among the data of each variable stored in the internal memory 25 to the assigned address of the common memory 21 based on the variable information. A transfer processing unit (not shown) is included. Note that the development support apparatus 10 also includes a download unit (not shown) that downloads the variable information to the PLC 20 or the like.

ここで、以上説明した実施例を実施例1とする。これより、例えば、図1は、実施例1のプログラマブルコントローラ・システムの構成・機能図であると言える。
後述する実施例2の場合、更に下記の特徴を有するものと考えてもよい。
Here, the embodiment described above is referred to as Embodiment 1. Thus, for example, FIG. 1 can be said to be a configuration / function diagram of the programmable controller system of the first embodiment.
In the case of Example 2 to be described later, it may be considered that the following features are further provided.

すなわち、後述する実施例2の場合、上記変数情報には、更に、その変数に係わるタスクの情報が含まれている。更に、上記コモンメモリ割当部は、各タスク毎に、そのタスクに係わる各共有変数に対してコモンメモリ21の任意のアドレスの割り当てを行うものである。このアドレス割当て結果は、例えば後述する図12(a)〜(c)に示す例のようになる。つまり、コモンメモリ21の同じ記憶領域を複数のタスクで共有させる形で、各共有変数のアドレス割当てが行われる。尚、実施例1の場合、後述する図13に示す例のようになる。   That is, in the case of Example 2 described later, the variable information further includes task information related to the variable. Further, the common memory allocation unit allocates an arbitrary address of the common memory 21 to each shared variable related to the task for each task. The address assignment result is, for example, as shown in FIGS. 12A to 12C described later. That is, the address assignment of each shared variable is performed in such a manner that the same storage area of the common memory 21 is shared by a plurality of tasks. In the case of the first embodiment, the example shown in FIG.

また、上記のように複数のタスクで記憶領域を共有させることにより、上記コモンメモリ割当部は、同じタスクに係わる共有変数に関しては相互に異なるアドレスを割当てるが、任意の複数の共有変数が相互に異なるタスクに係わる共有変数である場合には該複数の共有変数に対して同一のアドレスを割当てる場合もある。   In addition, by sharing the storage area among a plurality of tasks as described above, the common memory allocation unit allocates different addresses for the shared variables related to the same task. In the case of shared variables related to different tasks, the same address may be assigned to the plurality of shared variables.

また、実施例2の場合、例えば、上記転送処理部(不図示)は、任意のタスクの処理を実行すると、上記変数情報に基づいて、内部メモリ25に格納される各変数のデータのうち、該実行したタスクに係わる共有変数のデータを、コモンメモリ21の割当アドレスへ転送・格納する。   Further, in the case of the second embodiment, for example, when the transfer processing unit (not shown) executes processing of an arbitrary task, based on the variable information, among the data of each variable stored in the internal memory 25, Data of the shared variable related to the executed task is transferred / stored to the assigned address of the common memory 21.

また、上記転送処理部は、例えば更に“実行したタスクを示す情報”も一緒にコモンメモリ21へ転送・格納する。
コモンメモリ21に格納データは、上記既存の機能によって、他のプログラマブルコントローラ(PLC20等)のコモンメモリ21に転送・格納される。
Further, the transfer processing unit further transfers and stores “information indicating the executed task” to the common memory 21 together, for example.
Data stored in the common memory 21 is transferred and stored in the common memory 21 of another programmable controller (PLC 20 or the like) by the above existing function.

他のプログラマブルコントローラは、自己のコモンメモリ21に現在格納されているデータが、どのタスクに係わる共有変数のデータであるのかを、自己のコモンメモリ21に格納される上記“実行したタスクを示す情報”によって判別する。   The other programmable controller stores the information indicating the executed task stored in its own common memory 21 as to which task the data currently stored in its own common memory 21 is the shared variable data. ".

上記“実行したタスクを示す情報”は、例えば後述する“コモンメモリマッピング識別子”や、タスク名等である。
以下、実施例2について説明する。
The “information indicating the executed task” is, for example, a “common memory mapping identifier” described later, a task name, or the like.
Example 2 will be described below.

図9は、実施例2のプログラマブルコントローラ・システムの構成・機能図である。
尚、図9において、図1に示す構成と同一の構成については、同一符号を付してあり、その説明は省略する。
FIG. 9 is a configuration / function diagram of the programmable controller system according to the second embodiment.
In FIG. 9, the same components as those shown in FIG. 1 are denoted by the same reference numerals, and the description thereof is omitted.

また、図9において、図1に示す構成とほぼ同じ構成については、同一符号に「’(ダッシュ)」を付して示すものとする。例えば、図9に示す変数情報管理表17’は、図1に示す変数情報管理表17とほぼ同じであり、後述するタスク48が追加されているだけであるので、「17」に「’(ダッシュ)」を付して「17’」と表記している。この様な構成に関しては、図1に示すものと同じ部分に関しては、その説明は省略する。例えば上記変数情報管理表17’に関しては上記タスク48以外に関しては説明は省略する。   In FIG. 9, about the same configuration as the configuration shown in FIG. 1, “′ (dash)” is attached to the same reference numeral. For example, the variable information management table 17 ′ shown in FIG. 9 is almost the same as the variable information management table 17 shown in FIG. 1, and only a task 48 described later is added. Dash) ”and“ 17 ′ ”. With respect to such a configuration, the description of the same parts as those shown in FIG. 1 is omitted. For example, with respect to the variable information management table 17 ′, the description other than the task 48 is omitted.

実施例2のプログラマブルコントローラ・システムは、図示の開発支援装置(ローダ)10’と、PLC20’を有する。尚、上述したことから、開発支援装置(ローダ)10’は、図1の開発支援装置(ローダ)10とほぼ同じであるが、一部、異なる点があるものである。同様に、PLC20’は、図1のPLC20とほぼ同じであるが、一部、異なる点があるものである。以下、主に、実施例1とは異なる点について説明する。   The programmable controller system according to the second embodiment includes a development support apparatus (loader) 10 ′ and a PLC 20 ′ shown in the figure. From the above, the development support apparatus (loader) 10 ′ is substantially the same as the development support apparatus (loader) 10 of FIG. 1, but there are some differences. Similarly, the PLC 20 ′ is substantially the same as the PLC 20 of FIG. 1, but there are some differences. Hereinafter, points different from the first embodiment will be mainly described.

まず、開発支援装置(ローダ)10’は、図示のコンパイラ部12’等を有する。
コンパイラ部12’は、基本的には上記図1のコンパイラ部12とほぼ同じであるが、以下の点で異なる。
First, the development support apparatus (loader) 10 ′ includes a compiler unit 12 ′ shown in the figure.
The compiler unit 12 ′ is basically the same as the compiler unit 12 shown in FIG. 1 except for the following points.

すなわち、図1のコンパイラ部12が、コンパイル処理に伴って上記変数情報管理表17を生成するのに対して、コンパイラ部12’は図示の変数情報管理表17’や共有変数コモンメモリ割付情報50等を生成する。変数情報管理表17’については既に簡単に説明してあるが、図10に具体例を示し後に説明する。共有変数コモンメモリ割付情報50についても、図15に具体例を示しており後に説明する。   That is, the compiler unit 12 in FIG. 1 generates the variable information management table 17 along with the compilation process, whereas the compiler unit 12 ′ has the variable information management table 17 ′ and the shared variable common memory allocation information 50 shown in the figure. And so on. Although the variable information management table 17 ′ has already been briefly described, a specific example is shown in FIG. 10 and will be described later. A specific example of the shared variable common memory allocation information 50 is shown in FIG. 15 and will be described later.

また、コンパイラ部12’は、各変数のコモンメモリへのアドレス割当て処理の内容が、図1のコンパイラ部12とは異なる。すなわち、図1のコンパイラ部12は上記図5の処理を実行するが、コンパイラ部12’は後述する図11の処理を実行する。   Further, the compiler unit 12 'differs from the compiler unit 12 of FIG. 1 in the contents of address allocation processing of each variable to the common memory. That is, the compiler unit 12 shown in FIG. 1 executes the process shown in FIG. 5, while the compiler unit 12 'executes the process shown in FIG.

生成された上記変数情報管理表17’や共有変数コモンメモリ割付情報50は、各PLC20’に転送され、図示の変数情報管理表26’や共有変数コモンメモリ割付情報60として保持される。   The generated variable information management table 17 ′ and shared variable common memory allocation information 50 are transferred to each PLC 20 ′ and held as the illustrated variable information management table 26 ′ and shared variable common memory allocation information 60.

ここで、図10に、上記変数情報管理表17’の具体例を示す。
既に述べたように、図示のタスク48が追加されている点以外は、上記変数情報管理表17と同じであるので、その説明は省略する。タスク48には、プログラム名42のプログラムが設定されるタスクのタスク名等が格納される。これは、例えば上述したタスク情報18(特に図8(b)に示す情報)を参照することで、プログラム名42に対応するタスク名等が分かる。
FIG. 10 shows a specific example of the variable information management table 17 ′.
As already described, the variable information management table 17 is the same as the variable information management table 17 except that the illustrated task 48 is added. The task 48 stores the task name of the task in which the program with the program name 42 is set. For example, by referring to the task information 18 described above (particularly, the information shown in FIG. 8B), the task name corresponding to the program name 42 can be known.

図10は、作成途中の変数情報管理表17’を示している。すなわち、“コモンメモリへのデータ格納先アドレス”47のデータが、未だ生成されていない状態を示している。尚、これ以外の各データは、図示のように生成されているが、これらの生成処理はコンパイラ部12と同じであるので、ここでは特に説明しない。   FIG. 10 shows the variable information management table 17 ′ being created. That is, the data of “data storage destination address to common memory” 47 has not been generated yet. The other data are generated as shown in the figure, but the generation process is the same as that of the compiler unit 12 and will not be described here.

図10の状態において、コンパイラ部12’が図11の処理を実行することで、“コモンメモリへのデータ格納先アドレス”47の各データが生成・格納される。
以下、図11の処理例について説明する。
In the state of FIG. 10, the compiler unit 12 ′ executes the process of FIG. 11 to generate and store each data of “data storage destination address in common memory” 47.
Hereinafter, the processing example of FIG. 11 will be described.

図11の処理では、上記変数情報管理表17’を用いて、その各レコード(各変数)を順次処理対象としてステップS23〜S29の処理を繰り返し実行する。最初の処理対象レコードは、例えば、変数情報管理表17’の先頭レコード(管理ID41=‘1’のレコード)とする(ステップS21)。   In the process of FIG. 11, using the variable information management table 17 ′, the processes of steps S <b> 23 to S <b> 29 are repeatedly executed with each record (each variable) being sequentially processed. The first record to be processed is, for example, the first record of the variable information management table 17 '(record with management ID 41 =' 1 ') (step S21).

更に、各タスク毎の“割付先コモンメモリ”に対して初期値を設定する(ステップS22)。これは、上記ステップS12では初期値は‘0’に設定したが、本例では例えば初期値は‘2’に設定する。これは、実施例2の場合、例えば後述する図12に示すようにコモンメモリ21の先頭の記憶領域は、コモンメモリマッピング識別子の格納領域としているからである。更に、ここでは、この格納領域のサイズを‘2’としているからである。   Further, an initial value is set for the “allocation destination common memory” for each task (step S22). This is because the initial value is set to “0” in step S12, but in this example, the initial value is set to “2”, for example. This is because, in the case of the second embodiment, for example, as shown in FIG. 12 described later, the top storage area of the common memory 21 is a storage area for the common memory mapping identifier. Further, here, the size of this storage area is set to “2”.

また、実施例2では、実施例1とは異なり、“割付先コモンメモリ”は各タスク毎に対応して複数設けられている。本例では、“定周期1”、“定周期2”、“デフォルト”の3種類のタスクがあるものとし、これより、例えば、“定周期1”に対しては“割付先コモンメモリ(1)”が、“定周期2”に対しては“割付先コモンメモリ(2)”、“デフォルト”に対しては“割付先コモンメモリ(3)”が、設けられるものとする。そして、ここでは、これら3つ全てについて、例えば上記初期値=‘2’が設定されるものとする。   In the second embodiment, unlike the first embodiment, a plurality of “allocation destination common memories” are provided corresponding to each task. In this example, it is assumed that there are three types of tasks, “fixed cycle 1”, “fixed cycle 2”, and “default”. For example, for “fixed cycle 1”, “assignment destination common memory (1 ) "Is provided with" assignment destination common memory (2) "for" fixed period 2 "and" assignment destination common memory (3) "for" default ". In this case, for example, the initial value = '2' is set for all three.

尚、上記“割付先コモンメモリ”は、図5や図11の処理実行中に任意の値を随時格納/更新する変数と見做してよい。
そして、上記処理対象レコードに基づいて、まず、当該処理対象の変数が、共有変数であるか否かを、共有変数46から判定する(ステップS23)。そして、共有変数ではない場合には(ステップS23,NO)、後述するステップS28の処理へ移行する。
The “allocation destination common memory” may be regarded as a variable for storing / updating an arbitrary value at any time during the execution of the processing of FIGS.
Based on the processing target record, first, it is determined from the shared variable 46 whether or not the processing target variable is a shared variable (step S23). If it is not a shared variable (NO at step S23), the process proceeds to step S28 described later.

一方、処理対象の変数が共有変数である場合には(ステップS23,YES)、まず、処理対象レコードのタスク48を取得し(ステップS24)、このタスク48のタスクに対応する“割付先コモンメモリ”の値を取得する(ステップS25)。例えば先頭レコード(変数11)の場合、タスク48は“定周期1”であるので、上記の例では、上記“割付先コモンメモリ(1)”の現在の値が、取得されることになる。そして、この場合、現在値は上記初期値であるので、‘2’が取得されることになる。   On the other hand, if the variable to be processed is a shared variable (step S23, YES), first, the task 48 of the record to be processed is acquired (step S24), and the “assignment destination common memory corresponding to the task of this task 48 is acquired. The value "" is acquired (step S25). For example, in the case of the first record (variable 11), since the task 48 is “fixed period 1”, in the above example, the current value of the “allocation destination common memory (1)” is acquired. In this case, since the current value is the initial value, '2' is acquired.

そして、ステップS25で取得した値を、上記処理対象レコードの“コモンメモリへのデータ格納先アドレス”47に格納する(ステップS26)。これより、上記先頭レコードに関しては、図14に示すように、“コモンメモリへのデータ格納先アドレス”47に‘2’が格納されることになる。   Then, the value acquired in step S25 is stored in “data storage destination address in common memory” 47 of the processing target record (step S26). As a result, with respect to the first record, as shown in FIG. 14, “2” is stored in “data storage destination address to common memory” 47.

そして、上記該当する“割付先コモンメモリ”(ここでは“割付先コモンメモリ(1)”)の値を更新する(ステップS27)。これは、処理対象レコードのデータ型44に応じたサイズを判別して、このサイズを“割付先コモンメモリ(1)”の現在値に加算することで、“割付先コモンメモリ(1)”の値を更新する。尚、ここでは、INTやWORDに応じたサイズは‘1’であるものとする。よって、“割付先コモンメモリ(1)”の値は‘3’(=2+1)になる。   Then, the value of the corresponding “allocation destination common memory” (here “allocation destination common memory (1)”) is updated (step S27). This is because the size corresponding to the data type 44 of the record to be processed is determined, and this size is added to the current value of the “allocation destination common memory (1)”, so that the “allocation destination common memory (1)” Update the value. Here, the size corresponding to INT or WORD is assumed to be ‘1’. Therefore, the value of “assignment destination common memory (1)” is “3” (= 2 + 1).

そして、次のレコードを新たな処理対象レコードとして(ステップS28)、ステップS23の処理に戻る。但し、次の処理対象レコードが無い場合には(ステップS29,NO)、本処理を終了する。   Then, the next record is set as a new process target record (step S28), and the process returns to step S23. However, if there is no next process target record (step S29, NO), this process ends.

3番目のレコード(変数13)が処理対象のとき、“割付先コモンメモリ(1)”の値が‘3’となっているので、図14に示すように、その“コモンメモリへのデータ格納先アドレス”47には‘3’が格納されることになる。そして、ステップS27によって“割付先コモンメモリ(1)”の値は‘4’に更新されることになる。   When the third record (variable 13) is an object to be processed, the value of “allocation destination common memory (1)” is “3”. Therefore, as shown in FIG. “3” is stored in the destination address “47”. In step S27, the value of “allocation destination common memory (1)” is updated to “4”.

これより、5番目のレコード(変数22)が処理対象のときには、“割付先コモンメモリ(1)”の値が‘4’となっているので、図14に示すように、その“コモンメモリへのデータ格納先アドレス”47には‘4’が格納されることになる。そして、ステップS27によって、“割付先コモンメモリ(1)”の値は‘5’に更新されることになる。   As a result, when the fifth record (variable 22) is a processing target, the value of “allocation destination common memory (1)” is “4”, and as shown in FIG. “4” is stored in the data storage destination address “47”. In step S27, the value of “allocation destination common memory (1)” is updated to “5”.

ここで、7番目のレコード(変数32)に関しては、タスク48が“定周期2”であるので、“割付先コモンメモリ(1)”ではなく、“割付先コモンメモリ(2)”の値を用いる。このとき、“割付先コモンメモリ(2)”の値は上記初期値(=2)であるので、図14に示すように、“コモンメモリへのデータ格納先アドレス”47には‘5’ではなく‘2’が格納されることになる。   Here, regarding the seventh record (variable 32), since the task 48 is “fixed cycle 2”, the value of “allocation destination common memory (2)” is not set to “allocation destination common memory (1)”. Use. At this time, since the value of “allocation destination common memory (2)” is the initial value (= 2), as shown in FIG. 14, “data storage destination address to common memory” 47 is “5”. Instead, “2” is stored.

また、9番目のレコード(変数41)に関しては、タスク48が“デフォルト”であるので、“割付先コモンメモリ(1)”ではなく、“割付先コモンメモリ(3)”の値を用いる。このとき、“割付先コモンメモリ(3)”の値は上記初期値(=2)であるので、図14に示すように、“コモンメモリへのデータ格納先アドレス”47には‘5’ではなく‘2’が格納されることになる。   For the ninth record (variable 41), since the task 48 is “default”, the value of “allocation destination common memory (3)” is used instead of “allocation destination common memory (1)”. At this time, since the value of “allocation destination common memory (3)” is the above initial value (= 2), “5” is set in “data storage destination address to common memory” 47 as shown in FIG. Instead, “2” is stored.

例えばこの様にして、図14に示すような変数情報管理表17’が完成する。
コンパイラ部12’は、更に、上記完成した変数情報管理表17’に基づいて、上記共有変数コモンメモリ割付情報50を生成する。図15に、図14に示す変数情報管理表17’の具体例に応じて生成される、共有変数コモンメモリ割付情報50の具体例を示す。
For example, in this way, a variable information management table 17 ′ as shown in FIG. 14 is completed.
The compiler unit 12 ′ further generates the shared variable common memory allocation information 50 based on the completed variable information management table 17 ′. FIG. 15 shows a specific example of the shared variable common memory allocation information 50 generated according to the specific example of the variable information management table 17 ′ shown in FIG.

共有変数コモンメモリ割付情報50は、例えば、タスク51、コモンメモリマッピング識別子52、変数名53、BCアドレス54、データ型55等の各データ項目より成る。
コンパイラ部12’は、例えば上記変数情報管理表17’において共有変数46が“共有する”となっている全てのレコードについて、そのタスク48、変数名43、“コモンメモリへのデータ格納先アドレス”47、データ型44を、それぞれ、上記タスク51、変数名53、BCアドレス54、データ型55に格納する。更に、タスク51に対応する識別IDを、コモンメモリマッピング識別子52に格納する。尚、この識別IDは、各タスクに対応して任意に割当ててもよいし、予め各タスクには固有の識別IDが割当てられているものであってもよい。
The shared variable common memory allocation information 50 includes data items such as a task 51, a common memory mapping identifier 52, a variable name 53, a BC address 54, and a data type 55, for example.
The compiler unit 12 ′, for example, for all records in which the shared variable 46 is “shared” in the variable information management table 17 ′, the task 48, variable name 43, “data storage destination address in common memory” 47 and data type 44 are stored in task 51, variable name 53, BC address 54, and data type 55, respectively. Further, the identification ID corresponding to the task 51 is stored in the common memory mapping identifier 52. This identification ID may be arbitrarily assigned corresponding to each task, or a unique identification ID may be assigned to each task in advance.

但し、共有変数コモンメモリ割付情報50は、必ずも生成する必要はなく、以って必ずしも各PLC20’に保持させる必要はない。各PLC20’は、変数情報管理表17’を保持するだけでも構わない。尚、この場合、変数情報管理表17’に上記コモンメモリマッピング識別子52のデータ項目を付加してもよいが、付加しなくてもよい。コモンメモリマッピング識別子は、必ずしも必要ないからである(タスクの種類が判別できればよいので、タスク48(タスク名)を用いても構わない。勿論、この場合には、コモンメモリ21にタスク名を格納することになる)。   However, the shared variable common memory allocation information 50 does not necessarily have to be generated, and therefore does not necessarily have to be held in each PLC 20 '. Each PLC 20 'may only hold the variable information management table 17'. In this case, the data item of the common memory mapping identifier 52 may or may not be added to the variable information management table 17 '. This is because the common memory mapping identifier is not necessarily required (the task 48 (task name) may be used as long as the type of task can be determined. Of course, in this case, the task name is stored in the common memory 21). Will do).

そして、開発支援装置10’は、上記のように生成した上記変数情報管理表17’や共有変数コモンメモリ割付情報50を、各PLC20’にダウンロードする。各PLC20’は、これら変数情報管理表17’と共有変数コモンメモリ割付情報50を、図9に示す変数情報管理表26’と共有変数コモンメモリ割付情報60として記憶する。   Then, the development support apparatus 10 'downloads the variable information management table 17' and the shared variable common memory allocation information 50 generated as described above to each PLC 20 '. Each PLC 20 'stores the variable information management table 17' and the shared variable common memory allocation information 50 as the variable information management table 26 'and the shared variable common memory allocation information 60 shown in FIG.

但し、共有変数コモンメモリ割付情報50は、受信側のPLC20’用に生成される情報であるので、送信側のPLC20’にはダウンロードする必要がない。また、受信側のPLC20’は、共有変数コモンメモリ割付情報50があれば問題なく受信処理が行えるので、変数情報管理表17’をダウンロードする必要はない。但し、勿論、全てのPLC20’に変数情報管理表17’と共有変数コモンメモリ割付情報50の両方をダウンロードして保持させるようにしてもよい。   However, since the shared variable common memory allocation information 50 is information generated for the receiving PLC 20 ′, it is not necessary to download it to the transmitting PLC 20 ′. Further, the receiving side PLC 20 ′ can perform the receiving process without any problem if the shared variable common memory allocation information 50 exists, so there is no need to download the variable information management table 17 ′. However, of course, all the PLCs 20 ′ may download and hold both the variable information management table 17 ′ and the shared variable common memory allocation information 50.

尚、上記送信側、受信側とは、例えば特許文献1における図2を例にした場合、図示の「装置1A送信エリア」のデータに関しては、データ伝送装置1Aが送信側となり、他のデータ伝送装置1B,1Cが受信側となる。これは、図9の例の場合、開発支援装置10’が例えば図示のPLC−A用のソースコード14のコンパイルに伴って上記変数情報管理表17’と共有変数コモンメモリ割付情報50を生成した場合には、PLC−Aが送信側、PLC−Bが受信側となる。この例では、例えば、PLC−Aには変数情報管理表17’をダウンロードして保持させ、PLC−Bには共有変数コモンメモリ割付情報50をダウンロードして保持させることになる。尚、この場合には、変数情報管理表17’には更にコモンメモリマッピング識別子52が追加されていることが望ましい。   For example, in the case of FIG. 2 in Patent Document 1, the transmission side and the reception side are the transmission side for the data in the “device 1A transmission area” shown in FIG. The devices 1B and 1C are on the receiving side. In the example of FIG. 9, the development support apparatus 10 ′ generates the variable information management table 17 ′ and the shared variable common memory allocation information 50 with the compilation of the illustrated PLC-A source code 14, for example. In this case, PLC-A is the transmitting side and PLC-B is the receiving side. In this example, for example, the variable information management table 17 'is downloaded and held in the PLC-A, and the shared variable common memory allocation information 50 is downloaded and held in the PLC-B. In this case, it is desirable that a common memory mapping identifier 52 is further added to the variable information management table 17 '.

但し、この例に限らず、共有変数コモンメモリ割付情報50は必ずしに生成しなくてよいので、この場合にはPLC−Bにも変数情報管理表17’をダウンロードして保持させることになる。共有変数コモンメモリ割付情報50は、基本的に、変数情報管理表17’のデータのなかで受信処理に必要なデータを抽出して成るものであり、変数情報管理表17’に比べてデータ量が少なくて済むというメリットが得られる。   However, the present invention is not limited to this example, and the shared variable common memory allocation information 50 does not necessarily need to be generated. In this case, the PLC-B also downloads and holds the variable information management table 17 ′. . The shared variable common memory allocation information 50 is basically obtained by extracting data necessary for reception processing from the data of the variable information management table 17 ′, and has a data amount as compared with the variable information management table 17 ′. There is an advantage that less is required.

また、コモンメモリマッピング識別子52は、必ずしも必要なく、タスク51(タスク名)があればタスクを識別できるが、「コモンメモリマッピング識別子」を用いる方がコモンメモリ21に格納するデータ量が少なくて済む。   Further, the common memory mapping identifier 52 is not always necessary, and if there is a task 51 (task name), the task can be identified. However, using the “common memory mapping identifier” requires less data to be stored in the common memory 21. .

各PLC20’は、上記自己が保持する変数情報管理表26’や共有変数コモンメモリ割付情報60を用いて、コモンメモリデータ交換処理を実行する。以下、PLC20’におけるコモンメモリデータ交換処理について説明する。   Each PLC 20 ′ executes common memory data exchange processing using the variable information management table 26 ′ and shared variable common memory allocation information 60 held by itself. Hereinafter, the common memory data exchange process in the PLC 20 'will be described.

まず、送信側のPLC20’は、例えば図16に示す動作を行う。これは、例えば上記図8(a)、(b)に示す設定情報に従って、各タスクを動作させる。この例では、タスク“定周期1”は、200ms周期で動作させ、プログラム1とプログラム2を実行することになる。また、タスク“定周期2”は、1000ms周期で動作させ、プログラム3を実行することになる。そして、各タスク実行毎に、転送処理部24’が、図16に示す転送処理を行う。   First, the PLC 20 'on the transmission side performs the operation shown in FIG. 16, for example. For example, each task is operated according to the setting information shown in FIGS. 8 (a) and 8 (b). In this example, the task “fixed cycle 1” is operated at a cycle of 200 ms, and the program 1 and the program 2 are executed. Further, the task “fixed cycle 2” is operated at a cycle of 1000 ms and the program 3 is executed. Then, for each task execution, the transfer processing unit 24 'performs the transfer process shown in FIG.

ここで、図16において、△は、転送処理を示し、この△内に示す数字は、コモンメモリマッピング識別子52を示す。
転送処理部24’は、基本的には上記図1の転送処理部24と略同様の処理を行うものであるが、異なる点は、全ての共有変数データを転送するのではなく、その都度、そのときに(直前に)実行されたタスクに係わる共有変数データを転送する点である。更に、そのときに実行されたタスクの上記識別ID(コモンメモリマッピング識別子)を、コモンメモリ21の所定の格納領域(ここではアドレス‘0’‘1’)に格納する。
Here, in FIG. 16, Δ indicates a transfer process, and the number shown in Δ indicates the common memory mapping identifier 52.
The transfer processing unit 24 ′ basically performs substantially the same processing as the transfer processing unit 24 of FIG. 1, except that not all the shared variable data is transferred. The shared variable data relating to the task executed at that time (immediately before) is transferred. Further, the identification ID (common memory mapping identifier) of the task executed at that time is stored in a predetermined storage area (here, address “0” 1 ”) of the common memory 21.

転送処理部24’は、任意のタスク実行完了に伴って呼び出されると、コモンメモリ21の自己の記憶領域のデータを消去したうえで、まず、当該実行完了したタスクに対応するコモンメモリマッピング識別子52を、コモンメモリ21の所定の格納領域(ここではアドレス‘0’‘1’)に格納する。そして、変数情報管理表26’に基づいて、当該実行完了したタスクに係わる共有変数データを、内部メモリ25からコモンメモリ21へ転送する。   When the transfer processing unit 24 ′ is called upon completion of execution of an arbitrary task, the transfer processing unit 24 ′ erases the data in its own storage area of the common memory 21, and first, the common memory mapping identifier 52 corresponding to the task whose execution has been completed. Are stored in a predetermined storage area of the common memory 21 (here, address “0” 1 ”). Based on the variable information management table 26 ′, the shared variable data related to the task that has been executed is transferred from the internal memory 25 to the common memory 21.

例えば、図16において△内が‘1’である転送処理は、タスク“定周期1”を実行完了後、換言すればプログラム1とプログラム2を実行完了後に実行される転送処理である。この転送処理では、まず、タスク“定周期1”のコモンメモリマッピング識別子=‘1’が、コモンメモリ21の所定の格納領域に格納される。更に、タスク“定周期1”に係わる共有変数である変数11、変数13、変数22のデータが、内部メモリ25からコモンメモリ21の該当アドレスへと転送・記憶される。図14の例の場合、変数11、変数13、変数22の各データは、それぞれ、コモンメモリ21のアドレス‘2’、アドレス‘3’、アドレス‘4’へと転送・記憶される。これより、この転送処理実行後のコモンメモリ21のデータ格納状態は、図12(a)に示すようになる。   For example, in FIG. 16, the transfer process in which Δ is “1” is a transfer process that is executed after execution of the task “fixed period 1”, in other words, after execution of the program 1 and the program 2 is completed. In this transfer process, first, the common memory mapping identifier = ‘1’ of the task “fixed period 1” is stored in a predetermined storage area of the common memory 21. Further, the data of variables 11, 13, and 22 that are shared variables related to the task “fixed cycle 1” is transferred / stored from the internal memory 25 to the corresponding address of the common memory 21. In the example of FIG. 14, the data of the variable 11, the variable 13, and the variable 22 are transferred and stored to the address ‘2’, the address ‘3’, and the address ‘4’ of the common memory 21, respectively. Thus, the data storage state of the common memory 21 after execution of this transfer process is as shown in FIG.

また、例えば、図16において△内が‘2’である転送処理は、タスク“定周期2”を実行完了後、換言すればプログラム3を実行完了後に実行される転送処理である。この転送処理では、まず、タスク“定周期2”のコモンメモリマッピング識別子=‘2’が、コモンメモリ21の所定の格納領域に格納される。更に、タスク“定周期2”に係わる共有変数である変数32のデータが、内部メモリ25からコモンメモリ21の該当アドレスへと転送・記憶される。図14の例の場合、変数32データは、コモンメモリ21のアドレス‘2’へと転送・記憶される。これより、この転送処理実行後のコモンメモリ21のデータ格納状態は、図12(b)に示すようになる。   For example, in FIG. 16, the transfer process in which Δ is “2” is a transfer process that is executed after the task “fixed period 2” is completed, in other words, after the program 3 is completed. In this transfer processing, first, the common memory mapping identifier = ‘2’ of the task “fixed period 2” is stored in a predetermined storage area of the common memory 21. Further, the data of the variable 32 that is a shared variable related to the task “fixed cycle 2” is transferred / stored from the internal memory 25 to the corresponding address of the common memory 21. In the case of the example of FIG. 14, the variable 32 data is transferred and stored to the address “2” of the common memory 21. Thus, the data storage state of the common memory 21 after the execution of the transfer process is as shown in FIG.

また、例えば、図16において△内が‘3’である転送処理は、タスク“デフォルト”を実行完了後、換言すればプログラム4を実行完了後に実行される転送処理である。この転送処理では、まず、タスク“デフォルト”のコモンメモリマッピング識別子=‘3’が、コモンメモリ21の所定の格納領域に格納される。更に、タスク“デフォルト”に係わる共有変数である変数41のデータが、内部メモリ25からコモンメモリ21の該当アドレスへと転送・記憶される。図14の例の場合、変数41データは、コモンメモリ21のアドレス‘2’へと転送・記憶される。これより、この転送処理実行後のコモンメモリ21のデータ格納状態は、図12(c)に示すようになる。   Further, for example, the transfer process in FIG. 16 where “Δ” is “3” is a transfer process executed after the task “default” is completed, in other words, after the program 4 is completed. In this transfer process, first, the common memory mapping identifier = ‘3’ of the task “default” is stored in a predetermined storage area of the common memory 21. Furthermore, the data of the variable 41 that is a shared variable related to the task “default” is transferred / stored from the internal memory 25 to the corresponding address of the common memory 21. In the example of FIG. 14, the variable 41 data is transferred and stored to the address “2” of the common memory 21. Thus, the data storage state of the common memory 21 after the execution of the transfer process is as shown in FIG.

尚、図12との比較の為、図13には上記実施例1におけるコモンメモリ21のデータ割り付け例を示す。
図13に示すように、実施例1の場合、そのとき実行されたタスクが何であるかは関係なく、常に、全ての変数(変数11,13,22,32,41)のデータが、コモンメモリ21に格納される。つまり、コモンメモリ21には、これら5つの変数のデータを格納する為の記憶容量が、必要となる。
For comparison with FIG. 12, FIG. 13 shows an example of data allocation of the common memory 21 in the first embodiment.
As shown in FIG. 13, in the case of the first embodiment, the data of all variables (variables 11, 13, 22, 32, and 41) are always stored in the common memory regardless of what task is executed at that time. 21 is stored. That is, the common memory 21 needs a storage capacity for storing data of these five variables.

一方、実施例2の場合、上記の例では最大でも図12(a)に示す3つの変数のデータを格納する為の記憶容量が、あればよいことになる(尚、正確には、更に、コモンメモリマッピング識別子を格納するための記憶容量も必要となる)。この様に、実施例2は、実施例1に比べて、コモンメモリ21の記憶容量が少なくて済む、という効果が得られる。   On the other hand, in the case of Example 2, in the above example, it is sufficient to have a storage capacity for storing the data of the three variables shown in FIG. A storage capacity for storing the common memory mapping identifier is also required). As described above, the second embodiment has an effect that the storage capacity of the common memory 21 is smaller than that of the first embodiment.

更に、内部メモリ25からコモンメモリ21へのデータ転送量も、実施例2は実施例1に比べて少なくて済むという効果も得られる。すなわち、実施例1の場合、データ転送処理実行毎に、上記の例では上記5つの変数のデータを転送することになる。これに対して、実施例2の場合、特にタスク“定周期2”やタスク“デフォルト”の実行完了後に行われるデータ転送処理では、1つの変数のデータを転送すればよく(正確には、更に、コモンメモリマッピング識別子も転送するが)、データ転送量が非常に少なくて済む。   Furthermore, the amount of data transferred from the internal memory 25 to the common memory 21 can also be reduced in the second embodiment compared to the first embodiment. That is, in the case of the first embodiment, each time the data transfer process is executed, the data of the five variables is transferred in the above example. On the other hand, in the case of the second embodiment, in particular, in the data transfer process performed after the completion of the execution of the task “fixed period 2” or the task “default”, it is only necessary to transfer data of one variable (more precisely, The common memory mapping identifier is also transferred), but the data transfer amount is very small.

上記コモンメモリ21の格納データは、例えば上記特許文献1等に開示されている既存機能によって、他のPLC20’のコモンメモリ21に転送・格納される。
ここで、実施例2では、受信側のPLC20’は、自己が保持する上記共有変数コモンメモリ割付情報60等を参照して、自己のコモンメモリ21から所望の変数のデータを取得する。これは、まず、自己のコモンメモリ21から上記コモンメモリマッピング識別子を取得し、これを用いて共有変数コモンメモリ割付情報60等を参照することで、現在、自己のコモンメモリ21のどのアドレスにどの変数のデータが格納されているのかを認識できる。そして、これによって、自己のコモンメモリ21から所望の変数のデータを取得できる。
The data stored in the common memory 21 is transferred / stored in the common memory 21 of another PLC 20 ′ by the existing function disclosed in, for example, the above-mentioned Patent Document 1.
Here, in the second embodiment, the receiving side PLC 20 ′ refers to the shared variable common memory allocation information 60 and the like held by itself and acquires data of a desired variable from its own common memory 21. First, the common memory mapping identifier is acquired from its own common memory 21, and the shared variable common memory allocation information 60 and the like are referred to by using the common memory mapping identifier. You can recognize whether variable data is stored. As a result, data of a desired variable can be acquired from its own common memory 21.

例えば、自己のコモンメモリ21の状態が図12(a)に示す状態であった場合、そのコモンメモリマッピング識別子は‘1’であるので、例えば図15に示す共有変数コモンメモリ割付情報60を参照すれば、例えばアドレス‘2’には変数11のデータが格納されていることを認識できることになる。更に、これがタスク“定周期1”に係わる変数であること等も認識できる。また、コモンメモリ21から変数データを読み出す際には、BCアドレス54からデータ型55に応じたデータ量のデータを、読み出すことになる。   For example, if the state of its own common memory 21 is the state shown in FIG. 12A, the common memory mapping identifier is “1”, so refer to the shared variable common memory allocation information 60 shown in FIG. 15, for example. Then, for example, it can be recognized that the data of the variable 11 is stored at the address “2”. Further, it can be recognized that this is a variable related to the task “fixed period 1”. Further, when reading the variable data from the common memory 21, the data amount corresponding to the data type 55 is read from the BC address 54.

更に、変数情報管理表26’を参照すれば、この変数11がプログラム1に係わる変数であること等が認識できることになる。
また、例えば、自己のコモンメモリ21の状態が図12(b)に示す状態であった場合、そのコモンメモリマッピング識別子は‘2’であるので、例えばアドレス‘2’には変数32のデータが格納されていることを認識できることになる。
Further, by referring to the variable information management table 26 ′, it can be recognized that the variable 11 is a variable related to the program 1.
Further, for example, when the state of its own common memory 21 is the state shown in FIG. 12B, since the common memory mapping identifier is “2”, for example, the data of the variable 32 is stored at the address “2”. You can recognize that it is stored.

この様に、実施例2においても、受信側のPLC20’は、問題なく所望の共有変数データを取得することができる。   As described above, also in the second embodiment, the PLC 20 ′ on the receiving side can acquire desired shared variable data without any problem.

10 開発支援装置(ローダ)
11 インタフェース機能部
12 コンパイラ部
13 通信機能部
14 ソースコード
15 ソースコード識別番号対応表
16 機械語オブジェクト
17 変数情報管理表
18 タスク情報
20 PLC
21 コモンメモリ
22 通信機能部
23 プログラム実行管理機能部
24 転送処理部
25 内部メモリ
26 変数情報管理表
27 機械語オブジェクト
30 共有変数宣言情報
31 プログラム名
32 変数名
33 データ型
34 共有変数
41 管理ID
42 プログラム名
43 変数名
44 データ型
45 「PLC内メモリのアドレス」
46 共有変数
47 「コモンメモリへのデータ格納先アドレス」
10’ 開発支援装置
12’ コンパイラ部
17’ 変数情報管理表
20’ PLC
24’ 転送処理部
26’ 変数情報管理表
48 タスク
50 共有変数コモンメモリ割付情報
51 タスク
52 コモンメモリマッピング識別子
53 変数名
54 BCアドレス
55 データ型

10 Development support device (loader)
11 Interface function section 12 Compiler section 13 Communication function section 14 Source code 15 Source code identification number correspondence table 16 Machine language object 17 Variable information management table 18 Task information 20 PLC
21 common memory 22 communication function section 23 program execution management function section 24 transfer processing section 25 internal memory 26 variable information management table 27 machine language object 30 shared variable declaration information 31 program name 32 variable name 33 data type 34 shared variable 41 management ID
42 Program name 43 Variable name 44 Data type 45 “Address of memory in PLC”
46 Shared variable 47 “Data storage destination address in common memory”
10 'development support device 12' compiler section 17 'variable information management table 20' PLC
24 'transfer processing unit 26' variable information management table 48 task 50 shared variable common memory allocation information 51 task 52 common memory mapping identifier 53 variable name 54 BC address 55 data type

Claims (10)

各々が内部メモリとコモンメモリを有する複数のプログラマブルコントローラがネットワークに接続されており、該複数のプログラマブルコントローラが前記コモンメモリの格納データを共有するシステムであって、
任意の前記プログラマブルコントローラに対応して、そのプログラムのソースコードを任意に作成させる支援装置を更に有し、
該支援装置は、
前記ソースコードをコンパイルするコンパイル手段を有し、
該コンパイル手段は、
前記コンパイルの際に、前記ソースコードの各変数に前記内部メモリの任意のアドレスを割当てると共に、該内部メモリの割当アドレスとその変数が前記複数のプログラマブルコントローラで共有する変数である共有変数であるか否かを示す情報を含む変数情報を生成する変数情報作成手段と、
前記変数情報の各共有変数毎に、前記コモンメモリの任意のアドレスを割り当てて、該コモンメモリの割当アドレスを前記変数情報に前記内部メモリの割当アドレスに対応付けて追加記録するコモンメモリ割当手段とを有し、
前記プログラマブルコントローラは、
前記変数情報に基づいて、前記内部メモリに格納される前記各変数のデータのうち、前記共有変数のデータを前記コモンメモリの割当アドレスへ転送・格納する転送処理手段を有することを特徴とするプログラマブルコントローラシステム。
A plurality of programmable controllers each having an internal memory and a common memory are connected to a network, and the plurality of programmable controllers share data stored in the common memory,
In correspondence with any of the programmable controllers, further comprising a support device for arbitrarily generating the source code of the program,
The support device
Compiling means for compiling the source code,
The compiling means is:
During the compilation, the assigning any address of the internal memory to each variable of the source code, it is a shared variable and assigned address of the internal memory, is that variable is a variable that is shared by the plurality of programmable controllers a variable information creating means for generating a variable information including the information indicating whether,
Common memory allocating means for allocating an arbitrary address of the common memory for each shared variable of the variable information, and additionally recording the allocated address of the common memory in association with the allocated address of the internal memory in the variable information; Have
The programmable controller is
Programmable, comprising: transfer processing means for transferring and storing the data of the shared variable to the allocated address of the common memory among the data of the variables stored in the internal memory based on the variable information Controller system.
前記変数情報には更に前記各変数のデータ型が含まれており、
前記コモンメモリ割当手段は、予め設定される所定アドレスと、前記各共有変数の前記データ型とに基づいて、前記各共有変数の前記コモンメモリの割当アドレスを決定することを特徴とする請求項1記載のプログラマブルコントローラシステム。
The variable information further includes the data type of each variable,
2. The common memory allocating unit determines an allocation address of the common memory for each shared variable based on a predetermined address set in advance and the data type of each shared variable. The programmable controller system described.
前記支援装置は、
各タスクに対する任意の前記プログラムの割り当て情報を含むタスク情報を生成させるタスク情報生成手段を更に有し、
前記転送処理手段は、前記タスク情報と前記変数情報とに基づいて、任意のタスク実行完了時に、そのタスクに係わるプログラムの前記共有変数のデータを、前記内部メモリから前記コモンメモリの割当アドレスへ転送・格納することを特徴とする請求項1記載のプログラマブルコントローラシステム。
The support device includes:
Task information generating means for generating task information including allocation information of an arbitrary program for each task;
The transfer processing means transfers the data of the shared variable of the program related to the task from the internal memory to the allocation address of the common memory when execution of an arbitrary task is completed based on the task information and the variable information. The programmable controller system according to claim 1, wherein the programmable controller system is stored.
前記変数情報には、更に、その変数に係わるタスクの情報が含まれており、
前記コモンメモリ割当手段は、各タスク毎に、そのタスクに係わる各共有変数に対して前記コモンメモリの任意のアドレスの割り当てを行うことを特徴とする請求項1記載のプログラマブルコントローラシステム。
The variable information further includes task information related to the variable,
2. The programmable controller system according to claim 1, wherein the common memory allocating unit allocates an arbitrary address of the common memory to each shared variable related to the task for each task.
前記コモンメモリの同じ記憶領域を複数のタスクで共有させる形で前記共有変数のアドレス割当てが行われることを特徴とする請求項4記載のプログラマブルコントローラシステム。   5. The programmable controller system according to claim 4, wherein an address of the shared variable is assigned in such a manner that the same storage area of the common memory is shared by a plurality of tasks. 前記コモンメモリ割当手段は、同じタスクに係わる共有変数に関しては相互に異なるアドレスを割当てるが、任意の複数の共有変数が相互に異なるタスクに係わる共有変数である場合には該複数の共有変数に対して同一のアドレスを割当てる場合もあることを特徴とする請求項5記載のプログラマブルコントローラシステム。   The common memory allocating unit allocates different addresses for the shared variables related to the same task. However, if any of the plurality of shared variables are shared variables related to different tasks, 6. The programmable controller system according to claim 5, wherein the same address may be assigned. 前記プログラマブルコントローラの前記転送処理手段は、
任意のタスクの処理を実行すると、前記変数情報に基づいて、前記内部メモリに格納される前記各変数のデータのうち、該実行したタスクに係わる前記共有変数のデータを、前記コモンメモリの割当アドレスへ転送・格納することを特徴とする請求項4〜6の何れかに記載のプログラマブルコントローラシステム。
The transfer processing means of the programmable controller is:
When processing of an arbitrary task is executed, based on the variable information, among the data of each variable stored in the internal memory, the data of the shared variable related to the executed task is assigned to the allocation address of the common memory. The programmable controller system according to claim 4, wherein the programmable controller system is transferred to and stored in a computer.
前記転送処理手段は、前記実行したタスクを示す情報も一緒に前記コモンメモリへ転送・格納することを特徴とする請求項7記載のプログラマブルコントローラシステム。   8. The programmable controller system according to claim 7, wherein the transfer processing unit transfers / stores information indicating the executed task together with the common memory. 他のプログラマブルコントローラは、自己のコモンメモリに現在格納されているデータが、どのタスクに係わる共有変数のデータであるのかを、前記コモンメモリに格納される前記実行したタスクを示す情報によって判別することを特徴とする請求項7または8記載のプログラマブルコントローラシステム。   The other programmable controller determines which task is the data of the shared variable related to which task currently stored in its own common memory based on the information indicating the executed task stored in the common memory. The programmable controller system according to claim 7 or 8. 各々が内部メモリとコモンメモリを有する複数のプログラマブルコントローラがネットワークに接続されており、該複数のプログラマブルコントローラが前記コモンメモリの格納データを共有するシステムにおける、任意の前記プログラマブルコントローラに対応して、そのプログラムのソースコードを任意に作成させる支援装置であって、
前記ソースコードをコンパイルするコンパイル手段を有し、
該コンパイル手段は、
前記コンパイルの際に、前記ソースコードの各変数に前記内部メモリの任意のアドレスを割当てると共に、該内部メモリの割当アドレスとその変数が前記複数のプログラマブルコントローラで共有する変数である共有変数であるか否かを示す情報を含む変数情報を生成する変数情報作成手段と、
前記変数情報の各共有変数毎に、前記コモンメモリの任意のアドレスを割り当てて、該コモンメモリの割当アドレスを前記変数情報に前記内部メモリの割当アドレスに対応付けて追加記録するコモンメモリ割当手段とを有することを特徴とするプログラマブルコントローラシステムの支援装置。
A plurality of programmable controllers each having an internal memory and a common memory are connected to a network, and the plurality of programmable controllers correspond to any of the programmable controllers in a system in which data stored in the common memory is shared. A support device for arbitrarily creating a source code of a program,
Compiling means for compiling the source code,
The compiling means is:
During the compilation, the assigning any address of the internal memory to each variable of the source code, it is a shared variable and assigned address of the internal memory, is that variable is a variable that is shared by the plurality of programmable controllers a variable information creating means for generating a variable information including the information indicating whether,
Common memory allocating means for allocating an arbitrary address of the common memory for each shared variable of the variable information, and additionally recording the allocated address of the common memory in association with the allocated address of the internal memory in the variable information; An apparatus for supporting a programmable controller system, comprising:
JP2014197564A 2014-04-24 2014-09-26 Programmable controller system and its support device Active JP6292096B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014197564A JP6292096B2 (en) 2014-04-24 2014-09-26 Programmable controller system and its support device

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2014090720 2014-04-24
JP2014090720 2014-04-24
JP2014197564A JP6292096B2 (en) 2014-04-24 2014-09-26 Programmable controller system and its support device

Publications (2)

Publication Number Publication Date
JP2015215865A JP2015215865A (en) 2015-12-03
JP6292096B2 true JP6292096B2 (en) 2018-03-14

Family

ID=54752660

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014197564A Active JP6292096B2 (en) 2014-04-24 2014-09-26 Programmable controller system and its support device

Country Status (1)

Country Link
JP (1) JP6292096B2 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6558250B2 (en) * 2016-01-14 2019-08-14 東芝三菱電機産業システム株式会社 Design support device
JP6821497B2 (en) * 2017-04-27 2021-01-27 株式会社日立産機システム Data sharing method in the program development system of the industrial controller and the program development system of the industrial controller
WO2019215919A1 (en) * 2018-05-11 2019-11-14 三菱電機株式会社 Compiler and programming assistance device
JP6950634B2 (en) * 2018-07-03 2021-10-13 オムロン株式会社 Control device and control method

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7024463B1 (en) * 1999-10-15 2006-04-04 Omron Corporation Network system, control method, control apparatus, and multiprocessor
JP4207105B2 (en) * 2001-03-15 2009-01-14 オムロン株式会社 system
JP3751536B2 (en) * 2001-04-02 2006-03-01 株式会社東芝 Data transmission equipment
JP2003271209A (en) * 2002-03-15 2003-09-26 Omron Corp Control device, expansion device and programming tool
JP5464027B2 (en) * 2010-04-15 2014-04-09 三菱電機株式会社 Network parameter automatic setting program and peripheral device of programmable controller
JP5757098B2 (en) * 2011-02-08 2015-07-29 富士電機株式会社 Program creation support apparatus and program creation support method

Also Published As

Publication number Publication date
JP2015215865A (en) 2015-12-03

Similar Documents

Publication Publication Date Title
CN110249274B (en) Program development system for industrial controller and data sharing method thereof
CN110892378B (en) Global variable migration through virtual memory overlay techniques during multi-version asynchronous dynamic software updates
JP5790128B2 (en) Programmable controller system and its support device
JP6292096B2 (en) Programmable controller system and its support device
JP6866663B2 (en) Programmable controller system, programmable controller, support device, HCI device, redundant programmable controller system
JP2009146229A (en) Programmable controller system
JP5119902B2 (en) Dynamic reconfiguration support program, dynamic reconfiguration support method, dynamic reconfiguration circuit, dynamic reconfiguration support device, and dynamic reconfiguration system
JP5757098B2 (en) Program creation support apparatus and program creation support method
JP5849592B2 (en) Programmable controller system, programming device thereof, programmable controller, program, and debugging method
JP2009157533A (en) Programmable controller system
JP4319082B2 (en) Programming system
JP2015125713A (en) Programmable controller and system, support device thereof, programmable controller, and program
JP6119452B2 (en) Programmable controller system, its support device, programmable controller, program
JP2008198143A (en) Program preparation support device and program preparation support method for programmable controller
WO2020075351A1 (en) Control device
JP6455096B2 (en) Control system, its support device, programmable control device
JP5978775B2 (en) PROGRAMMABLE CONTROLLER, ITS SUPPORT DEVICE, PROGRAM, PROGRAM TRANSFER METHOD
JP4760607B2 (en) Programmable controller
JP4778312B2 (en) Data processing device, program, editor device, and recording medium
JP6295914B2 (en) Programmable controller system, its support device, programmable controller
JP6076564B2 (en) System design support tool
JP4877257B2 (en) Programmable controller, programmable controller support apparatus, and programmable controller system
JP6020071B2 (en) Programmable controller system, its support device, programmable controller
JP6452924B1 (en) Compiler and programming support device
JP2009157534A (en) Programming support system, its programmable controller support device, and programmable indicator support device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170214

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20171107

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20171121

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20171214

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: 20180116

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180129

R150 Certificate of patent or registration of utility model

Ref document number: 6292096

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