JP2008159004A - Programmable logic controller data trace device - Google Patents
Programmable logic controller data trace device Download PDFInfo
- Publication number
- JP2008159004A JP2008159004A JP2006350407A JP2006350407A JP2008159004A JP 2008159004 A JP2008159004 A JP 2008159004A JP 2006350407 A JP2006350407 A JP 2006350407A JP 2006350407 A JP2006350407 A JP 2006350407A JP 2008159004 A JP2008159004 A JP 2008159004A
- Authority
- JP
- Japan
- Prior art keywords
- variable
- array
- sampling
- value
- subscript
- 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.)
- Pending
Links
- 238000005070 sampling Methods 0.000 claims abstract description 82
- 238000000034 method Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 1
Images
Landscapes
- Debugging And Monitoring (AREA)
- Programmable Controllers (AREA)
Abstract
Description
本発明は、プログラマブル・ロジック・コントローラ(以下PLCと略す)の特定の信号を一定の周期でサンプリングして記録する、データトレース装置に関する。 The present invention relates to a data trace apparatus that samples and records a specific signal of a programmable logic controller (hereinafter abbreviated as PLC) at a constant period.
従来、PLCの特定の信号を一定の周期でサンプリングして記録するデータトレース装置がPLCの信号の状態の変化を知るために利用されている。近年、マイクロプロセッサの性能向上に伴い、シーケンスプログラムを汎用のマイクロプロセッサを使用してインタプリタ方式やコンパイラ方式で実行し、シーケンスプログラム実行中の実データをモニタ可能とする技術が特許文献1に開示されている。
Conventionally, a data trace device that samples and records a specific signal of a PLC at a constant period is used to know a change in the state of the signal of the PLC. In recent years, with improvement in performance of a microprocessor,
また、近年IEC61131−3に準拠し配列変数を使用したPLCプログラムを作成できるPLCが普及しており配列変数をトレースすることに対する要求が強まっている。 In recent years, PLCs that can create PLC programs that use array variables based on IEC61131-3 have become widespread, and there is an increasing demand for tracing array variables.
従来におけるデータトレース装置が配列変数をトレースする動作の一例を図4〜図7を参照して説明する。 An example of an operation in which a conventional data tracing apparatus traces an array variable will be described with reference to FIGS.
図4は従来のPLC及びデータトレース装置の一実施例を示すブロック構成図である。図4に示されるPLC10及びデータトレース装置20は、PLC実行部100及びデータトレース部200で構成されており、PLC実行部100はCPU110、PLCデータメモリ120、PLCプログラムメモリ130で構成されている。また、データトレース部200はサンプリング実行部210、サンプリングバッファ230、画面制御部240、サンプリング条件設定部250、操作入力制御部260で構成されている。画面制御部240はモニタ画面300に接続されて画面表示を行い、操作入力制御部260はキーボードやマウス等の入力機器320に接続されており、入力機器320からの入力を受け付ける。
FIG. 4 is a block diagram showing an embodiment of a conventional PLC and data trace apparatus. 4 includes a
図5は従来における配列変数をトレースする動作の一例を示すフローチャートである。サンプリング条件設定部250は入力機器320を使って操作入力制御部260に入力され、画面制御部240に表示されている配列変数名およびサンプリング回数から、配列の先頭アドレスと、配列のデータ型と、配列の添え字の値と、サンプリング回数を求め、前記配列の先頭アドレスと、配列のデータ型と、配列の添え字の値とから配列要素のアドレスを求め、前記サンプリング回数とあわせてサンプリング実行部210に設定する(ステップS131)。
FIG. 5 is a flowchart showing an example of a conventional operation for tracing array variables. The sampling
サンプリング実行部210は設定された配列要素のアドレスの値をPLCデータメモリ120から読み出して、サンプリングバッファ230の所定の位置に書き込み(ステップS140)、設定されたサンプリング回数だけサンプリングを終了するとトレースを終了する。設定されたサンプリング回数に達しない場合はサンプリング回数をカウントアップしステップS140に戻ってサンプリングを繰り返す(ステップS150およびステップS160)。
The
図6(a)および(b)は配列変数を使用したPLCプログラムの例である。図6(a)は左母線から2つ目の接点に添え字が定数=10の配列変数ARRAYA[]を使用しており、図6(b)は左母線から2つ目の接点に添え字が変数=iの配列変数ARRAYB[]を使用している。 FIGS. 6A and 6B are examples of PLC programs using array variables. 6 (a) uses an array variable ARRAYA [] whose subscript is constant = 10 at the second contact from the left bus, and FIG. 6 (b) is a subscript at the second contact from the left bus. Uses the array variable ARRAYB [] with variable = i.
図7は従来のデータトレース装置で図6(a)のPLCプログラムの各変数をトレースした結果を表示した画面の例である。画面例400の左から、信号名称フィールド410、データ型フィールド420、トレース結果フィールド430を表示している。トレース結果フィールド430の上部にはサンプリングした周期を識別するための番号が表示される番号フィールド432が配置され、その下には各変数のトレース結果が表示される入力フィールド434、配列変数フィールド436、出力フィールド438が配置される。トレース結果フィールド430は横方向にスクロールすることができる。図7の例ではトレース結果を数値で表示しているが、数値をもとにグラフにして表示することも可能であることは言うまでもない。
FIG. 7 shows an example of a screen displaying the result of tracing each variable of the PLC program of FIG. 6A by the conventional data trace apparatus. From the left of the screen example 400, a
従来のデータトレース装置では図6(a)のPLCプログラムの場合はサンプリング条件設定部250が配列の先頭要素を格納するアドレスと、配列の添え字の値と、配列のデータ型とからサンプリングする配列要素を格納するアドレスおよび配列要素のデータ型を求めることができるため、配列変数=ARRAYA[10]のデータトレースを行うことができるが、図6(b)のPLCプログラムの配列変数=ARRAYB[i]の場合は配列の添え字の値が変数=iの値でありサンプリングの途中で変化してしまうことがあるため、データトレースを行うことができなかった。
In the conventional data trace apparatus, in the case of the PLC program of FIG. 6A, the sampling
従来のデータトレース装置20はPLCプログラム中の配列変数の添え字が変数の場合に配列変数の配列要素のアドレスを特定することができないため、添え字が定数の場合しか配列変数の配列要素のデータトレースを行うことができないという問題があった。
Since the conventional
本発明は上述のような事情からなされたものであり、本発明の目的は配列変数の添え字が変数の場合にも配列変数の配列要素のデータトレースを行うことを可能にしたデータトレース装置20を提供することにある。
The present invention has been made under the circumstances described above, and an object of the present invention is to provide a
以上のような目的を達成するために、本発明に係るデータトレース装置は、プログラマブル・ロジック・コントローラの変数の値を一定の周期でサンプリングして記憶する、データトレース装置において、サンプリングを行う変数とサンプリングの開始および終了条件を設定するサンプリング条件設定部と、前記サンプリング条件設定部に設定された条件によりサンプリングを行うサンプリング実行部と、前記サンプリング実行部がサンプリングを行う配列変数のアドレスを演算する配列アドレス演算部と、サンプリング実行部のサンプリングした結果を記憶するサンプリングバッファとを備え、前記サンプリング条件設定部は配列変数と配列変数の添え字変数を組み合わせて設定可能であり、前記配列アドレス演算部は前記サンプリング条件設定部に設定されたサンプリングを行う変数が配列変数の場合に、配列変数の添え字変数の値にて特定される配列変数の要素のアドレスを計算して前記配列変数の添え字変数の値とともに前記サンプリング実行部に設定し、前記サンプリング実行部は前記配列変数の要素のアドレスから配列変数の要素の値を求めて、前記配列変数の添え字変数の値とともにサンプリング周期毎に前記サンプリングバッファに記録し、前記記録した前記配列変数の要素の値と前記配列変数の添え字変数の値とを前記サンプリング周期毎に並べて表示することを特徴とする。 In order to achieve the above object, a data trace device according to the present invention samples and stores variable logic controller variable values at a constant period, and the data trace device performs sampling and A sampling condition setting unit that sets sampling start and end conditions, a sampling execution unit that performs sampling according to the conditions set in the sampling condition setting unit, and an array that calculates an address of an array variable on which the sampling execution unit performs sampling An address calculation unit, and a sampling buffer for storing the sampling result of the sampling execution unit, the sampling condition setting unit can be set by combining an array variable and a subscript variable of the array variable, the array address calculation unit, Sampling conditions When the sampling variable set in the setting section is an array variable, calculate the address of the element of the array variable specified by the value of the subscript variable of the array variable, along with the value of the subscript variable of the array variable Set in the sampling execution unit, the sampling execution unit obtains the value of the element of the array variable from the address of the element of the array variable, and records the value of the subscript variable of the array variable in the sampling buffer for each sampling period The recorded element value of the array variable and the value of the subscript variable of the array variable are displayed side by side for each sampling period.
本発明を用いることにより、次に示す効果を得ることができる。すなわち、配列変数の添え字が変数の場合にも配列変数の要素のデータトレースを行うことが可能になるため、配列変数を含むPLCプログラムの実際の動作を解析することが容易になる。例えば、次のような場合に配列変数を使った効果的なPLCプログラムを組むことができる。 By using the present invention, the following effects can be obtained. That is, even when the subscript of the array variable is a variable, it is possible to perform data trace of the element of the array variable, so that it is easy to analyze the actual operation of the PLC program including the array variable. For example, an effective PLC program using array variables can be built in the following cases.
制御対象の動作モード(運転モード/一時停止モード/緊急停止モード等)を配列変数の添え字変数の値として割り当て、添え字変数の値を変更することでPLCプログラムのモードを一括で切り替えることが容易に実現できる。このように配列変数の添え字を変数で使用すれば同じ変数に複数の意味を持たせるといった使い方が可能になる。このような場合に、本発明によれば配列変数の添え字が変数の場合でもデータトレース機能を使ったデバッグができるため、PLCプログラム中に配列変数を使用した場合のプログラムのデバッグが極めて容易になる効果を得ることができる。 The operation mode (operation mode / pause mode / emergency stop mode, etc.) to be controlled is assigned as the value of the subscript variable of the array variable, and the PLC program mode can be switched at once by changing the value of the subscript variable. It can be easily realized. In this way, if the subscript of an array variable is used as a variable, the same variable can have multiple meanings. In such a case, according to the present invention, even when the subscript of the array variable is a variable, debugging can be performed using the data trace function. Therefore, it is very easy to debug the program when the array variable is used in the PLC program. The effect which becomes can be acquired.
以下、本発明の実施の形態(以下実施形態という)を、図1〜図3に従って説明する。 Hereinafter, an embodiment of the present invention (hereinafter referred to as an embodiment) will be described with reference to FIGS.
図1は、本実施形態のPLC10およびデータトレース装置20を図4に対応させて示すブロック構成図である。なお、同一構成箇所には同符号を付して説明を省略する。本実施形態では配列アドレス演算部220が新たに追加されている。
FIG. 1 is a block configuration diagram showing the
図2は本実施形態に係るデータトレース装置20におけるサンプリング実行部210および配列アドレス演算部220の動作の一例を示すフローチャートである。なお、図5と同一構成箇所には同符号を付して説明を省略する。
FIG. 2 is a flowchart showing an example of operations of the
サンプリング条件設定部250は、サンプリングする変数が配列変数の場合、配列の先頭要素を格納するアドレスと、配列のデータ型と、配列の添え字の値または配列の添え字の値を格納するアドレスと、配列の添え字種別のデータ型と、サンプリング回数を求め、配列アドレス演算部220に設定する。配列の添え字種別のデータ型には、配列の添え字が定数(数値)であるか、または変数であるかが設定され、変数の場合には、添え字のデータ型が設定されるものとする(ステップS100)。
When the variable to be sampled is an array variable, the sampling
配列アドレス演算部220は設定された配列の添え字が定数か変数かを判定して、変数の場合はステップS120に進み、定数の場合はステップS130に進む(ステップS110)。
The array
次に配列アドレス演算部220は前記配列の添え字が変数の場合は、設定された配列の添え字の値を格納するアドレスと、添え字のデータ型をもとに、PLCデータメモリ120から添え字の値を読み出して求める(ステップS120)。すなわち、配列アドレス演算部220は、PLCデータメモリ120内の配列の添え字の値を格納するアドレスへアクセスし、添え字のデータ型(データサイズなど)に基づいて当該アクセス先のアドレスから配列の添え字の値を読み出して求める。
Next, when the array subscript is a variable, the array
さらに、求めた添え字の値と、前記配列の先頭要素を格納するアドレスと、配列のデータ型とからサンプリングする配列要素を格納するアドレスを求める。例えば、求めた添え字の値がi=5で、先頭要素のアドレスが1000番地であり、添え字を0以上の整数とした場合、配列のデータ型が配列要素1についてアドレス1番地であれば、先頭要素のアドレスに添え字の値を加算することで、サンプリングする配列要素のアドレスは、1005番地と求められる。添え字が定数の場合も同様にして配列要素を格納するアドレスを求める。求めた配列要素のアドレスは添え字の値とともにサンプリング実行部210に設定する。(ステップS130)。
Further, an address for storing the array element to be sampled is obtained from the obtained subscript value, the address for storing the first element of the array, and the data type of the array. For example, if the obtained subscript value is i = 5, the address of the first element is 1000, and the subscript is an integer greater than or equal to 0, if the data type of the array is
サンプリング実行部210は設定された配列要素のアドレスより、PLCデータメモリ120から配列要素の値を読み出して、前記添え字の値とともにサンプリングバッファ230の所定の位置に書き込み、設定されたサンプリング回数だけサンプリングを終了するとトレースを終了する(ステップS150)。
The
設定されたサンプリング回数に達しない場合はサンプリング回数をカウントアップしステップS110に戻ってサンプリングを繰り返す(ステップS150およびステップS160)。 If the set number of samplings has not been reached, the number of samplings is counted up, the process returns to step S110 and the sampling is repeated (steps S150 and S160).
図3は本発明のデータトレース装置で図6(b)のPLCプログラムの各変数をトレースした結果を表示した画面の一例を図7に対比して示した例である。画面には、信号名称フィールド410、データ型フィールド420、トレース結果フィールド430が示される。トレース結果フィールド430には、入力フィールド434、配列変数フィールド436、出力フィールド438の他に、配列変数=ARRAYB[i]の添え字変数=iが表示される添え字変数フィールド437が示される。
FIG. 3 shows an example of a screen displaying the result of tracing each variable of the PLC program of FIG. 6B by the data trace apparatus of the present invention, as compared with FIG. The screen shows a
以上のように本発明によれば配列変数のサンプリングを行う際にサンプリングの都度、配列要素を格納するアドレスの値を計算するため、配列変数の添え字が変数の場合もデータトレースを行うことが可能である。なお、以上は1次元配列についての実施例であるが、多次元配列についても同様にして配列変数の添え字が変数の場合にもデータトレースを行うことが可能である。 As described above, according to the present invention, when an array variable is sampled, the value of the address for storing the array element is calculated every time sampling is performed. Therefore, even when the subscript of the array variable is a variable, data tracing can be performed. Is possible. Although the above is an example of a one-dimensional array, data trace can be performed in the same way for a multidimensional array even when the subscript of the array variable is a variable.
10 PLC、20 データトレース装置、100 PLC実行部、110 CPU、120 PLCデータメモリ、130 PLCプログラムメモリ、200 データトレース部、210 サンプリング実行部、220 配列アドレス演算部、230 サンプリングバッファ、240 画面制御部、250 サンプリング条件設定部、260 操作入力制御部、300 モニタ画面、320 入力機器。
10 PLC, 20 data trace device, 100 PLC execution unit, 110 CPU, 120 PLC data memory, 130 PLC program memory, 200 data trace unit, 210 sampling execution unit, 220 array address calculation unit, 230 sampling buffer, 240
Claims (1)
サンプリングを行う変数とサンプリングの開始および終了条件を設定するサンプリング条件設定部と、
前記サンプリング条件設定部に設定された条件によりサンプリングを行うサンプリング実行部と、
前記サンプリング実行部がサンプリングを行う配列変数のアドレスを演算する配列アドレス演算部と、
サンプリング実行部のサンプリングした結果を記憶するサンプリングバッファと、
を備え、
前記サンプリング条件設定部は、配列変数と配列変数の添え字変数を組み合わせて設定可能であり、
前記配列アドレス演算部は、前記サンプリング条件設定部に設定されたサンプリングを行う変数が配列変数の場合に、配列変数の添え字変数の値にて特定される配列変数の要素のアドレスを計算して前記配列変数の添え字変数の値とともに前記サンプリング実行部に設定し、
前記サンプリング実行部は、前記配列変数の要素のアドレスから配列変数の要素の値を求めて、前記配列変数の添え字変数の値とともにサンプリング周期毎に前記サンプリングバッファに記録し、前記記録した前記配列変数の要素の値と前記配列変数の添え字変数の値とを前記サンプリング周期毎に並べて表示する、
ことを特徴とするプログラマブル・ロジック・コントローラのデータトレース装置。 In a data trace device that samples and stores the value of a variable of a programmable logic controller at a constant cycle,
A sampling condition setting section for setting variables for sampling and sampling start and end conditions;
A sampling execution unit that performs sampling according to the conditions set in the sampling condition setting unit;
An array address calculation unit for calculating an address of an array variable to be sampled by the sampling execution unit;
A sampling buffer for storing the sampling result of the sampling execution unit;
With
The sampling condition setting unit can be set by combining an array variable and a subscript variable of the array variable,
The array address calculation unit calculates the address of the element of the array variable specified by the value of the subscript variable of the array variable when the sampling variable set in the sampling condition setting unit is an array variable. Set in the sampling execution unit together with the value of the subscript variable of the array variable,
The sampling execution unit obtains the value of the element of the array variable from the address of the element of the array variable, records the value of the subscript variable of the array variable in the sampling buffer for each sampling period, and records the recorded array Displaying the value of the variable element and the value of the subscript variable of the array variable side by side for each sampling period;
A data trace apparatus for a programmable logic controller.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006350407A JP2008159004A (en) | 2006-12-26 | 2006-12-26 | Programmable logic controller data trace device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006350407A JP2008159004A (en) | 2006-12-26 | 2006-12-26 | Programmable logic controller data trace device |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2008159004A true JP2008159004A (en) | 2008-07-10 |
Family
ID=39659807
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006350407A Pending JP2008159004A (en) | 2006-12-26 | 2006-12-26 | Programmable logic controller data trace device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2008159004A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017130068A (en) * | 2016-01-20 | 2017-07-27 | 富士電機株式会社 | Programmable controller system, development support device thereof and target device |
-
2006
- 2006-12-26 JP JP2006350407A patent/JP2008159004A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2017130068A (en) * | 2016-01-20 | 2017-07-27 | 富士電機株式会社 | Programmable controller system, development support device thereof and target device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9740185B2 (en) | Peripheral device for programmable controller and debug support program | |
JP5122000B2 (en) | A / D converter and programmable controller system | |
JP5325436B2 (en) | Trace stream generation technology for data processing equipment | |
JP6430037B2 (en) | Debugging support apparatus and debugging support method | |
KR101324370B1 (en) | Sequence program debugging device, debugging method, and program | |
US20210144303A1 (en) | Motion analysis device, motion analysis method and recording medium | |
JP5241388B2 (en) | Log data acquisition system and programmable display | |
CN108693836B (en) | Information processing apparatus | |
TW201706739A (en) | Programmable logic controller, engineering tool and engineering tool program | |
JP6245429B2 (en) | Program development support apparatus and computer program | |
JP2009122936A (en) | Sequence program monitor device equipped with display function for abnormality research and programmable controller | |
JP3358759B2 (en) | Data trace method for programmable controller | |
JP2008159004A (en) | Programmable logic controller data trace device | |
EP2410392A2 (en) | Non-linear time scale optimization for mechanical-electrical machine behavior model visualization | |
CN103365237A (en) | Method and device for monitoring and recording component and variable in PLC (Programmable Logic Controller) system | |
JP5937530B2 (en) | Software error analysis device, error information creation device | |
CN113348415B (en) | Device state reproducing device, method and storage medium | |
JP5599378B2 (en) | Display control device | |
CN112784666A (en) | Motion analysis device, motion analysis method, and computer-readable storage medium | |
JPH0458303A (en) | Programmable controller | |
JP2005301334A (en) | Motion controller | |
JPH01223504A (en) | Sampling trace system for programmable controller | |
JP2012088798A (en) | Debugging device, debugging method, and program for debugging | |
JP6297202B2 (en) | Procedure extraction system | |
JP5599377B2 (en) | Display control device |