JP4258826B2 - Function block variable setting method - Google Patents

Function block variable setting method Download PDF

Info

Publication number
JP4258826B2
JP4258826B2 JP2001182935A JP2001182935A JP4258826B2 JP 4258826 B2 JP4258826 B2 JP 4258826B2 JP 2001182935 A JP2001182935 A JP 2001182935A JP 2001182935 A JP2001182935 A JP 2001182935A JP 4258826 B2 JP4258826 B2 JP 4258826B2
Authority
JP
Japan
Prior art keywords
variable
character string
function block
interface
internal
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.)
Expired - Fee Related
Application number
JP2001182935A
Other languages
Japanese (ja)
Other versions
JP2002373001A (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.)
Yokogawa Electric Corp
Original Assignee
Yokogawa 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 Yokogawa Electric Corp filed Critical Yokogawa Electric Corp
Priority to JP2001182935A priority Critical patent/JP4258826B2/en
Publication of JP2002373001A publication Critical patent/JP2002373001A/en
Application granted granted Critical
Publication of JP4258826B2 publication Critical patent/JP4258826B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、複数の内部変数を使用し、制御機能がソフトウェアで定義された制御ファンクションブロック(以下FB)の内部変数の設定方法に関する。
【0002】
【従来の技術】
図6は、測定値と設定値の偏差に対してP(比例)I(積分)D(微分)演算を実行する制御機能が、IEC61131-3規格によるプログラム言語(以下IEC)で記述されたFBの機能ブロック線図の例である。
【0003】
1はIECで記述されたPID演算機能を備えるFBである。IECで作成されるFBはブラックボックス化されており、FBが内部の処理で使用する変数(測定値、設定値、操作出力値、制御パラメータ等)の値をFBの外部参照・設定する場合には、その変数を入力変数、出力変数として定義してインターフェイス化する必要がある。
【0004】
図6において、2は入力変数として定義された測定値のインターフェイス、3は同じく入力変数として定義された設定値のインターフェイス、4は出力変数として定義された操作出力値のインターフェイスである。
【0005】
FB1内において、5乃至10は、PID制御動作を実行するために使用される変数(パラメータ)であり、5は積分時間、6は微分時間、7は比例帯値、8はモード(手動、自動)値、9はアラーム設定値、10はリミット値を表す。
【0006】
【発明が解決しようとする課題】
複雑な制御ロジックをもつFBには、制御動作を行うために数十のパラメータを持つことがあり、FBの動作中にそれらのパラメータに値の書き込みや値の参照を行わなければならないことがある。
【0007】
IECによるFBは、前記のように内部変数を外部から参照することや設定することができないので、従来のFB構造であればアクセスが必要となる可能性のある変数をすべて入力変数や出力変数として定義してインターフェイス化する必要があり、変数が多くなるとインターフェイスの数も多くなり、FBとして使用しづらくなる。
図6の例では、内部変数5乃至10にアクセスするための6個の入力変数5´乃至10´をインターフェイスとして定義する必要がある。
【0008】
他の手法としては、内部変数が異なるFBを複数作成し、これを切り換えて使用することも可能であるが、内部の制御ロジックが同一のFBが多数必要となり、効率的ではない。
【0009】
本発明の目的は、複数の内部変数にアクセスするためのインターフェイスを最小限とすることが可能なファンクションブロックの変数設定方法を実現することにある。
【0010】
【課題を解決するための手段】
このような課題を達成するために、本発明のうち請求項1記載発明の特徴は、複数の内部変数を使用し、制御機能がソフトウェアで定義された制御ファンクションブロックに、前記内部変数に対して文字列によりアクセスする第1インターフェイスを設け、前記制御ファンクションブロック内に文字列解釈ファンクションブロックを形成し、前記第1のインターフェイスより与えられた文字列を前記文字列解釈ファンクションブロックで解釈して前記内部変数を変更すると共に、
前記文字列解釈ファンクションブロックによる前記内部変数変更が終了した後、その文字列を初期化して出力する第2インターフェイスを前記制御ファンクションブロックに設け、この第2インターフェイス出力を前記第1インターフェイスにフィードバックすることにより、1回限りの内部変数変更を実行する点にある。
【0011】
請求項2記載発明の特徴は、前記制御ファンクションブロックが、IEC61131-3規格によるプログラム言語で記述された点にある。
【0013】
請求項記載発明の特徴は、前記内部変数は、前記第1インターフェイスに入力される文字列に対応する固有の変数名を有する点にある。
【0014】
【発明の実施の形態】
以下本発明実施態様を、図面を用いて説明する。図1は本発明の基本概念を説明する機能ブロック線図である。FB1内において、11、12、13は3個の変数(変数1、変数2、変数3)を表す。
【0015】
14はFB内に導入される本発明特有の文字列解釈FBである。この文字列解釈FBもIECで記述される。15はこの文字列解釈FB14にアクセスするためにFB1に入力変数として定義した内部変数アクセスインターフェイスである。
【0016】
内部変数へは、このインターフェイス15を介して文字列により値の変更を指示する(図1(a))。例えば変数1と変数3を夫々値1と値3に設定する場合は、‘変数1=値1;変数3=値3’の文字列をインターフェイス15に与える。
【0017】
文字列解釈FB14は、この入力内容‘変数1=値1;変数3=値3’を解釈し(図1(b))、変数名の一致を検索により実行し、変数1を値1に設定し、変数3を値3に設定する(図1(c))。
【0018】
図2は、図6で説明したPID制御用FBに本発明を適用し、内部変数である積分時間5の値を100sに、モード値8の値をAUTOに設定する実施例である。この場合、内部変数アクセス用インターフェイス15には、‘モード=AUTO;積分時間=100s’ の文字列が与えられる。
【0019】
このように、本発明では、内部変数へのアクセスのインターフェイスが文字列であることから、FB内部のロジックがどのような場合においても同じインターフェイスを使用して内部変数の設定ができるので、変数設定のためのインターフェイスの数を最小とする設計が可能である。
【0020】
図3の実施例は、内部変数への文字列の変数を初期化することにより、1回限りに値を設定可能とした例である。図1の基本概念図との相違は、出力変数である内部変数アクセス用インターフェイス16が追加された点である。
【0021】
文字列解釈FB14は、内部変数アクセスの入力と出力に同じ変数を使用し、入力した文字列(図3(a))の内部変数への設定処理(図3(b)、(c))が終了した後、その文字列を初期化してインターフェイス16を介して出力する(図3(d))。
【0022】
インターフェイス16の出力は、インターフェイス14にフィードバックされインターフェイス14の内容が更新されるので、次回の入力では、設定すべき文字列が空の状態(図3(e))となる。このような入力・出力のインターフェイスとすることにより、設定したいタイミングのときのみ文字列を入力することで、1回限りに変数の値を設定することが可能となる。
【0023】
次に、本発明の主要部である文字列解釈FBの機能及び信号処理手順を、図4、図5により説明する。図4は文字列解釈FB14のインターフェイスであり、17乃至20は入力変数、21乃至24は出力変数で定義されるインターフェイスである。
【0024】
インターフェイス17、18、19には、変数1、変数2、変数3を一義的に表す固有の変数名である’変数1‘、‘変数2‘、‘変数3‘が入力され(図4(a))、インターフェイス20にはインターフェイス15からの設定文字列が入力される(図4(b))。
【0025】
インターフェイス21、22、23には変数1、変数2、変数3に設定すべきデータが出力され(図4(c))、インターフェイス24には初期化された空の文字列信号が出力され(図4(d))、この出力が図2で説明したインターフェイス16に与えられる。
【0026】
図5は文字列解釈FB14内部の信号処理手順を示すフローチャートである。まずステップS1で設定文字列(図4(b))を変数名と値との要素に分ける。ステップS2で分解作業が入力数だけ繰り返される。ステップS3では変数名要素と入力変数である変数名(図4(a))とで、一致するかどうかを検査する。
【0027】
一致する要素があれば、ステップステップS4でその変数名に対応するデータ(図4(c))に設定文字列から取り出した値要素を格納すると共に、インターフェイス24に初期化された空の文字列を出力させる。
【0028】
一致処理することのできなかった文字列はステップS5,ステップS6により削除されずインターフェイス24にそのまま出力される。
【0029】
【発明の効果】
以上説明したことから明らかなように、本発明によればIECにより記述された通常のFB内に文字列解釈FBを導入することにより、複数の内部変数にアクセスするためのインターフェイスを最小限とするFBを容易に実現することができ、FB設計の効率を向上せしめることが可能となる。
【図面の簡単な説明】
【図1】本発明の基本概念を説明する機能ブロック線図である。
【図2】図6のPID制御用FBに本発明を適用した実施例である。
【図3】内部変数への文字列の変数を初期化することにより、ワンショット的に値を設定可能とした実施例である。
【図4】本発明の文字列解釈FBのインターフェイス図である。
【図5】本発明の文字列解釈FB内部の信号処理手順を示すフローチャートである。
【図6】制御機能が、IECで記述されたFBの一般的な機能ブロック線図である。
【符号の説明】
1 ファンクションブロック
11 変数1
12 変数2
13 変数3
14 文字列解釈FB
15 内部変数アクセス用インターフェイス
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a method for setting internal variables of a control function block (hereinafter referred to as FB) in which a plurality of internal variables are used and a control function is defined by software.
[0002]
[Prior art]
FIG. 6 shows an FB in which a control function for executing a P (proportional) I (integral) D (differential) operation on a deviation between a measured value and a set value is described in a program language (hereinafter referred to as IEC) according to the IEC61131-3 standard. It is an example of a functional block diagram.
[0003]
Reference numeral 1 denotes an FB having a PID calculation function described in IEC. The FB created by the IEC is black-boxed. When the values of variables (measurement values, setting values, operation output values, control parameters, etc.) used by the FB in internal processing are externally referenced and set in the FB Needs to be interfaced by defining the variables as input and output variables.
[0004]
In FIG. 6, 2 is an interface for measurement values defined as input variables, 3 is an interface for set values defined as input variables, and 4 is an interface for operation output values defined as output variables.
[0005]
In FB1, 5 to 10 are variables (parameters) used to execute the PID control operation, 5 is an integration time, 6 is a differentiation time, 7 is a proportional band value, and 8 is a mode (manual, automatic). ) Value, 9 is an alarm set value, and 10 is a limit value.
[0006]
[Problems to be solved by the invention]
An FB having a complicated control logic may have several tens of parameters in order to perform a control operation, and it may be necessary to write values or reference values to these parameters during the operation of the FB. .
[0007]
As mentioned above, the FB based on IEC cannot refer to or set internal variables from the outside, so all variables that may need to be accessed in the conventional FB structure are input variables and output variables. It is necessary to define and interface, and as the number of variables increases, the number of interfaces also increases, making it difficult to use as an FB.
In the example of FIG. 6, it is necessary to define six input variables 5 ′ to 10 ′ for accessing the internal variables 5 to 10 as interfaces.
[0008]
As another method, it is possible to create a plurality of FBs having different internal variables and use them by switching them. However, many FBs having the same internal control logic are required, which is not efficient.
[0009]
An object of the present invention is to realize a function block variable setting method capable of minimizing an interface for accessing a plurality of internal variables.
[0010]
[Means for Solving the Problems]
In order to achieve such an object, the feature of the invention described in claim 1 of the present invention is that a control function block in which a plurality of internal variables are used and a control function is defined by software is provided for the internal variables. A first interface for accessing by a character string is provided, a character string interpretation function block is formed in the control function block, a character string given from the first interface is interpreted by the character string interpretation function block, and the internal While changing the variable ,
After the internal variable change by the character string interpretation function block is completed, a second interface for initializing and outputting the character string is provided in the control function block, and the second interface output is fed back to the first interface. Therefore, the internal variable is changed only once .
[0011]
According to a second aspect of the present invention, the control function block is described in a programming language according to the IEC61131-3 standard.
[0013]
According to a third aspect of the invention, the internal variable has a unique variable name corresponding to a character string input to the first interface.
[0014]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a functional block diagram illustrating the basic concept of the present invention. In FB1, 11, 12, and 13 represent three variables (variable 1, variable 2, variable 3).
[0015]
Reference numeral 14 denotes a character string interpretation FB unique to the present invention introduced into the FB. This character string interpretation FB is also described in IEC. Reference numeral 15 denotes an internal variable access interface defined as an input variable in FB1 in order to access the character string interpretation FB14.
[0016]
An internal variable is instructed to be changed by a character string via the interface 15 (FIG. 1 (a)). For example, when variable 1 and variable 3 are set to value 1 and value 3, respectively, a character string of “variable 1 = value 1; variable 3 = value 3” is given to interface 15.
[0017]
The character string interpretation FB 14 interprets this input content 'variable 1 = value 1; variable 3 = value 3' (FIG. 1 (b)), executes variable name matching by search, and sets variable 1 to value 1 Then, the variable 3 is set to the value 3 (FIG. 1 (c)).
[0018]
FIG. 2 shows an embodiment in which the present invention is applied to the PID control FB described with reference to FIG. 6, and the value of the integration time 5 as an internal variable is set to 100 s and the value of the mode value 8 is set to AUTO. In this case, the internal variable access interface 15 is given a character string of “mode = AUTO; integration time = 100 s”.
[0019]
As described above, in the present invention, since the interface for accessing the internal variable is a character string, the internal variable can be set using the same interface regardless of the logic inside the FB. Designs that minimize the number of interfaces for are possible.
[0020]
The embodiment of FIG. 3 is an example in which a value can be set only once by initializing a character string variable to an internal variable. The difference from the basic conceptual diagram of FIG. 1 is that an internal variable access interface 16 as an output variable is added.
[0021]
The character string interpretation FB 14 uses the same variable for input and output of internal variable access, and the input character string (FIG. 3A) is set to the internal variable (FIGS. 3B and 3C). After completion, the character string is initialized and output via the interface 16 (FIG. 3 (d)).
[0022]
Since the output of the interface 16 is fed back to the interface 14 and the contents of the interface 14 are updated, the character string to be set becomes empty (FIG. 3E) at the next input. By using such an input / output interface, it is possible to set the value of a variable only once by inputting a character string only at the desired timing.
[0023]
Next, the function and signal processing procedure of the character string interpretation FB, which is the main part of the present invention, will be described with reference to FIGS. FIG. 4 shows an interface of the character string interpretation FB 14, 17 to 20 are input variables, and 21 to 24 are interfaces defined by output variables.
[0024]
The interfaces 17, 18, and 19 are input with "variable 1", "variable 2", and "variable 3", which are unique variable names that uniquely represent the variable 1, variable 2, and variable 3 (FIG. 4 (a)). )), The setting character string from the interface 15 is input to the interface 20 (FIG. 4B).
[0025]
Data to be set in the variable 1, variable 2, and variable 3 is output to the interfaces 21, 22, and 23 (FIG. 4C), and an initialized empty character string signal is output to the interface 24 (FIG. 4). 4 (d)), this output is given to the interface 16 described in FIG.
[0026]
FIG. 5 is a flowchart showing a signal processing procedure inside the character string interpretation FB 14. First, in step S1, the set character string (FIG. 4B) is divided into variable name and value elements. In step S2, the disassembly operation is repeated for the number of inputs. In step S3, it is checked whether or not the variable name element and the input variable name (FIG. 4A) match.
[0027]
If there is a matching element, the value element extracted from the set character string is stored in the data (FIG. 4C) corresponding to the variable name in step S4, and the empty character string initialized in the interface 24 is stored. Is output.
[0028]
The character string that could not be matched is not deleted in steps S5 and S6, but is output to the interface 24 as it is.
[0029]
【The invention's effect】
As is apparent from the above description, according to the present invention, the interface for accessing a plurality of internal variables is minimized by introducing the character string interpretation FB into the normal FB described by the IEC. The FB can be easily realized, and the efficiency of the FB design can be improved.
[Brief description of the drawings]
FIG. 1 is a functional block diagram illustrating a basic concept of the present invention.
2 is an embodiment in which the present invention is applied to the PID control FB of FIG. 6;
FIG. 3 shows an embodiment in which a value can be set in a one-shot manner by initializing a character string variable to an internal variable.
FIG. 4 is an interface diagram of a character string interpretation FB according to the present invention.
FIG. 5 is a flowchart showing a signal processing procedure inside a character string interpretation FB according to the present invention.
FIG. 6 is a general functional block diagram of an FB whose control function is described in IEC.
[Explanation of symbols]
1 Function block 11 Variable 1
12 Variable 2
13 Variable 3
14 Character string interpretation FB
15 Internal variable access interface

Claims (3)

複数の内部変数を使用し、制御機能がソフトウェアで定義された制御ファンクションブロックに、前記内部変数に対して文字列によりアクセスする第1インターフェイスを設け、前記制御ファンクションブロック内に文字列解釈ファンクションブロックを形成し、前記第1のインターフェイスより与えられた文字列を前記文字列解釈ファンクションブロックで解釈して前記内部変数を変更すると共に、A control function block that uses a plurality of internal variables and whose control function is defined by software is provided with a first interface for accessing the internal variables by a character string, and a character string interpretation function block is provided in the control function block. Forming and interpreting the character string given from the first interface by the character string interpretation function block and changing the internal variable,
前記文字列解釈ファンクションブロックによる前記内部変数変更が終了した後、その文字列を初期化して出力する第2インターフェイスを前記制御ファンクションブロックに設け、この第2インターフェイス出力を前記第1インターフェイスにフィードバックすることにより、1回限りの内部変数変更を実行することを特徴とするファンクションブロックの変数設定方法。After the change of the internal variable by the character string interpretation function block is completed, a second interface for initializing and outputting the character string is provided in the control function block, and the second interface output is fed back to the first interface. A function block variable setting method characterized in that an internal variable change is executed only once.
前記制御ファンクションブロックが、The control function block is IEC61131-3IEC61131-3 規格によるプログラム言語で記述されたことを特徴とする請求項1記載のファンクションブロックの変数設定方法。2. The function block variable setting method according to claim 1, wherein the function block variable setting method is described in a program language according to a standard. 前記内部変数は、前記第1インターフェイスに入力される文字列に対応する固有の変数名を有することを特徴とする請求項1または2記載されたファンクションブロックの変数設定方法。3. The function block variable setting method according to claim 1, wherein the internal variable has a unique variable name corresponding to a character string input to the first interface.
JP2001182935A 2001-06-18 2001-06-18 Function block variable setting method Expired - Fee Related JP4258826B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001182935A JP4258826B2 (en) 2001-06-18 2001-06-18 Function block variable setting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001182935A JP4258826B2 (en) 2001-06-18 2001-06-18 Function block variable setting method

