JP2010072892A - Mounting system for pou - Google Patents
Mounting system for pou Download PDFInfo
- Publication number
- JP2010072892A JP2010072892A JP2008238797A JP2008238797A JP2010072892A JP 2010072892 A JP2010072892 A JP 2010072892A JP 2008238797 A JP2008238797 A JP 2008238797A JP 2008238797 A JP2008238797 A JP 2008238797A JP 2010072892 A JP2010072892 A JP 2010072892A
- Authority
- JP
- Japan
- Prior art keywords
- pou
- instance
- definition
- variable
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Programmable Controllers (AREA)
Abstract
Description
本発明は、プログラマブルコントローラ(PLC)におけるPOUの実装方式に係り、特に、IEC61131−3(JISB3503)に準拠したプログラムを実行するためのPOUの構成、POU変数の転送、初期化処理に関する。 The present invention relates to a POU mounting method in a programmable controller (PLC), and more particularly, to a configuration of a POU for executing a program compliant with IEC61131-3 (JISB3503), transfer of POU variables, and initialization processing.
(1)POU定義とインスタンス化
IEC61131−3(JlSB3503)ではユーザが作成するプログラムをPOU(Program Organisation Unit)という型として登録する。POUは、図4に示すように、変数定義部10とボディ部(アルゴリズム)20から構成される。POUを実行させる場合には、変数定義部10で定義した構成の演算用データ領域(インスタンス)を割り付けたPOUインスタンスとすることになっている。POUは型であり、1つのPOUに別々のインスタンスを用意することで、別々のPOUインスタンスとすることができる。
(1) POU definition and instantiation In IEC61131-3 (JlSB3503), a program created by a user is registered as a type called POU (Program Organization Unit). As shown in FIG. 4, the POU includes a
例えば、図4では、「ポンプ運転」というPOUを作成し、演算対象としてポンプP1,P2,P3があった場合、3個のインスタンスINS1,INS2,INS3を用意することで、別々のポンプを同じPOUを使って演算させることができる。 For example, in FIG. 4, when a POU called “pump operation” is created and there are pumps P1, P2, and P3 as calculation targets, three instances INS1, INS2, and INS3 are prepared, so that different pumps are the same. It can be calculated using POU.
このような処理をPOUのインスタンス化と呼んでいる。演算アルゴリズムであるボディ部20は各インスタンスで共通のものが使用される。
Such a process is called instantiation of the POU. The
IEC61131−3(JISB3503)ではPOU定義とPOUインスタンスは別管理になっており、通常、プログラミングツールでは別ファイルとして管理することになる(例えば、特許文献1参照)。 In IEC61131-3 (JISB3503), the POU definition and the POU instance are managed separately, and are usually managed as separate files in the programming tool (see, for example, Patent Document 1).
(2)変数の属性
IEC61131−3(JISB3503)では変数に表1に示すような属性を持たせることができる。
(2) Variable attributes In IEC61131-3 (JISB3503), attributes as shown in Table 1 can be given to variables.
これらの指定はPOU定義の変数定義部でもできるし、POUインスタンスでも可能である。例えば、図4のPOU定義の変数定義部10では変数Aを初期値=0として定義して、インスタンスINS1では初期値=1、インスタンスINS2では初期値=2、インスタンスINS3では初期値=3とすることができる。即ち、POU定義の変数定義部10で設定した属性を、POUインスタンスで上書きすることができる。この機能により、インスタンス毎に別々の初期値を設定できる。PLCは演算開始時に設定された属性を参照しながらインスタンス領域の初期化を実行することになる。即ち、PLC本体側ではPOU定義及びPOUインスタンス定義を記憶しておく必要がある。
These designations can be made in the variable definition part of the POU definition or in the POU instance. For example, the
(3)POU定義ファイル及びPOUインスタンス定義ファイル
上記のように、インスタンス領域の初期化のために、POU定義やPOUインスタンス定義をPLC本体で記億する必要がある。初期化処理は最初にPOUインスタンス定義に従って実行し、POUインスタンス定義で属性設定がない場合にはPOU定義に従って初期化を行う。図5に変数の初期化処理フローを示す。
(3) POU definition file and POU instance definition file As described above, it is necessary to store the POU definition and the POU instance definition in the PLC main body in order to initialize the instance area. Initialization processing is first executed according to the POU instance definition, and if there is no attribute setting in the POU instance definition, initialization is performed according to the POU definition. FIG. 5 shows a variable initialization process flow.
図5において、複数の変数のうち、先頭の変数を読み込み(S1)、当該変数がPOUインスタンスで保持属性(RETAIN)を設定しているか否かをチェックし(S2)、保持属性として設定している場合は初期化しないで、全変数についてチェックしたかを確認し(S3)、全変数についてチェックが終了していない場合には次の変数について初期化処理に入る(S4)。 In FIG. 5, among the plurality of variables, the first variable is read (S1), and whether or not the variable has a holding attribute (RETAIN) set in the POU instance (S2) is set as a holding attribute. If the check is not completed for all variables, the initialization process is started for the next variable (S4).
POUインスタンスで保持属性を設定していない場合(S2)、当該POUインスタンスで初期値または定数(CONSTANT)を設定しているか否かをチェックし(S5)、設定している場合にはインスタンス領域に初期値または定数属性を書き込み(S6)、次の変数についてのチェックに入る(S3)。設定していない場合にはPOU定義で初期値または定数を設定しているか否かをチェックし(S7)、設定している場合はインスタンス領域に初期値または定数属性を書き込む(S6)。設定していない場合はデフォルトを初期値とし、次の変数についてのチェックに入る(S3)。 When the holding attribute is not set in the POU instance (S2), it is checked whether an initial value or a constant (CONSTANT) is set in the POU instance (S5). The initial value or constant attribute is written (S6), and the next variable is checked (S3). If it is not set, it is checked whether or not an initial value or constant is set in the POU definition (S7). If it is set, the initial value or constant attribute is written in the instance area (S6). If not set, the default is the initial value, and the next variable is checked (S3).
上記のような変数初期化処理を行うためには、POU定義とPOUインスタンス定義の両方をPLC本体に持つ必要がある。これらはプログラミングツールで作成され、PLC本体に通信などの方法で転送される。一般的にこれらは下記のように、ファイルとして扱ったほうが通信するのに便利である。 In order to perform the variable initialization process as described above, it is necessary to have both the POU definition and the POU instance definition in the PLC body. These are created by a programming tool and transferred to the PLC main body by a method such as communication. In general, these are more convenient for communication if treated as a file, as described below.
(a)POU定義ファイル
POU定義ファイルには変数定義部とボティ部がある。変数定義部には変数の名称、型、属性、初期値、物理アドレスなどの情報が格納される。ボディ部にはアルゴリズムが格納され、具体的にはPLCのマシンコードや中間言語イメージが格納される。
(A) POU definition file The POU definition file has a variable definition part and a body part. The variable definition section stores information such as variable names, types, attributes, initial values, and physical addresses. An algorithm is stored in the body part, specifically, a PLC machine code and an intermediate language image are stored.
(b)POUインスタンス定義ファイル
POUインスタンス定義ファイルには変数定義部のみがあれば良い。アルゴリズムはPOU定義ファイルのものが使用できるためである。変数定義部はPOU定義ファイルと同等のものが必要となる。
(B) POU instance definition file The POU instance definition file only needs to have a variable definition section. This is because the algorithm of the POU definition file can be used. The variable definition part must be equivalent to the POU definition file.
(4)変数定義
POU定義ファイルやPOUインスタンス定義ファイルでは変数定義部で変数を個別に定義することになる。表2に変数定義の項目とその説明を示す。
(4) Variable definition In the POU definition file and the POU instance definition file, variables are individually defined in the variable definition section. Table 2 shows the variable definition items and their descriptions.
POU定義ファイルとPOUインスタンス定義ファイルは変数の数が多いほど大きいものになる。たとえBOOL型変数であっても、その1つ1つについての情報が必要になる。PLCは一般にBOOLデータを扱うプログラムが主流である。そのため、使用する変数が多い場合、POU定義ファイルやPOUインスタンス定義ファイルは大きいものになってしまう。 The POU definition file and the POU instance definition file become larger as the number of variables increases. Even if it is a Boolean variable, information about each one is required. In general, the PLC is mainly a program that handles BOOT data. Therefore, when there are many variables to be used, the POU definition file and the POU instance definition file become large.
例えば、前記の表2で示した変数定義が、変数1個につき64バイト必要だったとした場合、BOOL型変数が100個あっただけで、変数定義は6400バイト必要になる。本来、100ビットの変数のために、これだけ大きい情報が必要になる。このことにより、以下のような問題が発生する。 For example, if the variable definition shown in Table 2 requires 64 bytes for each variable, there are only 100 BOOL type variables, and the variable definition requires 6400 bytes. Essentially, such a large amount of information is required for a 100-bit variable. This causes the following problems.
(1)PLC本体に多くのメモリを必要とする。 (1) The PLC main body requires a lot of memory.
(2)メモリ容量が大きい分、PLCのコストが上昇する。 (2) Since the memory capacity is large, the cost of the PLC increases.
(3)プログラミングツールからPLC本体へのデータ転送時間が長くなる。 (3) The data transfer time from the programming tool to the PLC main body becomes longer.
本発明の目的は、POU変数を実装するためのメモリ容量を削減すると共にPOUの転送や変数の初期化処理を簡易にしたPOUの実装方式を提供することにある。 An object of the present invention is to provide a POU mounting system that reduces the memory capacity for mounting POU variables and simplifies POU transfer and variable initialization processing.
本発明は、前記の課題を解決するため、POU定義ファイルの変数定義情報をPOUインスタンス定義ファイルの変数定義に統合し、PLC本体に送信するPOU定義ファイルから変数定義部を削除し、POUインスタンス定義ファイルの変数定義部はインスタンス領域全体を対象にした変数定義を行うファイル構成とし、さらに変数定義部はインスタンス領域の初期値/定数の領域を指定する属性データと、この指定領域に書き込む値を設定する初期値データとによってインスタンス領域の初期化処理を可能にし、属性データで物理アドレスを指定された場合には直接表現変数定義データの追加によって初期化処理を可能にし、PLC本体が演算実行中に、インスタンス領域の初期値/定数の変更にはオンライン変更データの追加によってオンラインでも変更可能にしたもので、以下の実装方式を特徴とする。 In order to solve the above problems, the present invention integrates the variable definition information of the POU definition file into the variable definition of the POU instance definition file, deletes the variable definition part from the POU definition file transmitted to the PLC body, and The variable definition part of the file has a file structure that defines variables for the entire instance area, and the variable definition part sets attribute data that specifies the initial value / constant area of the instance area and the value to be written to this specified area The instance area can be initialized by initial value data, and when the physical address is specified by the attribute data, the initialization process can be performed by adding the direct expression variable definition data. To change the initial value / constant of the instance area, add online change data. Obtained by the possible changes in inline, characterized by the following mounting method.
(1)プログラミングツールで作成したPOU定義ファイルとPOUインスタンス定義ファイルをPLC本体に転送し、PLC本体は起動時にデータメモリのインスタンス領域に設定する変数データを初期化しておくPOUの実装方式であって、
前記プログラミングツールは、POUインスタンス定義ファイルの変数定義部にPOU定義ファイルの変数定義情報を統合し、POU定義ファイルはボディ部でのみ構成して前記PLC本体に転送することを特徴とする。
(1) A POU implementation method in which a POU definition file and a POU instance definition file created by a programming tool are transferred to the PLC main body, and the PLC main body initializes variable data to be set in the instance area of the data memory at startup. ,
The programming tool integrates the variable definition information of the POU definition file into the variable definition part of the POU instance definition file, and the POU definition file is configured only in the body part and transferred to the PLC main body.
(2)前記POUインスタンス定義ファイルの変数定義部は、前記PLC本体に設定するインスタンス領域全体を対象にした変数定義を行うファイル構成としたことを特徴とする。 (2) The variable definition section of the POU instance definition file is characterized in that it has a file configuration for defining variables for the entire instance area set in the PLC main body.
(3)前記POUインスタンス定義ファイルの変数定義部は、インスタンス領域の初期値/定数の領域を指定する属性データと、この指定領域に書き込む値を設定する初期値/定数データとを備え、前記PLC本体は前記属性データと初期値データによってインスタンス領域を初期化処理する手段を備えたことを特徴とする。 (3) The variable definition section of the POU instance definition file includes attribute data for specifying an initial value / constant area of the instance area, and initial value / constant data for setting a value to be written in the specified area, and the PLC The main body includes means for initializing the instance area with the attribute data and the initial value data.
(4)前記POUインスタンス定義ファイルの変数定義部は、前記属性データでインスタンス領域が物理アドレスで指定された場合に変数定義データを与える直接表現変数定義データを備えたことを特徴とする。 (4) The variable definition section of the POU instance definition file includes direct expression variable definition data that provides variable definition data when an instance area is specified by a physical address in the attribute data.
(5)前記POUインスタンス定義ファイルの変数定義部は、PLC本体が演算実行中に、インスタンス領域の初期値/定数が変更された場合にオンライン変更対象の変更データを与えるオンライン変更データを備えたことを特徴とする。 (5) The variable definition section of the POU instance definition file includes online change data that provides change data to be changed online when the initial value / constant of the instance area is changed while the PLC main body is executing an operation. It is characterized by.
以上のとおり、本発明によれば、POU定義ファイルの変数定義情報をPOUインスタンス定義ファイルの変数定義に統合し、PLC本体に送信するPOU定義ファイルから変数定義部を削除し、POUインスタンス定義ファイルの変数定義部はインスタンス領域全体を対象にした変数定義を行うファイル構成とし、さらに変数定義部はインスタンス領域の初期値/定数の領域を指定する属性データと、この指定領域に書き込む値を設定する初期値データとによってインスタンス領域の初期化処理を可能にし、属性データで物理アドレスを指定された場合には直接表現変数定義データの追加によって初期化処理を可能にし、PLC本体が演算実行中に、インスタンス領域の初期値/定数の変更にはオンライン変更データの追加によってオンラインでも変更可能にしたため、POU変数を実装するためのメモリ容量を削減されると共にPOUの転送や変数の初期化処理が簡易になる。 As described above, according to the present invention, the variable definition information of the POU definition file is integrated into the variable definition of the POU instance definition file, the variable definition part is deleted from the POU definition file transmitted to the PLC main body, and the POU instance definition file The variable definition part has a file structure that defines variables for the entire instance area, and the variable definition part is the initial value that sets the attribute data that specifies the initial value / constant area of the instance area and the value that is written to this specified area. The instance area can be initialized by the value data, and when the physical address is specified by the attribute data, the initialization process can be performed by adding the expression variable definition data directly. To change the initial value / constant of the area, add online change data. Since you can also be changed in emissions, the initialization process of transfer and variables of POU while being reduced memory capacity for implementing the POU variables is simplified.
図1は、本発明の実施形態を示すプログラマブルコントローラ(PLC)の要部構成図であり、POUの実装方式に係る部分のみを示す。 FIG. 1 is a main part configuration diagram of a programmable controller (PLC) showing an embodiment of the present invention, and shows only a part related to a POU mounting system.
プログラマブルコントローラ(PLC)は、PLC本体100とプログラミングツール(プログラミング装置)200でシステムが構築される。PLC本体100は、プログラムメモリ11にメインプログラムやPOU定義ファイルおよびPOUインスタンス定義ファイルを格納し、データメモリ12には定義された変数および入出力データを格納し、これらから逐次読み出すプログラムとデータを使って演算部13で所期のシーケンス演算を実行する。15はコントローラ100の制御対象または処理対象となる装置との間のデータ入力または出力を行うデータ入出力部である。
The programmable controller (PLC) is configured by a PLC
プログラミングツール200は、パソコンなどを利用して、POU定義ファイル,POUインスタンス定義ファイルを定義および作成し、これらの組み合わせでアプリケーションプログラムを構築し、このプログラムおよびデータをUSBやイーサネット(登録商標)、RS−232Cポートを使用してPLC本体100に転送する。
The
以上のようなプログラマブルコントローラ(PLC)において、本発明の実施形態では以下のPOUの実装方式とする。 In the programmable controller (PLC) as described above, the following POU mounting method is used in the embodiment of the present invention.
(1)POUインスタンス定義ファイルにPOU定義の初期化データを統合
PLC起動時には変数を初期化する必要がある。図5にその手順を示した。図5ではPOUインスタンス定義ファイルとPOU定義ファイルの内容によって初期化を行っている。これにより、POU定義で設定された定数とPOUインスタンス定義で設定された定数が異なる場合にも対応できるようにする。ここで、POUインスタンスで初期値や定数が設定されていない場合には、POU定義を参照して、その初期値/定数があればそれを初期値/定数として初期化処理を行っている。
(1) Integration of POU definition initialization data into the POU instance definition file It is necessary to initialize variables when starting the PLC. FIG. 5 shows the procedure. In FIG. 5, initialization is performed according to the contents of the POU instance definition file and the POU definition file. Thereby, it is possible to cope with a case where the constant set in the POU definition and the constant set in the POU instance definition are different. Here, if no initial value or constant is set in the POU instance, the POU definition is referred to, and if there is an initial value / constant, initialization processing is performed using the initial value / constant as an initial value / constant.
そこで、POUインスタンス定義ファイルの変数定義部にPOU定義ファイルの初期化情報も含めてしまう統合を行う。即ち、POUインスタンス定義ファイルで変数属性が設定されていない場合に限り、POU定義ファイルの変数を参照し、そこに初期値/定数が設定されていれば、POUインスタンス定義ファイルの変数定義の初期値/定数に上書きする。 Therefore, integration is performed to include initialization information of the POU definition file in the variable definition part of the POU instance definition file. That is, only when the variable attribute is not set in the POU instance definition file, the variable in the POU instance definition file is referred to and the initial value / constant is set there. / Overwrite constants.
こうすることで、PLC本体では変数初期化でPOU定義ファイルを参照しなくても良くなり、PLC動作開始時の変数初期化処理が簡略化され、PLC起動時間が短縮される。 By doing so, the PLC main body does not need to refer to the POU definition file for variable initialization, the variable initialization process at the start of the PLC operation is simplified, and the PLC startup time is shortened.
以上のことから、プログラミングツール200では、PLC本体100にPOUインスタンス定義ファイルを送信する前処理として、POUインスタンス定義ファイル21の変数定義部aにPOU定義ファイル22の変数定義部Aの内容を含んだ(統合した)POUインスタンス定義ファイル23に変換して送信する。即ち、元のPOUインスタンス定義ファイル21はPOUインスタンス定義ファイル23というファイルに変換してPLC本体100に転送する。
From the above, the
このように、POU定義ファイルの変数定義をPOUインスタンス定義ファイルに統合することで、PLC本体100の変数初期化処理部14は、同じファイルに含まれる変数定義を直接に参照して初期化処理することができ、PLC動作開始時の変数初期化処理を簡略化でき、PLC起動時間を短縮できる。
In this way, by integrating the variable definitions in the POU definition file into the POU instance definition file, the variable
(2)POU定義ファイルから変数定義部を削除
上記の変数定義部の統合により、PLC本体100ではPOU定義ファイルの変数定義部を使用しなくなる。そこで、プログラミングツール200がPLC本体100にPOU定義ファイル22を送信する場合には変数定義部を削除したPOU定義ファイル24に変換して転送する。即ち、元のPOU定義ファイル22は、そのボディ部BだけにしたPOU定義ファイル24にして転送される。
(2) Deleting the variable definition part from the POU definition file By integrating the variable definition part, the PLC
このように、PLC本体100に転送するPOU定義ファイル24には変数定義部Aがなくなるため、転送するPOU定義ファイル24のサイズが小さくなり、PLC本体100に必要となるメモリサイズが小さくできると共に転送時間を短縮できる。
Thus, since the variable definition part A is not present in the
(3)POUインスタンス定義ファイルの構成
POUインスタンス定義ファイル21にある変数定義部aでは各変数の変数属性や変数名などの情報を含んでいる。PLC本体100が変数を初期化する場合に本当に必要なのは、各変数の属性と初期値/定数と変数アドレスである。そこで、1つずつの変数定義を持つのでなく、インスタンス領域全体を対象にした変数定義にする。具体的には以下の表3に示すファイル構成(データ項目とその内容)にする。
(3) Configuration of POU Instance Definition File The variable definition section a in the POU
表中の項目のうち、ファイルヘッダは、POUインスタンス定義ファイルのヘッダ情報を書き込む。具体的には属性データや初期値データのサイズなどである
層性データは、インスタンス領域と同じ大きさを持ち、インスタンス領域のどこが初期値/定数であるかを示す。対象データがBOOLの場合には初期値/定数はビット単位になり、WORDの場合には16ビット単位になる。これにより、対象とする変数のデータタイプは意識しないで初期化できるようになる。例えば、1で初期値/定数属性、0で保持属性とする。
Of the items in the table, the file header writes the header information of the POU instance definition file. Specifically, the layer data such as the size of attribute data and initial value data has the same size as the instance area, and indicates where in the instance area is the initial value / constant. When the target data is BOOL, the initial value / constant is in units of bits, and in the case of WORD, it is in units of 16 bits. This makes it possible to initialize without considering the data type of the target variable. For example, 1 is an initial value / constant attribute, and 0 is a holding attribute.
初期値データは、インスタンス領域と同じ大きさを持ち、属性データで初期値/定数と指定されている領域に書き込む値を設定する。対象データがBOOLの場合には初期値/定数はビット単位になり、WORDの場合には16ビット単位になる。これにより、対象の変数のデータタイプは意識しないで初期化できるようになる。 The initial value data has the same size as the instance area, and sets a value to be written in the area designated as the initial value / constant in the attribute data. When the target data is BOOL, the initial value / constant is in units of bits, and in the case of WORD, it is in units of 16 bits. This makes it possible to initialize without considering the data type of the target variable.
このように、インスタンス領域全体を対象にした変数定義により、POUインスタンス定義ファイル23のサイズが小さくなる。例えば、INT型変数100個の定義をした場合、元のPOUインスタンス定義ファイルでは1変数で64Bを使用していたとすると、64B×100=6400Bを必要としていた。しかし、インスタンス領域全体を対象にした変数定義方式では属性データが100W(200B)、初期値データが100W(200B)、ファイルヘッダが数ワードであり、500B以下のサイズになり、1/10以下になる。
Thus, the variable definition for the entire instance area reduces the size of the POU
このように、POUインスタンス定義ファイル23の構成を変更することで、PLC本体100に送信するファイルサイズを大幅に小さくすることができる。このため、PLC本体100に必要となるメモリサイズも小さくて済み、転送時間も短縮できる。
Thus, by changing the configuration of the POU
(4)変数の初期化処理
前記の変数定義の統合およびPOUインスタンス定義ファイルの構成変更により、PLC本体100の動作開始時に行う変数の初期化処理が非常に簡単になる。
(4) Variable initialization process By integrating the variable definitions and changing the configuration of the POU instance definition file, the variable initialization process performed at the start of the operation of the PLC
具体的には、POUインスタンス定義ファイル23の属性データと初期値データを使用して、インスタンス領域の領域を16ビット単位または32ビット単位などで初期化することができる。しかも、変数のデータタイプに関係なく一気に初期化できる。
Specifically, using the attribute data and initial value data of the POU
図2は、変数初期化処理部14による変数の初期化処理フローを示し、16ビット単位に初期化を行う場合であり、図5に比べて非常に簡単になる。図3は図2による初期化処理の模式図を示し、この図を参照して初期化処理を説明する。
FIG. 2 shows a variable initialization processing flow by the variable
図1において、データメモリ12のインスタンス領域に対して、その属性データは前記の表3の定義からインスタンス領域と同じ大きさを有してインスタンス領域のどこ(どのビット)が初期値/定数であるかを示し、図3では先頭の16ビットが論理「1」になり、これに対応するインスタント領域の16ビットが初期値/定数であることを対応付ける。また、初期値データは、表3の定義からインスタンス領域と同じ大きさを有し、属性データでの初期値/定数と指定される領域に書き込む初期値が設定され、図3では先頭の16ビットに初期値(2進数)が書き込まれている。 In FIG. 1, the attribute data of the instance area of the data memory 12 has the same size as the instance area from the definition of Table 3 above, and where (which bit) of the instance area is the initial value / constant. In FIG. 3, the first 16 bits are logical “1”, and the corresponding 16 bits of the instant area are associated with the initial value / constant. In addition, the initial value data has the same size as the instance area from the definition in Table 3, and the initial value written in the area designated as the initial value / constant in the attribute data is set. Is written with an initial value (binary number).
図2において、まず、POUインスタンス定義ファイル23の先頭のインスタンス領域とその属性データと初期値データを得る(S11)。これらデータのうちインスタンス領域(16ビット)と属性データ(16ビット)の否定の論理積をワークメモリに格納する(S12)。この処理により、図3に示すワークメモリWM1にはインスタンス領域の初期値/定数が書き込まれるビットを全て「0」にした16ビットデータが格納される。
In FIG. 2, first, the top instance area of the POU
次に、属性データ(16ビット)と初期値データ(16ビット)の論理積をワークメモリWM2に格納する(S13)。この処理により、図3に示すワークメモリWM2には16ビットの初期値データが格納される。 Next, the logical product of the attribute data (16 bits) and the initial value data (16 bits) is stored in the work memory WM2 (S13). By this processing, 16-bit initial value data is stored in the work memory WM2 shown in FIG.
次に、ワークメモリWM1とワークメモリWM2の論理和をインスタンス領域(16ビット)に格納する(S14)。 Next, the logical sum of the work memory WM1 and the work memory WM2 is stored in the instance area (16 bits) (S14).
これら処理により、インスタンス領域には初期値データがそのまま書き込まれ、当該インスタンス領域の初期化を終了する。また、属性データが全て「0」の場合は、ワークメモリWM2には全て「0」が格納され、ワークメモリWM1にはインスタンス領域のデータが格納され、その論理和はインスタンス領域のデータそのものに更新される。 By these processes, the initial value data is written in the instance area as it is, and the initialization of the instance area is completed. When all the attribute data is “0”, all “0” is stored in the work memory WM2, the instance area data is stored in the work memory WM1, and the logical sum is updated to the instance area data itself. Is done.
1つのインスタンス領域について初期化が終了したか否かをチェックし(S15)、終わりでなければ、次のインスタンス領域(16ビット)、属性データ、初期値データのデータを得、S12に戻って当該インスタンス領域の初期化を行うという繰り返しになる。 It is checked whether or not initialization has been completed for one instance area (S15). If not, the next instance area (16 bits), attribute data, and initial value data are obtained. It is repeated that the instance area is initialized.
このように、POUインスタンス定義ファイルの構成として、属性データと初期値データを設けることで、PLC動作開始時の変数の初期化処理を簡略化でき、PLC起動時間を短縮できる。 Thus, by providing the attribute data and the initial value data as the configuration of the POU instance definition file, the variable initialization process at the start of the PLC operation can be simplified, and the PLC activation time can be shortened.
(5)物理アドレスヘの対応
図1に示すPOUインスタンス定義ファイル23では属性データでインスタンス領域が物理アドレスで指定された場合に、図2の初期化処理フローのままでは変数の初期化ができない。
(5) Correspondence to Physical Address In the POU
そのため、下記の表4で示すPOUインスタンス定義ファイルの構成とし、変数が物理アドレスを指定された場合にのみ、直接表現変数定義データを使用する。 Therefore, the structure of the POU instance definition file shown in Table 4 below is used, and the direct expression variable definition data is used only when the physical address is designated as the variable.
上記の表4のうち、表3と異なる部分は、ファイルヘッダを変更し、直接表現変数定義データを追加した点にある。ファイルヘッダは、POUインスタンス定義ファイルのヘッダ情報を示す。具体的には属性データや初期値データのサイズなどに加えて、直接表現変数の個数が必要になる。直接表現変数定義データは変数属性で物理アドレスが指定された場合の変数定義データであり、必要個数だけ並ぶ。構成は前記の表2と同等になる。 Of Table 4 above, the difference from Table 3 is that the file header is changed and expression variable definition data is added directly. The file header indicates header information of the POU instance definition file. Specifically, in addition to the size of attribute data and initial value data, the number of direct expression variables is required. The direct expression variable definition data is variable definition data when a physical address is specified by a variable attribute, and is arranged in the required number. The configuration is the same as in Table 2 above.
このように、PUインスタンス定義ファイルの項目として直接表現変数定義データを追加することにより、変数属性で物理アドレスが指定された場合には、直接表現変数定義データを使って対応できる。 In this way, by directly adding the expression variable definition data as an item of the PU instance definition file, when the physical address is specified by the variable attribute, it can be handled using the expression variable definition data directly.
(6)オンライン変更への対応
PLC本体100が演算動作中に、POUインスタンス定義ファイルをオンラインで変更する場合がある。即ち、初期値/定数の変更をオンラインで行う場合である。インスタンス領域に対する初期化処理はPLC演算開始時に行うが、オンライン変更時にも変更があった部分だけを初期化する必要がある。
(6) Response to online change The POU instance definition file may be changed online while the PLC
そこで、下記の表5で示すPOUインスタンス定義ファイルの構成とし、表4の構成に加えてオンライン変更データを付加する。このデータも属性データと同様にビット単位に意味を持たせ、論理「1」の部分のみオンライン変更対象とする。 Therefore, the POU instance definition file is configured as shown in Table 5 below, and online change data is added to the configuration of Table 4. Similar to the attribute data, this data also has a meaning in bit units, and only the logic “1” part is subject to online change.
具体的には、図2の初期化処理と同様に、初期値データとオンライン変更データの論理積(A)と、インスタンスデータとオンライン変更データの否定の論理積(B)を求め、AとBの論理和をインスタンスデータに書き込めばよい。 Specifically, as in the initialization process of FIG. 2, the logical product (A) of the initial value data and the online change data and the negative logical product (B) of the instance data and the online change data are obtained, and A and B Can be written in the instance data.
このように、POUインスタンス定義ファイルの項目としてオンライン変更データを追加することにより、変数のオンライン変更に対応できるようになる。 Thus, by adding online change data as an item of the POU instance definition file, it becomes possible to cope with online change of variables.
100 PLC本体
200 プログラミングツール
11 プログラムメモリ
12 データメモリ
13 演算部
14 変数初期化処理部
15 入出力部
21、23 POUインスタンス定義ファイル
22、24 POU定義ファイル
DESCRIPTION OF
Claims (5)
前記プログラミングツールは、POUインスタンス定義ファイルの変数定義部にPOU定義ファイルの変数定義情報を統合し、POU定義ファイルはボディ部でのみ構成して前記PLC本体に転送することを特徴とするPOUの実装方式。 The POU definition file created by the programming tool and the POU instance definition file are transferred to the PLC main body, and the PLC main body is a POU mounting method for initializing the variable data set in the instance area of the data memory at the time of startup.
The programming tool integrates the variable definition information of the POU definition file into the variable definition part of the POU instance definition file, and the POU definition file is composed only of the body part and transferred to the PLC main body. method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008238797A JP5233544B2 (en) | 2008-09-18 | 2008-09-18 | POU mounting method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008238797A JP5233544B2 (en) | 2008-09-18 | 2008-09-18 | POU mounting method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2010072892A true JP2010072892A (en) | 2010-04-02 |
JP5233544B2 JP5233544B2 (en) | 2013-07-10 |
Family
ID=42204618
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008238797A Active JP5233544B2 (en) | 2008-09-18 | 2008-09-18 | POU mounting method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5233544B2 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012234272A (en) * | 2011-04-28 | 2012-11-29 | Fuji Electric Co Ltd | Programmable controller system and support device therefor |
JP2018156511A (en) * | 2017-03-21 | 2018-10-04 | 株式会社明電舎 | Method of controlling a programmable logic controller memory |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10207512A (en) * | 1997-01-27 | 1998-08-07 | Omron Corp | Programmable controller |
JP2000020297A (en) * | 1998-07-01 | 2000-01-21 | Omron Corp | Controller |
JP2003029806A (en) * | 2001-07-17 | 2003-01-31 | Yokogawa Electric Corp | Input/output device and process control system having input/output device |
JP2005301520A (en) * | 2004-04-08 | 2005-10-27 | Mitsubishi Electric Corp | Programming system |
JP2008040996A (en) * | 2006-08-10 | 2008-02-21 | Meidensha Corp | Programmable controller |
-
2008
- 2008-09-18 JP JP2008238797A patent/JP5233544B2/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH10207512A (en) * | 1997-01-27 | 1998-08-07 | Omron Corp | Programmable controller |
JP2000020297A (en) * | 1998-07-01 | 2000-01-21 | Omron Corp | Controller |
JP2003029806A (en) * | 2001-07-17 | 2003-01-31 | Yokogawa Electric Corp | Input/output device and process control system having input/output device |
JP2005301520A (en) * | 2004-04-08 | 2005-10-27 | Mitsubishi Electric Corp | Programming system |
JP2008040996A (en) * | 2006-08-10 | 2008-02-21 | Meidensha Corp | Programmable controller |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012234272A (en) * | 2011-04-28 | 2012-11-29 | Fuji Electric Co Ltd | Programmable controller system and support device therefor |
JP2018156511A (en) * | 2017-03-21 | 2018-10-04 | 株式会社明電舎 | Method of controlling a programmable logic controller memory |
JP6992264B2 (en) | 2017-03-21 | 2022-01-13 | 株式会社明電舎 | Programmable logic controller memory management method |
Also Published As
Publication number | Publication date |
---|---|
JP5233544B2 (en) | 2013-07-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10228934B2 (en) | Vehicle-mounted control device, program writing device, program generating device and program | |
US10115230B2 (en) | Run-time optimized shader programs | |
US8970613B2 (en) | Render tree caching | |
JP2007164526A5 (en) | ||
TWI291098B (en) | Method and system for data optimization and protection in DSP firmware | |
JPWO2009017131A1 (en) | Nondeterministic finite automaton generation system, method and program without ε transition | |
JPH04172533A (en) | Electronic computer | |
JP5233544B2 (en) | POU mounting method | |
JP2007087127A (en) | Data generation program, storage medium for storing the program, open source software developmental environment integration program, and storage medium for storing the program | |
US9766866B2 (en) | Techniques for determining instruction dependencies | |
CN107851015A (en) | Vector operations numerical digit size controls | |
US10338891B2 (en) | Migration between model elements of different types in a modeling environment | |
US20190057125A1 (en) | System and method for managing log data | |
JP2009048557A (en) | Data update device, data update method, and data update program | |
CN113001538B (en) | Command analysis method and system | |
JP5205988B2 (en) | PLC global variable definition method | |
JP4479558B2 (en) | Programmable controller and programming tool thereof | |
CN106909356A (en) | The replacement method and device of method in java class | |
US20230214445A1 (en) | Electronic device and control method for electronic device | |
WO2021149368A1 (en) | Processing unit and processing system | |
JP6400191B2 (en) | Instruction set generation that implements rules designed to update specified objects according to the application data model | |
US20140317386A1 (en) | Techniques for determining instruction dependencies | |
JP2023049058A (en) | object operator | |
JP2004185290A (en) | Reading/writing method to flash memory | |
JP2024503035A (en) | lightweight extension |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110510 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120911 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20120912 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20121026 |
|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20121026 |
|
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: 20130226 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20130311 |
|
R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 Ref document number: 5233544 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20160405 Year of fee payment: 3 |