JP2007102384A - Debugging device - Google Patents

Debugging device Download PDF

Info

Publication number
JP2007102384A
JP2007102384A JP2005289404A JP2005289404A JP2007102384A JP 2007102384 A JP2007102384 A JP 2007102384A JP 2005289404 A JP2005289404 A JP 2005289404A JP 2005289404 A JP2005289404 A JP 2005289404A JP 2007102384 A JP2007102384 A JP 2007102384A
Authority
JP
Japan
Prior art keywords
program
function block
execution
executed
breakpoint
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
JP2005289404A
Other languages
Japanese (ja)
Other versions
JP4062546B2 (en
Inventor
Yukihiro Kawakami
幸浩 川上
Yutaka Abe
裕 阿部
Masaru Tsutsui
賢 筒井
Hiromi Yaoita
宏心 矢尾板
Takahisa Hasegawa
貴久 長谷川
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP2005289404A priority Critical patent/JP4062546B2/en
Priority to US11/529,566 priority patent/US20070078538A1/en
Publication of JP2007102384A publication Critical patent/JP2007102384A/en
Application granted granted Critical
Publication of JP4062546B2 publication Critical patent/JP4062546B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a debugging device allowing setting of a step position (a break point) for performing a temporary stop in each instance of a function block, and allowing the setting of the break point inside the function block. <P>SOLUTION: This debugging device continuously executes each step constituting a control program including the function block. A program execution part decides whether the present step during the execution is present in a corresponding step position of the function block specified by break point management information stored in a break point management table or not on the basis of the break point management table during the continuous execution inside the function block, and temporarily stops the program execution when the step is present in the corresponding step position. <P>COPYRIGHT: (C)2007,JPO&INPIT

Description

本発明は、ファンクションブロックを含む制御プログラム用のデバッグ装置に関するものである。   The present invention relates to a debugging device for a control program including function blocks.

プログラマブルコントローラ(以降、「PLC」と称する)の制御プログラムの開発では、IEC−61131−3の各種言語により、開発対象に応じた言語が利用できるようになっている。開発段階では、設計した制御プログラムの検証・動作チェックを行なうため、一般にデバッグ装置を用いたデバッグ処理が行なわれる。このデバッグ装置は、実機に替わって制御プログラムを実行するシミュレータと、そのシミュレータの動作を制御する制御手段を備えている。   In the development of a control program for a programmable controller (hereinafter referred to as “PLC”), various languages according to IEC-61131-3 can be used according to the development target. In the development stage, in order to verify and check the operation of the designed control program, debugging processing using a debugging device is generally performed. This debugging apparatus includes a simulator that executes a control program instead of an actual machine, and a control unit that controls the operation of the simulator.

係る動作の制御としては、実行命令の入力を受ける都度、制御プログラムを1ステップ(1命令)ずつ実行するステップ実行や、制御プログラムの全体を1回あるいは停止命令がくるまで繰り返し実行するスキャン実行などがある。また、予めブレークポイントを設定しておき、スキャン実行中にそのブレークポイントの位置に来た場合に、プログラムの実行を一時停止する制御もある。そのように適宜の手法で、プログラムを実行したり、停止したりし、そのときのメモリの状態を確認することで、正常に動作しているか否かや、問題が発生した場合には、その問題の発生箇所を特定し、修正する。係るデバッグ装置としては、従来、特許文献1等に開示されたものがある。
特開2001−67245号公報
The control of the operation includes step execution in which the control program is executed step by step (one instruction) each time an execution instruction is input, and scan execution in which the entire control program is executed once or until a stop instruction is received. There is. There is also a control for setting a breakpoint in advance and temporarily stopping the execution of the program when the breakpoint is reached during the scan execution. In such an appropriate way, by executing or stopping the program and checking the state of the memory at that time, whether it is operating normally or if a problem occurs, Identify and correct the problem location. As such a debugging device, there is a device disclosed in Patent Document 1 or the like.
JP 2001-67245 A

ところで、IEC−61131−3で規定されるプログラムを構成する要素の1つとしてファンクションブロックと称されるものがある。このファンクションブロックの記述目的の1つとして、プログラムの隠蔽による表示プログラム量の削減による設計・保守の容易化がある。このファンクションブロックの実現方法はインスタンスという概念で作成される。よって、ファンクションブロックの実体は1つ存在し、メインの制御プログラム上では1又は複数のインスタンスが記述され、プログラムの実行位置がそのファンクションブロックの記述された位置に至ると、サブルーチンプログラムのように上記のファンクションブロックの実体に記述された各命令を順に実行し、最後の命令まで実行すると再び、元の位置に復帰し、メインプログラム上における次の命令を実行する。   By the way, there is what is called a function block as one of the elements constituting the program defined in IEC-61131-3. One of the purpose of describing this function block is to facilitate design and maintenance by reducing the amount of display program by concealing the program. The function block implementation method is created based on the concept of an instance. Therefore, there is one function block entity, and one or more instances are described in the main control program. When the execution position of the program reaches the position where the function block is described, the above-mentioned subroutine program is executed. Each instruction described in the actual function block is executed in order, and when it is executed up to the last instruction, it returns to the original position and executes the next instruction on the main program.

このファンクションブロックの内部にブレークポイントを設定することは、困難である。すなわち、ファンクションブロックの実現方法がインスタンスという概念で作成されるため、制御プログラム上に同一のファンクションブロックが複数使用されている場合でも、ファンクションブロックのプログラムの実体が一つしか存在しないので、単にファンクションブロックを構成するプログラムのある位置のステップにブレークポイントを設定した場合、全てのファンクションブロックのインスタンスにおいて、設定したブレークポイントで一時停止してしまうという問題がある。   It is difficult to set a breakpoint inside this function block. In other words, since the function block implementation method is created with the concept of an instance, even if the same function block is used multiple times in the control program, there is only one function block program entity. When a breakpoint is set at a step in a certain position of a program that constitutes a block, there is a problem that all function block instances are temporarily stopped at the set breakpoint.

たとえば、ファンクションブロックがあるロボットの制御をするプログラムの場合であって、ロボットA,ロボットBの2つの制御に用いるとする。このとき、ロボットAについては、ある位置に設定したブレークポイントで一時停止させたいが、ロボットBについては一時停止させたくないという要求があるが、上記の例ではロボットBの制御のためにファンクションブロックのプログラムの実行中にも設定されたブレークポイントで一時停止してしまい、要求に対応できない。   For example, in the case of a program for controlling a robot having a function block, it is assumed that the program is used for two controls of the robot A and the robot B. At this time, robot A wants to pause at a breakpoint set at a certain position, but robot B does not want to pause, but in the above example, function block for controlling robot B During the execution of this program, the program pauses at the set breakpoint and cannot respond to the request.

また、ロボットAとロボットBとでそれぞれ別々の位置にブレークポイントを設定したいという要求があるが、仮に2つの位置にブレークポイントを設定すると、ロボットAの制御実行時とロボットBの制御実行時にそれぞれ2つのブレークポイントの位置で一時停止することになるので、係る要求にも対応できない。
この発明は、ファンクションブロック内にも実用的なブレークポイントの設定を行なうことができるようにしたデバッグ装置を提供することを目的とする。
In addition, there is a request to set breakpoints at different positions for robot A and robot B, but if breakpoints are set at two positions, robot A and robot B will each be controlled. Since it pauses at the position of two breakpoints, it cannot respond to such a request.
It is an object of the present invention to provide a debugging apparatus that can set a practical breakpoint in a function block.

上記した目的を達成するため、本発明に係るデバッグ装置は、ファンクションブロックを含む制御プログラム用のデバッグ装置であって、前記制御ブロックを構成するステップを連続実行させるプログラム実行手段と、前記制御プログラム中に記述されたファンクションブロックを特定するプログラム識別情報とそのファンクションブロック内のプログラムにおける一時停止させるステップ位置情報とを関連づけたブレークポイント管理情報を格納する記憶手段と、前記プログラム実行手段が、前記ファンクションブロック内を連続実行中に前記記憶手段に格納されたブレークポイント管理情報に基づき、現在実行中のステップが、前記記憶手段に格納された前記ブレークポイント管理情報で特定されるファンクションブロックの該当ステップ位置か否かを判断し、該当する場合にプログラム実行を一時停止する手段と、を備えて構成した。また、前記プログラム識別情報は、ファンクションブロックのインスタンス識別情報を含むものとすることができる。もちろん、他の情報をさらに付加しても良いし、インスタンス識別情報以外の情報(該当するインスタンスが特定できる情報)でも良い。ブレークポイント管理情報は、実施の形態では、ブレークポイント管理テーブルに対応する。   In order to achieve the above object, a debugging device according to the present invention is a debugging device for a control program including a function block, the program executing means for continuously executing the steps constituting the control block, and the control program Storage means for storing breakpoint management information associating program identification information for specifying the function block described in the above and step position information to be temporarily stopped in the program in the function block, and the program execution means, the function block Based on the breakpoint management information stored in the storage means during continuous execution, the step currently being executed is the corresponding step of the function block identified by the breakpoint management information stored in the storage means. It is equal to the position and configuration and means to suspend program execution when applicable. The program identification information may include function block instance identification information. Of course, other information may be further added, or information other than the instance identification information (information that can identify the corresponding instance) may be used. In the embodiment, the breakpoint management information corresponds to a breakpoint management table.

このようにすると、同一のファンクションブロックのインスタンスが制御プログラム中に複数存在しても、各インスタンスを特定できるので、各インスタンスごとに一時停止させるステップ位置を定義できる。よって、同一のファンクションブロックであっても、あるファンクションブロックのインスタンスでは一時停止することなく連続実行させ、別のインスタンスでは一時停止させることができる。また、一時停止させる位置も、それぞれのインスタンスに固有に設定できるので、作業性が向上する。   In this way, even if there are a plurality of instances of the same function block in the control program, each instance can be specified, so that a step position for temporary suspension can be defined for each instance. Therefore, even the same function block can be continuously executed without being paused in an instance of a certain function block, and can be paused in another instance. In addition, since the position to be paused can be set uniquely for each instance, workability is improved.

また、前記記憶手段には、ファンクションブロックの外に存在するステップについて、そのステップを特定するプログラム識別情報と、そのステップのステップ位置情報と、を関連づけたブレークポイント管理情報が格納され、前記一時停止する手段は、前記ファンクションブロックの外に存在するステップについても該当する場合にプログラム実行を一時停止するものとすることができる。係る構成を採ると、ファンクションブロックの内外を問わず、同一のシステム構成で、ブレークポイントの管理ができるので、好ましい。   The storage means stores breakpoint management information in which program identification information for specifying a step and step position information of the step are associated with each other for a step existing outside the function block. The means for suspending the execution of the program may be applicable to a step existing outside the function block if applicable. Such a configuration is preferable because breakpoints can be managed with the same system configuration regardless of whether the function block is inside or outside.

本発明では、個々のファンクションブロックのインスタンスごとに一時停止するステップ位置(ブレークポイント)が設定できるため、ファンクションブロック内にも実用的なブレークポイントの設定を行なうことができる。   In the present invention, since a step position (break point) for temporary stop can be set for each instance of each function block, a practical break point can also be set in the function block.

図1は、本発明に係るデバッグ装置の一実施の形態を示している。デバッグ装置は、たとえばパソコン等のコンピュータに、アプリケーションプログラムをインストールすることで構成される。従って、ハードウェア構成としては、図1に示すように、キーボード,ポインティングデバイス等の入力装置1と、表示装置2と、装置本体(CPU本体)3と、を備えている。装置本体3は、操作部11と、プログラム制御部12と、プログラム実行部13と、制御プログラム格納領域14と、プログラム制御情報領域15と、プログラム実行作業領域16と、I/O領域17と、を備えている。操作部11,プログラム制御部12並びにプログラム実行部13は、CPUで実行されるアプリケーションプログラムで実現される。制御プログラム格納領域14,プログラム制御情報領域15,プログラム実行作業領域16並びにI/O領域17は、RAMやハードディスクなどの各種記憶手段により実現される。   FIG. 1 shows an embodiment of a debugging apparatus according to the present invention. The debugging device is configured by installing an application program in a computer such as a personal computer. Accordingly, as shown in FIG. 1, the hardware configuration includes an input device 1 such as a keyboard and a pointing device, a display device 2, and a device main body (CPU main body) 3. The apparatus body 3 includes an operation unit 11, a program control unit 12, a program execution unit 13, a control program storage area 14, a program control information area 15, a program execution work area 16, an I / O area 17, It has. The operation unit 11, the program control unit 12, and the program execution unit 13 are realized by application programs executed by the CPU. The control program storage area 14, the program control information area 15, the program execution work area 16, and the I / O area 17 are realized by various storage means such as a RAM and a hard disk.

操作部11は、制御プログラムデバッグを行なうための操作画面を表示装置2に出力したり、入力装置1からの入力を受け付け、その受け付けた入力をプログラム制御部12に渡す。図2は、操作画面の一例を示している。この操作画面の配置レイアウトは、画面の上部に、制御プログラムの実行コマンドを与える各種実行操作ボタンB1,B2,B3,B4,B5,B6,……を配置し、左側にはプログラム構成を表示するプロジェクトツリー表示領域R1を配置し、右側にはデバッグ対象の制御プログラムを表示するプログラム表示領域R2を配置している。プログラム表示領域R2中には、現在実行中のステップ(命令)を示す矩形状のカーソルC1が表示される。後述するように、このカーソルC1は、ブレークポイントを設定するステップ位置を特定する際にも使用する。実行操作ボタンB1,B2,B3は、ステップ実行する際に使用する操作ボタンである。1スキャン実行操作ボタンB4は、制御プログラムを先頭から最後まで1回(1スキャン)だけ連続して実行する命令を与えるものである。連続実行操作ボタンB5は、制御プログラムを繰り返し実行する連続実行命令を与えるものである。また、実行停止ボタンB6は、連続実行操作ボタンB5の押下(クリック)により連続実行しているプログラム実行を停止させる命令を与えるものである。   The operation unit 11 outputs an operation screen for performing control program debugging to the display device 2, receives an input from the input device 1, and passes the received input to the program control unit 12. FIG. 2 shows an example of the operation screen. In this operation screen layout, various execution operation buttons B1, B2, B3, B4, B5, B6,... For giving a control program execution command are arranged at the top of the screen, and the program configuration is displayed on the left side. A project tree display area R1 is arranged, and a program display area R2 for displaying a control program to be debugged is arranged on the right side. In the program display area R2, a rectangular cursor C1 indicating a step (command) currently being executed is displayed. As will be described later, the cursor C1 is also used to specify a step position for setting a breakpoint. The execution operation buttons B1, B2, and B3 are operation buttons used when performing step execution. The one-scan execution operation button B4 gives a command for continuously executing the control program only once (one scan) from the beginning to the end. The continuous execution operation button B5 gives a continuous execution command for repeatedly executing the control program. The execution stop button B6 gives an instruction to stop the execution of the program being continuously executed by pressing (clicking) the continuous execution operation button B5.

プログラム制御部12は、操作部11から受け取った実行コマンドに基づき実行ステップを決定し、プログラム実行部13に決定した実行ステップの実行要求をしたり、操作部11から受け取ったブレークコマンドの設定位置により、ブレークポイントを管理するブレークポイント管理テーブルを作成し、プログラム制御情報領域15に格納する処理を行なう。   The program control unit 12 determines an execution step based on the execution command received from the operation unit 11, requests the program execution unit 13 to execute the determined execution step, or sets a break command received from the operation unit 11. Then, a breakpoint management table for managing breakpoints is created and stored in the program control information area 15.

プログラム実行部13は、プログラム制御部12からの要求、及びプログラム制御部12が設定するプログラム制御情報(本実施の形態では、ブレークポイント管理テーブル)により、制御プログラムを実行したり、停止したりする。   The program execution unit 13 executes or stops the control program according to a request from the program control unit 12 and program control information set by the program control unit 12 (breakpoint management table in the present embodiment). .

制御プログラム格納領域14は、PLCの制御プログラムを格納する記憶エリアであり、メモリの所定の領域に設定される。プログラム実行部13は、この制御プログラム格納領域14に格納された制御プログラムを読み出して実行する。   The control program storage area 14 is a storage area for storing a PLC control program, and is set in a predetermined area of the memory. The program execution unit 13 reads and executes the control program stored in the control program storage area 14.

プログラム制御情報領域15は、プログラム制御部12で作成したブレークポイント管理テーブルなどのプログラム制御情報を格納する記憶エリアであり、メモリの所定の領域に設定される。   The program control information area 15 is a storage area for storing program control information such as a breakpoint management table created by the program control unit 12, and is set in a predetermined area of the memory.

プログラム実行作業領域16は、PLCの内部メモリに相当すると共に、プログラム実行部13が制御プログラムを実行する際に使用するワークメモリとなる記憶エリアであり、RAMの所定の領域に設定される。I/O領域17は、PLCのI/Oメモリに相当する記憶エリアであり、RAMの所定の領域に設定される。   The program execution work area 16 corresponds to the internal memory of the PLC, and is a storage area serving as a work memory used when the program execution unit 13 executes the control program, and is set in a predetermined area of the RAM. The I / O area 17 is a storage area corresponding to the I / O memory of the PLC, and is set in a predetermined area of the RAM.

プログラム実行部13が実行する制御プログラムは、本実施の形態では、図2のプログラム表示領域R2に表示したように、ファンクションブロックを含み、ラダー言語で記述されたプログラムである。図2に示した制御プログラムの場合、ファンクションで作ったプログラム(FB_A)は、インスタンスとしてプログラムStationNo1内のRobot_1とRobot_2及びプログラムStationNo2内のRobot_3とRobot_4として利用され、それぞれの設備の制御を行う。   In the present embodiment, the control program executed by the program execution unit 13 is a program written in a ladder language including function blocks as displayed in the program display area R2 of FIG. In the case of the control program shown in FIG. 2, the program (FB_A) created by the function is used as instances Robot_1 and Robot_2 in the program StationNo1 and Robot_3 and Robot_4 in the program StationNo2, and controls each facility.

図3(a)は、ファンクションブロック(FB_A)のプログラムの一部を示している。図3(b)に示すように、制御プログラムに中にファンクションブロックに対応する矩形状のボックスを記述すると、図3(b)に示す制御プログラムの各命令を順次実行しファンクションブロックに至ると、図3(a)に示すファンクションブロック内のプログラムを最後まで実行し、次いで、図3(b)に示すファンクションブロックの次の命令を実行する。   FIG. 3A shows a part of the function block (FB_A) program. As shown in FIG. 3B, when a rectangular box corresponding to a function block is described in the control program, each instruction of the control program shown in FIG. The program in the function block shown in FIG. 3A is executed to the end, and then the next instruction of the function block shown in FIG. 3B is executed.

図3(b)では、Robot_1、Robot_2の制御を、ファンクションブロック(FB_A)で行なう。同一のファンクションブロック(FB_A)のインスタンスであるRobot_1とRobot_2は、プログラム実行作業領域16内に、それぞれ作業領域が設定され(図3(c)参照)、個別に入力データを与えることで、制御対象のRobotを制御する。このようにそれぞれに作業領域が設定されるため、同一のファンクションブロックのプログラムを実行しても、I/Oデータ等が異なり、それぞれの制御対象に応じた制御を行なうことができる。   In FIG. 3B, the control of Robot_1 and Robot_2 is performed by the function block (FB_A). Robot_1 and Robot_2, which are instances of the same function block (FB_A), have their respective work areas set in the program execution work area 16 (see FIG. 3C), and are individually controlled by giving input data individually. Controls the robot. Since the work areas are set in this way, even if the same function block program is executed, the I / O data and the like are different, and control according to each control target can be performed.

図4に示すように、ファンクションブロック(FB_A)を構成するプログラム中に、ファンクションブロック(FB−B)を記述することができる。このように、ファンクションブロックは、多重階層化構造の記述ができる。   As shown in FIG. 4, the function block (FB-B) can be described in the program constituting the function block (FB_A). Thus, the function block can describe a multi-layered structure.

本実施の形態では、プログラム制御部12が、ステップ実行時の機能として、「ステップオーバー」,「ステップイン」,「ステップアウト」の3つの機能を備えるようにした。これら3つの機能は、いずれも、ファンクションブロックに関する実行において使用するものである。   In the present embodiment, the program control unit 12 has three functions of “step over”, “step in”, and “step out” as functions at the time of step execution. These three functions are all used in execution related to the function block.

図5(a)に示すように、ステップオーバーは、実行対象の命令(現ステップ位置)を示すカーソルC1が、ファンクションブロックの先頭にある場合に、そのファンクションブロック内を連続実行し、次のステップへ移動するものである(図5(b)参照)。換言すると、ステップオーバーを実行するコマンドは、ファンクションブロックを1ステップとして実行するコマンドといえる。これにより、ファンクションブロック内の各命令をステップ実行する処理を省略でき、デバッグ作業が効率的に行える。これは、ファンクションブロックのデバッグが不要な場合に、有効な機能である。   As shown in FIG. 5A, in the step over, when the cursor C1 indicating the instruction to be executed (current step position) is at the head of the function block, the function block is continuously executed and the next step is executed. (Refer to FIG. 5B). In other words, the command for executing step over can be said to be a command for executing a function block as one step. As a result, the process of stepping each instruction in the function block can be omitted, and debugging work can be performed efficiently. This is an effective function when function block debugging is unnecessary.

ステップインは、実行対象の命令(現ステップ位置)を示すカーソルC1がファンクションブロックの先頭にある場合に、ファンクションブロック内の最初のステップへ移動するものである(図5(c)参照)。つまり、ステップインを実行するコマンドは、ファンクションブロック内の先頭ステップで停止するコマンドといえる。これにより、ファンクションブロック内のプログラムをステップ実行することが可能になる。ファンクションブロック内のプログラムについても検証したい場合に有効な機能である。   Step-in moves to the first step in the function block when the cursor C1 indicating the instruction to be executed (current step position) is at the head of the function block (see FIG. 5C). That is, the command for executing step-in can be said to be a command that stops at the first step in the function block. This makes it possible to execute the program in the function block step by step. This function is useful when you want to verify a program in a function block.

ステップアウトは、いったんステップインを実行してファンクションブロック内に入り、1命令ずつステップ実行している場合に、そのファンクションブロック内の残りステップを連続実行し、ファンクションブロック呼出し側のファンクションブロック実行後のステップへ移動するものである。このステップアウトを実行するコマンドは、ファンクションブロック内の残りステップを連続実行し、ファンクションブロック呼出し元のファンクションブロックの次ステップで停止するコマンドといえる。ファンクションブロックの内部をステップ実行して途中まで検証し、それ以降の命令の検証が不要な場合に、その後も1ステップずつステップ実行する作業が省略できる。   In step-out, once step-in is executed and the function block is entered, and if step by step is executed one instruction at a time, the remaining steps in the function block are continuously executed, and the function block calling side after the function block is executed Move to the step. The command for executing this step-out can be said to be a command that continuously executes the remaining steps in the function block and stops at the next step of the function block that has called the function block. If the inside of the function block is step-executed and verified halfway, and verification of subsequent instructions is unnecessary, the step-by-step operation after that can be omitted.

このようにステップオーバーと、ステップインの2つの機能を設けることで、ユーザは、ファンクションブロックの先頭に来たときに、そのファンクションブロックの内部に入り込んでステップ実行しながら検証するか(ステップイン)、そのファンクションブロック内に入り込むことなく、当該ファンクションブロックを連続実行させ次のステップに移行するか(ステップオーバー)を選択的することができ、状況に応じた適切な処理を効率的に行える。   By providing two functions of step over and step in in this way, when the user comes to the beginning of a function block, does the user enter the inside of the function block and perform verification while executing the step (step in)? Without entering into the function block, it is possible to selectively execute whether the function block is executed continuously and shift to the next step (step over), and an appropriate process according to the situation can be efficiently performed.

さらに、ステップアウトを設けることで、ファンクションブロックの内部について、必要な箇所までステップ実行して検証し、それ以降は連続実行させることでステップ実行コマンドをファンクションブロック内の全てのステップごとに1ステップ実行命令を入力する作業を省略できるので、作業性がさらに向上する。   Furthermore, by providing a step-out, step execution is performed up to the necessary part inside the function block, and after that, the step execution command is executed one step at every step in the function block by executing it continuously. Since the operation of inputting a command can be omitted, the workability is further improved.

本実施の形態では、上述した3つの機能と、通常のステップ実行とを、3つの実行操作ボタンB1,B2,B3により実行するようにした。すなわち、B1は、ステップインボタンである。ファンクションの先頭のときにこのステップインボタンB1が押されると、ファンクションブロック内の最初のステップへ移動する。つまり、上述したステップイン機能を実行する。ファンクションブロックの先頭以外、つまり、通常の命令や、ファンクションブロックの内部のときにこのステップインボタンB1が押されると、1ステップ実行する。   In the present embodiment, the three functions described above and normal step execution are executed by the three execution operation buttons B1, B2, and B3. That is, B1 is a step-in button. If this step-in button B1 is pressed at the beginning of the function, the process moves to the first step in the function block. That is, the above-described step-in function is executed. When this step-in button B1 is pressed at a position other than the top of the function block, that is, within a normal command or inside the function block, one step is executed.

B2は、ステップオーバーボタンである。ファンクションブロックの先頭のときに、このステップオーバーボタンB2が押されると、ファンクションブロック内を連続実行する。つまり、上述したステップオーバー機能を実行する。ファンクションブロックの先頭以外、つまり、通常の命令や、ファンクションブロックの内部のときにこのステップオーバーボタンB2が押されると、1ステップ実行する。   B2 is a step over button. When the step over button B2 is pressed at the beginning of the function block, the function block is continuously executed. That is, the above-described step over function is executed. When this step over button B2 is pressed at a position other than the top of the function block, that is, within a normal command or inside the function block, one step is executed.

B3は、ステップアウトボタンである。ファンクションブロック内の先頭,ファンクションブロックの途中のいずれの場合でも、ステップアウトボタンB3が押されると、そのファンクションブロック内の残りを連続実行する。なお、ファンクションブロックの外の通常命令の位置でこのステップアウトボタンB3が押されると、1ステップ実行する。   B3 is a step-out button. When the step-out button B3 is pressed in any case in the beginning of the function block or in the middle of the function block, the rest of the function block is continuously executed. When this step-out button B3 is pressed at the position of the normal command outside the function block, one step is executed.

つまり、ファンクションブロックの外部の通常の命令の位置では、3つのボタンB1,B2,B3のいずれも、1ステップ実行する命令を意味する。もちろん、本実施の形態では、3つのボタンB1,B2,B3により3つの機能と通常の1ステップ実行の命令の4種類をコマンドの入力を可能としたが、本発明はこれに限ることはなく、1ステップ実行の命令入力用のボタンをさらに設けても良いし、ステップオーバーと、ステップアウトを兼用することで、2つのボタンで実現するようにしても良く、実現手法は各種の対応がとれる。後者の兼用は、ファンクションブロックの先頭位置で兼用ボタンが押された場合には、ステップオーバーを実行し、ファンクションブロックの内部の時に兼用ボタンが押された場合には、ステップアウトを実行するようにすればよい。   That is, at the position of a normal command outside the function block, all of the three buttons B1, B2, and B3 mean commands that are executed in one step. Of course, in the present embodiment, the three buttons B1, B2, and B3 can be used to input three functions and four types of normal one-step execution commands. However, the present invention is not limited to this. A button for inputting instructions for one-step execution may be further provided, or it may be realized by two buttons by using both step over and step out. . In the latter case, step over is executed when the shared button is pressed at the beginning of the function block, and step out is executed when the shared button is pressed inside the function block. do it.

図6は、上述した3つの機能と1ステップ実行を行なうプログラム制御部12の機能を示すフローチャートである。プログラム制御部12は、操作部11から受け取った実行コマンド(B1,B2,B3の押下)に基づき実行ステップ(停止ステップ)を決定し、決定した内容に基づきプログラム実行部13に制御プログラムの所定ステップの実行要求を与える。   FIG. 6 is a flowchart showing the above-described three functions and the function of the program control unit 12 that performs one-step execution. The program control unit 12 determines an execution step (stop step) based on the execution command (pressing B1, B2, and B3) received from the operation unit 11, and determines a predetermined step of the control program based on the determined content. The execution request is given.

このフローチャートは、1ステップ実行モードの時に動作する。すなわち、図2に示す操作画面において、1スキャン実行操作ボタンB4あるいは連続実行操作ボタンB5の押下に伴なう連続実行をしていない場合が、1ステップ実行モードである。   This flowchart operates in the one-step execution mode. That is, in the operation screen shown in FIG. 2, the one-step execution mode is a case where continuous execution is not performed in response to pressing of the one-scan execution operation button B4 or the continuous execution operation button B5.

1ステップ実行モードにおいて、ステップインボタンB1,ステップオーバーボタンB2,ステップアウトボタンB3のいずれが押されること(コマンド入力)を待つ。そして、ステップオーバーボタンB2が押された場合、次のステップがファンクションブロックか否かを判断する(S11)。具体的には、カーソルC1が、図5(a)に示すようにファンクションブロックの先頭位置にあるか否かにより判断する。次のステップがファンクションブロックの場合(S11がYes)、ファンクションブロック内を連続実行し、そのファンクションブロックの次ステップで停止するように停止位置をセットする(S12)。これに基づき、プログラム実行部13は、ファンクションブロック内を連続実行する。カーソルC1は、停止位置であるファンクションブロックの次ステップに移行する。   In the one-step execution mode, it waits for any one of step-in button B1, step-over button B2, and step-out button B3 to be pressed (command input). When the step over button B2 is pressed, it is determined whether or not the next step is a function block (S11). Specifically, the determination is made based on whether or not the cursor C1 is at the head position of the function block as shown in FIG. When the next step is a function block (S11 is Yes), the inside of the function block is continuously executed, and the stop position is set so as to stop at the next step of the function block (S12). Based on this, the program execution unit 13 continuously executes the function block. The cursor C1 moves to the next step of the function block that is the stop position.

また、コマンド入力待ちの時に、ステップインボタンB1が押された場合、次のステップがファンクションブロックか否かを判断する(S13)。次のステップがファンクションブロックの場合(S13がYes)、ファンクションブロック内の先頭ステップで停止するように停止位置をセットする(S14)。これを受けて、プログラム実行部13は、ファンクションブロック内の先頭のステップに飛ぶ。また、操作部11は、そのファンクションブロックのプログラムをプログラム表示領域R2に表示するとともに、カーソルC1を、その表示されたファンクションブロックの先頭のステップに位置させる。   If the step-in button B1 is pressed while waiting for command input, it is determined whether or not the next step is a function block (S13). If the next step is a function block (S13 is Yes), a stop position is set so that the next step stops at the first step in the function block (S14). In response to this, the program execution unit 13 jumps to the first step in the function block. The operation unit 11 displays the function block program in the program display area R2 and positions the cursor C1 at the first step of the displayed function block.

また、コマンド入力待ちの時に、ステップアウトボタンB3が押された場合、ファンクションブロック内を実行中か否かを判断する(S15)。これは、カーソルC1が、ファンクションブロックのプログラムを構成するステップ(先頭か否かを問わず)に位置しているか否かにより判断できる。ファンクションブロック内を実行中の場合(S15がYes)、ファンクションブロック呼出し元のファンクションブロックの次ステップで停止する停止位置をセットする(S16)。これに基づき、プログラム実行部13は、現在のステップ以降のファンクションブロック内のステップを連続実行する。カーソルC1は、停止位置であるファンクションブロックの次ステップに移行する。   If the step-out button B3 is pressed while waiting for command input, it is determined whether or not the function block is being executed (S15). This can be determined based on whether or not the cursor C1 is positioned at a step (regardless of whether it is the head or not) constituting the function block program. If the inside of the function block is being executed (S15 is Yes), a stop position to stop at the next step of the function block that called the function block is set (S16). Based on this, the program execution unit 13 continuously executes the steps in the function block after the current step. The cursor C1 moves to the next step of the function block that is the stop position.

いずれのコマンドを入力された場合も、各分岐判断S11,S13,S15の判断結果がNoの場合には、1ステップ実行する(S17)。つまり、プログラム実行部13は、カーソルC1がおかれた現ステップを実行し、次ステップで停止する。   Regardless of which command is input, if the judgment result of each branch judgment S11, S13, S15 is No, one step is executed (S17). That is, the program execution unit 13 executes the current step where the cursor C1 is placed and stops at the next step.

次に連続実行について説明する。プログラム実行部13は、1スキャン実行操作ボタンB4が押されたことを操作部11からプログラム制御部12経由で取得すると、制御プログラムを先頭から最後まで1回(1スキャン)だけ連続実行し、停止する。プログラム実行部13は、連続実行操作ボタンB5が押されたことを、操作部11からプログラム制御部12経由で取得すると、制御プログラムを繰り返し実行する。また、プログラム実行部13は、制御プログラムを繰り返し実行している最中に、実行停止ボタンB6が押されたことを認識すると、制御プログラムの先頭のステップ位置でプログラム実行を停止する。実際には、制御プログラムの最後までプログラム実行をし、実行対象のステップを制御プログラムの先頭に戻した際に、実行停止ボタンB6が押されているか否かを判断し、実行停止ボタンB6が押されていない場合には、制御プログラムを先頭から最後まで連続実行し、実行位置を制御プログラムの先頭に戻す。また、実行対象のステップを制御プログラムの先頭に戻した際に、実行停止ボタンB6が押されている場合には、プログラムの実行を停止する。このように実行停止ボタンB6は、連続実行ボタンB5が押され、制御プログラムを繰り返し実行しているときに有効に機能するものであるため、通常は図2に示すように非アクティブなボタンとなって選択できず、連続実行ボタンB5が押されたことを条件に実行停止ボタンB6がアクティブとなる。   Next, continuous execution will be described. When the program execution unit 13 acquires that the one-scan execution operation button B4 has been pressed from the operation unit 11 via the program control unit 12, the program execution unit 13 continuously executes the control program from the beginning to the end (one scan) and stops. To do. When the program execution unit 13 acquires that the continuous execution operation button B5 has been pressed from the operation unit 11 via the program control unit 12, the program execution unit 13 repeatedly executes the control program. Further, when the program execution unit 13 recognizes that the execution stop button B6 has been pressed while the control program is being repeatedly executed, the program execution unit 13 stops the program execution at the top step position of the control program. Actually, when the program is executed to the end of the control program and the execution target step is returned to the top of the control program, it is determined whether or not the execution stop button B6 is pressed, and the execution stop button B6 is pressed. If not, the control program is continuously executed from the beginning to the end, and the execution position is returned to the beginning of the control program. If the execution stop button B6 is pressed when the execution target step is returned to the top of the control program, the execution of the program is stopped. As described above, the execution stop button B6 functions effectively when the continuous execution button B5 is pressed and the control program is repeatedly executed. Therefore, the execution stop button B6 is normally an inactive button as shown in FIG. The execution stop button B6 becomes active on the condition that the continuous execution button B5 is pressed.

プログラム制御情報領域15にブレークポイントを設定・登録しておくと、プログラム実行部13は、上述した連続実行中に次の実行位置がブレークポイントで設定されたステップ位置になったか否かを判断し、ブレークポイントでない場合にはそのステップを実行し、ブレークポイントのステップ位置の場合にはプログラムの実行を一時停止する。本実施の形態では、プログラム制御情報領域15に格納するブレークポイントの情報を、以下のようにした。   If a breakpoint is set and registered in the program control information area 15, the program execution unit 13 determines whether or not the next execution position has become the step position set by the breakpoint during the above-described continuous execution. If it is not a breakpoint, the step is executed. If the breakpoint is at the step position, execution of the program is paused. In the present embodiment, the breakpoint information stored in the program control information area 15 is as follows.

図7は、プログラム制御情報領域15に格納されるブレークポイント管理テーブルのデータ構造の一例を示している。このブレークポイント管理テーブルは、プログラム識別情報と、POU名と、ブレークポイント位置(プログラムのステップ位置)とを関連付けたテーブルである。図2のプロジェクトツリー表示領域R1に表示されたプロジェクトツリーから明らかなように、同一のファンクションブロック(FB_A)が、タスク_000で2つ(Robot_1とRobot_2)とタスク_001で2つ(Robot_3とRobot_4)の合計4箇所で使用されている。   FIG. 7 shows an example of the data structure of the breakpoint management table stored in the program control information area 15. This breakpoint management table is a table in which program identification information, a POU name, and a breakpoint position (program step position) are associated with each other. As is apparent from the project tree displayed in the project tree display area R1 of FIG. 2, the same function block (FB_A) is two for task_000 (Robot_1 and Robot_2) and two for task_001 (Robot_3 and Robot_4). Are used in a total of four places.

単純に、ファンクションブロック(FB_A)のプログラム自体のステップ位置にブレークポイントを設定すると、4つのインスタンスの全てにおいて、同じステップ位置でブレークして停止してしまう。しかし、実際には、たとえばRobot_1とRobot_4では、ブレークして停止させたいが、Robot_2とRobot_3ではブレークすることなくそのまま連続実行させたいという要求がある。さらに、ブレークさせたいRobot_1とRobot_4において、それぞれ異なるステップ位置で停止させたいという要求もある。これは、同一のファンクションブロックを使用していても、制御対象が異なるため、各制御対象ごとにブレークの必要性の有無や、停止させたいブレークポイントが異なる(たとえば、Robot_1の6番目のステップと、とRobot_4の10番目のステップ)ためである。   Simply setting a breakpoint at the step position of the function block (FB_A) program itself breaks and stops at the same step position in all four instances. However, actually, for example, in Robot_1 and Robot_4, there is a request to break and stop, but in Robot_2 and Robot_3, it is desired to continuously execute without break. Furthermore, there is also a request for stopping at different step positions in Robot_1 and Robot_4 to be broken. This is because even if the same function block is used, the controlled object is different, so the presence or absence of a break and the breakpoint to be stopped differ for each controlled object (for example, the sixth step of Robot_1). And 10th step of Robot_4).