Publications (2)

Publication Number Publication Date
JP2002373001A JP2002373001A (en) 2002-12-26
JP4258826B2 true JP4258826B2 (en) 2009-04-30

Family

ID=19022947

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001182935A Expired - Fee Related JP4258826B2 (en) 2001-06-18 2001-06-18 Function block variable setting method

Country Status (1)

Country Link
JP (1) JP4258826B2 (en)

Also Published As

Publication number Publication date
JP2002373001A (en) 2002-12-26

Similar Documents

Publication Publication Date Title
US5197016A (en) Integrated silicon-software compiler
US6055368A (en) Batch execution control programming device and method
JPH07110749A (en) Dynamic construction method of dialog box
US6173245B1 (en) Programmable logic array device design using parameterized logic modules
US5987239A (en) Computer system and method for building a hardware description language representation of control logic for a complex digital system
US5615308A (en) Rule-based production system adapted for complex procedures flow
US5276855A (en) Logic synthesis apparatus for incorporating additional rules to the knowledge base without causing competition
JP4258826B2 (en) Function block variable setting method
JP2003271679A (en) Hybrid model generation method and program
US5799192A (en) Tool encapsulating method and apparatus thereof
JP2607467B2 (en) Table conversion type software configuration method
JPH10320027A (en) Numerical controller
JP3494215B2 (en) Program control unit
JPH045703A (en) Sequence program generating device
JPH09147132A (en) Cad system
Hug et al. User interaction in HP PE/SolidDesigner
JP2724241B2 (en) Automatic program generator with block diagram parts processing function
JPH02287737A (en) Automatic designing system for test item
JPH1196209A (en) Method for editing shared data base
JP2852402B2 (en) Program development equipment
JPH02163823A (en) Set value check system at decision of system constitution
JPH08286902A (en) Program step number converting device
JPH01109430A (en) Programming method for computer processing
JPH08123675A (en) Method and device for data input
Chmiel et al. Dynamic partial reconfiguration of CPU-s for Programmable Logic Controllers executing control programs developed in the Ladder Diagram language

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051109

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20051115

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20071005

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20071203

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080131

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

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

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

Free format text: PAYMENT UNTIL: 20120220

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees