JP2007280214A - Programmable controller - Google Patents

Programmable controller Download PDF

Info

Publication number
JP2007280214A
JP2007280214A JP2006107895A JP2006107895A JP2007280214A JP 2007280214 A JP2007280214 A JP 2007280214A JP 2006107895 A JP2006107895 A JP 2006107895A JP 2006107895 A JP2006107895 A JP 2006107895A JP 2007280214 A JP2007280214 A JP 2007280214A
Authority
JP
Japan
Prior art keywords
programmable controller
variable
destination address
variable name
hash function
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP2006107895A
Other languages
Japanese (ja)
Other versions
JP4516046B2 (en
Inventor
Hirotsugu Ichioka
裕嗣 市岡
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2006107895A priority Critical patent/JP4516046B2/en
Publication of JP2007280214A publication Critical patent/JP2007280214A/en
Application granted granted Critical
Publication of JP4516046B2 publication Critical patent/JP4516046B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a programmable controller capable of simplifying a monitor device to be connected to perform a monitoring operation and accelerating the monitoring operation a in speed. <P>SOLUTION: The programmable controller 300 downloads a performance code and a table generated by using a hash function generation system 120 on a different programming device 100 which are performance codes (variable name hash function (103)) of a predetermined function program for deriving a hash value from a variable name and a table (allocation destination address arrangement 104) for deriving an allocation destination address of a monitor value from the hash value in a storing part, determines an allocation destination address for a variable name inputted from the outside by referring to an evaluation result by a function program and the table and outputs a corresponding monitor value. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

この発明は、プログラマブルコントローラに関し、特に外部から入力された変数名に対して対応するモニタ値を出力するプログラマブルコントローラに関するものである。   The present invention relates to a programmable controller, and more particularly to a programmable controller that outputs a monitor value corresponding to a variable name input from the outside.

図4は従来のプログラマブルコントローラとその周辺機器の構成を示す模式図である。図4においてプログラマブルコントローラ(PLC:Programmable Logic Controller)1300は、図示しない記憶部にPLC実行コード102を記憶している。このPLC実行コード102は、プログラミング機器1100にてコンパイルされて実行コード(ロードモジュール)とされプログラマブルコントローラ1300にダウンロードされたものである。プログラマブルコントローラ1300は、このPLC実行コード102を実行することにより、モニタ機器1200から入力された変数名に対して対応するモニタ値をモニタ機器1200に出力する。   FIG. 4 is a schematic diagram showing the configuration of a conventional programmable controller and its peripheral devices. In FIG. 4, a programmable controller (PLC: Programmable Logic Controller) 1300 stores a PLC execution code 102 in a storage unit (not shown). The PLC execution code 102 is compiled by the programming device 1100 into an execution code (load module) and downloaded to the programmable controller 1300. The programmable controller 1300 outputs the monitor value corresponding to the variable name input from the monitor device 1200 to the monitor device 1200 by executing the PLC execution code 102.

プログラミング機器1100には、国際規格ICE61131−3で定義されているストラクチャード・テキスト言語(ST言語)のような高級プログラミング言語にて記載されたPLCソースコード101が記憶されており、このPLCソースコード101をPLC実行コード生成系(コンパイラ)110を用いてコンパイルすることによりPLC実行コード102が生成される。なお、本明細書において、「コンパイルする」とは、人間がプログラミング言語を用いて作成したソフトウェアの設計図(ソースコード)を、コンピュータ上で実行可能な形式(実行コード)に変換することを言う。   The programming device 1100 stores a PLC source code 101 described in a high-level programming language such as a structured text language (ST language) defined in the international standard ICE61131-3. Is compiled using a PLC execution code generation system (compiler) 110 to generate a PLC execution code 102. In this specification, “compiling” means converting a design drawing (source code) of software created by a human using a programming language into a format (executable code) executable on a computer. .

PLC実行コード生成系110は、PLC実行コード102のコンパイルの過程で中間生成物である変数割付テーブル130を生成する。この変数割付テーブル130には、コンパイル中にPLCソースコード101上にて見つかった変数名が逐次登録される。そしてさらに、登録された変数名に対してプログラマブルコントローラのデータメモリ上の空き領域から順次必要な領域が割り当てられ、そのメモリアドレスが記録される。従来、この変数割付テーブル130は、ファイル化されて、プログラマブルコントローラ1300をモニタするモニタ機器1200にコピーされ、モニタ機器1200がモニタリング動作する際、変数名からモニタ値の割付先アドレスを導き出す対応表として用いられていた。   The PLC execution code generation system 110 generates a variable allocation table 130 that is an intermediate product in the process of compiling the PLC execution code 102. In the variable allocation table 130, variable names found on the PLC source code 101 during compilation are sequentially registered. Further, necessary areas are sequentially assigned from the empty areas in the data memory of the programmable controller to the registered variable names, and the memory addresses are recorded. Conventionally, the variable allocation table 130 is filed and copied to a monitor device 1200 that monitors the programmable controller 1300. When the monitor device 1200 performs a monitoring operation, the variable allocation table 130 is a correspondence table for deriving an allocation destination address of a monitor value from a variable name It was used.

モニタ機器1200の変数割付テーブル検索系1220は、この変数割付テーブル130を用いて、オペレータが入力したモニタ対象の変数名201からモニタ値の割付先アドレス1203を導き出す。そして、PLC通信系210は、プログラマブルコントローラ1300の周辺サービス処理系1330に、この割付先アドレス1203にてモニタ値の問い合わせをする。プログラマブルコントローラ1300の周辺サービス処理系1330は、PLC実行制御系310を介して割付先アドレス1203に格納されているモニタ値を獲得し、このモニタ値をモニタ機器1200に向けて出力する。従来、このようにして、プログラマブルコントローラ1300に対するモニタ機器1200のモニタリング動作が行われていた。   The variable assignment table search system 1220 of the monitor device 1200 uses this variable assignment table 130 to derive the monitor value assignment destination address 1203 from the variable name 201 to be monitored input by the operator. Then, the PLC communication system 210 inquires of the peripheral service processing system 1330 of the programmable controller 1300 about the monitor value at the allocation destination address 1203. The peripheral service processing system 1330 of the programmable controller 1300 acquires the monitor value stored in the assignment destination address 1203 via the PLC execution control system 310, and outputs this monitor value to the monitor device 1200. Conventionally, the monitoring operation of the monitor device 1200 with respect to the programmable controller 1300 has been performed in this manner.

ここで、パソコン等のコンピュータ汎用機器とプログラマブルコントローラとの違いに関して言及する。プログラマブルコントローラはファクトリーオートメーション(FA)分野を始めとして、幅広いアプリケーションに適用できる所謂シーケンス制御を行うプログラマブル論理制御装置のことを言い、例えば、ラダーダイアグラムまたは機能チャートに従って信号の論理的な相互接続を模擬する専用の装置のことを指し、パソコン等の汎用機器に較べて一般に入出力機能等が充実しているが記憶装置の容量等は小さい。   Here, the difference between a computer general-purpose device such as a personal computer and a programmable controller will be mentioned. Programmable controller refers to a programmable logic control device that performs so-called sequence control applicable to a wide range of applications including factory automation (FA) field, and simulates logical interconnection of signals according to a ladder diagram or a function chart, for example. This refers to a dedicated device, and generally has more input / output functions than a general-purpose device such as a personal computer, but the capacity of the storage device is small.

従来、記憶装置の記憶容量に関する課題は、長い間広い技術分野に渡って存在している。従来、記憶領域を縮小する目的で、また検索時間を縮小する目的でハッシュ関数を使用することが提案されている。例えば、ワードプロセッサ等における電子辞書の検索動作において、ハッシュ関数を用いてスペルチェックの所要時間を短縮することが提案されている(例えば、特許文献1参照)。   Conventionally, problems related to the storage capacity of a storage device have existed over a wide technical field for a long time. Conventionally, it has been proposed to use a hash function for the purpose of reducing the storage area and for the purpose of reducing the search time. For example, in a search operation of an electronic dictionary in a word processor or the like, it has been proposed to shorten the time required for spell check using a hash function (see, for example, Patent Document 1).

特開昭62−74153号公報JP-A-62-74153

図4に示した従来技術において、コンパイルの過程に中間生成物として生成された変数割付テーブル130は、内部に変数名そのものを有している。そのため、比較的長い変数名を数多く登録するプログラマブルコントローラの技術分野においては変数割付テーブル130により非常に大きな記憶領域を消費する。一方でプログラマブルコントローラ1300の記憶部は、上述のようにパソコン等の汎用機器の記憶部に比べて記憶領域が小さい。そのため、変数割付テーブル130はプログラマブルコントローラ1300の記憶部に格納することが容易ではなく、従来、この変数割付テーブル130は、図4に示すように、プログラマブルコントローラ1300をモニタリング動作するモニタ機器1200側に持たされていた。   In the prior art shown in FIG. 4, the variable allocation table 130 generated as an intermediate product during the compilation process has the variable name itself inside. Therefore, a very large storage area is consumed by the variable allocation table 130 in the technical field of programmable controllers that register many relatively long variable names. On the other hand, the storage unit of the programmable controller 1300 has a smaller storage area than the storage unit of a general-purpose device such as a personal computer as described above. Therefore, it is not easy to store the variable allocation table 130 in the storage unit of the programmable controller 1300. Conventionally, as shown in FIG. 4, the variable allocation table 130 is provided on the monitor device 1200 side that performs the monitoring operation of the programmable controller 1300. It was held.

そしてさらに、従来、モニタ機器1200は変数割付テーブル検索系1220を持ち、この変数割付テーブル検索系1220にて、変数割付テーブル130を用いて変数名から割付先アドレスを検索しなければならず、モニタリング動作をスピーディーに行えないばかりか、モニタ機器1200として、例えば大きな記憶領域と高度な性能を持つパソコンを使用する必要があり、コストが増加するといった課題があった。   Further, conventionally, the monitor device 1200 has a variable assignment table search system 1220. In this variable assignment table search system 1220, the assignment destination address must be searched from the variable name using the variable assignment table 130. In addition to not being able to perform the operation speedily, it is necessary to use, for example, a personal computer having a large storage area and high performance as the monitor device 1200, resulting in an increase in cost.

一方、上記特許文献1に提案されている方法においては、単語郡をグループ分けして辞書に登録する際に、ハッシュ値のインデックスの桁数を増減することによってグループ当たりの単語の個数を調整して、インデックスの桁数を充分大きく設定することにより、頭文字及び文字数によるグループ分けの場合よりもグループ数を増やして、それだけグループ当たりの単語数を減少させ、これにより、スペルチェックの所要時間を短縮する。しかしながら、この技術は検索要素がグループ分けされる場合に有効であり、上記課題の変数割付テーブルは特に検索要素がグループ分けされてないので、有効に適用できるものではなかった。   On the other hand, in the method proposed in Patent Document 1, when the word groups are grouped and registered in the dictionary, the number of words per group is adjusted by increasing or decreasing the number of digits of the index of the hash value. Therefore, by setting the number of digits in the index sufficiently large, the number of groups is increased compared to the case of grouping by initial and number of characters, and the number of words per group is decreased accordingly, thereby reducing the time required for spell check. Shorten. However, this technique is effective when the search elements are grouped, and the variable assignment table of the above problem is not particularly applicable because the search elements are not grouped.

この発明は上記の課題を解決するためになされたもので、プログラマブルコントローラ側に持たせる変数名から割付先アドレス導き出す変換手段を小さなものとすることができ、これにより、この変換手段をプログラマブルコントローラの記憶部に容易に記憶させることができ、一方でモニタ機器側に変数割付テーブル持たせる必要がなくなりモニタ機器を簡素なものとすることができ、さらにはモニタ機器の行うモニタリング動作を高速なものとすることができるプログラマブルコントローラを提供することを目的とする。   The present invention has been made to solve the above-described problem, and the conversion means for deriving the allocation destination address from the variable name to be given to the programmable controller can be made small. It can be easily stored in the storage unit. On the other hand, there is no need to have a variable allocation table on the monitor device side, the monitor device can be simplified, and the monitoring operation performed by the monitor device can be performed at high speed. It is an object of the present invention to provide a programmable controller that can do the above.

上記課題を解決するために、この発明に係るプログラマブルコントローラは、他のプログラミング機器上にてハッシュ関数生成系を用いて生成された実行コードとテーブルであって、変数名からハッシュ値を導き出す所定の関数プログラムの実行コード(変数名ハッシュ関数)と、ハッシュ値からモニタ値の割付先アドレスを導き出すテーブル(割付先アドレス配列)とが記憶部にダウンロードされており、外部から入力された変数名に対して、前記関数プログラムによる評価結果と前記テーブルの参照により割付先アドレスを決定して対応するモニタ値を外部に出力する。   In order to solve the above problems, a programmable controller according to the present invention is an execution code and a table generated using a hash function generation system on another programming device, and has a predetermined value for deriving a hash value from a variable name. The execution code of the function program (variable name hash function) and the table (assignment destination address array) for deriving the assignment destination address of the monitor value from the hash value are downloaded to the storage unit, and the variable name input from the outside Then, the allocation destination address is determined by referring to the evaluation result by the function program and the table, and the corresponding monitor value is output to the outside.

従来のプログラマブルコントローラによれば、上述のように、変数割付テーブルが内部に変数名そのものを持っているため、名称の長い変数名が数多く登録される状況において非常に大きな記憶領域を消費することになり、プログラマブルコントローラの記憶部に容易に記憶させることができなかった。しかしながら、この発明に係るプログラマブルコントローラによれば、変数名からモニタ値の割付先アドレスを導き出す変換手段として、変数名からハッシュ値を導き出す関数プログラムの実行コード(変数名ハッシュ関数)と、ハッシュ値からモニタ値の割付先アドレスを導き出すテーブル(割付先アドレス配列)とが記憶部にダウンロードされている。そして、ハッシュ値を導き出すハッシュ関数は、内部に変数名そのものを持たず、関数の入力引数として与えられた文字列を特定の値にマッピングする演算プログラムにすぎないため、そのプログラムの実行コードは、コンパイルの過程に中間生成物として生成された変数割付テーブルと比較して非常に小さくすることができる。そのため、プログラマブルコントローラの記憶部に容易に記憶させることができる。   According to the conventional programmable controller, as described above, since the variable allocation table has the variable name itself, a very large storage area is consumed in a situation where many variable names having a long name are registered. Therefore, it could not be easily stored in the storage unit of the programmable controller. However, according to the programmable controller of the present invention, as a conversion means for deriving the monitor value assignment destination address from the variable name, the function program execution code (variable name hash function) for deriving the hash value from the variable name and the hash value are used. A table (assignment destination address array) for deriving the assignment destination address of the monitor value is downloaded to the storage unit. And since the hash function for deriving the hash value does not have the variable name itself and is merely an arithmetic program that maps the character string given as the input argument of the function to a specific value, the execution code of the program is Compared with the variable allocation table generated as an intermediate product during the compilation process, it can be made very small. Therefore, it can be easily stored in the storage unit of the programmable controller.

さらに、この発明に係るプログラマブルコントローラによれば、ハッシュ値を導き出すハッシュ関数は比較的単純な演算プログラムで構成されており、変数割付テーブルから目的の変数名を見つけ出す目的で従来使用されていた線形検索アルゴリズム、或いは二分木探索アルゴリズムを用いた検索プログラムと比較して、高速に実行することができる。これにより、モニタ機器の行うモニタリング動作を高速なものとすることができる。   Further, according to the programmable controller according to the present invention, the hash function for deriving the hash value is composed of a relatively simple arithmetic program, and a linear search conventionally used for the purpose of finding the target variable name from the variable allocation table. Compared to a search program using an algorithm or a binary tree search algorithm, the program can be executed at high speed. As a result, the monitoring operation performed by the monitoring device can be performed at high speed.

以下、本発明にかかるプログラマブルコントローラの実施の形態を図面に基づいて詳細に説明する。なお、この実施の形態によりこの発明が限定されるものではない。   Embodiments of a programmable controller according to the present invention will be described below in detail with reference to the drawings. Note that the present invention is not limited to the embodiments.

実施の形態
図1はこの発明に係る実施の形態のプログラマブルコントローラとその周辺機器の構成を示す模式図である。図1において、プログラマブルコントローラ300は、図示しない記憶部に、PLC実行コード102と、請求項にて言う関数プログラムの実行コードである変数名ハッシュ関数103と、同じく請求項にて言うテーブルである割付先アドレス配列104とを記憶している。このPLC実行コード102、変数名ハッシュ関数103および割付先アドレス配列104は、例えばパソコン等の他のプログラミング機器100にて生成されたものがプログラマブルコントローラ300にダウンロードされたものである。プログラマブルコントローラ300は、これらの実行コード(ロードモジュール)を実行することによりモニタ機器200から入力された変数名に対して対応するモニタ値を出力する。
Embodiment FIG. 1 is a schematic diagram showing the configuration of a programmable controller and its peripheral devices according to an embodiment of the present invention. In FIG. 1, the programmable controller 300 allocates a PLC execution code 102, a variable name hash function 103 which is an execution code of a function program as claimed in a claim, and a table which is also a claim as a claim in a storage unit (not shown). The destination address array 104 is stored. The PLC execution code 102, the variable name hash function 103, and the allocation destination address array 104 are generated by another programming device 100 such as a personal computer and downloaded to the programmable controller 300, for example. The programmable controller 300 outputs a monitor value corresponding to the variable name input from the monitor device 200 by executing these execution codes (load modules).

本実施の形態のプログラミング機器100には、例えば国際規格ICE61131−3で定義されているストラクチャード・テキスト言語(ST言語)のような高級プログラミング言語にて記載されたPLCソースコード101が記憶されている。そして、このPLCソースコード101をPLC実行コード生成系(コンパイラ)110を用いてコンパイルすることによりPLC実行コード102が生成される。   The programming device 100 according to the present embodiment stores a PLC source code 101 described in a high-level programming language such as a structured text language (ST language) defined in the international standard ICE61131-3, for example. . Then, the PLC execution code 102 is generated by compiling the PLC source code 101 using a PLC execution code generation system (compiler) 110.

変数割付テーブル130は、PLCソースコード101コンパイルの過程にて中間生成物としてコンパイラが生成するテーブルであり、コンパイル中にPLCソースコード101上の変数名を拾いながら新規に見つかったものが逐次登録される。そして、登録された変数名に対してプログラマブルコントローラ300のデータメモリ上の空き領域から順次必要な領域が割り当てられ、そのメモリアドレスが記録される。この変数割付テーブル130は、変数名からモニタ値の割付先アドレスを導き出す対応表となる。この変数割付テーブル130には、例えば、変数名と割付先アドレスとが以下のように記載されている。   The variable allocation table 130 is a table generated by the compiler as an intermediate product in the process of compiling the PLC source code 101, and newly found while picking up the variable names on the PLC source code 101 during compilation. The Then, necessary areas are sequentially assigned from the empty areas in the data memory of the programmable controller 300 to the registered variable names, and the memory addresses are recorded. This variable allocation table 130 is a correspondence table for deriving the allocation destination address of the monitor value from the variable name. In the variable assignment table 130, for example, variable names and assignment destination addresses are described as follows.

変数名 割付先アドレス
VAR1 D0020
PUMP_STATUS D1234
: :
Variable name Allocation address
VAR1 D0020
PUMP_STATUS D1234
::

最小完全ハッシュ関数生成系120は、変数割付テーブル130に登録された変数名を入力とする最小完全ハッシュ関数103(以下、変数名ハッシュ関数103と呼ぶ)を生成する。この変数名ハッシュ関数103は、総数N個の変数名のキーから衝突しない0〜N−1の値(ハッシュ値)を導き出す。本実施の形態においては、最小完全ハッシュ関数生成系120として、最小完全ハッシュ関数のテーブル生成ユーティリティである“GNU gperf”を用いている。最小完全ハッシュ関数生成系120は、さらにまた、変数割付テーブル130と変数名ハッシュ関数103とから、割付先アドレス配列104も生成する。この割付先アドレス配列104は、変数名ハッシュ関数103のハッシュ値を配列インデックスとするモニタ値の割付先アドレス配列である。   The minimum complete hash function generation system 120 generates a minimum complete hash function 103 (hereinafter referred to as a variable name hash function 103) that receives a variable name registered in the variable assignment table 130 as an input. The variable name hash function 103 derives a value (hash value) of 0 to N−1 that does not collide with the keys of the total N variable names. In the present embodiment, “GNU gperf” which is a table generation utility for the minimum complete hash function is used as the minimum complete hash function generation system 120. The minimum complete hash function generation system 120 also generates an allocation destination address array 104 from the variable allocation table 130 and the variable name hash function 103. This allocation destination address array 104 is an allocation destination address array of monitor values using the hash value of the variable name hash function 103 as an array index.

プログラマブルコントローラ300は、従来技術においても有していたPLC実行制御系310および周辺サービス処理系330のほかに、ハッシュ関数評価系320を有している。そして、プログラマブルコントローラ300は、上述のように、プログラミング機器100から、PLC実行コード102、変数名ハッシュ関数103および割付先アドレス配列104を組にして図示しない記憶部にダウンロードされている。   The programmable controller 300 includes a hash function evaluation system 320 in addition to the PLC execution control system 310 and the peripheral service processing system 330 that are also included in the prior art. As described above, the programmable controller 300 is downloaded from the programming device 100 to the storage unit (not shown) as a set of the PLC execution code 102, the variable name hash function 103, and the allocation destination address array 104.

プログラマブルコントローラ300をモニタするモニタ機器200は、例えばシリアル(RS232、RS422、USB)、もしくはイーサネット(登録商標)にてプログラマブルコントローラ300と接続可能とされている。モニタ機器200はPLC通信系210を有しており、このPLC通信系210は、オペレータが入力したモニタ対象の変数名201を取り込み、この変数名201をそのまま出力することで、プログラマブルコントローラ300の周辺サービス処理系330にモニタ値の問い合わせをする。例えば、以下のように問い合わせをする。   The monitor device 200 that monitors the programmable controller 300 can be connected to the programmable controller 300 by, for example, serial (RS232, RS422, USB) or Ethernet (registered trademark). The monitor device 200 has a PLC communication system 210. The PLC communication system 210 takes in the variable name 201 to be monitored input by the operator, and outputs the variable name 201 as it is. The service processing system 330 is inquired about the monitor value. For example, an inquiry is made as follows.

“VAR1”?
“PUMP_STATUS”?
“VAR1”?
“PUMP_STATUS”?

そして、プログラマブルコントローラ300の周辺サービス処理系330から対応する変数モニタ値202を得る。一方、周辺サービス処理系330は、まず受け取った変数名をハッシュ関数評価系320に渡し、次にハッシュ関数評価系320は、変数名ハッシュ関数103を使って変数名からハッシュ値を導き出し、さらに割付先アドレス配列104を使ってハッシュ値からモニタ値の割付先アドレスを導き出す。そして、周辺サービス処理系330は、割付先アドレスに格納されているデータを読み出しモニタ機器200に変数モニタ値として出力する。   Then, the corresponding variable monitor value 202 is obtained from the peripheral service processing system 330 of the programmable controller 300. On the other hand, the peripheral service processing system 330 first passes the received variable name to the hash function evaluation system 320. Next, the hash function evaluation system 320 uses the variable name hash function 103 to derive a hash value from the variable name, and further assigns it. The allocation address of the monitor value is derived from the hash value using the destination address array 104. Then, the peripheral service processing system 330 reads the data stored in the allocation destination address and outputs the data to the monitor device 200 as a variable monitor value.

図2はプログラミング機器100の最小完全ハッシュ関数生成系120が行う変数名ハッシュ関数103及び割付先アドレス配列104の生成過程の動作を示すフローチャートである。図2に沿って変数名ハッシュ関数103と割付先アドレス配列104とが生成される過程を説明する。変数名ハッシュ関数103と割付先アドレス配列104の生成が開始されると、まず、変数割付テーブル130から変数名一覧が抽出され、これが最小完全ハッシュ関数生成系120に与えられて、変数名ハッシュ関数103が生成される(ステップS1)。   FIG. 2 is a flowchart showing the operation of the generation process of the variable name hash function 103 and the allocation destination address array 104 performed by the minimum complete hash function generation system 120 of the programming device 100. A process of generating the variable name hash function 103 and the allocation destination address array 104 will be described with reference to FIG. When the generation of the variable name hash function 103 and the allocation destination address array 104 is started, first, a variable name list is extracted from the variable allocation table 130, and this is given to the minimum complete hash function generation system 120, so that the variable name hash function 103 is generated (step S1).

次に、変数名の個数と同じ要素数の割付先アドレス配列104が用意され(ステップS2)、次いで、この割付先アドレス配列104に、変数割付テーブル130から変数名とその割付先アドレスとが順次列挙される(ステップS3)。さらに、列挙された変数名が変数名ハッシュ関数103に与えられて評価(関数の実行)され、ハッシュ値が得られる(ステップS4)。そして、得られたハッシュ値を配列インデックス位置とする変数割付先アドレス配列の配列要素に割付先アドレスが格納される(ステップS5)。   Next, an allocation destination address array 104 having the same number of elements as the number of variable names is prepared (step S2). Next, variable names and their allocation destination addresses are sequentially stored in the allocation destination address array 104 from the variable allocation table 130. Are enumerated (step S3). Further, the enumerated variable names are given to the variable name hash function 103 and evaluated (execution of the function), and a hash value is obtained (step S4). Then, the allocation destination address is stored in the array element of the variable allocation destination address array using the obtained hash value as the array index position (step S5).

次いで、変数割付テーブル130の全ての変数が列挙されたかが確認され(ステップS6)、未だ全ての変数が列挙されていなければ、ステップS3に戻り、一方、全ての変数が列挙されていれば、生成終了となる。   Next, it is confirmed whether or not all the variables in the variable allocation table 130 are enumerated (step S6). If not all the variables are enumerated yet, the process returns to step S3. On the other hand, if all the variables are enumerated, the generation is performed. End.

図3はプログラマブルコントローラ300のハッシュ関数評価系320が中心となって行う変数名によるモニタ応答の動作を示すフローチャートである。図3に沿って変数名によるモニタ応答の動作を説明する。動作においては、まず、モニタ機器200からのモニタ対象の変数名を周辺サービス処理系330が受信する(ステップS11)。次いで、受信した変数名が、変数名ハッシュ関数に与えられて評価(関数の実行が行われ)され、ハッシュ値が得られる(ステップS12)。そして、得られたハッシュ値を配列インデックス位置とする変数割付先アドレス配列の配列要素から割付先アドレスが取得される(ステップS13)。   FIG. 3 is a flowchart showing an operation of a monitor response based on variable names performed mainly by the hash function evaluation system 320 of the programmable controller 300. The operation of the monitor response by the variable name will be described with reference to FIG. In operation, first, the peripheral service processing system 330 receives the monitoring target variable name from the monitoring device 200 (step S11). Next, the received variable name is given to the variable name hash function and evaluated (the function is executed), and a hash value is obtained (step S12). Then, an allocation destination address is acquired from the array element of the variable allocation destination address array using the obtained hash value as the array index position (step S13).

次いで、PLC実行制御系310により、割付先アドレスに位置する値が参照され(ステップS14)、得られた値がモニタ対象の変数値としてモニタ機器200に応答送信され(ステップS15)、動作終了となる。   Next, the PLC execution control system 310 refers to the value located at the allocation destination address (step S14), and the obtained value is transmitted in response to the monitor device 200 as a monitored variable value (step S15). Become.

このような構成のプログラマブルコントローラ300においては、例えばパソコン等の他のプログラミング機器100の環境にて、ハッシュ関数生成系120を用いて生成された実行コードとテーブルであって、変数名からハッシュ値を導き出す変数名ハッシュ関数103と、ハッシュ値からモニタ値の割付先アドレスを導き出す割付先アドレス配列104とが記憶部にダウンロードされており、外部から入力された変数名に対して、変数名ハッシュ関数103による評価結果と割付先アドレス配列104の参照により割付先アドレスを決定して対応するモニタ値を出力する。   In the programmable controller 300 having such a configuration, for example, an execution code and a table generated using the hash function generation system 120 in an environment of another programming device 100 such as a personal computer, and a hash value is obtained from a variable name. A variable name hash function 103 to be derived and an allocation destination address array 104 to derive an allocation destination address of the monitor value from the hash value are downloaded to the storage unit, and the variable name hash function 103 is obtained for the variable name input from the outside. The assignment destination address is determined by referring to the evaluation result and the assignment destination address array 104, and the corresponding monitor value is output.

そして、この実施の形態のプログラマブルコントローラ300によれば、ハッシュ値を導き出すハッシュ関数は、内部に変数名そのものを持たず、関数の入力引数として与えられた文字列を特定の値にマッピングする演算プログラムにすぎないため、そのプログラムの実行コードは、従来の変数割付テーブルと比較して非常に小さくすることができ、プログラマブルコントローラ300の記憶部に容易に記憶させることができる。   According to the programmable controller 300 of this embodiment, the hash function for deriving the hash value does not have a variable name itself, and an arithmetic program that maps a character string given as an input argument of the function to a specific value Therefore, the execution code of the program can be made very small as compared with the conventional variable allocation table, and can be easily stored in the storage unit of the programmable controller 300.

さらに、この実施の形態のプログラマブルコントローラ300によれば、ハッシュ値を導き出すハッシュ関数は比較的単純な演算プログラムであり、変数割付テーブルから目的の変数名を見つけ出すために従来使用されていた線形検索アルゴリズム、二分木探索アルゴリズムを用いた検索プログラムよりも高速に実行することができ、モニタリング動作を高速なものとすることができる。   Furthermore, according to the programmable controller 300 of this embodiment, the hash function for deriving the hash value is a relatively simple arithmetic program, and a linear search algorithm conventionally used to find the target variable name from the variable allocation table. It can be executed faster than a search program using a binary tree search algorithm, and the monitoring operation can be made faster.

また、使用するハッシュ関数が、最小完全ハッシュ関数であるので、対応するハッシュ値が一意に決定されるとともに、変換テーブルを非常に縮小されたものとすることができる。   Further, since the hash function to be used is the minimum complete hash function, the corresponding hash value is uniquely determined, and the conversion table can be greatly reduced.

なお、本実施の形態においては、プログラミング言語として国際規格ICE61131−3で定義されているストラクチャード・テキスト言語(ST言語)のような高級プログラミング言語を用いているが、これに限らず他の言語であってもよい。また、本実施の形態においては、最小完全ハッシュ関数のテーブル生成ユーティリティとして“GNU gperf”を用いているが、他のユーティリティを用いてもよい。   In this embodiment, a high-level programming language such as a structured text language (ST language) defined in the international standard ICE61131-3 is used as a programming language. However, the present invention is not limited to this. There may be. In this embodiment, “GNU gperf” is used as the table generation utility for the minimum complete hash function, but other utilities may be used.

また、本実施の形態の割付先アドレス配列104に、誤り検出用のデータとして、例えばチェックサムを付加するようにしてもよい。これにより、容易な方法でデータ取得の信頼性を向上させることができる。   Further, for example, a checksum may be added as error detection data to the allocation destination address array 104 of the present embodiment. Thereby, the reliability of data acquisition can be improved by an easy method.

本願発明は、ファクトリーオートメーション(FA)分野にて用いられるプログラマブルコントローラに適用されて最適なものである。   The present invention is optimally applied to a programmable controller used in the field of factory automation (FA).

この発明に係る実施の形態のプログラマブルコントローラとその周辺機器の構成を示す模式図である。It is a schematic diagram which shows the structure of the programmable controller of embodiment which concerns on this invention, and its peripheral device. 変数名ハッシュ関数と割付先アドレス配列との生成の過程を示すフローチャートである。It is a flowchart which shows the process of the production | generation of a variable name hash function and an allocation destination address array. 変数名によるモニタ応答の動作を示すフローチャートである。It is a flowchart which shows the operation | movement of the monitor response by a variable name. 従来のプログラマブルコントローラとその周辺機器の構成を示す模式図である。It is a schematic diagram which shows the structure of the conventional programmable controller and its peripheral device.

符号の説明Explanation of symbols

100 プログラミング機器
101 PLCソースコード
102 PLC実行コード
103 変数名ハッシュ関数(関数プログラムの実行コード)
104 割付先アドレス配列(テーブル)
110 PLC実行コード生成系(コンパイラ)
120 最小完全ハッシュ関数生成系(ハッシュ関数生成系)
130 変数割付テーブル
200 モニタ機器
201 モニタ対象変数名
202 変数モニタ値
210 PLC通信系
300 プログラマブルコントローラ
310 PLC実行制御系
320 ハッシュ関数評価系
330 周辺サービス処理系
100 Programming Equipment 101 PLC Source Code 102 PLC Execution Code 103 Variable Name Hash Function (Function Program Execution Code)
104 Allocation destination address array (table)
110 PLC execution code generation system (compiler)
120 Minimum complete hash function generation system (hash function generation system)
DESCRIPTION OF SYMBOLS 130 Variable allocation table 200 Monitor apparatus 201 Monitor object variable name 202 Variable monitor value 210 PLC communication system 300 Programmable controller 310 PLC execution control system 320 Hash function evaluation system 330 Peripheral service processing system

Claims (4)

他のプログラミング機器上にてハッシュ関数生成系を用いて生成された実行コードとテーブルであって、前記変数名からハッシュ値を導き出す所定の関数プログラムの実行コードと、前記ハッシュ値からモニタ値の割付先アドレスを導き出すテーブルとが記憶部にダウンロードされており、
外部から入力された変数名に対して、前記関数プログラムによる評価結果と前記テーブルの参照により割付先アドレスを決定して対応するモニタ値を出力する
ことを特徴とするプログラマブルコントローラ。
Execution code and table generated using a hash function generation system on another programming device, and an execution code of a predetermined function program for deriving a hash value from the variable name, and assignment of a monitor value from the hash value A table for deriving the destination address is downloaded to the storage unit,
A programmable controller, wherein an assignment destination address is determined by referring to an evaluation result of the function program and a reference to the table for a variable name input from the outside, and a corresponding monitor value is output.
前記ハッシュ関数が、最小完全ハッシュ関数である
ことを特徴とする請求項1に記載のプログラマブルコントローラ。
The programmable controller according to claim 1, wherein the hash function is a minimum complete hash function.
前記テーブルに、誤り検出用のデータが付加されている
ことを特徴とする請求項1または2に記載のプログラマブルコントローラ。
The programmable controller according to claim 1, wherein error detection data is added to the table.
前記誤り検出用のデータがチェックサムである
ことを特徴とする請求項3に記載のプログラマブルコントローラ。
The programmable controller according to claim 3, wherein the error detection data is a checksum.
JP2006107895A 2006-04-10 2006-04-10 Programmable controller Expired - Fee Related JP4516046B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006107895A JP4516046B2 (en) 2006-04-10 2006-04-10 Programmable controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006107895A JP4516046B2 (en) 2006-04-10 2006-04-10 Programmable controller

Publications (2)

Publication Number Publication Date
JP2007280214A true JP2007280214A (en) 2007-10-25
JP4516046B2 JP4516046B2 (en) 2010-08-04

Family

ID=38681583

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006107895A Expired - Fee Related JP4516046B2 (en) 2006-04-10 2006-04-10 Programmable controller

Country Status (1)

Country Link
JP (1) JP4516046B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015162179A (en) * 2014-02-28 2015-09-07 ファナック株式会社 Sequence program replacement method of programmable controller
JP2020524852A (en) * 2017-06-21 2020-08-20 テトラ ラバル ホールディングス アンド ファイナンス エス エイ Method for logging process data in PLC control equipment

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2869145B1 (en) * 2013-10-29 2016-04-27 dSPACE digital signal processing and control engineering GmbH Method for influencing a control program of a control unit

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05289867A (en) * 1992-04-13 1993-11-05 Nec Corp Multibranch branching control system
JPH11184508A (en) * 1997-12-25 1999-07-09 Toshiba Corp Programmable controller

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05289867A (en) * 1992-04-13 1993-11-05 Nec Corp Multibranch branching control system
JPH11184508A (en) * 1997-12-25 1999-07-09 Toshiba Corp Programmable controller

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015162179A (en) * 2014-02-28 2015-09-07 ファナック株式会社 Sequence program replacement method of programmable controller
JP2020524852A (en) * 2017-06-21 2020-08-20 テトラ ラバル ホールディングス アンド ファイナンス エス エイ Method for logging process data in PLC control equipment
JP7199387B2 (en) 2017-06-21 2023-01-05 テトラ ラバル ホールディングス アンド ファイナンス エス エイ How to log process data in PLC control equipment

Also Published As

Publication number Publication date
JP4516046B2 (en) 2010-08-04

Similar Documents

Publication Publication Date Title
JP6065008B2 (en) Control device
EP3647941B1 (en) Engineering apparatus, control method of engineering apparatus, and program
JP6023266B2 (en) PLC program management device
JP2009146229A (en) Programmable controller system
CN108345451B (en) Continuous function diagram programming method
JP4516046B2 (en) Programmable controller
KR102280116B1 (en) Engineering apparatus, control method of engineering apparatus, and program
Grimmer et al. Supporting program analysis for non-mainstream languages: experiences and lessons learned
US20170115972A1 (en) Method of optimally compiling plc command
JP2009157533A (en) Programmable controller system
WO2017213868A1 (en) System and method for facilitating dynamic remapping of absolute addresses during software migration
JP2017167588A (en) Program development support device, program development support program, and program development support method
WO2016181526A1 (en) Control logic diagram analysis device and control logic diagram analysis method
KR101398718B1 (en) Apparatus and method for processing data
JP2005141435A (en) Tool
US8832670B2 (en) Programmable controller and programming tool for communication with legacy equipment
KR101670916B1 (en) Method for storing function and system device using the same
JP6175306B2 (en) Control program dividing apparatus, control program dividing method and recording medium therefor
CN102402662A (en) System and method for acceleration of malware detection using antivirus cache
JP5079166B1 (en) Symbol table generation method, communication method with peripheral device, and programmable logic controller
JP2008299763A (en) Distributed object development tool
JP2023031925A (en) Maintenance system
JP2022118310A (en) Compilation method, development supporting device, and control system
CN117827693A (en) Batch access method and device for programmable logic controller addresses
CN117873607A (en) Processing method and device for target operation corresponding to custom function

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20081204

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20100204

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100209

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100326

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

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100513

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20130521

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20140521

Year of fee payment: 4

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

LAPS Cancellation because of no payment of annual fees