JP5233544B2 - POU mounting method - Google Patents

POU mounting method Download PDF

Info

Publication number
JP5233544B2
JP5233544B2 JP2008238797A JP2008238797A JP5233544B2 JP 5233544 B2 JP5233544 B2 JP 5233544B2 JP 2008238797 A JP2008238797 A JP 2008238797A JP 2008238797 A JP2008238797 A JP 2008238797A JP 5233544 B2 JP5233544 B2 JP 5233544B2
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.)
Active
Application number
JP2008238797A
Other languages
Japanese (ja)
Other versions
JP2010072892A (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.)
Meidensha Corp
Original Assignee
Meidensha Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Meidensha Corp filed Critical Meidensha Corp
Priority to JP2008238797A priority Critical patent/JP5233544B2/en
Publication of JP2010072892A publication Critical patent/JP2010072892A/en
Application granted granted Critical
Publication of JP5233544B2 publication Critical patent/JP5233544B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Programmable Controllers (AREA)

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 variable definition unit 10 and a body unit (algorithm) 20. When the POU is executed, the POU instance is assigned with the operation data area (instance) having the configuration defined by the variable definition unit 10. A POU is a type, and different POU instances can be obtained by preparing different instances for one POU.

例えば、図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 body part 20 that is an arithmetic algorithm is common to each instance.

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.

Figure 0005233544
Figure 0005233544

これらの指定は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 variable definition unit 10 of the POU definition in FIG. 4 defines variable A as an initial value = 0, initial value = 1 in instance INS1, initial value = 2 in instance INS2, and initial value = 3 in instance INS3. be able to. That is, the attribute set in the variable definition unit 10 of the POU definition can be overwritten with the POU instance. With this function, different initial values can be set for each instance. The PLC executes the initialization of the instance area while referring to the attribute set at the start of calculation. That is, it is necessary to store the POU definition and the POU instance definition on the PLC main body side.

(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 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.

Figure 0005233544
Figure 0005233544
特開2008−040996号公報JP 2008-040996 A

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定義ファイルの変数の設定値をPOUインスタンス定義ファイルの変数定義情報に上書きし、POU定義ファイルはボディ部でのみ構成して、当該POU定義ファイルのボディ部と前記POU定義ファイルの変数の設定値を上書きしたPOUインスタンス定義ファイルとを前記PLC本体に転送することを特徴とする。
(1) Transfer the POU definition file and POU instance definition file that was created in the programming tool to the PLC, a mounting method of POU PLC body to slide into initialize the variable data to be set to an instance area of the data memory at the time of start-up ,
The programming tool is a variable definition part of the POU instance definition file, and refers to the variable in the POU definition file only when the variable attribute is not set in the variable definition part. POU instance definition file that overwrites the variable definition information of the POU instance definition file with the value, and that the POU definition file is composed only of the body part and overwrites the setting values of the body part of the POU definition file and the variables of the POU definition file. and wherein the transfer of bets on 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 unit of the POU instance definition file is an online function that provides change data to the instance area to be changed when the initial value / constant of the instance area is changed online while the PLC body is executing an operation. It is characterized by having change data.

以上のとおり、本発明によれば、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 transferring or variables POU while being reduced memory capacity for implementing 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 main body 100 and a programming tool (programming device) 200. The PLC main body 100 stores a main program, a POU definition file, and a POU instance definition file in the program memory 11, stores defined variables and input / output data in the data memory 12, and uses programs and data that are read sequentially from these. Then, the expected sequence calculation is executed by the calculation unit 13. Reference numeral 15 denotes a data input / output unit that inputs or outputs data to / from an apparatus to be controlled or processed by the controller 100.

プログラミングツール200は、パソコンなどを利用して、POU定義ファイル,POUインスタンス定義ファイルを定義および作成し、これらの組み合わせでアプリケーションプログラムを構築し、このプログラムおよびデータをUSBやイーサネット(登録商標)、RS−232Cポートを使用してPLC本体100に転送する。   The programming tool 200 uses a personal computer or the like to define and create a POU definition file and a POU instance definition file, construct an application program by combining these, and transfer the program and data to USB, Ethernet (registered trademark), RS Transfer to the PLC main body 100 using the -232C port.

以上のようなプログラマブルコントローラ(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 programming tool 200 includes the contents of the variable definition part A of the POU definition file 22 in the variable definition part a of the POU instance definition file 21 as pre-processing for transmitting the POU instance definition file to the PLC main body 100. It is converted into the (integrated) POU instance definition file 23 and transmitted. That is, the original POU instance definition file 21 is converted into a file called a POU instance definition file 23 and transferred to the PLC main body 100.

このように、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 initialization processing unit 14 of the PLC main body 100 performs initialization processing by directly referring to the variable definitions included in the same file. Therefore, the variable initialization process at the start of the PLC operation can be simplified, and the PLC activation time can be shortened.

(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 main body 100 does not use the variable definition part of the POU definition file. Therefore, when the programming tool 200 transmits the POU definition file 22 to the PLC main body 100, it is converted into the POU definition file 24 from which the variable definition part is deleted and transferred. That is, the original POU definition file 22 is transferred as a POU definition file 24 only for the body part B.

このように、PLC本体100に転送するPOU定義ファイル24には変数定義部Aがなくなるため、転送するPOU定義ファイル24のサイズが小さくなり、PLC本体100に必要となるメモリサイズが小さくできると共に転送時間を短縮できる。   Thus, since the POU definition file 24 to be transferred to the PLC main body 100 does not have the variable definition part A, the size of the POU definition file 24 to be transferred is reduced, and the memory size required for the PLC main body 100 can be reduced and transferred. You can save time.

(3)POUインスタンス定義ファイルの構成
POUインスタンス定義ファイル21にある変数定義部aでは各変数の変数属性や変数名などの情報を含んでいる。PLC本体100が変数を初期化する場合に本当に必要なのは、各変数の属性と初期値/定数と変数アドレスである。そこで、1つずつの変数定義を持つのでなく、インスタンス領域全体を対象にした変数定義にする。具体的には以下の表3に示すファイル構成(データ項目とその内容)にする。
(3) Configuration of POU Instance Definition File The variable definition part a in the POU instance definition file 21 includes information such as variable attributes and variable names of each variable. When the PLC main body 100 initializes a variable, what is really necessary is an attribute of each variable, an initial value / constant, and a variable address. Therefore, instead of having one variable definition at a time, the variable definition is for the entire instance area. Specifically, the file structure (data items and contents) shown in Table 3 below is used.

Figure 0005233544
Figure 0005233544

表中の項目のうち、ファイルヘッダは、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 instance definition file 23. For example, when 100 INT type variables are defined, if the original POU instance definition file uses 64B with one variable, 64B × 100 = 6400B is required. However, in the variable definition method for the entire instance area, the attribute data is 100 W (200 B), the initial value data is 100 W (200 B), the file header is several words, the size is 500 B or less, and the size is 1/10 or less. Become.

このように、POUインスタンス定義ファイル23の構成を変更することで、PLC本体100に送信するファイルサイズを大幅に小さくすることができる。このため、PLC本体100に必要となるメモリサイズも小さくて済み、転送時間も短縮できる。   Thus, by changing the configuration of the POU instance definition file 23, the file size transmitted to the PLC main body 100 can be greatly reduced. For this reason, the memory size required for the PLC main body 100 can be reduced, and the transfer time can be shortened.

(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 main body 100 becomes very simple.

具体的には、POUインスタンス定義ファイル23の属性データと初期値データを使用して、インスタンス領域の領域を16ビット単位または32ビット単位などで初期化することができる。しかも、変数のデータタイプに関係なく一気に初期化できる。   Specifically, using the attribute data and initial value data of the POU instance definition file 23, the instance area can be initialized in units of 16 bits or 32 bits. Moreover, it can be initialized at once regardless of the data type of the variable.

図2は、変数初期化処理部14による変数の初期化処理フローを示し、16ビット単位に初期化を行う場合であり、図5に比べて非常に簡単になる。図3は図2による初期化処理の模式図を示し、この図を参照して初期化処理を説明する。   FIG. 2 shows a variable initialization processing flow by the variable initialization processing unit 14, which is a case where initialization is performed in units of 16 bits, which is much simpler than FIG. FIG. 3 is a schematic diagram of the initialization process according to FIG. 2, and the initialization process will be described with reference to this figure.

図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 instance definition file 23, its attribute data, and initial value data are obtained (S11). Of these data, the negative logical product of the instance area (16 bits) and the attribute data (16 bits) is stored in the work memory (S12). By this processing, 16-bit data in which all the bits in which the initial value / constant of the instance area is written is set to “0” is stored in the work memory WM1 shown in FIG.

次に、属性データ(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 instance definition file 23 shown in FIG. 1, when the instance area is specified by the physical address in the attribute data, the variable cannot be initialized with the initialization process flow of FIG.

そのため、下記の表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.

Figure 0005233544
Figure 0005233544

上記の表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.

このように、POUインスタンス定義ファイルの項目として直接表現変数定義データを追加することにより、変数属性で物理アドレスが指定された場合には、直接表現変数定義データを使って対応できる。 In this way, by directly adding the expression variable definition data as an item of the POU 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 main body 100 is performing a calculation operation. That is, the initial value / constant is changed online. Although the initialization process for the instance area is performed at the start of the PLC calculation, it is necessary to initialize only the changed part even when the online change is performed.

そこで、表4の構成に加えてオンライン変更データを付加したPOUインスタンス定義ファイルの構成とする。このデータも属性データと同様にビット単位に意味を持たせ、論理「1」の部分のみオンライン変更対象とする。 Therefore , the POU instance definition file is configured by adding online change data in addition 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.

本発明の実施形態を示すプログラマブルコントローラ(PLC)の要部構成図。The principal part block diagram of the programmable controller (PLC) which shows embodiment of this invention. 変数の初期化処理フロー。Variable initialization process flow. 初期化処理の模式図。The schematic diagram of an initialization process. POU定義とインスタンス化。POU definition and instantiation. 変数の初期化処理フロー。Variable initialization process flow.

符号の説明Explanation of symbols

100 PLC本体
200 プログラミングツール
11 プログラムメモリ
12 データメモリ
13 演算部
14 変数初期化処理部
15 入出力部
21、23 POUインスタンス定義ファイル
22、24 POU定義ファイル
DESCRIPTION OF SYMBOLS 100 PLC main body 200 Programming tool 11 Program memory 12 Data memory 13 Calculation part 14 Variable initialization process part 15 Input / output part 21, 23 POU instance definition file 22, 24 POU definition file

Claims (5)

プログラミングツールで作成したPOU定義ファイルとPOUインスタンス定義ファイルをPLC本体に転送し、PLC本体は起動時にデータメモリのインスタンス領域に設定する変数データを初期化してゆくPOUの実装方式であって、
前記プログラミングツールは、POUインスタンス定義ファイルの変数定義部であって、当該変数定義部において変数属性が設定されていない場合に限り、POU定義ファイルの変数を参照し、当該POU定義ファイルの変数の設定値をPOUインスタンス定義ファイルの変数定義情報に上書きし、POU定義ファイルはボディ部でのみ構成して、当該POU定義ファイルのボディ部と前記POU定義ファイルの変数の設定値を上書きしたPOUインスタンス定義ファイルとを前記PLC本体に転送することを特徴とするPOUの実装方式。
Transfer the POU definition file and POU instance definition file that was created in the programming tool to the PLC, a mounting method of POU PLC body to slide into initialize the variable data to be set to an instance area of the data memory at startup,
The programming tool is a variable definition part of the POU instance definition file, and refers to the variable in the POU definition file only when the variable attribute is not set in the variable definition part. POU instance definition file that overwrites the variable definition information of the POU instance definition file with the value, and that the POU definition file is composed only of the body part and overwrites the setting values of the body part of the POU definition file and the variables of the POU definition file. mounting method of POU, characterized in that to transfer the bets on the PLC main body.
前記POUインスタンス定義ファイルの変数定義部は、前記PLC本体に設定するインスタンス領域全体を対象にした変数定義を行うファイル構成としたことを特徴とする請求項1に記載のPOUの実装方式。   2. The POU mounting method according to claim 1, wherein the variable definition section of the POU instance definition file has a file configuration that performs variable definition for the entire instance area set in the PLC main body. 前記POUインスタンス定義ファイルの変数定義部は、インスタンス領域の初期値/定数の領域を指定する属性データと、この指定領域に書き込む値を設定する初期値/定数データとを備え、前記PLC本体は前記属性データと初期値データによってインスタンス領域を初期化処理する手段を備えたことを特徴とする請求項1または2に記載のPOUの実装方式。   The variable definition section of the POU instance definition file includes attribute data that specifies an initial value / constant area of an instance area, and initial value / constant data that sets a value to be written to the specified area. 3. The POU mounting method according to claim 1, further comprising means for initializing the instance area using attribute data and initial value data. 前記POUインスタンス定義ファイルの変数定義部は、前記属性データでインスタンス領域が物理アドレスで指定された場合に変数定義データを与える直接表現変数定義データを備えたことを特徴とする請求項1〜3のいずれか1項に記載のPOUの実装方式。   The variable definition unit 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. The POU mounting method according to any one of the above items. 前記POUインスタンス定義ファイルの変数定義部は、前記PLC本体が演算実行中に、インスタンス領域の初期値/定数がオンラインで変更された場合に当該変更対象のインスタンス領域に変更データを与えるオンライン変更データを備えたことを特徴とする請求項1〜4のいずれか1項に記載のPOUの実装方式。 The variable definition part of the POU instance definition file stores online change data that gives change data to the change target instance area when the initial value / constant of the instance area is changed online while the PLC main body is executing an operation. The POU mounting method according to claim 1, wherein the POU mounting method is provided.
JP2008238797A 2008-09-18 2008-09-18 POU mounting method Active JP5233544B2 (en)

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 JP2010072892A (en) 2010-04-02
JP5233544B2 true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5790128B2 (en) * 2011-04-28 2015-10-07 富士電機株式会社 Programmable controller system and its support device
JP6992264B2 (en) * 2017-03-21 2022-01-13 株式会社明電舎 Programmable logic controller memory management method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3389592B2 (en) * 1997-01-27 2003-03-24 オムロン株式会社 Programmable controller
JP2000020297A (en) * 1998-07-01 2000-01-21 Omron Corp Controller
JP3541383B2 (en) * 2001-07-17 2004-07-07 横河電機株式会社 I / O device and process control system having I / O device
JP4319082B2 (en) * 2004-04-08 2009-08-26 三菱電機株式会社 Programming system
JP4760607B2 (en) * 2006-08-10 2011-08-31 株式会社明電舎 Programmable controller

Also Published As

Publication number Publication date
JP2010072892A (en) 2010-04-02

Similar Documents

Publication Publication Date Title
US11403025B2 (en) Matrix transfer accelerator system and method
US10228934B2 (en) Vehicle-mounted control device, program writing device, program generating device and program
US11232257B2 (en) Apparatuses, systems, and methods for providing a visual program for machine vision systems
TWI461910B (en) Memories and methods for performing atomic memory operations in accordance with configuration information
TWI291098B (en) Method and system for data optimization and protection in DSP firmware
CN110352412A (en) Matrix compression accelerator system and method
JP5233544B2 (en) POU mounting method
US8189897B2 (en) Program-controlled microscope and method for externally controlling microscopes
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
US10338891B2 (en) Migration between model elements of different types in a modeling environment
CN107851015A (en) Vector operations numerical digit size controls
JP2009048557A (en) Data update device, data update method, and data update program
JP5205988B2 (en) PLC global variable definition method
US10891136B1 (en) Data transmission between memory and on chip memory of inference engine for machine learning via a single data gathering instruction
JP6843823B2 (en) PLC program processing device
JP4479558B2 (en) Programmable controller and programming tool thereof
US12019422B2 (en) Control device with attribute setting for industrial machine, attribute setting system for control device for industrial machine, method of setting control device with attributes for industrial machine, and information storage medium for setting a control device with attributes
CN106909356A (en) The replacement method and device of method in java class
JP2012164182A (en) Fixed-length file generation processing system and method, and program
US10474662B2 (en) Method and system for database processing units
JP2023049058A (en) object operator
JP2004185290A (en) Reading/writing method to flash memory
JP2020201659A (en) Computation device, computation method, and computation program
JPH10105447A (en) Data processor
JP2008152451A (en) Information storage medium, medium processor and medium processing system

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