JP6394516B2 - Development support program, recording medium, development support method, and development support apparatus - Google Patents
Development support program, recording medium, development support method, and development support apparatus Download PDFInfo
- Publication number
- JP6394516B2 JP6394516B2 JP2015132795A JP2015132795A JP6394516B2 JP 6394516 B2 JP6394516 B2 JP 6394516B2 JP 2015132795 A JP2015132795 A JP 2015132795A JP 2015132795 A JP2015132795 A JP 2015132795A JP 6394516 B2 JP6394516 B2 JP 6394516B2
- Authority
- JP
- Japan
- Prior art keywords
- text
- comment
- variable
- expression
- development support
- 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.)
- Active
Links
Images
Description
開示の実施形態は、開発支援プログラム、記録媒体、開発支援方法、及び開発支援装置に関する。 Embodiments disclosed herein relate to a development support program, a recording medium, a development support method, and a development support apparatus.
特許文献1には、テキストプログラム中のデバイスやラベルを示すテキストを抽出し、直前又は直後のコメント行にそれらデバイスやラベルの意味を表現する付属情報をそれぞれ記述方向の位置を合わせて表示するプログラム作成支援技術が開示されている。 Patent Document 1 extracts a text indicating a device or a label in a text program, and displays attached information expressing the meaning of the device or label in a comment line immediately before or after the position in the description direction. A creation support technique is disclosed.
上記従来技術によれば、テキストプログラム中で単純なアルファベットや数字の組み合わせにより抽象的に記述されているデバイスやラベルそのものの具体的な意味を、コメント行中のそれぞれ対応する付属情報から個別に確認しやすくなる。しかし、それらデバイスやラベルが演算式中に記述されている場合、上記従来技術では、その演算式全体の演算内容の意味合いまではコメント行から直接把握できない。そのため、ユーザは元の演算式とコメント行の付属情報とを照合して演算内容を確認しなければならず、プログラムの開発効率、特にデバッグ効率が低下する要因となっていた。 According to the above prior art, the specific meaning of the device or label itself, which is abstractly described by a combination of simple alphabets and numbers in the text program, can be confirmed individually from the corresponding attached information in the comment line. It becomes easy to do. However, when these devices and labels are described in an arithmetic expression, the above prior art cannot directly grasp the meaning of the arithmetic contents of the entire arithmetic expression from the comment line. For this reason, the user has to check the content of the operation by comparing the original operation expression with the information attached to the comment line, which causes a reduction in program development efficiency, particularly debugging efficiency.
本発明はこのような問題点に鑑みてなされたものであり、プログラムの開発効率、特にデバッグ効率が向上する開発支援プログラム、記録媒体、開発支援方法、及び開発支援装置を提供することを目的とする。 The present invention has been made in view of such problems, and an object thereof is to provide a development support program, a recording medium, a development support method, and a development support apparatus that improve program development efficiency, particularly debugging efficiency. To do.
上記課題を解決するため、本発明の一の観点によれば、実行コードから逆変換されたテキスト記述型プログラムの開発支援装置が備える演算装置に実行させる開発支援プログラムであって、前記実行コードに対応するデータベースを取得することと、前記テキスト記述型プログラムのプログラムリストに記述されている演算式テキストを、前記開発支援装置が備える表示部上の所定の演算式表示領域に表示することと、前記演算式テキストから記憶領域のアドレスで表記した演算変数テキストを抽出することと、前記データベースを参照して前記演算変数テキストに対応するコメント変数テキストを取得することと、前記演算式テキスト中の前記演算変数テキストを前記コメント変数テキストに置換して前記コメント変数テキストと演算子テキストを含んだテキスト列で式対応コメントテキストを生成することと、前記演算式表示領域に対応するコメント表示領域に前記式対応コメントテキストを表示することと、を実行する開発支援プログラムが適用される。
In order to solve the above-described problem, according to one aspect of the present invention, there is provided a development support program to be executed by an arithmetic unit provided in a development support apparatus for a text description type program inversely converted from an execution code, the execution code Obtaining a corresponding database; displaying an arithmetic expression text described in a program list of the text description type program in a predetermined arithmetic expression display area on a display unit included in the development support apparatus; Extracting a calculation variable text expressed by an address of a storage area from the calculation formula text; obtaining a comment variable text corresponding to the calculation variable text with reference to the database; and the calculation in the calculation formula text It said to replace the variable text in the comment variable text comments variable text and operators Te Generating a formula corresponding comment text in a text string containing the list, development support program for executing, and displaying the equation corresponding comment text in the comment display area corresponding to the arithmetic expression display region is applied .
また、本発明の別の観点によれば、開発支援プログラムを記録した、前記開発支援装置が読み取り可能な記録媒体が適用される。 According to another aspect of the present invention, a recording medium that records a development support program and is readable by the development support apparatus is applied.
また、本発明の別の観点によれば、実行コードから逆変換されたテキスト記述型プログラムの開発支援方法であって、前記実行コードに対応するデータベースを取得することと、前記テキスト記述型プログラムのプログラムリストに記述されている演算式テキストを、所定の演算式表示領域に表示することと、前記演算式テキストから記憶領域のアドレスで表記した演算変数テキストを抽出することと、前記データベースを参照して前記演算変数テキストに対応するコメント変数テキストを取得することと、前記演算式テキスト中の前記演算変数テキストを前記コメント変数テキストに置換して前記コメント変数テキストと演算子テキストを含んだテキスト列で式対応コメントテキストを生成することと、前記演算式表示領域に対応するコメント表示領域に前記式対応コメントテキストを表示することと、を実行する開発支援方法が適用される。
Further, according to another aspect of the present invention, there is provided a development support method for a text description type program inversely converted from an execution code, including obtaining a database corresponding to the execution code ; Display the arithmetic expression text described in the program list in a predetermined arithmetic expression display area, extract the arithmetic variable text expressed by the address of the storage area from the arithmetic expression text, and refer to the database. Obtaining a comment variable text corresponding to the calculation variable text, replacing the calculation variable text in the calculation formula text with the comment variable text, and a text string including the comment variable text and the operator text. Generating comment text corresponding to an expression and a comment corresponding to the arithmetic expression display area. Development method of performing and displaying the equation corresponding comment text preparative display area, a is applied.
また、本発明の別の観点によれば、実行コードから逆変換されたテキスト記述型プログラムの開発支援装置であって、前記実行コードに対応するデータベースを取得するデータベース取得部と、前記テキスト記述型プログラムのプログラムリストに記述されている演算式テキストを、当該開発支援装置が備える表示部上の所定の演算式表示領域に表示する演算式記述表示部と、前記演算式テキストから記憶領域のアドレスで表記した演算変数テキストを抽出する演算変数抽出部と、前記データベースを参照して前記演算変数テキストに対応するコメント変数テキストを取得するコメント変数取得部と、前記演算式テキスト中の前記演算変数テキストを前記コメント変数テキストに置換して前記コメント変数テキストと演算子テキストを含んだテキスト列で式対応コメントテキストを生成する式対応コメント生成部と、前記演算式表示領域に対応するコメント表示領域に前記式対応コメントテキストを表示する式対応コメント表示部と、を有する開発支援装置が適用される。 Further, according to another aspect of the present invention, there is provided a development support apparatus for a text description type program inversely converted from an execution code, a database acquisition unit for acquiring a database corresponding to the execution code, and the text description type An arithmetic expression description display unit for displaying the arithmetic expression text described in the program list of the program in a predetermined arithmetic expression display area on the display unit included in the development support apparatus, and an address of the storage area from the arithmetic expression text a calculation variable extractor for extracting operational variable text notation, and comments variable obtaining section by referring to the database to retrieve the comments variable text corresponding to the calculation variable text, the calculation variables text of the arithmetic expression in the text including the comment variable text and operators text is replaced with the comment variable text And wherein corresponding comments generating unit for generating a formula corresponding comment text in text column, a formula corresponding comment display unit that displays the equation corresponding comment text in the comment display area corresponding to the arithmetic expression display region, the development support device having Applied.
本発明によれば、プログラムの開発効率、特にデバッグ効率が向上する。 According to the present invention, program development efficiency, particularly debugging efficiency, is improved.
以下、一実施の形態について図面を参照しつつ説明する。 Hereinafter, an embodiment will be described with reference to the drawings.
<開発支援システムの概略構成>
図1は、本実施形態の開発支援プログラムを利用した開発支援システムのブロック図を表している。この図1において、開発支援システム100は、開発支援プログラムを実行する汎用パーソナルコ
FIG. 1 shows a block diagram of a development support system using the development support program of this embodiment. In FIG. 1, a development support system 100 includes a general-purpose personal computer 1 (hereinafter referred to as a general-purpose PC 1) that executes a development support program, a programmable logic controller 2 (referred to as PLC 2 in the drawing and hereinafter), and a servo amplifier 3. And a motor 4.
汎用PC1(開発支援装置)は、特に図示しないCPU、ROM、RAM、HDDなどからなる不揮発性記憶装置、及び通信制御部と、操作部1a、ディスプレイ1b(表示部)を備えた一般的なパーソナルコンピュータである。CPU(演算装置)は、上記のROM、RAM、不揮発性記憶装置に記憶された開発支援プログラムやデータに基づいて、後述のPLC2が実行可能な
PLC2は、特に図示しないCPU、ROM、RAM、フ
<開発支援プログラムのソフトウェア概略構成>
図2は、汎用PC1上で実行される開発支援プログラム全体の概略的なソフトウェア構成を示すブロック図を表している。この図2において、開発支援プログラム11は、エディタ12、記憶部13
FIG. 2 is a block diagram showing a schematic software configuration of the entire development support program executed on the general-purpose PC 1. In FIG. 2, the development support program 11 includes function programs of an editor 12, a storage unit 13, a compiler 14, a decompiler 15, a transmission / reception unit 16, an input processing unit 17, a display processing unit 18, a database 19, and a manager 20. It is integrated.
エディタ12は、上位言語の形式で記述されたプログラム(プログラムリスト、ラダー図)の表示と入力編集を行う機能を有する。プログラムの表示は、上記表示処理部18を介した汎用PC1のディスプレイ1bでの表示により行われる。プログラムの入力編集は、汎用PC1の操作部1a及び上記入力処理部17を介したユーザからの入力により行われる。当該エディタ12が扱うプログラムの上位言語の形式としては、所定の制御手順を図形的に記述するいわゆる図形記述型プログラムと、所定の制御手順をテキスト(文字列)で記述するいわゆるテキスト記述型プログラムの2種類を複合的に扱う。本実施形態の例では、ラダー図(後述の図3参照)で記述するラダープログラムを図形記述型プログラムとして扱い、テキスト記述型プログラムではプログラムリスト(後述の図4参照)に各命令のテキストを複数行に渡って記述する。このエディタ12は、特に
コンパイラ14は、上記記憶部13により記憶されたプログラムリストやラダー図21を、実行コード22に変換する機能を有する。
逆コンパイラ15は、上記記憶部13により記憶された実行コード22を、プログラムリストやラダ
送受信部16は、PLC2と
入力処理部17は、汎用PC1の操作部1aを介した
表示処理部18は、各種の情報を汎用PC1のディスプレイ1b上に表示
マネージャ20は、当該開発支援プログラム11が有する上記の各機能プログラムを統合的に実行する機能を有する。 The manager 20 has a function of executing the function programs of the development support program 11 in an integrated manner.
以上のように構成された開発支援プログラム11においては、ユーザがエディタ12を用いた入力編集によりプログラムリスト及びラダー図21の形式で制御プログラムを作成し、その制御プログラムをコンパイラ14で実行コード22に変換してから送受信部16を介してPLC2に送信し記憶、実行させる。また開発支援プログ
<ラダー図及びプログラムリストについて>
図3は、上記エディタ12によりディスプレイ1b上に表示されたラダー図の一例を示している。なお、本実施形態ではディスプレイ1b上における各種の情報がいわゆるGUI(Graphical User I
FIG. 3 shows an example of a ladder diagram displayed on the display 1 b by the editor 12. In the present embodiment, various information on the display 1b is displayed in a so-called GUI (Graphical User Interface) mode, and the cursor is moved by a pointing device (not shown) provided in the operation unit 1a of the general-purpose PC 1. In C, it is possible to specify a target location for an input operation (the same applies to the following screen display diagrams).
この図3において、ラダー図の左右両端には直流母線に見立てた平行な2本のレール31が記載され、それらのレール31の間にそれぞれリレー回線に見立てた水平直線のラング32が複数記載されている。そして各ラング32の左側に接点(スイッチ)に見立てた起動条件33が記載され、またそれらラング32の右側にアクチュエータコイルに見立てた出力部34が記載されている。各ラング32の起動条件33が満たされた場合に、対応するラング32の出力部34で各指令を出力する。また、各出力部34の出力を各起動条件33に入力することで、ラング32どうし
演算式テキストは、演算変数テキストと、演算子テキストと、関数テキストとを組み合わせた演算式として記述されるテキストである。演算変数テキストは、RAM上の所定の記憶領域に対応して数値を代入し記憶させる変数を表すテキストであり、変数の指定様式によって図示する例の「GF00100」、「GF00200」などのアドレステキストと、「sr」、「Datasu」、「DivP」などの変数名テキストの2種類に分類される(これらアドレステキストや変数名テキストについては後に詳述する)。演算子テキストは、「=」、「+」、「−」、「*(×)」、「/(÷)」などの算術演算子を表すテキストである。関数テキストは、図示する例では「SQRT(引数)(;平方根(引数))」などのシステム関数を表すテキストである。 The arithmetic expression text is text that is described as an arithmetic expression that is a combination of an arithmetic variable text, an operator text, and a function text. The calculation variable text is a text representing a variable to be stored by assigning a numerical value corresponding to a predetermined storage area on the RAM, and an address text such as “GF100100”, “GF00200” in the example illustrated by the variable designation format, , “Sr”, “Dataasu”, “DivP” and the like, are classified into two types of variable name text (these address text and variable name text will be described in detail later). The operator text is text representing an arithmetic operator such as “=”, “+”, “−”, “* (×)”, “/ (÷)”. The function text is a text representing a system function such as “SQRT (argument) (; square root (argument))” in the illustrated example.
コメントテキストは、所定の内容の文字列が注釈として記述されるテキストである。コメントテキストは、基本的にその冒頭に「// 」のヘッダが付加されてそれ以降に自由な内容で記載されるものであるが、その中には隣接する演算式テキスト全体の意味合いを説明するよう記載されるものがある。本実施形態の例では、そのように演算式テキストに対応する内容のコメントテキスト(図示する例の「‘BC二乗’=‘球面曲率’*‘球面曲率’」など)を特に式対応コメントテキストと称呼し、これをプログラムリスト中に記述することなく、ディスプレイ1b上におけるプログラムリストの表示画面中においてのみ当該演算式テキストの直前の行に表示する。つまり、演算式テキストの内容に対応する式対応コメントテキストの表示領域41(コメント表示領域)は、当該演算式テキストの表示領域42(演算式表示領域)の直前の行に配置される。また、本実施形態においては、式対応コメントテキストの冒頭にはヘッダ「// 」は付加しない(演算式テキストと式対応コメントテキストについても後述する)。
The comment text is text in which a character string having a predetermined content is described as a comment. The comment text is basically a "//" header added at the beginning and is described in free content after that. The comment text explains the meaning of the entire adjacent arithmetic expression text. There are thing
また、基本的には演算式テキストとコメントテキストがそれぞれ1文ごとに改行して1行に1文ずつ記述(又は表示)されるが、演算式テキストとコメントテキストのそれぞれの末尾に個々のテキストの区切りを示す「;(セミコロン)」を記述することで1行に複数の演算式テキストやコメントテキストを並記するいわゆるマルチステートメントとすることもできる。 Basically, the formula text and comment text are written (or displayed) one line per line with a new line for each sentence. Individual text is added at the end of each formula text and comment text. By describing “; (semi-colon)” indicating a delimiter, a so-called multi-statement in which a plurality of arithmetic expression texts and comment texts are written in one line can be provided.
<本実施形態の特徴>
汎用PC1では、その操作部1aを介したユーザからの文字入力によりプログラムリスト中に各テキストを記述する。このとき、上記演算変数テキスト(この例のアドレステキストと変数名テキスト)は、数字やアルファベットを少ない文字数で組み合わせただけの単純で抽象的なテキストで記述、表示されるため、演算式テキスト全体の意味が理解しにくい。このため、ディスプレイ1b上におけるプログラムリストの表示画面中で、上述したように演算式テキストを表示する演算式表示領域42に隣接してコメント表示領域41を設け、このコメント表示領域41に演算式テキストの内容に対応した式対応コメントテキストを表
In t
しかし、これまでのプログラム開発においては、新規に演算式テキストを入力した際に、対応する式対応コメントテキストの全部を別途手入力で記述し、表示する必要があった。また、デバッグや調整などの目的で既存の演算式テキスト中の一部の演算変数テキストを修正、変更した場合でも、その際には対応する式対応コメントテキスト中の対応するコメント変数テキストもまた別途手作業で修正、変更する必要があった。これらの入力作業では、各演算変数テキストに対応するコメント変数テキストを確認しながら入力することになり、とても煩雑な作業となっていた。 However, in the program development so far, when a new arithmetic expression text is input, it is necessary to manually describe and display all the corresponding expression corresponding comment texts. Also, even if some calculation variable texts in the existing calculation formula text are modified or changed for the purpose of debugging or adjustment, the corresponding comment variable text in the corresponding expression corresponding comment text is also separately available. It was necessary to correct and change manually. In these input operations, it is necessary to input the comment variable text corresponding to each calculation variable text while confirming it, which is a very complicated operation.
これに対し本実施形態では、汎用PC1上で実行される開発支援プログラム11のエディタ12において、上記演算変数抽出部122が入力された演算式テキストから演算変数テキストを抽出し、上記コメント変数取得部123がデータベース19を参照して演算変数テキストに対応するコメント変数テキ
これにより、新規入力又は修正入力された演算式テキストに対応する式対応コメントテキストが自動的に生成、修正され、プログラムリストの表示画面上に表示される。これにより、ユーザは演算式テキストを入力するだけで、同じ演算内容をさらに理解しやすく表現した式対応コメントテキストを手入力によらず正確に表示することができる。 Thereby, the comment text corresponding to the expression corresponding to the arithmetic expression text newly input or corrected is automatically generated and corrected, and displayed on the program list display screen. As a result, the user can accurately display the comment text corresponding to the expression expressing the same calculation content more easily by simply inputting the calculation expression text without depending on the manual input.
<アドレステキストと変数名テキストについて>
上述したように、数値を代入する変数の名称である演算変数テキストには、アドレステキストと変数名テキストの2種類がある。アドレステキストは、PLC2が備えるRAM(特に図示せず)において数値を格納させるアドレス(番地)をそのまま変数の名称として表記したテキストである。変数名テキストは、ユーザが任意に設定した抽象的な文字列を変数の名称として表記したテキストである。本実施形態では、プログラムリスト中に使用するアドレステキストと変数名テキストについて、それぞれユーザが漢字やかな文字などを用いてその意味合いをわかりやすく記述したコメント変数テキス
As described above, there are two types of calculation variable texts, which are names of variables to which numerical values are assigned, address text an
図5は、上記図4のプログラムリスト中に使用している各アドレステキストを、それぞれコメント変数テキストに対応させて登録するアドレステキスト対応テーブルを模式的に示している。この図5において、各アドレステキストは、上述したように当該変数の数値を記憶させるRAM上のアドレスそのままで記述される。例えば「GF00100」のアドレステキストは、RAM上の「GF00100」のアドレスに数値を記憶させる変数の名称である。このようなアドレステキストを用いることで、ユーザは数値を記憶させるRAM上の格納アドレス(記憶領域)を任意に指定してプログラムリスト上でも確認できる。そして、このアドレステキスト自体は単なるアルファベットと数字の羅列でしかないため、そのまま演算式中に記述されてもそこに代入される数値の意味が把握しにくい。そこで各アドレステキストに対応して、それぞれ漢字やかな文字を用いてその数値の意味を分かりやすく記述したコメント変数テキストがユーザにより別途登録される。例えば「GF00100」のアドレステキストに対応して、このアドレステキストの変数に代入される数値の意味を表す「BC二乗」のコメント変数テキストが登録される。 FIG. 5 schematically shows an address text correspondence table for registering each address text used in the program list of FIG. 4 in correspondence with the comment variable text. In FIG. 5, each address text is described as it is as the address on the RAM for storing the numerical value of the variable as described above. For example, the address text “GF100100” is the name of a variable that stores a numerical value at the address “GF00100” on the RAM. By using such an address text, the user can arbitrarily specify a storage address (storage area) on the RAM for storing numerical values and check it on the program list. Since the address text itself is merely a list of alphabets and numbers, it is difficult to grasp the meaning of the numerical value assigned to it even if it is described in the arithmetic expression as it is. Therefore, corresponding to each address text, a comment variable text in which the meaning of the numerical value is described in an easy-to-understand manner using kanji-like characters is separately registered by the user. For example, a comment variable text of “BC square” indicating the meaning of a numerical value to be assigned to the variable of the address text is registered corresponding to the address text of “GF100100”.
図6は、上記図4のプログラムリスト中に使用している各変数名テキストを、それぞれコメント変数テキストと格納アドレスに対応させて登録する変数名テキスト対応テーブルを模式的に示している。この図6において、各変数名テキストは、ユーザが任意に選んだ数字やアルファベットを組み合わせただけの抽象的な文字列の変数名で記述される。そしてこの変数名テキストが示す変数に代入される数値もまた、RAM上においてユーザが任意に指定した格納アドレス(記憶領域)に記憶される。変数名テキスト対応テーブルでは、各変数名テキストに対応して、代入する数値の意味を分かりやすく記述したコメント変数テキストとともに、上記の格納アドレスが登録される。例えば「sr」の変数名テキストに対応して、この変数名テキストの変数に代入される数値の意味を表す「球面曲率」のコメント変数テキストと、数値を記憶するRAM上の格納アドレス「GF01010」が別途ユーザにより登録される。このような変数名テキストを用いることで、ユーザは簡略化、抽象化した文字列で変数を記述できる。
FIG. 6 schematically shows a variable name text correspondence table in which each variable name text used in the program list of FIG. 4 is registered in correspondence with the comment variable text and the storage address. In FIG. 6, each variable name text is described by an abstract character string variable name that is simply a combination of numbers and alphabets arbitrarily selected by the user. A numerical value assigned to the variable indicated by the variable name text is also stored in a storage address (storage area) arbitrarily designated by the user on the RAM. In the variable name text correspondence table, the above storage address is registered corresponding to each variable name text, together with the comment variable text describing the meaning of the numerical value to be substituted in an easy-to-understand manner. For example, in correspondence with the variable name text of “sr”, the comment variable text of “spherical curvature” indicating the meaning of the numerical value assigned to the variable of the variable name text, and the storage address “GF01010” on the RAM for storing the numerical value. Is separately registered by the user. By using such variable name text, the user can describe the variable with a si
なお、これらのアドレステキスト対応テーブルと変数名テキスト対応テーブルを併せて、上記図2に示したデータベース19に相当する。 These address text correspondence table and variable name text correspondence table together correspond to the database 19 shown in FIG.
<式対応コメントテキストの生成と表示について>
図7は、本実施形態における式対応コメントテキストの生成手法を説明している。この図7においては、上記図4中の「GF00100=sr*sr」の演算式テキストに対応する「‘BC二乗’=‘球面曲率’*‘球面曲率’」の式対応コメントテキストの生成過程を例に取って説明している。
<Generation and display of comment text for expressions>
FIG. 7 illustrates a method for generating a comment text corresponding to an expression in the present embodiment. In FIG. 7, the process of generating the comment text corresponding to the expression “BC square” = “spherical curvature” * “spherical curvature” corresponding to the arithmetic expression text “GF00100 = sr * sr” in FIG. An example is given.
まずプログラムリストから対象となる演算式テキスト「GF00100=sr*sr」を複写し、そこに含まれている演算変数テキスト「GF00100」、「sr」、「sr」を抽出する。この抽出処理は、上記図2に示したエディタ12の演算変数抽出部12
次に、抽出された各演算変数テキストにそれぞれ対応するコメント変数テキスト「BC二乗」、「球面曲率」、「球面曲率」を取得する。この取得処理は、エディタ12のコメント変数取得部123がデータベース19(上記図5のアドレステキスト対応テーブルと
次に、上記複写した元の演算式テキスト中における各演算変数テキストに対して、それぞれ対応して取得したコメント変数テキストを置換することで式対応コメントテキスト「‘BC二乗’=‘球面曲率’*‘球面曲率’」を生成する。この生成処理は、エディタ12の式対応コメント生成部124が、プログラムリストから複写した演算式テキストに対してその中の演算変数テキストをコメント変数テキストに置換し、さらに各コメント変数テキストの前後をクォー
図8は、生成した式対応コメントテキストをプログラムリストの表示画面上に表示する手法を説明している。まず図8の上方に示すように、入力処理部17を介したユーザの入力に基づいてエディタ12の演算式記述表示部121がプログラムリスト中に演算式テキスト(図示する例では「GF00100=sr*sr」)を記述する。そして、エディタ12による後述のリスト表示処理が、図8の下方に示すように各演算式テキストにそれぞれ対応した式対応コメントテキスト(図示する例では「‘BC二乗’=‘球面曲率’*‘球面曲率’」)を自動的に生成し、表示処理部18を介してディスプレイ1bにおけるプログラムリストの表示画面上に各演算式テキストとともにリアルタイムに表示する。この表示処理は、エディタ12の式対応コメント表示部125が、プログラムリストの表示画面中における対象の演算式
なお特に図示しないが、すでに対応する式対応コメントテキストが生成、表示されている状態で元の演算式テキストの内容を変更した場合には、上記のリスト表示処理により、新たに対応する式対応コメントテキストが自動的に生成されて同じコメント表示領域41にリアルタイムに再表示される。また本実施形態では、コメント表示領域41が演算式テキストの行と直前の行との間に配置されるが、これに限られない。例えばユーザからの設定によって、演算式テキストの行と直後の行との間や、当該演算式テキストと同じ行にマルチステートメントでコメント表示領域41を挿入でき
<制御フロー>
以上のような機能を実現するために、汎用PC1のCPU(演算装置)がエディタ12上で実行する上記リスト表示処理の制御手順を、図9、図10により順を追って説明する。まず図9において、このフローに示す処理は、ディスプレイ1b上においてM行分の表示が可能なウィンドウ部(図4の「EXP
T
まずステップS5で、汎用PC1のCPUは、プログラムリストの全行数Nを計数して取得する
次にステップS10へ移り、汎用PC1のCPUは、ウィンドウ部の表示可能行数Mを取得する。
Next, the process proceeds to step S10, and the CP
次にステップS15へ移り、汎用PC1のCPUは、ウィンドウ部中におけるスクロールの状態から現在のプログラムリストの表示開始行Pを取得する。
In step S15, the CPU of the
次にステップS20へ移り、汎用PC1のCPUは、変数である表示行カウンタLCに1の値を代入する。 Next, the process proceeds to step S20, and the CPU of the general-purpose PC 1 assigns a value of 1 to the display row counter LC that is a variable.
一方、P行目中に演算式テキストの記述が含まれている場合、判定が満たされ、ステップS100へ移る。
On the other hand, if the description of the arithmetic expression text is included in the Pth line, the determination is satisfied, and the routine goes
ステップS100では、汎用PC1のCPUは、上記ステップS25で判定された演算式テキストに対応する式対応コメントテキストを生成する式対応コメントテキスト生成処理を実行する(後述の図10参照)。 In step S100, the CPU of the general-purpose PC 1 executes an expression corresponding comment text generation process for generating an expression corresponding comment text corresponding to the arithmetic expression text determined in step S25 (see FIG. 10 described later).
次にステップS35へ移り、汎
一方、LCの値とMの値が一致しない場合、判定は満たされ
ステップS40では、汎用PC1のCPUは、表示行カウンタLCの値
次にステップS45へ移り、汎用PC1のCPUは、ウィンドウ部中のLC行目にプログラムリスト上のP行目を表示する。 In step S45, the CPU of the general-purpose PC 1 displays the Pth line on the program list on the LC line in the window portion.
一方、LCの値とMの値が一致しない場合、判定は満たされず、ステップS55へ移る。 On the other hand, if the LC value does not match the M value, the determination is not satisfied, and the routine goes to Step S55.
一方、Pの値とNの値が一致しない場合、判定は満たされず、ステップS60へ移る。
On the other hand, if the value of P does
ステップS60では、汎用PC1のCPUは、Pの値とLCの値にそれぞれ1を加算する。そして、上記ステップS25へ戻り、同様の手順を繰り返す。 In step S60, the CPU of the general-purpose PC 1 adds 1 to the value of P and the value of LC, respectively. And it returns to said step S25 and repeats the same procedure.
図10は、上記図9中におけるステップS100の式対応テキストコメント生成部の詳細な制御手順を示している。
FIG. 10
まずステップS105で、汎用PC1のCPUは、プログラムリストのP行目から対象となる演算式テキストを複写して取得する。 First, in step S105, the CPU of the general-purpose PC 1 copies and obtains the target arithmetic expression text from the P-th line of the program list.
次にステップS115へ移り、汎用PC1のCPUは、データベース19(アドレステキスト対応
次にステップS120へ移り、汎用PC1のCPUは、上記ステップS105で複写した元の演算式テキスト中の各演算変数テキストを、上記ステップS115で取得したそれぞれに対応するコメント変数テキストに置換してコメントテキストを
<本実施形態の効果>
以上説明したように、本実施形態の開発支援プログラム11によれば、演算変数抽出部122により演算式テキストから変数に関する演算変数テキストを抽出することと、コメント変数取得部123によりデータベース19を参照して演算変数テキストに対応するコメント変数テキストを取得することと、式対応コメント生成部124により演算式テキスト中の演算変数テキストをコメント変数テキストに置換して式対応コメントテキストを生成
As described above, according to the development support program 11 of the present embodiment, the operation variable text
これにより、新規入力又は修正入力された演算式テキストに対応する式対応コメントテキストが自動的に生成、修正され、プログラムリストの表示画面上におけるコメント表示領域41に表示される。特にこの式対応コメントテキストは、元の演算式テキスト中における各演算変数テキストだけを対応するコメント変数テキストに置換しているだけであり、他の演算子テキストや関数テキストは同じ配置関係が維持されたまま記述されるため、演算式全体の演算内容の意味合いは元の演算式テキストと同等に表現される。これにより、ユーザは演算式テキストを入力するだけで、同じ演算内
なお、本実施形態では、ユーザによるプログラムリスト中の演算式テキストの記述操作をエディタ12が常時リアルタイムに監視し、演算式テキストもしくは演算変数テキストの単位で記述入力が行われたと判断された際にすぐに対応するコメントテキストを生成、表示したが、これに限られない。例えば、特に図示しないが、式対応コメントテキストの表示と非表示をユーザが任意に切
また、本実施形態では特に、演算変数テキストが、ユーザが任意に指定した記憶領域の格納アドレスで表記したアドレステキストである。これにより、ユーザが任意に指定した記憶領域の格納アドレスに当該アドレステキストに対応する変数の数値内容を記憶させることができ、またその格納アドレスをプログラムリスト上でも確認できる。 In this embodiment, in particular, the calculation variable text is an address text expressed by a storage address of a storage area arbitrarily designated by the user. Thus, the numerical contents of the variable corresponding to the address text can be stored in the storage address of the storage area arbitrarily designated by the user, and the storage address can be confirmed on the program list.
また、本実施形態では特に、演算変数テキストが、ユーザが任意に設定した変数名で表記した変数名テキストである。これにより、ユーザは簡略化、抽象化した文字列で変数を記述できる。 In this embodiment, in particular, the calculation variable text is a variable name text expressed by a variable name arbitrarily set by the user. As a result, the user can describe the variable with a simplified and abstracted character string.
なお、本実施形態では、ユーザが新規に作成したか、もしくは既存のものを修正したプログラムリストに対して自動的にテキストコメントを生成し、これを挿入表示したが、これに限られない。例えば、一度コンパイラ14によって変換された実行コードを逆コンパイラ15によって再度逆変換されたプログラムリストに対しても本実施形態を適用できる。この場合には、エディタ12が対応するデータベース19(アドレステキスト対応テーブルと変数名テキスト対応テーブル)も併せて取得し参照することで、各演算式テキストの記述内容に対応した式対応コメントテキス
また、本実施形態では特に、テキスト記述型プログラムのプログラムリストが、図形記述型プログラムのラダー図中の数値演算処理に適用されるものである。この場合、テキスト記述型プログラムが分担して行う処理は数値演算に特化することになり、演算式テキストを多用する記述となるため、本実施形態の適用が特に有用である。 In this embodiment, in particular, the program list of the text description type program is applied to the numerical operation processing in the ladder diagram of the graphic description type program. In this case, the processing performed by the text description type program is specialized in numerical computation, and is a description that makes heavy use of arithmetic expression text. Therefore, the application of this embodiment is particularly useful.
<変形例>
なお、開示の実施形態は、上記に限られるものではなく、その趣旨及び技術的思想を逸脱しない範囲内で種々の変形が可能である。以下、そのような変形例を説明する。
<Modification>
The disclosed embodiments are not limited to the above, and various modifications can be made without departing from the spirit and technical idea thereof. Hereinafter, such modifications will be described.
(1)コメント変数テキストの表示文字数を任意に設定する場合
上記実施形態では、式対応コメントテキストを表示する際にデータベース19に登録されているコメント変数テキストをそのまま置換した状態の式対応コメントテキストをプログラムリストの表示画面中に表示していたが、これに限られない。例えば、コメント変数テキス
例えば、上記図5のアドレステキスト対応テーブルにおいて、「GF00100」のアドレステキストに対応して「2つの球面曲率を掛け合わせて算出したBC二乗」といった長文のコメント変数テキストを登録した場合には、そのままコメント変数テキストを置換すると式対応コメントテキスト全体が冗長となって見づらくなる。これに対して本変形例では、エディタ12のオプション設定によりコメント変数テキストの表示文字数を例えば先頭の5文字に設定することで、図11の上方部に示すようにコメント変数テキストを「‘2つの球面〜’」とだけ表示することができる。なお、末尾の「〜」は、登録されたコメント変数テキストの先頭の一部だけを表示していることを示すフッタである。そして、ユーザがプログラムリストの表示画面上で部分表示されたコメント変数テキストの表示領域41にカーソルCを重ねることで、図11の下方部に示すようにいわゆるバルーンヘルプBHの態様でコメント変数テキストを全文字数で表示する。
For example, if a long comment variable
以上説明したように、本変形例の開発支援プログラム11によれば、コメント表示領域41におけるコメント変数テ
なお、最終的にはディスプレイ1b
また、本変形例では特に、GUI上でコメント表示領域
(2)コメント変数テキストだけを特別な態様で表示する場合
上記実施形態では、式対応コメントテキスト中において、コメント変数テキストと、演算子テキストと、関数テキストのいずれも同じ態様で表示していたが、これに限られない。例えば、上記図4に対応する図12に示すように、各式対応コメントテキスト中においてコメント変数テキストだけを他の演算子テキストや関数テキストと異なる特別な態様で表示してもよい。図示する例では、コメント変数テキストだけを太字、斜体のフォントスタイルで表示している。このような表示を行うことで、式対応コメントテキスト中におけるコメント変数テキストと演算子テキスト(関数テキスト)の区別か明確となり、式対応コメントテキスト全体の構成が容易に把握可能となる。なお、特別な表示態様として、図示した例のフォントスタイル以外にも、文字色や大きさ(ポイント)などで相違させてもよい。
(2) When only the comment variable text is displayed in a special manner In the above embodiment, the comment variable text, the operator text, and the function text are all displayed in the same manner in the comment text corresponding to the expression. Not limited to this. For example, as shown in FIG. 12 corresponding to FIG. 4, only the comment variable text in the comment text corresponding to each expression may be displayed in a special mode different from other operator text and function text. In the illustrated example, only the comment variable text is displayed in bold and italic font style. By performing such display, it becomes clear whether the comment variable text and the operator text (function text) in the comment text corresponding to the expression are distinct, and the configuration of the entire comment text can be easily grasped. Note that, as a special display mode, in addition to the font style of the illustrated example, it may be different depending on the character color or size (point).
また本変形例においても、最終的にはディスプレイ1b上でのプログラムリストの表示が明確にな
また、以上既に述べた以外にも、上記実施形態や各変形例による手法を適宜組み合わせて利用しても良い。 In addition to those already described above, the methods according to the above-described embodiments and modifications may be used in appropriate combination.
その他、一々例示はしないが、上記実施形態や各変形例は、その趣旨を逸脱しない範囲内において、種々の変更が加えられて実施されるものである。 In addition, although not illustrated one by one, the above-mentioned embodiment and each modification are implemented with various modifications within a range not departing from the gist thereof.
1 汎用パーソナルコンピュータ(開発支援装置)
1a 操作部
1b ディスプレイ(表示部)
2 プログラマブルロジックコントローラ
3 サーボアンプ
4 モータ
11 開発支援プログラム
12 エディタ
13 記憶部
14 コンパイラ
15 逆コンパイラ
16 送受信部
17 入力処理部
18 表示処理部
19 データベース
20 マネージャ
21 プログラムリスト及びラダー図
22 実行コード
41 コメント表示領域
42 演算式表示領域
122
123
124
C
1a Operation unit 1b
DESCRIPTION OF
Claims (8)
前記実行コードに対応するデータベースを取得することと、
前記テキスト記述型プログラムのプログラムリストに記述されている演算式テキストを、前記開発支援装置が備える表示部上の所定の演算式表示領域に表示することと、
前記演算式テキストから記憶領域のアドレスで表記した演算変数テキストを抽出することと、
前記データベースを参照して前記演算変数テキストに対応するコメント変数テキストを取得することと、
前記演算式テキスト中の前記演算変数テキストを前記コメント変数テキストに置換して前記コメント変数テキストと演算子テキストを含んだテキスト列で式対応コメントテキストを生成することと、
前記演算式表示領域に対応するコメント表示領域に前記式対応コメントテキストを表示することと、
を実行することを特徴とする開発支援プログラム。 A development support program to be executed by an arithmetic unit provided in a development support device for a text description type program inversely converted from an execution code,
Obtaining a database corresponding to the executable code;
Displaying the arithmetic expression text described in the program list of the text description type program in a predetermined arithmetic expression display area on a display unit included in the development support device;
Extracting a calculation variable text expressed by a storage area address from the calculation formula text;
Obtaining a comment variable text corresponding to the operation variable text with reference to the database;
Replacing the operation variable text in the operation expression text with the comment variable text to generate an expression corresponding comment text in a text string including the comment variable text and operator text ;
Displaying the expression corresponding comment text in a comment display area corresponding to the arithmetic expression display area;
Development support program characterized by executing
前記実行コードに対応するデータベースを取得することと、
前記テキスト記述型プログラムのプログラムリストに記述されている演算式テキストを、所定の演算式表示領域に表示することと、
前記演算式テキストから記憶領域のアドレスで表記した演算変数テキストを抽出することと、
前記データベースを参照して前記演算変数テキストに対応するコメント変数テキストを取得することと、
前記演算式テキスト中の前記演算変数テキストを前記コメント変数テキストに置換して前記コメント変数テキストと演算子テキストを含んだテキスト列で式対応コメントテキストを生成することと、
前記演算式表示領域に対応するコメント表示領域に前記式対応コメントテキストを表示することと、
を実行することを特徴とする開発支援方法。 A method for supporting the development of a text description type program that has been inversely transformed from an executable code,
Obtaining a database corresponding to the executable code;
Displaying the arithmetic expression text described in the program list of the text description type program in a predetermined arithmetic expression display area;
Extracting a calculation variable text expressed by a storage area address from the calculation formula text;
Obtaining a comment variable text corresponding to the operation variable text with reference to the database;
Replacing the operation variable text in the operation expression text with the comment variable text to generate an expression corresponding comment text in a text string including the comment variable text and operator text ;
Displaying the expression corresponding comment text in a comment display area corresponding to the arithmetic expression display area;
A development support method characterized by executing
前記実行コードに対応するデータベースを取得するデータベース取得部と、
前記テキスト記述型プログラムのプログラムリストに記述されている演算式テキストを、当該開発支援装置が備える表示部上の所定の演算式表示領域に表示する演算式記述表示部と、
前記演算式テキストから記憶領域のアドレスで表記した演算変数テキストを抽出する演算変数抽出部と、
前記データベースを参照して前記演算変数テキストに対応するコメント変数テキストを取得するコメント変数取得部と、
前記演算式テキスト中の前記演算変数テキストを前記コメント変数テキストに置換して前記コメント変数テキストと演算子テキストを含んだテキスト列で式対応コメントテキストを生成する式対応コメント生成部と、
前記演算式表示領域に対応するコメント表示領域に前記式対応コメントテキストを表示する式対応コメント表示部と、
を有することを特徴とする開発支援装置。
A development support device for a text description type program that is inversely transformed from an executable code,
A database acquisition unit for acquiring a database corresponding to the execution code;
An arithmetic expression description display unit for displaying the arithmetic expression text described in the program list of the text description type program in a predetermined arithmetic expression display area on the display unit included in the development support apparatus;
A calculation variable extraction unit that extracts a calculation variable text represented by a storage area address from the calculation formula text;
A comment variable obtaining unit that obtains a comment variable text corresponding to the operation variable text with reference to the database;
An expression corresponding comment generating unit that replaces the operation variable text in the operation expression text with the comment variable text and generates an expression corresponding comment text in a text string including the comment variable text and the operator text ;
An expression corresponding comment display section for displaying the expression corresponding comment text in a comment display area corresponding to the arithmetic expression display area;
A development support apparatus characterized by comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015132795A JP6394516B2 (en) | 2015-07-01 | 2015-07-01 | Development support program, recording medium, development support method, and development support apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2015132795A JP6394516B2 (en) | 2015-07-01 | 2015-07-01 | Development support program, recording medium, development support method, and development support apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2017016411A JP2017016411A (en) | 2017-01-19 |
JP6394516B2 true JP6394516B2 (en) | 2018-09-26 |
Family
ID=57828203
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2015132795A Active JP6394516B2 (en) | 2015-07-01 | 2015-07-01 | Development support program, recording medium, development support method, and development support apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP6394516B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP7447574B2 (en) * | 2020-03-12 | 2024-03-12 | オムロン株式会社 | Support equipment, support programs and support methods |
JP2024011850A (en) * | 2022-07-15 | 2024-01-25 | オムロン株式会社 | Control program editing device, editing method, and program |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2001142684A (en) * | 1999-11-15 | 2001-05-25 | Fujitsu Ltd | Recording medium stored with program for analyzing source program |
JP4972866B2 (en) * | 2005-03-10 | 2012-07-11 | 富士通株式会社 | Conversion program |
JP2006330865A (en) * | 2005-05-24 | 2006-12-07 | Keyence Corp | User program display device, and program applied to the same |
JP5490170B2 (en) * | 2012-04-03 | 2014-05-14 | 三菱電機株式会社 | Program creation support apparatus and program creation support method |
WO2014064830A1 (en) * | 2012-10-26 | 2014-05-01 | 株式会社安川電機 | Development support device and development support program |
-
2015
- 2015-07-01 JP JP2015132795A patent/JP6394516B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2017016411A (en) | 2017-01-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7805705B2 (en) | Graphically depicting program code depth | |
US10203850B2 (en) | Data editing apparatus, data editing method, and data editing program | |
JP5454783B2 (en) | Variable name input support method in PLC programming, variable name input support device in PLC programming, and computer program | |
CN105446983A (en) | Method and device used for generating data format descriptive language model | |
KR101324370B1 (en) | Sequence program debugging device, debugging method, and program | |
WO2019098107A1 (en) | Translation support device, translation support program, and method to support translation with information processing device | |
JP6394516B2 (en) | Development support program, recording medium, development support method, and development support apparatus | |
Kiesel et al. | WAT-SL: a customizable web annotation tool for segment labeling | |
CN112487334A (en) | Method, apparatus, computer device and medium for front end page language translation | |
JP5490170B2 (en) | Program creation support apparatus and program creation support method | |
US9342064B2 (en) | Motion SFC program component creation device | |
JP2005242682A (en) | Graphical programming apparatus and programmable display unit | |
JP4735854B2 (en) | PLC program development support device | |
JP5109646B2 (en) | Program source conversion device | |
US11055069B2 (en) | Tree structure data editing device, tree structure data editing method, and program | |
JP2009086922A (en) | Program editing device | |
CN107612919B (en) | Protocol configuration method and device | |
JP2011165039A (en) | Model debugging device and model debugging method | |
JP2009163524A (en) | Arithmetic processing unit | |
JP2018156214A (en) | SFC program creation support apparatus, SFC program creation support program, and SFC program creation method | |
JP2003303100A (en) | Information processing system, method for constructing information processing system, and program therefor | |
JP6407481B1 (en) | Program creation device | |
JPS63109578A (en) | Processing system for logic diagram outline display | |
JP2013030196A (en) | Program editing device | |
JP2006195827A (en) | Application development tool |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20161228 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20171026 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20171109 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20171208 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20180323 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20180412 |
|
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: 20180731 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20180813 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 6394516 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |