JP2008084261A - Program automatic generation device, program automatic generation method, and program automatic generation program - Google Patents
Program automatic generation device, program automatic generation method, and program automatic generation program Download PDFInfo
- Publication number
- JP2008084261A JP2008084261A JP2006266436A JP2006266436A JP2008084261A JP 2008084261 A JP2008084261 A JP 2008084261A JP 2006266436 A JP2006266436 A JP 2006266436A JP 2006266436 A JP2006266436 A JP 2006266436A JP 2008084261 A JP2008084261 A JP 2008084261A
- Authority
- JP
- Japan
- Prior art keywords
- block
- data flow
- flow diagram
- switching
- function
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Stored Programmes (AREA)
Abstract
Description
本発明はプログラム自動生成装置、プログラム自動生成方法およびプログラム自動生成プログラムに関し、特に、切り替え処理を有するプログラム自動生成装置、プログラム自動生成方法およびプログラム自動生成プログラムに関する。 The present invention relates to an automatic program generation device, an automatic program generation method, and an automatic program generation program, and more particularly, to an automatic program generation device having a switching process, an automatic program generation method, and an automatic program generation program.
圧延プラント・発電プラントなどの大規模プラントや産業用機械装置などでは、コンピュータを用いたデジタル制御が、既に実用化されている。このような大規模プラントや産業用機械装置などにおいては、デジタル制御を実施するために、制御用のプログラムが必要となる。 Digital control using a computer has already been put into practical use in large-scale plants such as rolling plants and power plants and industrial machinery. In such a large-scale plant, industrial machine, and the like, a control program is required to perform digital control.
そこで、このプログラムの開発に、C言語などの高級言語が広く利用されている。そして、高級言語によって作製されたプログラムは、コンパイラなどを用いて、ロードモジュールに変換されて、コンピュータによって処理が行われている。 Therefore, high-level languages such as C language are widely used for developing this program. A program created in a high-level language is converted into a load module using a compiler or the like and processed by a computer.
また、一般に、高級言語によるプログラムと同時に、ドキュメントも作製される。このドキュメントは、視覚的把握の向上のために、図形を多用して作製されることが多い。
ところが、この図形によって作製されたドキュメントに基づいて手作業でプログラムを作成する場合、人為的ミスが多く生じることが問題視されていた。
In general, a document is created simultaneously with a high-level language program. This document is often created using a lot of graphics to improve visual comprehension.
However, it has been regarded as a problem that many human errors occur when a program is manually created on the basis of a document created by this figure.
そこで、現在では、図形ベースのドキュメントからテキストベースのプログラムへの自動生成が実現されている(例えば、特許文献1,2,3,4参照。)。このプログラムの自動生成によって、開発者の人為的ミスが減少され、操作の時間も短縮することができる。さらに、開発者は図形ベースのドキュメントとテキストベースのプログラムの2つを個別に記述し、生成する必要がなくなり、プログラムの開発効率がさらに向上する。
Therefore, at present, automatic generation from a graphic-based document to a text-based program has been realized (see, for example,
なお、図形ベースのドキュメントは、例えば、特許文献2に開示されているように、複数のブロックが接続されたデータフロー図と呼ばれる形式をとることがある。以下にこのデータフロー図の概要について説明する。 Note that a figure-based document may take a form called a data flow diagram in which a plurality of blocks are connected, as disclosed in, for example, Patent Document 2. The outline of this data flow diagram will be described below.
図14は、従来のデータフロー図の例を示す図である。
データフロー図は、それぞれの関数で実行される処理の流れを記述したものである。図14に示したデータフロー図500には、開始ブロック510,511、通常ブロック520,521,522,523,524、終端ブロック550,551、分岐点530、保持ブロック540,541および論理ブロック560により記述されている。そして、矢印線によって、これらの機能ブロック間のデータ入出力関係が図14に示すように記述されている。
FIG. 14 is a diagram showing an example of a conventional data flow diagram.
The data flow diagram describes the flow of processing executed by each function. The data flow diagram 500 shown in FIG. 14 includes a
開始ブロックは、処理の開始時に関数の外部から与えられた入力値を意味する。多くの場合、1つのデータフロー図につき、1以上の開始ブロックが記述される。図14に示したデータフロー図500では、処理の開始時に2つの入力値(開始ブロック510および開始ブロック511に対応する入力値)が与えられる。
The start block means an input value given from outside the function at the start of processing. In many cases, one or more starting blocks are described per data flow diagram. In the data flow diagram 500 shown in FIG. 14, two input values (input values corresponding to the
通常ブロックは、一定のまとまったデータ処理を意味する。それぞれの通常ブロックでは、矢印線にそって入力されるデータに基づいて、矢印線にそって出力されるデータが計算される。例えば、図14の通常ブロック520では、開始ブロック510で与えられる入力値に基づいて、通常ブロック521に対して出力するデータが計算される。
A normal block means a certain set of data processing. In each normal block, the data output along the arrow line is calculated based on the data input along the arrow line. For example, in the
終端ブロックは、処理の終了時に関数の外部へと出力される戻り値を意味する。多くの場合、1つのデータフロー図につき、1つ以上の終端ブロックが記述される。図14に示したデータフロー図500では、後に説明する保持ブロック540または論理ブロック560が出力したデータが最終的な戻り値(終端ブロック550および終端ブロック551に対応する戻り値)として出力されている。
The end block means a return value output to the outside of the function at the end of processing. In many cases, one or more termination blocks are described per data flow diagram. In the data flow diagram 500 shown in FIG. 14, data output from the
保持ブロックは、入力されたデータを保持するか、または保持しつつ、そのデータを計算して次のブロックへ出力するデータ処理を意味する。通常ブロックであれば、データが入力されると、一旦、そのデータはワーク領域などで保持される。その後、データが出力されると、そのワーク領域の役目が終わり、破棄される。しかし、例えば、図14の保持ブロック540では、通常ブロック522から出力されたデータを保持したまま、計算して、計算結果を出力する。データを保持することによって、この保持ブロックの外からこのデータを参照するなど、データの保持が必要な場合に備えることができる。
The holding block means data processing for holding input data or calculating and outputting the data to the next block while holding the data. In the case of a normal block, once data is input, the data is once held in a work area or the like. Thereafter, when data is output, the role of the work area ends and is discarded. However, for example, the
論理ブロックは、入力されたデータに対して、真(TRUE)または偽(FALSE)のいずれかの値を出力するデータ処理を意味する。
上記のデータフロー図500は、ユーザの操作入力に基づいて作成することができる。このようなデータフロー図500を用いることで、ユーザは関数の内部で実行される処理の流れを容易に理解することができる。
The logical block means data processing for outputting either true (FALSE) or false (FALSE) for input data.
The above data flow diagram 500 can be created based on user operation input. By using such a data flow diagram 500, the user can easily understand the flow of processing executed inside the function.
図15は、従来のデータフロー図の別の例を示す図である。
データフロー図の別の例として、図15のデータフロー図600は、データフロー図500と同様に、開始ブロック610,650,651、終端ブロック652、通常ブロック620,621,622および論理ブロック660により記述されている。さらに、図15では、切り替え要素として、切り替えブロック690が接続されている。そして、矢印線によって、これらの機能ブロック間のデータ入出力関係が図15に示すように記述されている。
FIG. 15 is a diagram showing another example of a conventional data flow diagram.
As another example of a data flow diagram, the data flow diagram 600 of FIG. 15 is similar to the data flow diagram 500 by a
なお、切り替えブロックは、入力されたデータによって、出力を切り替えるデータ処理を意味する。例えば、図15において、論理ブロック660に対応する関数からの信号が真である場合は、通常ブロック620から、切り替えブロック690を介して、通常ブロック622への出力と見なされる。一方、論理ブロック660に対応する関数からの信号が偽である場合は、通常ブロック621から、切り替えブロック690を介して、通常ブロック622への出力と見なされる。
The switching block means data processing for switching output according to input data. For example, in FIG. 15, when the signal from the function corresponding to the
図14,15ようにブロックを用いたデータフロー図は様々な表記を記述することができるため、データの受け渡しによって進行する処理の記述に適している。
ところが、図形ベースのドキュメントからテキストベースのプログラムへの自動生成には以下のような問題点があった。
データフロー図で表記される内容は、処理を伴うために、処理時間を必要とする。例えば、図15の開始ブロック610の入力値が論理ブロック660に入力されて、真または偽であるか判断される。真である場合は、通常ブロック620から通常ブロック622側に出力される。しかし、一方で、通常ブロック621側のデータの処理の計算が行われている。結果的に、通常ブロック621側からのデータの処理の計算は捨てられてしまう。このように、切り替えブロック690では処理を行うために、不要な処理を行って余計な時間がかかってしまうという問題があった。
However, automatic generation from a figure-based document to a text-based program has the following problems.
The content described in the data flow diagram requires processing time because it involves processing. For example, the input value of
さらに、このような場合には、ブロックにそのブロックを呼び出すかどうかのデータを入力して、実行の制御を行っていた場合があった。しかし、このような制御の方法では、処理の内容が隠れてしまうため、プログラムの自動生成が適切に行われないという問題があった。 Further, in such a case, there is a case where execution control is performed by inputting data on whether to call the block to the block. However, in such a control method, the contents of the process are hidden, so that there is a problem in that automatic generation of the program is not appropriately performed.
本発明はこのような点に鑑みてなされたものであり、処理効率が向上されたプログラムを記述し、生成できるプログラム自動生成装置、プログラム自動生成方法およびプログラム自動生成プログラムを提供することを目的とする。 The present invention has been made in view of these points, and an object thereof is to provide an automatic program generation apparatus, an automatic program generation method, and an automatic program generation program that can describe and generate a program with improved processing efficiency. To do.
本発明では上記課題を解決するために、プログラムによるデータ処理を表す機能ブロックと、前記機能ブロック間のデータの受け渡し関係とを記述したデータフロー図から実装コードを生成するプログラム自動生成装置において、ユーザによる操作入力を受け付け、前記機能ブロックの一種であり、入力値に応じて真偽の値を返す関数に対応する論理ブロックを作成する論理ブロック作成手段と、前記操作入力を受け付け、複数の前記機能ブロックが接続されたブロック列を作成するブロック列作成手段と、前記操作入力を受け付け、前記ブロック列を囲む切り替えブロック領域を作成する切り替えブロック領域作成手段と、前記操作入力を受け付け、前記切り替えブロック領域に前記論理ブロックが接続された前記データフロー図を作成するブロック接続手段と、を有するデータフロー図作成手段と、作成された前記データフロー図を保持するデータフロー図記憶手段と、前記データフロー図記憶手段に保持された前記データフロー図の前記論理ブロックに対応する前記関数に対して入力値を入力させるコードと、前記論理ブロックに対応する前記関数が返す出力値を判断し、実行時に前記出力値が真と判断されると、前記論理ブロックに接続された前記切り替えブロック領域内の前記ブロック列に対応する処理を実行させるコードと、前記切り替えブロック領域内の前記ブロック列を構成する前記機能ブロックに対応する関数の実行を指示するコードと、により構成される前記実装コードを生成する実装コード生成手段と、を有することを特徴とするプログラム自動生成装置が提供される。 In the present invention, in order to solve the above problems, in a program automatic generation apparatus that generates an implementation code from a data flow diagram describing a functional block representing data processing by a program and a data transfer relationship between the functional blocks, a user A logical block creating means for creating a logical block corresponding to a function that is a kind of the functional block and returns a true / false value in accordance with an input value; and a plurality of the functions Block sequence creating means for creating a block sequence to which blocks are connected, switching block area creating means for accepting the operation input and creating a switching block area surrounding the block sequence, and accepting the operation input, and the switching block area Create the data flow diagram with the logical block connected to Block connection means, data flow diagram creation means having data flow diagram storage means for holding the created data flow diagram, and the logical block of the data flow diagram held in the data flow diagram storage means A code for inputting an input value to the corresponding function and an output value returned by the function corresponding to the logical block are determined, and when the output value is determined to be true at the time of execution, the function is connected to the logical block. And a code for executing a process corresponding to the block sequence in the switching block area, and a code for instructing execution of a function corresponding to the functional block constituting the block sequence in the switching block area. And an implementation code generation means for generating the implementation code. It is subjected.
このようなプログラム自動生成装置によれば、ユーザによる操作入力を受け付け、入力値に応じて真偽の値を返す関数に対応する論理ブロックを作成する論理ブロック作成手段と、ユーザによる操作入力を受け付け、複数の機能ブロックが接続されたブロック列を作成するブロック列作成手段と、ユーザによる操作入力を受け付け、ブロック列の機能ブロックを囲む切り替えブロック領域を作成する切り替えブロック領域作成手段と、ユーザによる操作入力を受け付け、切り替えブロック領域に論理ブロックが接続されたデータフロー図を作成するブロック接続手段と、切り替えブロック領域に論理ブロックが接続されたデータフロー図を作成するデータフロー図作成手段と、により、データフロー図が作成される。そして、データフロー図から、実装コード生成手段によって、データフロー図記憶手段に保持されたデータフロー図の論理ブロックに対応する関数に対して入力値を入力させるコードと、論理ブロックに対応する関数が返す出力値を判断し、実行時に出力値が真と判断されると、論理ブロックに接続された切り替えブロック領域内のブロック列に対応する処理を実行させるコードと、切り替えブロック領域内のブロック列を構成する機能ブロックに対応する関数の実行を指示するコードと、により構成される実装コードが生成される。 According to such an automatic program generation device, a logical block creating unit that creates a logical block corresponding to a function that accepts an operation input by the user and returns a true / false value according to the input value, and an operation input by the user are accepted. A block sequence creating means for creating a block sequence in which a plurality of functional blocks are connected; a switching block area creating means for accepting an operation input by a user and creating a switching block area surrounding the functional blocks of the block sequence; and a user operation A block connection unit that receives an input and creates a data flow diagram in which a logical block is connected to the switching block area, and a data flow diagram creation unit that creates a data flow diagram in which a logical block is connected to the switching block area, A data flow diagram is created. Then, from the data flow diagram, a code for inputting an input value to a function corresponding to the logical block of the data flow diagram held in the data flow diagram storage unit by the implementation code generation unit, and a function corresponding to the logical block are When the output value to be returned is determined, and the output value is determined to be true at the time of execution, the code for executing the processing corresponding to the block sequence in the switching block area connected to the logical block and the block sequence in the switching block area are An implementation code composed of a code for instructing execution of a function corresponding to the function block to be constructed is generated.
また、上記課題を解決するために、プログラムによるデータ処理を表す機能ブロックと、前記機能ブロックのデータの受け渡し関係とを記述したデータフロー図から実装コードを生成するプログラム自動生成方法において、論理ブロック作成手段が、ユーザによる操作入力を受け付け、前記機能ブロックの一種であり、入力値に応じて真偽の値を返す関数に対応する論理ブロックを作成し、ブロック列作成手段が、前記操作入力を受け付け、複数の前記機能ブロックが接続されたブロック列を作成して、切り替えブロック領域作成手段が、前記操作入力を受け付け、前記ブロック列を囲む切り替えブロック領域を作成して、ブロック接続手段が、前記操作入力を受け付け、前記切り替えブロック領域に前記論理ブロックが接続された前記データフロー図を作成して、実装コード生成手段が、前記データフロー図の前記論理ブロックに対応する前記関数に対して入力値を入力させるコードと、前記論理ブロックに対応する前記関数が返す出力値を判断し、実行時に前記出力値が真と判断されると、前記論理ブロックに接続された前記切り替えブロック領域内の前記ブロック列に対応する処理を実行させるコードと、前記切り替えブロック領域内の前記ブロック列を構成する前記機能ブロックに対応する関数の実行を指示するコードと、により構成される前記実装コードを生成する、ことを特徴とするプログラム自動生成方法が提供される。 In addition, in order to solve the above-mentioned problem, in the program automatic generation method for generating the implementation code from the data flow diagram describing the functional block representing the data processing by the program and the data transfer relationship of the functional block, the logical block creation The means accepts an operation input by a user and is a kind of the functional block, creates a logical block corresponding to a function that returns a true / false value according to the input value, and a block string creation means accepts the operation input A block sequence in which a plurality of functional blocks are connected, a switching block region creation unit accepts the operation input, creates a switching block region surrounding the block sequence, and a block connection unit creates the operation Accepts input, and the data in which the logical block is connected to the switching block area. A flow diagram is created, and the implementation code generation means includes a code for inputting an input value to the function corresponding to the logical block of the data flow diagram, and an output value returned by the function corresponding to the logical block. If the output value is determined to be true at the time of execution, a code for executing processing corresponding to the block sequence in the switching block area connected to the logical block, and the block in the switching block area There is provided an automatic program generation method characterized by generating the implementation code composed of code for instructing execution of a function corresponding to the functional block constituting a sequence.
このようなプログラム自動生成方法によれば、入力値に応じて真偽の値を返す関数に対応する論理ブロックを作成する論理ブロック作成手段と、ユーザによる操作入力を受け付け、複数の機能ブロックが接続されたブロック列を作成するブロック列作成手段と、ユーザによる操作入力を受け付け、ブロック列の機能ブロックを囲む切り替えブロック領域を作成する切り替えブロック領域作成手段と、ユーザによる操作入力を受け付け、切り替えブロック領域に論理ブロックが接続されたデータフロー図を作成するブロック接続手段と、を有するデータフロー図作成手段により、切り替えブロック領域に論理ブロックが接続されたデータフロー図が作成され、実装コード生成手段によって、論理ブロックに対応する関数が返す出力値を判断し、実行時に出力値が真と判断されると、切り替えブロック領域内のブロック列の処理が実行される実装コードが生成される。 According to such an automatic program generation method, a logical block creating means for creating a logical block corresponding to a function that returns a true / false value according to an input value, and a user's operation input are received, and a plurality of functional blocks are connected. A block sequence creating means for creating a block sequence, a switching block area creating means for accepting an operation input by a user and creating a switching block area surrounding a functional block of the block sequence, and a switching block area accepting an operation input by a user A data flow diagram in which a logical block is connected to the switching block area is created by a data flow diagram creating unit having a block connection unit that creates a data flow diagram in which a logical block is connected to Determine the output value returned by the function corresponding to the logical block, When the output value when the line is determined to true, implementation code processing block column select block area is performed is generated.
また上記課題を解決するために、プログラムによるデータ処理を表す機能ブロックと、前記機能ブロック間のデータの受け渡し関係とを記述したデータフロー図から実装コードを生成するプログラム自動生成プログラムにおいて、コンピュータを、ユーザによる操作入力を受け付け、前記機能ブロックの一種であり、入力値に応じて真偽の値を返す関数に対応する論理ブロックを作成する論理ブロック作成手段と、前記操作入力を受け付け、複数の前記機能ブロックが接続されたブロック列を作成するブロック列作成手段と、前記操作入力を受け付け、前記ブロック列を囲む切り替えブロック領域を作成する切り替えブロック領域作成手段と、前記操作入力を受け付け、前記切り替えブロック領域に前記論理ブロックが接続された前記データフロー図を作成するブロック接続手段と、を有するデータフロー図作成手段、作成された前記データフロー図を保持するデータフロー図記憶手段、前記データフロー図記憶手段に保持された前記データフロー図の前記論理ブロックに対応する前記関数に対して入力値を入力させるコードと、前記論理ブロックに対応する前記関数が返す出力値を判断し、実行時に前記出力値が真と判断されると、前記論理ブロックに接続された前記切り替えブロック領域内の前記ブロック列に対応する処理を実行させるコードと、前記切り替えブロック領域内の前記ブロック列を構成する前記機能ブロックに対応する関数の実行を指示するコードと、により構成される前記実装コードを生成する実装コード生成手段、として機能させることを特徴とするプログラム自動生成プログラムが提供される。 In order to solve the above problem, in a program automatic generation program for generating an implementation code from a data flow diagram describing a functional block representing data processing by a program and a data transfer relationship between the functional blocks, Accepts an operation input by a user, is a kind of the functional block, and creates a logic block corresponding to a function that returns a true / false value according to an input value, and accepts the operation input, Block sequence creating means for creating a block sequence to which functional blocks are connected, switching block area creating means for accepting the operation input and creating a switching block area surrounding the block sequence, accepting the operation input, and the switching block The data in which the logical block is connected to an area Block connection means for creating a raw diagram, data flow diagram creating means having data flow diagram storage means for holding the created data flow diagram, and the data flow diagram stored in the data flow diagram storage means A code for inputting an input value to the function corresponding to the logical block and an output value returned by the function corresponding to the logical block are determined. When the output value is determined to be true at the time of execution, the logical block A code for executing processing corresponding to the block sequence in the switching block region connected to the code, and a code for instructing execution of a function corresponding to the functional block constituting the block sequence in the switching block region; A program which functions as an implementation code generation means for generating the implementation code configured by Beam automatic generation program is provided.
このようなプログラム自動生成プログラムによれば、ユーザによる操作入力を受け付け、入力値に応じて真偽の値を返す関数に対応する論理ブロックを作成する論理ブロック作成手段と、ユーザによる操作入力を受け付け、複数の機能ブロックが接続されたブロック列を作成するブロック列作成手段と、ユーザによる操作入力を受け付け、ブロック列の機能ブロックを囲む切り替えブロック領域を作成する切り替えブロック領域作成手段と、ユーザによる操作入力を受け付け、切り替えブロック領域に論理ブロックが接続されたデータフロー図を作成するブロック接続手段と、切り替えブロック領域に論理ブロックが接続されたデータフロー図を作成するデータフロー図作成手段と、により、データフロー図が作成される。そして、データフロー図から、実装コード生成手段によって、データフロー図記憶手段に保持されたデータフロー図の論理ブロックに対応する関数に対して入力値を入力させるコードと、論理ブロックに対応する関数が返す出力値を判断し、実行時に出力値が真と判断されると、論理ブロックに接続された切り替えブロック領域内のブロック列に対応する処理を実行させるコードと、切り替えブロック領域内のブロック列を構成する機能ブロックに対応する関数の実行を指示するコードと、により構成される実装コードが生成される。 According to such an automatic program generation program, a logical block creating means for creating a logical block corresponding to a function that accepts an operation input by a user and returns a true / false value according to the input value, and an operation input by the user are accepted. A block sequence creating means for creating a block sequence in which a plurality of functional blocks are connected; a switching block area creating means for accepting an operation input by a user and creating a switching block area surrounding the functional blocks of the block sequence; and a user operation A block connection unit that receives an input and creates a data flow diagram in which a logical block is connected to the switching block area, and a data flow diagram creation unit that creates a data flow diagram in which a logical block is connected to the switching block area, A data flow diagram is created. Then, from the data flow diagram, a code for inputting an input value to a function corresponding to the logical block of the data flow diagram held in the data flow diagram storage unit by the implementation code generation unit, and a function corresponding to the logical block are When the output value to be returned is determined, and the output value is determined to be true at the time of execution, the code for executing the processing corresponding to the block sequence in the switching block area connected to the logical block and the block sequence in the switching block area are An implementation code composed of a code for instructing execution of a function corresponding to the function block to be constructed is generated.
本発明では、切り替えブロック領域を有するデータフロー図から、論理ブロックに対応する関数に対して入力値を入力させるコードと、論理ブロックに対応する関数が返す出力値を判断し、実行時に出力値が真と判断されると、論理ブロックに接続された切り替えブロック領域内のブロック列に対応する処理を実行させるコードと、切り替えブロック領域内のブロック列を構成する機能ブロックに対応する関数の実行を指示するコードと、により構成される実装コードを、生成するようにした。これにより、切り替えブロック領域内の処理の中身を表示することができるため、切り替えブロック領域を有するデータフロー図からプログラムの自動生成を効率よく行うことができる。 In the present invention, a code for inputting an input value to a function corresponding to a logical block and an output value returned by the function corresponding to the logical block are determined from a data flow diagram having a switching block area. If it is determined to be true, it instructs the execution of the function corresponding to the function block constituting the block sequence in the switching block area and the code for executing the processing corresponding to the block sequence in the switching block area connected to the logical block. And implementation code composed of code to be generated. As a result, the contents of the processing in the switching block area can be displayed, so that automatic program generation can be efficiently performed from the data flow diagram having the switching block area.
以下、本発明の実施の形態を、図面を参照して詳細に説明する。
まず、本発明の概要について説明し、続いて、本発明の実施の形態について説明する。
図1は、本実施の形態の概念図である。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
First, an outline of the present invention will be described, and then an embodiment of the present invention will be described.
FIG. 1 is a conceptual diagram of the present embodiment.
図1に示されるプログラム自動生成装置10において、入力装置2を介して、データフロー図12aが作成され、作成されたデータフロー図12aから、プログラムの実装コード3が生成されるものである。
In the automatic
プログラム自動生成装置10は、機能ブロックライブラリ記憶手段11、データフロー図記憶手段12、データフロー図作成手段13および実装コード生成手段14を有する。
機能ブロックライブラリ記憶手段11は、データフロー図を構成する機能ブロックに対応した関数が格納されている。機能ブロックには、開始ブロック、通常ブロック、終端ブロック、保持ブロックおよび論理ブロックなどがある。開始ブロックとは、最初に与えられる入力値に対応する機能ブロックである。通常ブロックとは、データが入力されて処理を行ってデータを出力する機能ブロックである。終端ブロックとは、通常ブロックなどによってブロック図の最後に出力される値に対応する機能ブロックである。保持ブロックとは、入力値が計算されて出力されても、入力された値が保持される機能ブロックである。論理ブロックとは、入力された値に対し、出力の値は真(TRUE)または偽(FALSE)の2つの値のどちらかしか取れない機能ブロックである。また、プログラム自動生成装置10において、機能ブロックライブラリ記憶手段11を用いなくても、実装コードを作成することができる。その場合、機能ブロックに対応する関数の実行を支持するコードのみが生成されているために、ユーザによって適宜、関数の作成が必要となる。
The automatic
The function block library storage unit 11 stores functions corresponding to the function blocks constituting the data flow diagram. The functional block includes a start block, a normal block, an end block, a holding block, a logical block, and the like. The start block is a functional block corresponding to the input value given first. A normal block is a functional block that receives data and performs processing to output data. The end block is a functional block corresponding to a value output at the end of the block diagram by a normal block or the like. A holding block is a functional block that holds an input value even if the input value is calculated and output. The logic block is a functional block that can take only one of two values, that is, true (TRUE) or false (FALSE) with respect to an input value. Further, in the automatic
データフロー図記憶手段12は、データフロー図作成手段13により作成されたデータフロー図12aが格納される。なお、このデータフロー図12aは、機能ブロックと機能ブロック間のデータの受け渡し関係とが記述されている。機能ブロックはプログラムによる一定のまとまったデータ処理を表す。
The data flow
データフロー図作成手段13は、論理ブロック作成手段13a、切り替えブロック領域作成手段13b、ブロック列作成手段13cおよびブロック接続手段13dを有する。
論理ブロック作成手段13aでは、論理ブロックが作成される。
The data flow diagram creating unit 13 includes a logical
The logical
切り替えブロック領域作成手段13bでは、切り替えブロック領域が作成される。切り替えブロック領域によって、後に形成されるブロック列のうちの任意の機能ブロックが囲まれることになる。複数の機能ブロックを囲む切り替えブロック領域は、論理ブロックによって判定された結果によって、切り替えブロック領域の中の機能ブロックによる処理が行われるか否かが決まる。
The switching block
ブロック列作成手段13cでは、複数のブロックが接続されたブロック列が作成される。
ブロック接続手段13dでは、ブロック列作成手段13cによって作成されたブロック列が中に配置された、切り替えブロック領域作成手段13bによって作成された切り替えブロック領域に対して、論理ブロック作成手段13aによって作成された論理ブロックを接続させることによって、データフロー図が作成される。
The block
In the
以上により、データフロー図12aがデータフロー図作成手段13によって作成される。
実装コード生成手段14では、必要に応じて、機能ブロックライブラリ記憶手段11を参照して、データフロー図12aからプログラムの自動生成が行われて実装コード3が生成される。
Thus, the data flow diagram 12a is created by the data flow diagram creation means 13.
The implementation
このプログラム自動生成装置10では、データフロー図作成手段13により、切り替え処理を行う機能ブロックが接続されたデータフロー図について、従来表示されなかった切り替えの処理の内容が表示されたデータフロー図を作成することができる。
In this automatic
これにより、実装コード生成手段14において、切り替えの処理内容が表示されたデータフロー図12aからプログラムの自動生成を行うことができる。さらに、切り替え処理の内容が表示されるようになったために、データフロー図作成の際に、処理効率の良いプログラムを記述することができる。
As a result, the implementation
以下に、本発明を利用した実施の形態について、図面を参照して説明する。
本実施の形態は、1つのプログラム自動生成装置で構成される。ユーザはプログラム自動生成装置を用いて、データフロー図などを記述することができる。そして、記述されたデータフロー図からプログラムの実装コードを生成することができる。
Embodiments using the present invention will be described below with reference to the drawings.
This embodiment is composed of one program automatic generation device. A user can describe a data flow diagram and the like using an automatic program generation device. Then, it is possible to generate a program implementation code from the described data flow diagram.
図2は、プログラム自動生成装置のハードウェア構造を示す図である。プログラム自動生成装置100は、CPU(Central Processing Unit)101によって装置全体が制御されている。CPU101には、バス106を介してRAM(Random Access Memory)102、ハードディスクドライブ(HDD:Hard Disc Drive)103、グラフィック処理装置104および入力インタフェース105が接続されている。
FIG. 2 is a diagram illustrating a hardware structure of the automatic program generation device. The entire automatic program generation apparatus 100 is controlled by a CPU (Central Processing Unit) 101. A random access memory (RAM) 102, a hard disk drive (HDD) 103, a
RAM102には、CPU101に実行させるOS(Operating System)プログラムやアプリケーションプログラムの少なくとも一部が一時的に格納される。また、RAM102には、CPU101による処理に必要な各種データが格納される。HDD103には、OSプログラムやアプリケーションプログラムが格納される。
The
グラフィック処理装置104には、モニタ21が接続されている。グラフィック処理装置104は、CPU101からの命令に従って、画像をモニタ21の画面に表示させる。入力インタフェース105には、キーボード22とマウス23とが接続されている。入力インタフェース105は、キーボード22やマウス23から送られてくる信号を、バス106を介してCPU101に送信する。
A monitor 21 is connected to the
以上のようなハードウェア構成によって、本実施の形態の処理機能を実現することができる。
次に、プログラム自動生成装置100のモジュール構成について説明する。
With the hardware configuration as described above, the processing functions of the present embodiment can be realized.
Next, the module configuration of the automatic program generation device 100 will be described.
なお、本実施の形態では、機能ブロックライブラリ記憶部を参照して、データフロー図から、プログラムの自動生成を行う場合を例に挙げて説明する。
図3は、プログラム自動生成装置の機能を示すブロック図である。
In the present embodiment, an example in which a program is automatically generated from a data flow diagram with reference to a functional block library storage unit will be described.
FIG. 3 is a block diagram illustrating functions of the automatic program generation device.
プログラム自動生成装置100は、機能ブロックライブラリ記憶部110、データフロー図記憶部120、ソースファイル記憶部130、データフロー図作成部140およびソースコード生成部150を有する。
The automatic program generation device 100 includes a functional block
機能ブロックライブラリ記憶部110は、データフロー図を構成する通常ブロック、保持ブロックおよび論理ブロックの各種ブロックに対応する関数が格納されている。
データフロー図記憶部120は、ブロック列作成部143によって作成されるブロック列、切り替えブロック領域作成部142によって作成される切り替えブロック領域および論理ブロック作成部141によって作成される論理ブロックから、ブロック接続部144によって作成されるデータフロー図を格納する。
The function block
The data flow
ソースファイル記憶部130は、データフロー図からプログラムの自動生成が行われて生成された実装コードが格納される。
データフロー図作成部140は、論理ブロック作成部141、切り替えブロック領域作成部142、ブロック列作成部143およびブロック接続部144により構成される。なお、これらは、モニタ21を介して、キーボード22およびマウス23を通じて、ユーザからの入力を受け付けることができる。
The source
The data flow
論理ブロック作成部141は、ユーザの操作入力を受け付け、機能ブロックライブラリ記憶部110に格納されている論理ブロックに対応する関数を参照し、そして、論理ブロックを作成する。
The logical
切り替えブロック領域作成部142は、ユーザの操作入力を受け付け、切り替えブロック領域を作成する。ブロック列作成部143にて作成されるブロック列の全て、もしくは一部の機能ブロックが、切り替えブロック領域作成部142にて作成された切り替えブロック領域に囲まれる。複数の機能ブロックが中に配置された切り替えブロック領域は、論理ブロックと接続され、論理ブロックに対応する関数から返される真の時のみ、切り替えブロック領域の中の機能ブロックによる処理が行われる。
The switching block
ブロック列作成部143は、ユーザの操作入力を受け付け、機能ブロックライブラリ記憶部110に格納されてある各種ブロックに対応する関数を参照して、複数の機能ブロックを接続させてブロック列を作成する。
The block
ブロック接続部144は、ブロック列作成部143によって作成されたブロック列が中に配置された、切り替えブロック領域作成部142によって作成された切り替えブロック領域に対して、論理ブロック作成部141によって作成された論理ブロックを接続させることによって、データフロー図が作成される。
The
ソースコード生成部150は、データフロー図記憶部120に格納されているデータフロー図から、機能ブロックライブラリ記憶部110に格納されてある各種ブロックに対応する関数を参照して、プログラムの自動生成が行われる。
The source
次に、プログラム自動生成装置100によって作成されたデータフロー図から実装コードを生成する処理について説明する。
図4は、実装コード生成の処理手順を示すフローチャートである。データフロー図作成部140によって作成されたデータフロー図から、ソースコード生成部150によって、プログラムを生成する処理について、図4を用いて説明する。
Next, a process for generating a mounting code from a data flow diagram created by the automatic program generation device 100 will be described.
FIG. 4 is a flowchart showing a processing procedure for generating the mounting code. Processing for generating a program by the source
[ステップS11]ソースコード生成部150は、選択した機能ブロックに対応するソースファイル記憶領域を確保する。
[ステップS12]ソースコード生成部150は、データフロー図記憶部120から受け取ったデータフロー図のうち、開始ブロックから近い順に、未選択の機能ブロックを1つ選択する。
[Step S11] The source
[Step S12] The source
[ステップS13]ソースコード生成部150は、ステップS12にて選択したブロックが通常ブロックであるか判断する。通常ブロックである場合はステップS14へ進められ、違う場合はステップS15へ進められる。
[Step S13] The source
[ステップS14]ソースコード生成部150は、ステップS13で選択した通常ブロックに対応する関数を機能ブロックライブラリ記憶部110から選択し、通常ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。
[Step S14] The source
[ステップS15]ソースコード生成部150は、ステップS12にて選択したブロックが保持ブロックであるか判断する。保持ブロックである場合はステップS16へ進められ、違う場合はステップS17へ進められる。
[Step S15] The source
[ステップS16]ソースコード生成部150は、ステップS15で選択した保持ブロックに対応する関数を機能ブロックライブラリ記憶部110から選択し、保持ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。
[Step S16] The source
[ステップS17]ソースコード生成部150は、ステップS12にて選択したブロックが論理ブロックであるか判断する。論理ブロックである場合はステップS18へ進められ、違う場合はステップS29へ進められる。
[Step S17] The source
[ステップS18]ソースコード生成部150は、ステップS17で選択した論理ブロックに対応する関数を機能ブロックライブラリ記憶部110から選択し、論理ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。
[Step S18] The source
[ステップS19]ソースコード生成部150は、論理ブロックの次に、切り替えブロック領域の有無を判断する。切り替えブロック領域がある場合は、ステップS20へ進められ、無い場合は、ステップS23へ進められる。
[Step S19] The source
[ステップS20]ソースコード生成部150は、ステップS19で切り替えブロック領域があると判断すると、切り替えブロック領域内に、通常ブロックを選択する。
[ステップS21]ソースコード生成部150は、ステップS20で通常ブロックを選択すると、それに対応する関数を機能ブロックライブラリ記憶部110から選択し、通常ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。
[Step S20] When the source
[Step S21] When the source
[ステップS22]ソースコード生成部150は、ステップS20で選択した通常ブロックの次にさらにブロックがあるか判断する。次にブロックがある場合は、ステップS21へ進められ、無い場合は、ステップS23へ進められる。なお、次にブロックが無い場合は、切り替えブロック領域内の処理が終了し、切り替えブロック領域の外に続くブロックの処理となる。
[Step S22] The source
[ステップS23]ソースコード生成部150は、切り替えブロック領域の外にあるブロックが通常ブロックであるか判断する。通常ブロックである場合は、ステップS24へ進められ、違う場合は、ステップS25へ進められる。
[Step S23] The source
[ステップS24]ソースコード生成部150は、ステップS23で選択した通常ブロックに対応する関数を機能ブロックライブラリ記憶部110から選択し、通常ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。
[Step S24] The source
[ステップS25]ソースコード生成部150は、切り替えブロック領域の外にあるブロックが保持ブロックであるか判断する。保持ブロックである場合は、ステップS26へ進められ、違う場合は、ステップS27へ進められる。
[Step S25] The source
[ステップS26]ソースコード生成部150は、ステップS25で選択した保持ブロックに対応する関数を機能ブロックライブラリ記憶部110から選択し、保持ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。
[Step S26] The source
[ステップS27]ソースコード生成部150は、切り替えブロック領域の外にあるブロックが論理ブロックであるか判断する。論理ブロックである場合は、ステップS28へ進められ、違う場合は、ステップS29へ進められる。
[Step S27] The source
[ステップS28]ソースコード生成部150は、ステップS27で選択した論理ブロックに対応する関数を機能ブロックライブラリ記憶部110から選択し、論理ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。
[Step S28] The source
[ステップS29]ソースコード生成部150は、データフロー図のうち、ステップS12で未選択のブロックがあるか判断する。未選択のブロックがある場合は、処理がステップS12へ進められ、未選択のブロックが無い場合は、処理がステップS30へ進められる。
[Step S29] The source
[ステップS30]ソースコード生成部150は、ステップS11で確保したコード記憶領域にある実装コードをファイルに出力し、ソースファイル記憶部130に記憶して、処理がソースコード生成処理を終了する。
[Step S30] The source
このようにして、ソースコード生成部150は、データフロー図のブロックごとにソースファイルに出力し、ソースファイル記憶部130に格納する。
このようなプログラム自動生成装置100による、プログラム化されるデータフロー図について、以下に具体例として、データフロー図を挙げて説明する。
In this way, the source
A data flow diagram to be programmed by the automatic program generation device 100 will be described below with reference to a data flow diagram as a specific example.
第1の例では、ブロック列の全てが切り替えブロック領域に囲まれる場合について説明する。
図5は、第1の例のデータフロー図を示す図である。
In the first example, a case will be described in which the entire block row is surrounded by the switching block area.
FIG. 5 is a diagram illustrating a data flow diagram of the first example.
プログラム自動生成装置100によって、図5に示すデータフロー図121を作成した場合を例に説明する。
データフロー図121は、開始ブロック121a、論理ブロック121b、そして通常ブロック121d,121e,121f、終端ブロック121gおよびこれらを囲む切り替えブロック領域121aaを有する。
The case where the data flow diagram 121 shown in FIG. 5 is created by the automatic program generation device 100 will be described as an example.
The data flow diagram 121 includes a
なお、データフロー図121は、開始ブロック121aに対応する入力値が、論理ブロック121bに入力する。論理ブロック121bに対応する関数は、入力値に応じて、真または偽の値を返す。そして、真の時は、切り替えブロック領域121aa内の通常ブロック121d,121e,121fに対応する関数が順に処理を行って、終端ブロック121gに対応する出力値を出力する。
In the data flow diagram 121, an input value corresponding to the
図6は、第1の例のデータフロー図から生成される実装コード例を示す図である。
図5のデータフロー図121からプログラム自動生成装置100によって生成された実装コードの例を図6に示している。
FIG. 6 is a diagram illustrating an example of an implementation code generated from the data flow diagram of the first example.
FIG. 6 shows an example of the mounting code generated by the automatic program generation device 100 from the data flow diagram 121 of FIG.
実装コード131は、説明のためにC言語に類似の文法で記述されたものである。そして、ソースファイル記憶部130に格納されている。
関数宣言文131aの引数は、図5のデータフロー図121の開始ブロック121a、および関数呼び出し文131bは、図5のデータフロー図121の論理ブロック121bに対応したものであり、引数の入力値“in_1”を関数に与えて出力データ“out_f”を取得する。
The implementation code 131 is described with a grammar similar to the C language for explanation. Then, it is stored in the source
The argument of the
if文131cは、図5のデータフロー図121の切り替えブロック121aaに対応したものである。出力データ“out_f”が真の場合、図5のデータフロー図121の切り替えブロック領域121aa内の通常ブロック121d,121e,121fにて順に行われる処理に対応したものであり、入力データに対して、出力データ“out_a”が出力(131d)され、入力データ“out_a”に対して、出力データ“out_b”が出力(131e)され、入力データ“out_b”に対して、出力データ“out_c”が取得(131f)される。
The if
なお、関数131g,131h,131i,131jは、関数呼び出し文131b,131d,131e,131fで呼び出される関数である。
なお、図5では、切り替えブロック領域121aaに直接、論理ブロック121bの出力が接続されているが、その間に通常ブロックが挿入されても切り替えブロック121aaなどの意味は同等である。
The
In FIG. 5, the output of the
次に第2の例について説明する。
第2の例では、切り替えブロック領域から通常ブロックへ接続されている場合を例に挙げて説明する。
Next, a second example will be described.
In the second example, a case where the switching block area is connected to the normal block will be described as an example.
図7は、第2の例のデータフロー図を示す図である。
プログラム自動生成装置100によって、図7に示すデータフロー図122が作成された場合を例に説明する。
FIG. 7 is a diagram illustrating a data flow diagram of the second example.
A case where the data flow diagram 122 shown in FIG. 7 is created by the automatic program generation device 100 will be described as an example.
データフロー図122は、開始ブロック122a、論理ブロック122b、そして通常ブロック122d,122e,122f,122gおよびこれらを囲む切り替えブロック領域122aa、通常ブロック122h、終端ブロック122iを有する。
The data flow diagram 122 includes a
なお、データフロー図122は、開始ブロック122aに対応する入力値が、論理ブロック122bに入力する。論理ブロック122bに対応する関数は、入力値に応じて、真または偽の値を返す。そして、真の時は、切り替えブロック領域122aa内の通常ブロック122d,122e,122f,122gに対応する関数が順に処理を行う。そして、通常ブロック122gから、切り替えブロック領域122aaの外から接続されている通常ブロック122hへ入力されて処理を行う。最後に、終端ブロック122iに対応する出力値を出力する。
In the data flow diagram 122, an input value corresponding to the
図8は、第2の例のデータフロー図から生成される実装コード例を示す図である。
図7のデータフロー図122からプログラム自動生成装置100によって生成された実装コードの例を図8に示している。
FIG. 8 is a diagram illustrating an example of the implementation code generated from the data flow diagram of the second example.
An example of the implementation code generated by the automatic program generation device 100 from the data flow diagram 122 of FIG. 7 is shown in FIG.
実装コード132は、説明のためにC言語に類似の文法で記述されたものである。そして、ソースファイル記憶部130に格納されている。
関数宣言文132aの引数は、図7のデータフロー図122の開始ブロック122a、および関数呼び出し文132bは、図7のデータフロー図122の論理ブロック122bに対応したものであり、引数の入力値“in_1”を関数に与えて出力データ“out_f”を取得する。
The implementation code 132 is described in a grammar similar to the C language for explanation. Then, it is stored in the source
The argument of the
if文132cは、図7のデータフロー図122の切り替えブロック122aaに対応したものである。出力データ“out_f”が真の場合、図7のデータフロー図122の切り替えブロック領域122aa内の通常ブロック122d,122e,122f,122gにて順に行われる処理に対応したものであり、入力データに対して、出力データ“out_a”が出力(132d)され、入力データ“out_a”に対して、出力データ“out_b”が出力(132e)され、入力データ“out_b”に対して、出力データ“out_c”が出力(132f)され、入力データ“out_c”に対して、出力データ“out_d”が取得(132g)される。他方、出力データ“out_f”が偽の場合、図7のデータフロー図122の切り替えブロック領域122aa内において処理が行われないために、出力データが“out_d=0”(132h)とされる。
The if
そして、関数呼び出し文132iは、図7のデータフロー図122の通常ブロック122hに対応するものであり、図7のデータフロー図122の切り替えブロック領域122aaからの出力データ“out_d”が入力されて、出力データ“out_g”が取得される。
The
なお、関数132j,132k,132l,132m,132n,132oは、関数呼び出し文132b,132d,132e,132f,132g,132iで呼び出される関数である。
The
次に第3の例について説明する。
第3の例では、切り替えブロック領域から保持ブロックへ接続されている場合を例に挙げて説明する。
Next, a third example will be described.
In the third example, a case where the switching block area is connected to the holding block will be described as an example.
図9は、第3の例のデータフロー図を示す図である。
プログラム自動生成装置100によって、図9に示すデータフロー図123が作成された場合について説明する。
FIG. 9 is a diagram illustrating a data flow diagram of the third example.
The case where the data flow diagram 123 shown in FIG. 9 is created by the automatic program generation device 100 will be described.
データフロー図123は、開始ブロック123a、論理ブロック123b、そして通常ブロック123d,123e,123f,123gおよびこれらを囲む切り替えブロック領域123aa、保持ブロック123h、終端ブロック123iを有する。
The data flow diagram 123 includes a
なお、データフロー図123は、開始ブロック123aに対応する入力値が、論理ブロック123bに入力する。論理ブロック123bに対応する関数は、入力値に応じて、真または偽の値を返す。そして、真の時は、切り替えブロック領域123aa内の通常ブロック123d,123e,123f,123gに対応する関数が順に処理を行う。そして、通常ブロック123gから、切り替えブロック領域123aaの外から接続されている保持ブロック123hへ入力し処理を行う。最後に、終端ブロック123iに対応する出力値を出力する。
In the data flow diagram 123, an input value corresponding to the
図10は、第3の例のデータフロー図から生成される実装コード例を示す図である。
図9のデータフロー図123からプログラム自動生成装置100によって生成された実装コードの例を図10に示している。
FIG. 10 is a diagram illustrating an example of the implementation code generated from the data flow diagram of the third example.
An example of the implementation code generated by the automatic program generation device 100 from the data flow diagram 123 of FIG. 9 is shown in FIG.
実装コード133は、説明のためにC言語に類似の文法で記述されたものである。そして、ソースファイル記憶部130に格納されている。
関数宣言文133aは、図9のデータフロー図123の開始ブロック123aの引数、および関数呼び出し文133bは、図9のデータフロー図123の論理ブロック123bに対応したものであり、引数の入力値“in_1”を関数に与えて出力データ“out_f”を取得する。
The implementation code 133 is described in a grammar similar to the C language for explanation. Then, it is stored in the source
The
if文133cは、図9のデータフロー図123の切り替えブロック123aaに対応したものである。出力データ“out_f”が真の場合、図9のデータフロー図123の切り替えブロック領域123aa内の通常ブロック123d,123e,123f,123gにて順に行われる処理に対応したものであり、入力データに対して、出力データ“out_a”が出力(133d)され、入力データ“out_a”に対して、出力データ“out_b”が出力(133e)され、入力データ“out_b”に対して、出力データ“out_c”が出力(133f)され、入力データ“out_c”に対して、出力データ“out_d”が取得(133g)される。他方、出力データ“out_f”が偽の場合、図9のデータフロー図123の切り替えブロック領域123aa内では処理は行われないが、出力データが“out_d=var_i”とされて、データが保持されるようにされている。
The if
そして、関数呼び出し文133iは、図9のデータフロー図123の保持ブロック123hに対応するものであり、図9のデータフロー図123の切り替えブロック領域123aaの出力データ“out_d”が入力されて、出力データ“var_i”が取得される。
The
なお、関数133j,133k,133l,133m,133n,133oは、関数呼び出し文133b,133d,133e,133f,133g,133iで呼び出される関数である。
Note that the
次に第4の例について説明する。
第4の例では、切り替えブロック領域内の論理ブロックから切り替えブロック領域外の通常ブロックへ接続されている場合を例に挙げて説明する。
Next, a fourth example will be described.
In the fourth example, a case where a logical block in the switching block area is connected to a normal block outside the switching block area will be described as an example.
図11は、第4の例のデータフロー図を示す図である。
プログラム自動生成装置100によって、図11に示すデータフロー図124が作成された場合について説明する。
FIG. 11 is a diagram illustrating a data flow diagram of the fourth example.
A case where the data flow diagram 124 shown in FIG. 11 is created by the automatic program generation device 100 will be described.
データフロー図124は、開始ブロック124a、論理ブロック124b、そして通常ブロック124d,124e,124f、論理ブロック124gおよびこれらを囲む切り替えブロック領域124aa、通常ブロック124i、終端ブロック124jを有する。
The data flow diagram 124 includes a
なお、データフロー図124は、開始ブロック124aに対応する入力値が、論理ブロック124bに入力する。論理ブロック124bに対応する関数は、入力値に応じて、真または偽の値を返す。そして、真の時は、切り替えブロック領域124aa内の通常ブロック124d,124e,124f、論理ブロック124gに対応する関数が順に処理を行う。そして、論理ブロック124gに対応する関数が真を返すとき、論理ブロック124gから、切り替えブロック領域124aaの外から接続されている通常ブロック124iへ入力し処理を行う。最後に、終端ブロック124jに対応する出力値を出力する。
In the data flow diagram 124, an input value corresponding to the
図12は、第4の例のデータフロー図から生成される実装コード例を示す図である。
図11のデータフロー図124からプログラム自動生成装置100によって生成された実装コードの例を図12に示している。
FIG. 12 is a diagram illustrating an example of an implementation code generated from the data flow diagram of the fourth example.
An example of the implementation code generated by the automatic program generation device 100 from the data flow diagram 124 of FIG. 11 is shown in FIG.
実装コード134は、説明のためにC言語に類似した文法で記述されたものである。そして、ソースファイル記憶部130に格納されている。
関数宣言文134aの引数は、図11のデータフロー図124の開始ブロック124aおよび関数呼び出し文134bは、図11のデータフロー図124の論理ブロック124bに対応したものであり、引数の入力値“in_1”を関数に与えて出力データ“out_f”を取得する。
The implementation code 134 is described in a grammar similar to the C language for explanation. Then, it is stored in the source
The argument of the
if文134cは、図11のデータフロー図124の切り替えブロック124aaに対応したものである。出力データ“out_f”が真の場合、図11のデータフロー図124の切り替えブロック領域124aa内の通常ブロック124d,124e,124fおよび論理ブロック124gにて順に行われる処理に対応したものであり、入力データに対して、出力データ“out_a”が出力(134d)され、入力データ“out_a”に対して、出力データ“out_b”が出力(134e)され、入力データ“out_b”に対して、出力データ“out_c”が出力(134f)され、入力データ“out_c”に対して、出力データ“out_d”が取得(134g)される。他方、出力データ“out_f”が偽の場合、“0”とすると出力に不具合が生じるために、出力データが“out_d=false”とされている。
The if
そして、関数呼び出し文134iは、図11のデータフロー図124の通常ブロック124iに対応するものであり、図11のデータフロー図124の切り替えブロック領域124aaの出力データ“out_d”が入力されて、出力データ“out_j”が取得される。
The
なお、関数134j,134k,134l,134m,134n,134oは、関数呼び出し文134b,134d,134e,134f,134g,134iで呼び出される関数である。
The
次に第5の例について説明する。
第5の例では、切り替えブロック領域からの出力が分岐しており、一方が通常ブロックと接続されており、他方は保持ブロックと接続されている場合を例に挙げて説明する。
Next, a fifth example will be described.
In the fifth example, the case where the output from the switching block area is branched, one is connected to the normal block, and the other is connected to the holding block will be described as an example.
図13は、第5の例のデータフロー図を示す図である。
プログラム自動生成装置100によって、図13のデータフロー図125が作成された場合について説明する。
FIG. 13 is a diagram illustrating a data flow diagram of the fifth example.
A case where the data flow diagram 125 of FIG. 13 is created by the automatic program generation device 100 will be described.
データフロー図125は、開始ブロック125a、論理ブロック125b、そして通常ブロック125d,125e,125f,125gおよびこれらを囲む切り替えブロック領域125aa、通常ブロック125h、保持ブロック125i、終端ブロック125j,125kを有する。
The data flow diagram 125 includes a
この図13のデータフロー図125では、切り替えブロック領域125aa外に信号が出力される時、他の実施例と異なり、分岐しているために、ここでエラーが判定される。分岐の一方の出力先は通常ブロックで、他方が保持ブロックである場合は、if文、else節の生成が一意にできないために、エラーが判定されて、実装コードは出力されない。 In the data flow diagram 125 of FIG. 13, when a signal is output outside the switching block area 125aa, unlike the other embodiments, it is branched, so an error is determined here. If one output destination of a branch is a normal block and the other is a holding block, the generation of the if statement and else clause cannot be made unique, so an error is determined and the implementation code is not output.
なお、第1〜第5の例では、説明のためにC言語に類似した文法で記述された実装コードを生成したが、第1の実施の形態に係るプログラム自動生成装置は特定のプログラミング言語に特化したものではなく、他のプログラミング言語への応用も容易に行える。 In the first to fifth examples, the implementation code described in the grammar similar to the C language is generated for explanation. However, the automatic program generation device according to the first embodiment uses a specific programming language. It is not specialized and can be easily applied to other programming languages.
以上、本発明のプログラム自動生成装置、プログラム自動生成方法およびプログラム自動生成プログラムを、図示の実施の形態について基づいて説明したが、本発明はこれに限定されるものではなく、各部の構成は、同様の機能を有する任意の構成のものに置換することができる。また本発明に、他の任意の構成物や工程が付加されてもよい。 As described above, the automatic program generation device, the automatic program generation method, and the automatic program generation program of the present invention have been described based on the illustrated embodiment, but the present invention is not limited to this, and the configuration of each unit is as follows. Any structure having a similar function can be substituted. Moreover, other arbitrary structures and processes may be added to the present invention.
なお、上記の処理機能は、コンピュータによって実現することができる。その場合、プログラム自動生成装置100が有すべき機能の処理内容を記述したプログラムが提供される。そのプログラムをコンピュータで実行することにより、上記処理機能がコンピュータ上で実現される。処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体に記録しておくことができる。コンピュータで読み取り可能な記録媒体としては、例えば、磁気記録装置、光ディスク、光磁気記録媒体、半導体メモリなどが挙げられる。磁気記録装置としては、例えば、ハードディスク装置(HDD)、フレキシブルディスク(FD)、磁気テープなどが挙げられる。光ディスクとしては、例えば、DVD(Digital Versatile Disc)、DVD−RAM、CD−ROM(Compact Disc Read Only Memory)、CD−R(Recordable)/RW(Rewritable)などが挙げられる。光磁気記録媒体としては、例えば、MO(Magneto-Optical disk)などが挙げられる。 The above processing functions can be realized by a computer. In that case, a program describing the processing contents of the functions that the automatic program generation device 100 should have is provided. By executing the program on a computer, the above processing functions are realized on the computer. The program describing the processing contents can be recorded on a computer-readable recording medium. Examples of the computer-readable recording medium include a magnetic recording device, an optical disk, a magneto-optical recording medium, and a semiconductor memory. Examples of the magnetic recording device include a hard disk device (HDD), a flexible disk (FD), and a magnetic tape. Examples of the optical disc include a DVD (Digital Versatile Disc), a DVD-RAM, a CD-ROM (Compact Disc Read Only Memory), and a CD-R (Recordable) / RW (Rewritable). Examples of the magneto-optical recording medium include an MO (Magneto-Optical disk).
プログラムを流通させる場合には、例えば、そのプログラムが記録されたDVD、CD−ROMなどの可搬型記録媒体が販売される。また、プログラムをサーバコンピュータの記憶装置に格納しておき、ネットワークを介して、サーバコンピュータから他のコンピュータにそのプログラムを転送することもできる。 When distributing the program, for example, portable recording media such as a DVD and a CD-ROM on which the program is recorded are sold. It is also possible to store the program in a storage device of a server computer and transfer the program from the server computer to another computer via a network.
プログラム自動生成装置を実行するコンピュータは、例えば、可搬型記録媒体に記録されたプログラムもしくはサーバコンピュータから転送されたプログラムを、自己の記録装置に格納する。そして、コンピュータは、自己の記録装置からプログラムを読み取り、プログラムに従った処理を実行する。なお、コンピュータは、可搬型記録媒体から直接プログラムを読み取り、そのプログラムに従った処理を実行することもできる。また、コンピュータは、サーバコンピュータからプログラムが転送されるごとに、逐次、受け取ったプログラムに従った処理を実行することもできる。 A computer that executes an automatic program generation device stores, for example, a program recorded on a portable recording medium or a program transferred from a server computer in its own recording device. Then, the computer reads the program from its own recording device and executes processing according to the program. The computer can also read the program directly from the portable recording medium and execute processing according to the program. Further, each time the program is transferred from the server computer, the computer can sequentially execute processing according to the received program.
2 入力装置
3 実装コード
10 プログラム自動生成装置
11 機能ブロックライブラリ記憶手段
12 データフロー図記憶手段
12a データフロー図
13 データフロー図作成手段
13a 論理ブロック作成手段
13b 切り替えブロック領域作成手段
13c ブロック列作成手段
13d ブロック接続手段
14 実装コード生成手段
2 input device 3
Claims (8)
ユーザによる操作入力を受け付け、前記機能ブロックの一種であり、入力値に応じて真偽の値を返す関数に対応する論理ブロックを作成する論理ブロック作成手段と、前記操作入力を受け付け、複数の前記機能ブロックが接続されたブロック列を作成するブロック列作成手段と、前記操作入力を受け付け、前記ブロック列を囲む切り替えブロック領域を作成する切り替えブロック領域作成手段と、前記操作入力を受け付け、前記切り替えブロック領域に前記論理ブロックが接続された前記データフロー図を作成するブロック接続手段と、を有するデータフロー図作成手段と、
作成された前記データフロー図を保持するデータフロー図記憶手段と、
前記データフロー図記憶手段に保持された前記データフロー図の前記論理ブロックに対応する前記関数に対して入力値を入力させるコードと、前記論理ブロックに対応する前記関数が返す出力値を判断し、実行時に前記出力値が真と判断されると、前記論理ブロックに接続された前記切り替えブロック領域内の前記ブロック列に対応する処理を実行させるコードと、前記切り替えブロック領域内の前記ブロック列を構成する前記機能ブロックに対応する関数の実行を指示するコードと、により構成される前記実装コードを生成する実装コード生成手段と、
を有することを特徴とするプログラム自動生成装置。 In an automatic program generation device that generates an implementation code from a data flow diagram describing a functional block representing data processing by a program and a data transfer relationship between the functional blocks,
Accepts an operation input by a user, is a kind of the functional block, and creates a logic block corresponding to a function that returns a true / false value according to an input value, and accepts the operation input, Block sequence creating means for creating a block sequence to which functional blocks are connected, switching block area creating means for accepting the operation input and creating a switching block area surrounding the block sequence, accepting the operation input, and the switching block Block connection means for creating the data flow diagram in which the logical block is connected to an area; and data flow diagram creation means having
Data flow diagram storage means for holding the created data flow diagram;
A code for inputting an input value to the function corresponding to the logical block of the data flow diagram held in the data flow diagram storage means, and an output value returned by the function corresponding to the logical block; If the output value is determined to be true at the time of execution, a code for executing processing corresponding to the block sequence in the switching block area connected to the logical block, and the block sequence in the switching block area are configured. Implementation code generation means for generating the implementation code composed of code for instructing execution of a function corresponding to the functional block
A program automatic generation apparatus characterized by comprising:
論理ブロック作成手段が、ユーザによる操作入力を受け付け、前記機能ブロックの一種であり、入力値に応じて真偽の値を返す関数に対応する論理ブロックを作成し、
ブロック列作成手段が、前記操作入力を受け付け、複数の前記機能ブロックが接続されたブロック列を作成して、
切り替えブロック領域作成手段が、前記操作入力を受け付け、前記ブロック列を囲む切り替えブロック領域を作成して、
ブロック接続手段が、前記操作入力を受け付け、前記切り替えブロック領域に前記論理ブロックが接続された前記データフロー図を作成して、
実装コード生成手段が、前記データフロー図の前記論理ブロックに対応する前記関数に対して入力値を入力させるコードと、前記論理ブロックに対応する前記関数が返す出力値を判断し、実行時に前記出力値が真と判断されると、前記論理ブロックに接続された前記切り替えブロック領域内の前記ブロック列に対応する処理を実行させるコードと、前記切り替えブロック領域内の前記ブロック列を構成する前記機能ブロックに対応する関数の実行を指示するコードと、により構成される前記実装コードを生成する、
ことを特徴とするプログラム自動生成方法。 In a program automatic generation method for generating an implementation code from a data flow diagram describing a functional block representing data processing by a program and a data transfer relationship of the functional block,
The logical block creation means accepts an operation input by the user, is a kind of the functional block, creates a logical block corresponding to a function that returns a true / false value according to the input value,
Block sequence creating means accepts the operation input, creates a block sequence to which a plurality of the functional blocks are connected,
The switching block area creating means receives the operation input, creates a switching block area surrounding the block row,
Block connection means accepts the operation input, creates the data flow diagram in which the logical block is connected to the switching block area,
The implementation code generation means determines a code for inputting an input value to the function corresponding to the logical block in the data flow diagram, and an output value returned by the function corresponding to the logical block, and the output at the time of execution. When the value is determined to be true, a code for executing processing corresponding to the block sequence in the switching block area connected to the logical block, and the functional block constituting the block sequence in the switching block area Generating the implementation code composed of code for instructing execution of a function corresponding to
A method for automatically generating a program.
コンピュータを、
ユーザによる操作入力を受け付け、前記機能ブロックの一種であり、入力値に応じて真偽の値を返す関数に対応する論理ブロックを作成する論理ブロック作成手段と、前記操作入力を受け付け、複数の前記機能ブロックが接続されたブロック列を作成するブロック列作成手段と、前記操作入力を受け付け、前記ブロック列を囲む切り替えブロック領域を作成する切り替えブロック領域作成手段と、前記操作入力を受け付け、前記切り替えブロック領域に前記論理ブロックが接続された前記データフロー図を作成するブロック接続手段と、を有するデータフロー図作成手段、
作成された前記データフロー図を保持するデータフロー図記憶手段、
前記データフロー図記憶手段に保持された前記データフロー図の前記論理ブロックに対応する前記関数に対して入力値を入力させるコードと、前記論理ブロックに対応する前記関数が返す出力値を判断し、実行時に前記出力値が真と判断されると、前記論理ブロックに接続された前記切り替えブロック領域内の前記ブロック列に対応する処理を実行させるコードと、前記切り替えブロック領域内の前記ブロック列を構成する前記機能ブロックに対応する関数の実行を指示するコードと、により構成される前記実装コードを生成する実装コード生成手段、
として機能させることを特徴とするプログラム自動生成プログラム。 In an automatic program generation program for generating an implementation code from a data flow diagram describing a functional block representing data processing by a program and a data transfer relationship between the functional blocks,
Computer
Accepts an operation input by a user, is a kind of the functional block, and creates a logic block corresponding to a function that returns a true / false value according to an input value, and accepts the operation input, Block sequence creating means for creating a block sequence to which functional blocks are connected, switching block area creating means for accepting the operation input and creating a switching block area surrounding the block sequence, accepting the operation input, and the switching block Block connection means for creating the data flow diagram in which the logical block is connected to an area; and a data flow diagram creation means having
Data flow diagram storage means for holding the created data flow diagram;
A code for inputting an input value to the function corresponding to the logical block of the data flow diagram held in the data flow diagram storage means, and an output value returned by the function corresponding to the logical block; If the output value is determined to be true at the time of execution, a code for executing processing corresponding to the block sequence in the switching block area connected to the logical block, and the block sequence in the switching block area are configured. Implementation code generation means for generating the implementation code composed of code for instructing execution of a function corresponding to the functional block
An automatic program generation program characterized in that it functions as a program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006266436A JP2008084261A (en) | 2006-09-29 | 2006-09-29 | Program automatic generation device, program automatic generation method, and program automatic generation program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2006266436A JP2008084261A (en) | 2006-09-29 | 2006-09-29 | Program automatic generation device, program automatic generation method, and program automatic generation program |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2008084261A true JP2008084261A (en) | 2008-04-10 |
Family
ID=39355019
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2006266436A Pending JP2008084261A (en) | 2006-09-29 | 2006-09-29 | Program automatic generation device, program automatic generation method, and program automatic generation program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2008084261A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010198338A (en) * | 2009-02-25 | 2010-09-09 | Fuji Electric Systems Co Ltd | Apparatus and method for supporting development of software |
US9251554B2 (en) | 2012-12-26 | 2016-02-02 | Analog Devices, Inc. | Block-based signal processing |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0573283A (en) * | 1991-09-18 | 1993-03-26 | Kobe Nippon Denki Software Kk | Chart editor |
JPH07191840A (en) * | 1993-12-27 | 1995-07-28 | Mitsubishi Electric Corp | Automatic program generator |
JP2000353087A (en) * | 1999-06-10 | 2000-12-19 | Toshiba Corp | Computer system having operation scenario developing environment of high available system |
JP2002304295A (en) * | 2001-04-05 | 2002-10-18 | Linx Corp | Method for describing graphical algorithm of block diagram base for development of image processing application |
-
2006
- 2006-09-29 JP JP2006266436A patent/JP2008084261A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0573283A (en) * | 1991-09-18 | 1993-03-26 | Kobe Nippon Denki Software Kk | Chart editor |
JPH07191840A (en) * | 1993-12-27 | 1995-07-28 | Mitsubishi Electric Corp | Automatic program generator |
JP2000353087A (en) * | 1999-06-10 | 2000-12-19 | Toshiba Corp | Computer system having operation scenario developing environment of high available system |
JP2002304295A (en) * | 2001-04-05 | 2002-10-18 | Linx Corp | Method for describing graphical algorithm of block diagram base for development of image processing application |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010198338A (en) * | 2009-02-25 | 2010-09-09 | Fuji Electric Systems Co Ltd | Apparatus and method for supporting development of software |
US9251554B2 (en) | 2012-12-26 | 2016-02-02 | Analog Devices, Inc. | Block-based signal processing |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Basten et al. | QTL Cartographer, version 1.17 | |
CN110059009B (en) | Method and apparatus for testing code files | |
EP2434396A1 (en) | Automatic synchronous-to-asynchronous software application converter | |
US7958133B2 (en) | Application conversion of source data | |
JP4001286B2 (en) | Program maintenance support apparatus, program maintenance support method, and program | |
WO2009098739A1 (en) | Program optimization device and program optimization method | |
JP2007122747A (en) | Dialogue flow interpreter | |
JP5303795B2 (en) | Application analysis method, analysis system, and analysis program | |
JP2007304840A (en) | Compilation method, debugging method, compilation program, and debugging program | |
US20090125895A1 (en) | Re-Using Legacy Libraries in Software | |
US8196093B2 (en) | Apparatus and method for componentizing legacy system | |
JP5626333B2 (en) | Program creation support apparatus, program, and information system | |
JP2005182562A (en) | Compiling method and apparatus, and compiler | |
JP2008084261A (en) | Program automatic generation device, program automatic generation method, and program automatic generation program | |
Basten et al. | QTL Cartographer, version 1.17 | |
US8849650B2 (en) | System and method for automatically generating sentences of a language | |
US20100088656A1 (en) | Property checking system, property checking method, and computer-readable storage medium | |
JP4565585B2 (en) | Data processing apparatus, data processing method, and recording medium | |
WO2007116490A1 (en) | Source code generation program, source code generation method, and source code generation device | |
US7464368B2 (en) | Logical separation of code and content | |
US20100153935A1 (en) | Delayed insertion of safepoint-related code | |
US7689905B1 (en) | Containment of terminal application run-time data for viewing when disconnected from a host server | |
CN110737431B (en) | Software development method, development platform, terminal device and storage medium | |
JP5399601B2 (en) | Implementation code development system and implementation code development program | |
KR100846203B1 (en) | Method for generating mobile application and record media recorded program for realizing the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20090714 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20101109 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110107 |
|
A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20110208 |