そこで、本実施の形態では、タスクNo.とインスタンス識別情報とからなるプログラム識別情報により、対象となるインスタンスを一意に特定する。さらに、係るプログラム識別情報と、プログラムのステップ位置とを管理することで、特定のファンクションブロックのインスタンスに対し、それぞれのブレークポイント設定位置を識別するようにした。   Therefore, in this embodiment, the task No. The target instance is uniquely identified by the program identification information including the instance identification information. Further, by managing the program identification information and the step position of the program, each breakpoint setting position is identified for a specific function block instance.

プログラム実行部13は、制御プログラムの連続実行中に、ブレークポイント管理テーブルに格納された情報に基づき現在のステップ位置がブレークして停止すべきステップか否かを判断し、ブレークポイントでない場合には、そのままステップを実行し、ブレークポイントの場合には停止する処理を行なう。そして、ブレークポイントか否かは、プログラム識別とPOU名とステップ位置が一致したことを条件にブレークポイントと判断する。換言すると、プログラム識別とPOU名とステップ位置とのうち、1つでも異なるものがあればブレークポイントではないと判断し、そのステップを実行する。   The program execution unit 13 determines whether or not the current step position is a step that should be broken and stopped based on the information stored in the breakpoint management table during continuous execution of the control program. Then, the step is executed as it is, and in the case of a breakpoint, the process is stopped. Whether or not it is a breakpoint is determined as a breakpoint on condition that the program identification, the POU name, and the step position match. In other words, if any one of the program identification, the POU name, and the step position is different, it is determined that it is not a breakpoint, and the step is executed.

図7に示すブレークポイント管理テーブルの場合、プログラム識別情報が、「タスク_000¥StationNo1¥Robot_1」のファンクションブロック(FB_A)は、6番目のステップでブレークするという条件が格納され、「タスク_001¥StationNo2¥Robot_4」のファンクションブロック(FB_A)は、10番目のステップでブレークするという条件が格納されているため、StationNo1のRobot_1の6番目のステップではブレークにより停止するが、10番目のステップでは停止しない。逆に、StationNo2のRobot_4は、10番目のステップではブレークにより停止するが、6番目のステップでは停止しない。さらに、StationNo1のRobot_2や、StationNo2のRobot_3を連続実行中には、ブレークされることなく最後まで連続実行される(6番目のステップや10番目のステップでは停止しない)。   In the case of the breakpoint management table shown in FIG. 7, the function block (FB_A) whose program identification information is “task_000 \ StationNo1 \ Robot_1” stores the condition that a break occurs in the sixth step, and “task_001 ¥ StationNo2 The function block (FB_A) of “¥ Robot — 4” stores the condition that a break occurs at the 10th step. Therefore, the function block (FB_A) stops at the sixth step of Robot — 1 of Station No. 1 but does not stop at the 10th step. Conversely, Robot_4 of Station No. 2 stops due to a break at the 10th step, but does not stop at the 6th step. Furthermore, during the continuous execution of Robot No. 2 of Station No. 1 and Robot No. 3 of Station No. 2, the program is continuously executed to the end without being broken (it is not stopped at the sixth step or the tenth step).

係るブレークポイント管理テーブルの登録処理は、プログラム制御部12が、図8に示すフローチャートを実行することで行なう。まず、操作部11を介してブレークポイントが選択(入力)されるのを待つ(S21)。具体的には、図9に示すように、プログラム表示領域R2に表示されたプログラム中の命令(ステップ)のうち、カーソルC1で指定された命令についてブレークポイントの設定命令を受け付ける。すなわち、ユーザは、入力装置1を操作し、表示されたプログラムにおいて、ブレークポイントに設定したい命令(ステップ)にカーソルC1を移動させる。その状態で、入力装置1を操作し、そのカーソルC1が指している命令を、ブレークポイントとして登録する指示を与える。係る指示は、たとえば、設定画面中に所定の登録ボタンを表示し、その登録ボタンをクリックする他、各種の手法がとれる。   The breakpoint management table registration process is performed by the program control unit 12 executing the flowchart shown in FIG. First, it waits for a breakpoint to be selected (input) via the operation unit 11 (S21). Specifically, as shown in FIG. 9, a breakpoint setting instruction is accepted for the instruction specified by the cursor C1 among the instructions (steps) in the program displayed in the program display area R2. That is, the user operates the input device 1 and moves the cursor C1 to an instruction (step) to be set as a breakpoint in the displayed program. In this state, the input device 1 is operated to give an instruction to register the instruction pointed by the cursor C1 as a breakpoint. For example, various instructions can be used for such instructions, such as displaying a predetermined registration button on the setting screen and clicking the registration button.

