JP4692452B2 - Program creation method of programmable controller - Google Patents
Program creation method of programmable controller Download PDFInfo
- Publication number
- JP4692452B2 JP4692452B2 JP2006253744A JP2006253744A JP4692452B2 JP 4692452 B2 JP4692452 B2 JP 4692452B2 JP 2006253744 A JP2006253744 A JP 2006253744A JP 2006253744 A JP2006253744 A JP 2006253744A JP 4692452 B2 JP4692452 B2 JP 4692452B2
- Authority
- JP
- Japan
- Prior art keywords
- variable
- program
- partial range
- function
- check
- 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
Links
Images
Landscapes
- Programmable Controllers (AREA)
Description
本発明は、JISB3503(IEC61131−3)に規定されているプログラム言語によるプログラマブルコントローラのプログラム作成方式に関わり、特に、変数の派生データ形の1つである、範囲データ形変数を使ったプログラム作成方式に関わるものである。 The present invention relates to a program creation method for a programmable controller using a programming language defined in JISB3503 (IEC61131-3), and in particular, a program creation method using a range data type variable, which is one of the derived data types of variables. It is related to.
JISB3503(IEC61131−3)では変数の派生データ形として、以下の表に示す4種類が規定されている。以下にJISB3503での説明文を示す。なお、表中の「表12」とはJISB3503内の表番号である。 In JISB3503 (IEC61131-3), four types shown in the following table are defined as variable data types. The explanatory text in JISB3503 is shown below. “Table 12” in the table is a table number in JISB3503.
現在、IEC61131−3準拠のPLC(プログラマブルコントローラ)が各社から発売されている。このPLCのプログラム作成には、その目的に応じて上記のデータ形で個々に宣言した変数をプログラム中に適宜組み込み、これら変数を使って演算を実行できるようにする。 Currently, IEC61131-3 compliant PLCs (programmable controllers) are available from various companies. In creating the PLC program, variables individually declared in the above data form are appropriately incorporated in the program according to the purpose, and operations can be executed using these variables.
これら変数を使用したプログラミングにおいて、宣言された変数の型チェック、サイズチェック、値チェックなどを自動的に行うことでプログラムの正当性を高めると共に、プログラミングの負担を軽減する装置も提案されている(例えば、特許文献1参照)。
しかし、上記表に示す4種類の派生データ形すべてを扱えるPLCはない。特に、部分範囲データ形の場合は、プログラムのコンパイル時には、変数の部分範囲に対象変数が収まっているかが判断できない。このため、演算実行中に、演算対象データが定義された部分範囲に入っているかどうかを検証しながら演算しなくてはならず、正確なプログラミングを難しくしている。 However, there is no PLC that can handle all four types of derived data types shown in the above table. In particular, in the case of a partial range data type, it cannot be determined whether the target variable is within the partial range of the variable when the program is compiled. For this reason, during the execution of the calculation, it is necessary to perform the calculation while verifying whether the calculation target data is within the defined partial range, which makes accurate programming difficult.
例えば、部分範囲データ形は、図3の(a)に示すように、変数「VAL1」の定義として整数「INT」、範囲「−6〜+12」として宣言しておき、この変数「VAL1」を図3の(b)に示す加算命令「ADD」の演算結果として使用する場合、入力データ「IN1」の値が「−17」以下、または「3」以上であれば、変数「VAL1」は「−6〜+12」の範囲外となる。このチェックはコンパイラではできず、プログラム実行時のみ実行できる。 For example, as shown in FIG. 3A, the partial range data type is declared as an integer “INT” and a range “−6 to +12” as the definition of the variable “VAL1”, and this variable “VAL1” is defined. When used as the operation result of the addition instruction “ADD” shown in FIG. 3B, if the value of the input data “IN1” is “−17” or less, or “3” or more, the variable “VAL1” is “ It is out of the range of “−6 to +12”. This check cannot be performed by the compiler, and can only be performed during program execution.
また、部分範囲データ形に対応したPLCが発売されていない理由として、IEC61131−3には演算対象データが部分範囲外であった時の対処方法が明確に規定されていないことも挙げられる。但し、ファンクション言語では「ENフラグ」が規定されていて、ENフラグ=1でファンクションが起動された場合に、ファンクション中で演算エラーがあれば、ENフラグ=0とするという記述がある。 Further, as a reason why the PLC corresponding to the partial range data type has not been released, it is also mentioned that the handling method when the calculation target data is out of the partial range is not clearly defined in IEC61131-3. However, in the function language, “EN flag” is defined, and there is a description that when the function is activated with EN flag = 1, if there is an operation error in the function, EN flag = 0.
例えば、図4において、ENの入力端子に接続される演算条件が真であれば、ファンクションは演算を行う。この場合、入力1と入力2に対する演算を行い、演算結果を出力する。演算途中でエラーがなければENO端子には真が出力されるが、エラーがあれば偽が出力される。
For example, in FIG. 4, if the calculation condition connected to the EN input terminal is true, the function performs the calculation. In this case, an operation is performed on
また、IEC61131−3の標準ファンクションとしてLIMITが規定されている。このファンクションは入力された変数の上下限チェックを行うもので、以下の形をしている。このLIMITファンクションは、図5の(a)に示すように、入力「IN」で与えられた数値がMN(下限値)とMX(上限値)により上下限制限されるものとなっている。例えば、MN=0でMX=1000の時に、IN=2000であれば、出力は1000になる。このファンクションを使えば、部分範囲データ形を使わなくても演算ができそうである。しかし、LIMITファンクションは入力が上限と下限を超えた場合でも、出力を上下限に制限してしまうため、入力の正当性確認には使用できない。つまり、エラー検出機能はない。例えば、図5の(b)に示すように、変数「VAL1」の出力をLIMITで制限すると、変数「VAL1」は(−6〜+12)の範囲に制限されるだけで、演算時チェックでエラー検出はできない。 LIMIT is defined as a standard function of IEC61131-3. This function checks the upper and lower limits of the input variable and has the following form. In the LIMIT function, as shown in FIG. 5A, the numerical value given by the input “IN” is limited by the upper and lower limits by MN (lower limit value) and MX (upper limit value). For example, when MN = 0 and MX = 1000, if IN = 2000, the output is 1000. If this function is used, it is possible to perform calculations without using a subrange data type. However, since the LIMIT function limits the output to the upper and lower limits even when the input exceeds the upper limit and the lower limit, it cannot be used to check the validity of the input. That is, there is no error detection function. For example, as shown in FIG. 5B, when the output of the variable “VAL1” is limited by LIMIT, the variable “VAL1” is only limited to the range of (−6 to +12), and an error occurs during the check during calculation. It cannot be detected.
本発明の目的は、部分範囲データ形変数の使用に際して上下限逸脱発生のチェックおよび確認を容易にしたプログラマブルコントローラのプログラム作成方式を提供することにある。 It is an object of the present invention to provide a program creation method for a programmable controller that facilitates checking and confirming the occurrence of upper and lower limit deviations when using a partial range data type variable.
本発明は、前記の課題を解決するため、部分範囲データ形変数が使用されているときに、コンパイラがEN付きLIMITファンクションとENフラグチェックファンクションを自動的に埋め込み、部分範囲データ形変数が部分範囲を逸脱したことを検出および確認可能とするもので、以下の構成を特徴とする。 In order to solve the above problem, the present invention automatically embeds the LIMIT function with EN and the EN flag check function when the partial range data type variable is used, and the partial range data type variable is Can be detected and confirmed, and has the following configuration.
(1)ソースプログラムで記述されるファンクションをコンパイラで目的プログラムに変換するプログラマブルコントローラのプログラム作成方式において、
前記コンパイラは、前記ファンクションの入力変数が部分範囲データ形変数である場合、該変数に対して部分範囲チェックを行うEN付きLIMITファンクション命令と、この部分範囲チェック内に該変数が収まっていない場合にその時点の演算プログラム位置を記憶するENフラグチェックファンクション命令とを自動的に変換プログラムに埋め込む手段を備えたことを特徴とする。
(1) In a program creation method of a programmable controller that converts a function described in a source program into a target program by a compiler,
When the input variable of the function is a partial range data type variable, the compiler executes a LIMIT function instruction with EN for performing a partial range check on the variable, and when the variable does not fall within the partial range check. An EN flag check function instruction for storing the calculation program position at that time is automatically embedded in the conversion program.
(2)前記ENフラグチェックファンクション命令は、前記変数が部分範囲チェック内に収まっていない場合にアプリケーションプログラムで確認できる出力を得ることを特徴とする。 (2) The EN flag check function instruction obtains an output that can be confirmed by an application program when the variable does not fall within the partial range check.
以上のとおり、本発明によれば、部分範囲データ形変数が使用されているときに、コンパイラがEN付きLIMITファンクションとENフラグチェックファンクションを自動的に埋め込み、部分範囲データ形変数が部分範囲を逸脱したことを検出および確認可能とするため、部分範囲データ形変数の使用に際して上下限逸脱発生をチェックおよび確認が容易になる。 As described above, according to the present invention, when a partial range data type variable is used, the compiler automatically embeds the LIMIT function with EN and the EN flag check function, and the partial range data type variable deviates from the partial range. Therefore, it is easy to check and confirm the occurrence of deviation from the upper and lower limits when using the partial range data type variable.
(実施形態1)
図1は本実施形態を示すプログラム作成の模式図であり、加算ファンクションの変数Xに部分範囲データ形を指定する場合である。
(Embodiment 1)
FIG. 1 is a schematic diagram of program creation showing this embodiment, in which a partial range data type is designated for the variable X of the addition function.
アプリケーションプログラムのソースプログラムとしての加算ファンクション(ADD)1は、変数Xと変数Yを加算し、この演算結果Z(=X+Y)を得るという演算であり、IL(Instruction List)言語で記述すると右側に示す命令の組み合わせになる。 An addition function (ADD) 1 as a source program of an application program is an operation of adding a variable X and a variable Y to obtain an operation result Z (= X + Y). When described in an IL (Instruction List) language, It becomes the combination of the command shown.
コンパイラ2は、加算ファンクション1のソースプログラムをプログラマブルコントローラの目的プログラムにコンパイルした変換プログラム3として得る。ここで、変数Xは部分範囲データ形であり、上限が1000で下限が0であるとする場合、コンパイラ2は、変数Xに対して、EN付きLIMITファンクション命令3Aと、ENフラグチェックファンクション命令3Bを自動的に変換プログラムに埋め込み、範囲逸脱エラー検出を可能にする。ただし、命令3Aと命令3Bは、ソースプログラムとしては見せないようにして、見た目は加算ファンクション1と同じ命令3Cのみのようにする。
The
図1の変換プログラム3では、変数Xに対して、EN付きLIMITファンクション命令3Aを使って、部分範囲チェックを行う。EN付きLIMITファンクションは入力データ(変数X)が部分範囲(0〜1000)に収まっていれば、ENO=1になり、収まっていなければENO=0になるようにする。ENフラグチェックファンクション命令3Bでは、ENO=0の場合にのみ動作して、その時点の演算プログラム位置を記憶する。その演算プログラム位置はPLCのシステムプログラム内メモリに記憶され、プログラミングツールなどの装置で、エラーの発生時にはエラー発生アドレスを元に検索したソースプログラム位置として表示できるようにする。
In the
なお、変数Yも部分範囲データ形変数とする場合には、コンパイラ2は、変数YについてもEN付きLIMITファンクション命令3Aと、ENフラグチェックファンクション命令3Bを自動的に追加する。
When the variable Y is also a partial range data type variable, the
したがって、本実施形態によれば、部分範囲データ形変数を使用するプログラミングに際して、アプリケーションプログラム上では、通常の変数と部分範囲データ形変数で、特に見た目が変わらないようにプログラミングすることができる。そして、部分範囲データ形変数の上下限逸脱をシステムプログラムに通知することができる。また、プログラミング装置などで、上下限逸脱のあった変数を使ったプログラムの場所を表示することができる。 Therefore, according to the present embodiment, when programming using the partial range data type variable, it is possible to program the application program so that the appearance is not particularly changed between the normal variable and the partial range data type variable. Then, the upper and lower limit deviation of the partial range data type variable can be notified to the system program. In addition, it is possible to display the location of a program that uses a variable that has deviated from the upper and lower limits using a programming device.
(実施形態2)
図2は本実施形態を示すプログラム作成の模式図であり、加算ファンクションの変数Xに部分範囲データ形を指定する場合である。
(Embodiment 2)
FIG. 2 is a schematic diagram of program creation showing this embodiment, in which a partial range data type is designated for the variable X of the addition function.
同図が図1と異なる部分は、ENフラグチェックファンクション命令3BをENO=0の場合に出力=1となるようにする点にある。こうすることで、部分範囲データが上下限を逸脱したことを、アプリケーションプログラムでも確認できることになる。
1 is different from FIG. 1 in that the EN flag
図2において、変数Xが上下限を逸脱した場合には、変数ERRORが真となり、アプリケーションプログラムで、部分範囲データエラーがあったことを確認することができる。この場合は、ENフラグチェックファンクション命令3Bは、明示的として、アプリケーションプログラムから自由に使用できるものとする。
In FIG. 2, when the variable X deviates from the upper and lower limits, the variable ERROR becomes true, and it can be confirmed by the application program that there has been a partial range data error. In this case, it is assumed that the EN flag
本実施形態によれば、部分範囲データ形変数の上下限逸脱がアプリケーションプログラムで確認することができる。 According to this embodiment, the upper and lower limit deviation of the partial range data type variable can be confirmed by the application program.
なお、変数Yも部分範囲データ形変数である場合には、コンパイラ2は、変数YについてもEN付きLIMITファンクション命令3Aと、ENフラグチェックファンクション命令3Bを自動的に追加する。
If the variable Y is also a partial range data type variable, the
また、実施形態1,2では加算ファンクション命令についての部分範囲データ形変数である場合を示すが、他のファンクション命令についても同様に適用することができる。 Further, although the first and second embodiments show the case of the partial range data type variable for the addition function instruction, the present invention can be similarly applied to other function instructions.
1 加算ファンクション
2 コンパイラ
3 変換プログラム
3A EN付きLIMITファンクション命令
3B ENフラグチェックファンクション命令
3C 加算命令
1
Claims (2)
前記コンパイラは、前記ファンクションの入力変数が部分範囲データ形変数である場合、該変数に対して部分範囲チェックを行うEN付きLIMITファンクション命令と、この部分範囲チェック内に該変数が収まっていない場合にその時点の演算プログラム位置を記憶するENフラグチェックファンクション命令とを自動的に変換プログラムに埋め込む手段を備えたことを特徴とするプログラマブルコントローラのプログラム作成方式。 In the program creation method of the programmable controller that converts the function described in the source program into the target program with the compiler,
When the input variable of the function is a partial range data type variable, the compiler executes a LIMIT function instruction with EN for performing a partial range check on the variable, and when the variable does not fall within the partial range check. A program generation method for a programmable controller, comprising means for automatically embedding an EN flag check function instruction for storing a calculation program position at that time in a conversion program.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006253744A JP4692452B2 (en) | 2006-09-20 | 2006-09-20 | Program creation method of programmable controller |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006253744A JP4692452B2 (en) | 2006-09-20 | 2006-09-20 | Program creation method of programmable controller |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2008077262A JP2008077262A (en) | 2008-04-03 |
| JP4692452B2 true JP4692452B2 (en) | 2011-06-01 |
Family
ID=39349270
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2006253744A Expired - Fee Related JP4692452B2 (en) | 2006-09-20 | 2006-09-20 | Program creation method of programmable controller |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4692452B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5667948B2 (en) * | 2011-09-06 | 2015-02-12 | 株式会社東芝 | Program inspection device |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH0997105A (en) * | 1995-10-02 | 1997-04-08 | Fanuc Ltd | Numerical controller |
| JP2000099116A (en) * | 1998-09-17 | 2000-04-07 | Meidensha Corp | Ladder, language structure |
| JP3373163B2 (en) * | 1998-11-30 | 2003-02-04 | 三菱電機株式会社 | Program editing device for programmable controller |
| JP2002351506A (en) * | 2001-05-22 | 2002-12-06 | Yaskawa Electric Corp | Programming device for programmable controller |
-
2006
- 2006-09-20 JP JP2006253744A patent/JP4692452B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2008077262A (en) | 2008-04-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102245356B (en) | For optimizing the method and system of the parameter of the robot for assembling in production | |
| US20190012168A1 (en) | Program generating apparatus | |
| US8572583B2 (en) | Method and system for testing software for industrial machine | |
| CN1328658C (en) | Compiler revalidation methods for security controls | |
| JP6891838B2 (en) | Development support equipment, development support methods, and development support programs | |
| CN102395928A (en) | System and method for automatically testing programs for safety-oriented automation systems | |
| JP5295061B2 (en) | Programmable controller | |
| KR20190094779A (en) | Automatically Generate Device for PLC Instruction Compiler Test-Case | |
| JP6053854B2 (en) | Interaction method for control program | |
| CN115003459B (en) | Origin Reset Device | |
| KR100694381B1 (en) | Graphical Programmers and Programmable Indicators | |
| WO2014136185A1 (en) | Program development support device and method therefor | |
| JP4692452B2 (en) | Program creation method of programmable controller | |
| CA2981129C (en) | Method for checking equivalence of code | |
| KR102096595B1 (en) | Monitor supported devices, monitor support methods, and monitor support programs | |
| JP5667948B2 (en) | Program inspection device | |
| JP2016045712A (en) | Programmable logic controller | |
| JP7226121B2 (en) | AUTOMATIC TEST SCENARIO GENERATION METHOD AND DEVICE FOR CONTROL SOFTWARE, AND COMPUTER PROGRAM | |
| JP4488227B2 (en) | Debugging method of control component having variability and debugging support apparatus | |
| US20120272222A1 (en) | Software Tool for Automation | |
| WO2024166239A1 (en) | Numerical control system, numerical control program, and numerical control method | |
| CN100367233C (en) | program execution control | |
| JP2010211555A (en) | Data trace method for programmable controller | |
| JP6290147B2 (en) | Computer-implemented method for creating control device program code and associated message management system | |
| JP2016115312A (en) | Numerical value control device having creation function of variable checking nc program having buried variable value used during processing |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20090709 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20110113 |
|
| 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: 20110125 |
|
| 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: 20110207 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140304 Year of fee payment: 3 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 4692452 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| LAPS | Cancellation because of no payment of annual fees |