ついで、ブレークポイントに指定された命令(ステップ)が、ファンクションブロック内のものか否かを判断する(S22)。そして、ファンクションブロック内の場合には、プログラム識別情報の欄に、タスクNo.とインスタンス識別情報を登録し(S23)、POU名の欄にPOU名を登録し(S24)、位置の欄にステップ位置(番号)を登録する(S24)。上記のプログラム識別情報やPOU名やステップ位置は、操作部11を介して与えられる。プログラム表示領域R2に表示されたプログラムが、プロジェクトツリー表示領域R1におけるどのプログラムであるかは、デバッグ装置側で関連付けられてわかっているため、プログラムの任意の命令(ステップ)の上にカーソルC1を置いた場合、そのプログラムについてのプログラム識別情報や、POU名を操作部11が認識でき、また、カーソルC1にて指定されたステップ位置も操作部11が認識できる。よって、ブレークポイント管理テーブルに登録するのに必要な情報は、操作部11を介してプログラム制御部12が取得できる。たとえば図7に示すRobot_1やRobot_4についてのブレークポイントは、係る処理を実行して登録される。   Next, it is determined whether or not the instruction (step) designated as the breakpoint is in the function block (S22). In the case of the function block, the task number is displayed in the program identification information column. The instance identification information is registered (S23), the POU name is registered in the POU name column (S24), and the step position (number) is registered in the position column (S24). The program identification information, the POU name, and the step position are given via the operation unit 11. Since the program displayed in the program display area R2 is known in the debug device side as to which program in the project tree display area R1, the cursor C1 is placed on an arbitrary instruction (step) of the program. When placed, the operation unit 11 can recognize the program identification information and the POU name for the program, and the operation unit 11 can also recognize the step position designated by the cursor C1. Therefore, the program control unit 12 can acquire information necessary for registration in the breakpoint management table via the operation unit 11. For example, breakpoints for Robot_1 and Robot_4 shown in FIG. 7 are registered by executing such processing.

一方、選択されたブレークポイントがファンクションブロック外の場合には、プログラム識別情報の欄に、タスクNo.を登録し(S26)、POU名の欄にPOU名を登録し(S27)、位置の欄にステップ位置(番号)を登録する(S28)。たとえば図7に示すStationNo3_Robot5についてのブレークポイントは、係る処理を実行して登録される。   On the other hand, when the selected breakpoint is outside the function block, the task number is displayed in the program identification information column. (S26), the POU name is registered in the POU name column (S27), and the step position (number) is registered in the position column (S28). For example, a breakpoint for StationNo3_Robot5 shown in FIG. 7 is registered by executing such processing.

プログラム実行部13は、制御プログラムの実行に際し、上述した登録処理により作成されたブレークポイント管理テーブルを参照しつつ、プログラムの実行・停止を行なう。具体的には、プログラム実行部13は、図10に示すフローチャートを実行する。   When executing the control program, the program execution unit 13 executes and stops the program while referring to the breakpoint management table created by the registration process described above. Specifically, the program execution unit 13 executes the flowchart shown in FIG.

まず、ステップ実行か否かを判断する(S30)。図2に示す操作画面において、1スキャン実行操作ボタンB4あるいは連続実行操作ボタンB5の押下に伴なう連続実行をしていない場合が、ステップ実行である。ステップ実行の場合には、停止位置をセットする処理を行なう(S31)。この停止位置セットの処理にて、1ステップ実行の場合には、停止位置を1ステップ実行後の次に実行するステップにセットする。ステップオーバー実行の場合には、停止位置をファンクションブロックの次ステップにセットする(図6のS16と同様である)。   First, it is determined whether or not step execution is performed (S30). In the operation screen shown in FIG. 2, step execution is performed when continuous execution is not performed in response to pressing of one scan execution operation button B4 or continuous execution operation button B5. In the case of step execution, processing for setting a stop position is performed (S31). In this stop position setting process, when one step is executed, the stop position is set to the next step to be executed after one step is executed. In the case of step over execution, the stop position is set to the next step of the function block (similar to S16 in FIG. 6).

1スキャン実行操作ボタンB4あるいは連続実行操作ボタンB5が押された場合には、連続実行であるため、処理ステップS30の分岐判断は、Noとなり、S31を経由しないので停止位置はセットされない。   When the one-scan execution operation button B4 or the continuous execution operation button B5 is pressed, since it is continuous execution, the branch determination in processing step S30 is No, and the stop position is not set because it does not go through S31.

そして、プログラム実行部13は、現在の実行位置のステップを実行する(S32)。ついで、プログラム実行部13は、次に実行するステップを算出する(S33)。すなわち、基本的には、ステップ番号順に実行するが、ジャンプ命令等があり、必ずしも次のステップ番号とは限らないため、この処理ステップで次に実行するステップを決定する。   Then, the program execution unit 13 executes the step at the current execution position (S32). Next, the program execution unit 13 calculates the next step to be executed (S33). That is, although the steps are basically executed in the order of step numbers, there is a jump instruction or the like, which is not necessarily the next step number, so the next step to be executed is determined in this processing step.

次に実行するステップが決まると、プログラム実行部13は、その決定したステップが、スキャンの先頭(制御プログラムの先頭)のステップか否かを判断する(S34)。先頭でない場合(処理ステップS34の分岐判断でNo)には、S33で決定した次の実行位置(ステップ)が、ブレークポイント管理テーブルに登録されているステップ位置・POU名と一致するか否かを判断する(S35)。そして、一致している場合(処理ステップS35の分岐判断でYes)には、プログラム識別番号(情報)と一致しているか否かを判断する(S36)。そして、一致している場合(処理ステップS36の分岐判断でYes)には、現在実行しようとしている次のステップがブレークポイントだと判断し、プログラムの実行を停止する(S39)。また、処理ステップS35と処理ステップS36の分岐判断で、いずれかがNoの場合には、次のステップはブレークポイントではないので、処理ステップS37に飛ぶ。処理ステップS37にて、現在実行しようとしている次のステップが、S31でセットされたステップ停止位置か否かを判断する(S37)。ステップ停止位置の場合(処理ステップS37の分岐判断でYes)には、プログラムの実行を停止する(S39)。ステップ停止位置でない場合(処理ステップS37の分岐判断でNo)には、処理ステップS32を実行する。   When the next step to be executed is determined, the program execution unit 13 determines whether or not the determined step is the step at the head of the scan (the head of the control program) (S34). If it is not the top (No in the branching determination in processing step S34), it is determined whether or not the next execution position (step) determined in S33 matches the step position / POU name registered in the breakpoint management table. Judgment is made (S35). If they match (Yes in the branch determination in processing step S35), it is determined whether or not they match the program identification number (information) (S36). If they match (Yes in the branch determination of processing step S36), it is determined that the next step that is currently being executed is a breakpoint, and the program execution is stopped (S39). In addition, if any of the branch determinations in the processing step S35 and the processing step S36 is No, the next step is not a breakpoint, and the process jumps to the processing step S37. In process step S37, it is determined whether or not the next step to be executed at present is the step stop position set in S31 (S37). In the case of the step stop position (Yes in the branch determination in process step S37), the program execution is stopped (S39). When the position is not the step stop position (No in the branch determination in process step S37), the process step S32 is executed.

一方、処理ステップS33で求めたステップが、制御プログラムの先頭の場合、処理ステップS34の分岐判断でYesとなるため、停止コマンドを受け付け中か否かを判断する(S37)。具体的には、実行停止ボタンB6が押されている(受付中)か否かを判断する。停止コマンドを受け付けていない場合には、処理ステップS35に飛ぶ。   On the other hand, if the step determined in process step S33 is the head of the control program, the branch determination in process step S34 is Yes, so it is determined whether a stop command is being accepted (S37). Specifically, it is determined whether or not the execution stop button B6 is pressed (being accepted). If no stop command has been received, the process jumps to step S35.

このフローチャートにより、1ステップ実行の場合には、処理ステップS32にて1ステップを実行すれば、次はステップ停止位置なので、処理ステップS37にてYesとなり、プログラム実行を停止する。つまり1ステップだけ実行して停止する。また、ステップオーバー実行の場合には、処理ステップS32からS35まで順番に進み、ブレークポイントが来ない限り処理ステップS35ではNoNoとなり、ファンクションブロック内のステップが残っている限り、処理ステップS37にてNoNoとなるので、処理ステップS32に戻り、それを繰り返す。ブレークポイントがなければ、前述のようにS32〜S37を繰り返して、ファンクションブロック内のステップをすべて処理した後、S31にてセットしたステップ停止位置にくるので、S37にてYesとなり、プログラム実行を停止する。つまりファンクションブロック内の残りのステップをすべて実行してから停止する。なお、ブレークポイントがあれば、1ステップ実行でもステップオーバー実行でも、処理ステップS35およびS36にてYesとなり、ブレークポイントの位置でプログラム実行は停止する(S39)。   According to this flowchart, in the case of one-step execution, if one step is executed in processing step S32, the next is the step stop position, so that it becomes Yes in processing step S37 and the program execution is stopped. That is, only one step is executed and stopped. In the case of step over execution, the process proceeds from the process steps S32 to S35 in order, and if the break point does not come, the process step S35 is NoNo, and as long as the step in the function block remains, the process step S37 is NoNo. Therefore, it returns to processing step S32 and repeats it. If there is no breakpoint, repeat steps S32 to S37 as described above to process all the steps in the function block, and then come to the step stop position set in S31. To do. In other words, all remaining steps in the function block are executed and then stopped. If there is a breakpoint, whether it is one-step execution or step-over execution, the processing steps S35 and S36 result in Yes, and the program execution stops at the breakpoint position (S39).

1スキャン実行操作ボタンB4あるいは連続実行操作ボタンB5が押されて実行する場合には、スキャン先頭でなければ処理ステップS32からS35まで順番に進み、ブレークポイントが来ない限り処理ステップS35ではNoNoとなり、停止位置はセットされていないから処理ステップS37はNoNoとなり、処理ステップS32に戻り、それを繰り返す。ブレークポイントがあれば、処理ステップS35およびS36にてYesとなり、ブレークポイントの位置でプログラム実行は停止する(S39)。つまり、連続実行の場合には、ブレークポイントがない限り、かつ、実行停止ボタンB6が押されない限り、延々と前述のS32からS37を繰り返し実行する。連続実行中に実行停止ボタンB6が押されて、停止コマンドを受け付けた場合には、スキャン先頭位置にきたときにS34にてYesとなり、S38にてYesとなり、プログラム実行停止となる。   When the one-scan execution operation button B4 or the continuous execution operation button B5 is pressed and executed, if it is not the head of the scan, the process proceeds from step S32 to S35 in order, and unless a breakpoint comes, No in process step S35. Since the stop position is not set, the process step S37 is No, and the process returns to the process step S32 to repeat it. If there is a breakpoint, the processing steps S35 and S36 result in Yes, and the program execution stops at the breakpoint position (S39). That is, in the case of continuous execution, the above-described S32 to S37 are repeatedly executed as long as there is no breakpoint and the execution stop button B6 is not pressed. When the execution stop button B6 is pressed during continuous execution and a stop command is received, when the scan head position is reached, Yes is made in S34, Yes is made in S38, and program execution is stopped.

1スキャン実行の場合には、スキャン先頭でなければ処理ステップS32からS35まで順番に進み、ブレークポイントが来ない限り処理ステップS35でNoNoとなり、処理ステップS37はNoNoとなり、処理ステップS32に戻る。1スキャン内のプログラムが残っている限り、このフローを繰り返す。ブレークポイントがあれば、処理ステップS35およびS36の処理にて、ブレークポイントの位置でプログラム実行は停止する(S39)。ブレークポイントがなくても、1スキャン内のプログラムのステップをすべて処理した後、スキャン先頭に戻った場合には、S34でYesとなり、ST38でYesとなりプログラム実行は停止する(S39)。補足すると、1スキャン実行操作ボタンB4が押された場合に、実行停止ボタンB6の操作によらず、自動的に停止コマンドを発行しておくことで、このような動作となる。なお、1スキャン実行操作ボタンB4の押下と共に停止コマンドを自動的に発行せずに、処理ステップST38において、「停止コマンド受付か?」および「1スキャン実行か?」の2つの判断をするようにしてもよい。2つの判断処理を別々に分けて直列なフロー処理としてもよい。   In the case of one scan execution, if it is not the head of the scan, the process proceeds in order from process steps S32 to S35, and unless a breakpoint comes, the process step S35 becomes NoNo, the process step S37 becomes NoNo, and the process returns to process step S32. This flow is repeated as long as the program in one scan remains. If there is a breakpoint, program execution stops at the breakpoint position in the processing steps S35 and S36 (S39). Even if there are no break points, after all the program steps in one scan have been processed and then returned to the beginning of the scan, the result is Yes in S34, Yes in ST38, and program execution is stopped (S39). Supplementally, when the one-scan execution operation button B4 is pressed, the operation is performed by automatically issuing a stop command regardless of the operation of the execution stop button B6. Instead of automatically issuing a stop command when the one-scan execution operation button B4 is pressed, two determinations are made in processing step ST38: “Do you accept stop command?” And “Is it executed one scan?” May be. The two determination processes may be separately divided into serial flow processes.

なお、図10のフローチャートにおいて、1スキャン実行を処理ステップS30におけるステップ実行と扱うように変形することが可能である。その場合は、処理ステップS30にてYesとなり、処理ステップS31において停止位置をスキャン先頭ステップにセットする。この変形例だと、1スキャン実行の場合、スキャン先頭位置にくればS34にてYesとなるが、ST38でNoNoとなり、ST35とST36を経て、ST37にて、ST31にてセットされたステップ停止位置と一致するのでYesとなり、プログラム実行停止(S39)となる。   In the flowchart of FIG. 10, it is possible to modify the one scan execution to be handled as the step execution in the processing step S30. In that case, Yes in processing step S30, and in step S31, the stop position is set in the scan head step. In this modification, in the case of one scan execution, if the scan head position is reached, Yes in S34, but No in ST38, after ST35 and ST36, in step ST37, the step stop position set in ST31 Yes, and the program execution is stopped (S39).

次に、Robot_4のファンクションブロック内を連続実行する場合を例に挙げて説明する。係る場合、ステップを順次実行し、次ステップが、6番目のステップになったとする。すると、POU名はFB_Aで、ステップ位置も6番目となり、ブレークポイント管理テーブルに登録された情報と一致するため、処理ステップS35の分岐判断は、Yesとなる。しかし、プログラム識別情報は、異なるため、処理ステップS36の分岐判断はNoとなり、6番目のステップは実行される。   Next, a case where the inside of the function block of Robot_4 is continuously executed will be described as an example. In this case, it is assumed that the steps are sequentially executed and the next step becomes the sixth step. Then, the POU name is FB_A and the step position is sixth, which matches the information registered in the breakpoint management table, so that the branch determination in processing step S35 is Yes. However, since the program identification information is different, the branch determination in processing step S36 is No, and the sixth step is executed.

そして、さらに処理が進み、次ステップが、10番目のステップになったとする。すると、POU名はFB_Aで、ステップ位置も10番目となり、ブレークポイント管理テーブルに登録された情報と一致するため、処理ステップS35の分岐判断は、Yesとなる。さらに、プログラム識別情報も一致するため、処理ステップS36の分岐判断もYesとなるので、プログラム実行がそのステップ位置で停止する。   Then, it is assumed that the process further proceeds and the next step becomes the tenth step. Then, the POU name is FB_A, the step position is 10th, and the information matches the information registered in the breakpoint management table, so the branch determination in processing step S35 is Yes. Furthermore, since the program identification information also matches, the branch determination in process step S36 is also Yes, so that program execution stops at that step position.

これに対し、Robot_2やRobot_3のファンクションブロックをステップオーバーにより連続実行した場合、いずれも、6番目と10番目のステップで処理ステップS35の分岐判断がYesとなるものの、プログラム識別情報が一致しないため、処理ステップS36の分岐判断はNoとなり、最後のステップまでブレークされることなく実行される。このように、本実施の形態では、各ファンクションブロックのインスタンスごとにそれぞれ固有の位置にブレークポイントの設定をすることができる。   On the other hand, when the function blocks of Robot_2 and Robot_3 are continuously executed by step over, the branch determination of processing step S35 is Yes in both the sixth and tenth steps, but the program identification information does not match. The branch determination in process step S36 is No, and the process is executed without a break until the last step. As described above, in this embodiment, a breakpoint can be set at a unique position for each instance of each function block.

もちろん、本発明は、ファンクションブロックの外の通常の命令(ステップ)に対して設定したブレークポイントについても、同様の手順でブレーク処理に基づく一時停止を行なうことができる。   Of course, according to the present invention, a breakpoint set for a normal instruction (step) outside the function block can be suspended based on the break process in the same procedure.

なお、上述した説明では、B4,B5が押されて連続実行をする場合について説明したが、ステップオーバーやステップアウトにより、ファンクションブロック内を連続実行している場合にも本発明が適用できる。   In the above description, the case where B4 and B5 are pressed to perform continuous execution has been described. However, the present invention can also be applied to the case where function blocks are continuously executed due to step over or step out.

本発明の好適な一実施の形態を示すブロック図である。1 is a block diagram showing a preferred embodiment of the present invention. 操作画面の一例を示す図である。It is a figure which shows an example of an operation screen. ファンクションブロックを説明する図である。It is a figure explaining a function block. ファンクションブロックを説明する図である。It is a figure explaining a function block. ステップオーバーとステップインとステップアウトを説明する概念図である。It is a conceptual diagram explaining step over, step in, and step out. プログラム制御部の機能を示すフローチャートである。It is a flowchart which shows the function of a program control part. ブレークポイント管理テーブルのデータ構造の一例を示す図である。It is a figure which shows an example of the data structure of a breakpoint management table. プログラム制御部が持つ、ブレークポイントの登録機能を説明するフローチャートである。It is a flowchart explaining the registration function of a breakpoint which a program control part has. ブレークポイントの登録の作用を説明する図である。It is a figure explaining the effect | action of a breakpoint registration. プログラム実行部が持つ、ブレーク処理機能を説明するフローチャートである。It is a flowchart explaining the break processing function which a program execution part has.

符号の説明Explanation of symbols

11 操作部
12 プログラム制御部
13 プログラム実行部
14 制御プログラム格納領域
15 プログラム制御情報領域
16 プログラム実行作業領域
17 I/O領域
DESCRIPTION OF SYMBOLS 11 Operation part 12 Program control part 13 Program execution part 14 Control program storage area 15 Program control information area 16 Program execution work area 17 I / O area

Claims (3)

ファンクションブロックを含む制御プログラム用のデバッグ装置であって、
前記制御ブロックを構成するステップを連続実行させるプログラム実行手段と、
前記制御プログラム中に記述されたファンクションブロックを特定するプログラム識別情報と、そのファンクションブロック内のプログラムにおける一時停止させるステップ位置情報と、を関連づけたブレークポイント管理情報を格納する記憶手段と、
前記プログラム実行手段が、前記ファンクションブロック内を連続実行中に前記記憶手段に格納されたブレークポイント管理情報に基づき、現在実行中のステップが、前記記憶手段に格納された前記ブレークポイント管理情報で特定されるファンクションブロックの該当ステップ位置か否かを判断し、該当する場合にプログラム実行を一時停止する手段と、
を備えたことを特徴とするデバッグ装置。
A debugging device for a control program including a function block,
Program execution means for continuously executing the steps constituting the control block;
Storage means for storing breakpoint management information in which program identification information for specifying a function block described in the control program and step position information for temporarily stopping the program in the function block are associated with each other;
Based on the breakpoint management information stored in the storage means during continuous execution of the function block by the program execution means, the step currently being executed is identified by the breakpoint management information stored in the storage means Means for determining whether or not the corresponding step position of the function block to be executed, and, if applicable, temporarily stopping program execution;
A debugging device comprising:
前記プログラム識別情報は、ファンクションブロックのインスタンス識別情報を含むものであることを特徴とする請求項1に記載のデバッグ装置。   The debugging apparatus according to claim 1, wherein the program identification information includes function block instance identification information. 前記記憶手段には、ファンクションブロックの外に存在するステップについて、そのステップを特定するプログラム識別情報と、そのステップのステップ位置情報とを関連づけたブレークポイント管理情報が格納され、
前記一時停止する手段は、前記ファンクションブロックの外に存在するステップについても該当する場合にプログラム実行を一時停止するものであることを特徴とする請求項1に記載のデバッグ装置。
For the step existing outside the function block, the storage means stores breakpoint management information that associates the program identification information that identifies the step with the step position information of the step,
2. The debugging apparatus according to claim 1, wherein the means for temporarily stopping the program temporarily stops program execution when a step existing outside the function block is applicable.
JP2005289404A 2005-09-30 2005-09-30 Debug device Active JP4062546B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2005289404A JP4062546B2 (en) 2005-09-30 2005-09-30 Debug device
US11/529,566 US20070078538A1 (en) 2005-09-30 2006-09-29 Debug device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2005289404A JP4062546B2 (en) 2005-09-30 2005-09-30 Debug device

Publications (2)

Publication Number Publication Date
JP2007102384A true JP2007102384A (en) 2007-04-19
JP4062546B2 JP4062546B2 (en) 2008-03-19

Family

ID=38029284

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2005289404A Active JP4062546B2 (en) 2005-09-30 2005-09-30 Debug device

Country Status (1)

Country Link
JP (1) JP4062546B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008146859A1 (en) * 2007-06-01 2008-12-04 Mitsubishi Electric Corporation Simulation system
JP2009245194A (en) * 2008-03-31 2009-10-22 Fuji Electric Systems Co Ltd Programmable controller, programmable controller support apparatus, and programmable controller system
JP2016212574A (en) * 2015-05-07 2016-12-15 富士通株式会社 Debug circuit, semiconductor device, and debug method
WO2023248478A1 (en) * 2022-06-24 2023-12-28 ファナック株式会社 Information processing device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0773070A (en) * 1993-06-21 1995-03-17 Toshiba Corp Program debugging device
JPH0854907A (en) * 1994-08-12 1996-02-27 Yokogawa Electric Corp Verification support system
JP2000276212A (en) * 1999-03-23 2000-10-06 Digital Electronics Corp System and method for simulating control program for industrial controller and recording medium recording software therefor

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0773070A (en) * 1993-06-21 1995-03-17 Toshiba Corp Program debugging device
JPH0854907A (en) * 1994-08-12 1996-02-27 Yokogawa Electric Corp Verification support system
JP2000276212A (en) * 1999-03-23 2000-10-06 Digital Electronics Corp System and method for simulating control program for industrial controller and recording medium recording software therefor

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
福住光記: "ブロックエンジニアリングによる制御ソフトウェアの開発効率向上", 富士時報, vol. 第73巻、第2号, CSNH200200137004, 10 February 2000 (2000-02-10), JP, pages 114 - 117, ISSN: 0000836835 *
福住光記: "ブロックエンジニアリングによる制御ソフトウェアの開発効率向上", 富士時報, vol. 第73巻、第2号, JPN6007011626, 10 February 2000 (2000-02-10), JP, pages 114 - 117, ISSN: 0000938745 *
香川徹雄: "CS1シミュレータの開発", OMRON TECHNICS, vol. 第40巻、第1号, CSNH200200152020, 20 March 2000 (2000-03-20), JP, pages 98 - 102, ISSN: 0000836836 *
香川徹雄: "CS1シミュレータの開発", OMRON TECHNICS, vol. 第40巻、第1号, JPN6007011627, 20 March 2000 (2000-03-20), JP, pages 98 - 102, ISSN: 0000938746 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008146859A1 (en) * 2007-06-01 2008-12-04 Mitsubishi Electric Corporation Simulation system
JP2009245194A (en) * 2008-03-31 2009-10-22 Fuji Electric Systems Co Ltd Programmable controller, programmable controller support apparatus, and programmable controller system
JP2016212574A (en) * 2015-05-07 2016-12-15 富士通株式会社 Debug circuit, semiconductor device, and debug method
WO2023248478A1 (en) * 2022-06-24 2023-12-28 ファナック株式会社 Information processing device

Also Published As

Publication number Publication date
JP4062546B2 (en) 2008-03-19

Similar Documents

Publication Publication Date Title
US20070078538A1 (en) Debug device
JPWO2013145105A1 (en) Sequence program debugging support device
JPH0561646B2 (en)
US20130144409A1 (en) Control program generation device, control program generation program, and control program generation method
KR101700553B1 (en) System development device, method, and program
JP4062546B2 (en) Debug device
EP3511827A1 (en) Executable program creation device, executable program creation method, and executable program creation program
US20120072777A1 (en) Debugging device, debugging method, and computer program for sequence program
JP2007058368A (en) Collating device for program
US20150277413A1 (en) System construction support apparatus
JP5849592B2 (en) Programmable controller system, programming device thereof, programmable controller, program, and debugging method
JP3992054B2 (en) Debug device
US8989891B2 (en) Machining tool control system and control method
KR20050087713A (en) Graphical programing device and programmable indicator
JP2009223471A (en) Simulation system
JP4387288B2 (en) Display device for control, editor device, program, and recording medium
JP2006318504A (en) Control method of development support device
JP4488231B2 (en) Program management device
CN111324088A (en) Information processing apparatus
US20180164787A1 (en) Nc program transfer apparatus
JP2007004516A (en) Program debugging method of built-in system
JP2533370B2 (en) Control program creation method
JP2007128455A (en) Program component attached data generating device
JP2008003725A (en) Control program maintenance method, control program maintenance device, and control program maintenance program
JP2533372B2 (en) Control program creation method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20070307

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20070315

A975 Report on accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A971005

Effective date: 20070328

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070403

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070604

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070904

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071101

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071219

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4062546

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20110111

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20110111

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120111

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130111

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20140111

Year of fee payment: 6