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 PDF

Info

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
Application number
JP2006266436A
Other languages
Japanese (ja)
Inventor
Hirokazu Tokuda
寛和 徳田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Holdings Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Electric Holdings Ltd filed Critical Fuji Electric Holdings Ltd
Priority to JP2006266436A priority Critical patent/JP2008084261A/en
Publication of JP2008084261A publication Critical patent/JP2008084261A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a program automatic generation device capable of describing and generating a program with improved processing efficiency. <P>SOLUTION: A data flow chart creation means 13 having a logical block creation means 13a creating a logical block corresponding to a function returning true/false, a block column creation means 13c creating a block column to which a function block is connected, a switch block area creation means 13b creating a switch block area surrounding the function block, and a block connection means 13d creating a data flow chart in which the logical block is connected to the switch block area creates a data flow chart 12a. An implementation code generation means 14 generates an implementation code 3 constructed of a code for allowing input of an input value to the function corresponding to the logical block from the data flow chart 12a, a code for allowing execution of processing corresponding to the block column in the switch block area, and a code for instructing execution of the function corresponding to the function block constituting the block column. <P>COPYRIGHT: (C)2008,JPO&INPIT

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, Patent Documents 1, 2, 3, and 4). This automatic program generation reduces the human error of the developer and shortens the operation time. In addition, the developer does not need to describe and generate two graphics-based documents and text-based programs separately, which further improves the program development efficiency.

なお、図形ベースのドキュメントは、例えば、特許文献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 start block 510, 511, a normal block 520, 521, 522, 523, 524, a termination block 550, 551, a branch point 530, a holding block 540, 541, and a logic block 560. is described. The data input / output relationship between these functional blocks is described by arrow lines as shown in FIG.

開始ブロックは、処理の開始時に関数の外部から与えられた入力値を意味する。多くの場合、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 start block 510 and the start block 511) are given at the start of processing.

通常ブロックは、一定のまとまったデータ処理を意味する。それぞれの通常ブロックでは、矢印線にそって入力されるデータに基づいて、矢印線にそって出力されるデータが計算される。例えば、図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 normal block 520 in FIG. 14, data to be output to the normal block 521 is calculated based on the input value given in the start block 510.

終端ブロックは、処理の終了時に関数の外部へと出力される戻り値を意味する。多くの場合、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 holding block 540 or the logic block 560 described later is output as final return values (return values corresponding to the termination block 550 and the termination block 551). .

保持ブロックは、入力されたデータを保持するか、または保持しつつ、そのデータを計算して次のブロックへ出力するデータ処理を意味する。通常ブロックであれば、データが入力されると、一旦、そのデータはワーク領域などで保持される。その後、データが出力されると、そのワーク領域の役目が終わり、破棄される。しかし、例えば、図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 holding block 540 of FIG. 14 performs calculation while holding the data output from the normal block 522, and outputs the calculation result. By holding the data, it is possible to prepare for the case where the data needs to be held, such as referring to the data from outside the holding block.

論理ブロックは、入力されたデータに対して、真(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 start block 610, 650, 651, an end block 652, a normal block 620, 621, 622, and a logic block 660. is described. Further, in FIG. 15, a switching block 690 is connected as a switching element. Further, the data input / output relationship between these functional blocks is described by arrow lines as shown in FIG.

なお、切り替えブロックは、入力されたデータによって、出力を切り替えるデータ処理を意味する。例えば、図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 logical block 660 is true, it is regarded as an output from the normal block 620 to the normal block 622 via the switching block 690. On the other hand, when the signal from the function corresponding to the logical block 660 is false, it is regarded as an output from the normal block 621 to the normal block 622 via the switching block 690.

図14,15ようにブロックを用いたデータフロー図は様々な表記を記述することができるため、データの受け渡しによって進行する処理の記述に適している。
特開平8−55019号公報 特開平8−106380号公報 特開平2−235144号公報 特開平5−88869号公報
As shown in FIGS. 14 and 15, the data flow diagram using blocks can describe various notations, and is suitable for describing processes that proceed by data transfer.
JP-A-8-55019 JP-A-8-106380 JP-A-2-235144 Japanese Patent Laid-Open No. 5-88869

ところが、図形ベースのドキュメントからテキストベースのプログラムへの自動生成には以下のような問題点があった。
データフロー図で表記される内容は、処理を伴うために、処理時間を必要とする。例えば、図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 start block 610 of FIG. 15 is input to logic block 660 to determine whether it is true or false. If true, the data is output from the normal block 620 to the normal block 622 side. However, on the other hand, calculation of data processing on the normal block 621 side is performed. As a result, the calculation of data processing from the normal block 621 side is discarded. Thus, since the switching block 690 performs processing, there is a problem that unnecessary processing is performed and extra time is required.

さらに、このような場合には、ブロックにそのブロックを呼び出すかどうかのデータを入力して、実行の制御を行っていた場合があった。しかし、このような制御の方法では、処理の内容が隠れてしまうため、プログラムの自動生成が適切に行われないという問題があった。   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 program generation device 10 shown in FIG. 1, a data flow diagram 12a is created via the input device 2, and a program implementation code 3 is generated from the created data flow diagram 12a.

プログラム自動生成装置10は、機能ブロックライブラリ記憶手段11、データフロー図記憶手段12、データフロー図作成手段13および実装コード生成手段14を有する。
機能ブロックライブラリ記憶手段11は、データフロー図を構成する機能ブロックに対応した関数が格納されている。機能ブロックには、開始ブロック、通常ブロック、終端ブロック、保持ブロックおよび論理ブロックなどがある。開始ブロックとは、最初に与えられる入力値に対応する機能ブロックである。通常ブロックとは、データが入力されて処理を行ってデータを出力する機能ブロックである。終端ブロックとは、通常ブロックなどによってブロック図の最後に出力される値に対応する機能ブロックである。保持ブロックとは、入力値が計算されて出力されても、入力された値が保持される機能ブロックである。論理ブロックとは、入力された値に対し、出力の値は真(TRUE)または偽(FALSE)の2つの値のどちらかしか取れない機能ブロックである。また、プログラム自動生成装置10において、機能ブロックライブラリ記憶手段11を用いなくても、実装コードを作成することができる。その場合、機能ブロックに対応する関数の実行を支持するコードのみが生成されているために、ユーザによって適宜、関数の作成が必要となる。
The automatic program generation apparatus 10 includes a function block library storage unit 11, a data flow diagram storage unit 12, a data flow diagram creation unit 13, and an implementation code generation unit 14.
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 program generation device 10, the implementation code can be created without using the functional block library storage unit 11. In that case, since only the code that supports the execution of the function corresponding to the functional block is generated, it is necessary for the user to appropriately create the function.

データフロー図記憶手段12は、データフロー図作成手段13により作成されたデータフロー図12aが格納される。なお、このデータフロー図12aは、機能ブロックと機能ブロック間のデータの受け渡し関係とが記述されている。機能ブロックはプログラムによる一定のまとまったデータ処理を表す。   The data flow diagram storage unit 12 stores the data flow diagram 12 a created by the data flow diagram creation unit 13. The data flow diagram 12a describes the functional blocks and the data transfer relationship between the functional blocks. A function block represents a certain set of data processing by a program.

データフロー図作成手段13は、論理ブロック作成手段13a、切り替えブロック領域作成手段13b、ブロック列作成手段13cおよびブロック接続手段13dを有する。
論理ブロック作成手段13aでは、論理ブロックが作成される。
The data flow diagram creating unit 13 includes a logical block creating unit 13a, a switching block area creating unit 13b, a block string creating unit 13c, and a block connecting unit 13d.
The logical block creating means 13a creates a logical block.

切り替えブロック領域作成手段13bでは、切り替えブロック領域が作成される。切り替えブロック領域によって、後に形成されるブロック列のうちの任意の機能ブロックが囲まれることになる。複数の機能ブロックを囲む切り替えブロック領域は、論理ブロックによって判定された結果によって、切り替えブロック領域の中の機能ブロックによる処理が行われるか否かが決まる。   The switching block area creating means 13b creates a switching block area. An arbitrary functional block in a block string to be formed later is surrounded by the switching block area. In the switching block area surrounding a plurality of functional blocks, whether or not processing by the functional blocks in the switching block area is performed is determined based on the result determined by the logical block.

ブロック列作成手段13cでは、複数のブロックが接続されたブロック列が作成される。
ブロック接続手段13dでは、ブロック列作成手段13cによって作成されたブロック列が中に配置された、切り替えブロック領域作成手段13bによって作成された切り替えブロック領域に対して、論理ブロック作成手段13aによって作成された論理ブロックを接続させることによって、データフロー図が作成される。
The block sequence creating means 13c creates a block sequence in which a plurality of blocks are connected.
In the block connection unit 13d, the block block created by the block row creation unit 13c is created by the logical block creation unit 13a with respect to the switching block area created by the switching block region creation unit 13b. A data flow diagram is created by connecting logic blocks.

以上により、データフロー図12aがデータフロー図作成手段13によって作成される。
実装コード生成手段14では、必要に応じて、機能ブロックライブラリ記憶手段11を参照して、データフロー図12aからプログラムの自動生成が行われて実装コード3が生成される。
Thus, the data flow diagram 12a is created by the data flow diagram creation means 13.
The implementation code generation unit 14 refers to the function block library storage unit 11 as necessary, and automatically generates a program from the data flow diagram 12a to generate the implementation code 3.

このプログラム自動生成装置10では、データフロー図作成手段13により、切り替え処理を行う機能ブロックが接続されたデータフロー図について、従来表示されなかった切り替えの処理の内容が表示されたデータフロー図を作成することができる。   In this automatic program generation device 10, the data flow diagram creating means 13 creates a data flow diagram in which the contents of the switching process not conventionally displayed are displayed for the data flow diagram to which the functional block for performing the switching process is connected. can do.

これにより、実装コード生成手段14において、切り替えの処理内容が表示されたデータフロー図12aからプログラムの自動生成を行うことができる。さらに、切り替え処理の内容が表示されるようになったために、データフロー図作成の際に、処理効率の良いプログラムを記述することができる。   As a result, the implementation code generation unit 14 can automatically generate a program from the data flow diagram 12a on which the switching processing content is displayed. Furthermore, since the contents of the switching process are displayed, a program with high processing efficiency can be described when creating a data flow diagram.

以下に、本発明を利用した実施の形態について、図面を参照して説明する。
本実施の形態は、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 graphic processing device 104, and an input interface 105 are connected to the CPU 101 via a bus 106.

RAM102には、CPU101に実行させるOS(Operating System)プログラムやアプリケーションプログラムの少なくとも一部が一時的に格納される。また、RAM102には、CPU101による処理に必要な各種データが格納される。HDD103には、OSプログラムやアプリケーションプログラムが格納される。   The RAM 102 temporarily stores at least part of an OS (Operating System) program and application programs to be executed by the CPU 101. The RAM 102 stores various data necessary for processing by the CPU 101. The HDD 103 stores an OS program and application programs.

グラフィック処理装置104には、モニタ21が接続されている。グラフィック処理装置104は、CPU101からの命令に従って、画像をモニタ21の画面に表示させる。入力インタフェース105には、キーボード22とマウス23とが接続されている。入力インタフェース105は、キーボード22やマウス23から送られてくる信号を、バス106を介してCPU101に送信する。   A monitor 21 is connected to the graphic processing device 104. The graphic processing device 104 displays an image on the screen of the monitor 21 in accordance with a command from the CPU 101. A keyboard 22 and a mouse 23 are connected to the input interface 105. The input interface 105 transmits a signal sent from the keyboard 22 or the mouse 23 to the CPU 101 via the bus 106.

以上のようなハードウェア構成によって、本実施の形態の処理機能を実現することができる。
次に、プログラム自動生成装置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 library storage unit 110, a data flow diagram storage unit 120, a source file storage unit 130, a data flow diagram creation unit 140, and a source code generation unit 150.

機能ブロックライブラリ記憶部110は、データフロー図を構成する通常ブロック、保持ブロックおよび論理ブロックの各種ブロックに対応する関数が格納されている。
データフロー図記憶部120は、ブロック列作成部143によって作成されるブロック列、切り替えブロック領域作成部142によって作成される切り替えブロック領域および論理ブロック作成部141によって作成される論理ブロックから、ブロック接続部144によって作成されるデータフロー図を格納する。
The function block library storage unit 110 stores functions corresponding to various blocks of a normal block, a holding block, and a logical block constituting the data flow diagram.
The data flow diagram storage unit 120 includes a block connection unit from a block sequence created by the block sequence creation unit 143, a switching block area created by the switching block region creation unit 142, and a logical block created by the logical block creation unit 141. The data flow diagram created by 144 is stored.

ソースファイル記憶部130は、データフロー図からプログラムの自動生成が行われて生成された実装コードが格納される。
データフロー図作成部140は、論理ブロック作成部141、切り替えブロック領域作成部142、ブロック列作成部143およびブロック接続部144により構成される。なお、これらは、モニタ21を介して、キーボード22およびマウス23を通じて、ユーザからの入力を受け付けることができる。
The source file storage unit 130 stores the implementation code generated by automatically generating the program from the data flow diagram.
The data flow diagram creation unit 140 includes a logical block creation unit 141, a switching block area creation unit 142, a block string creation unit 143, and a block connection unit 144. Note that these can accept input from the user via the monitor 21 and the keyboard 22 and the mouse 23.

論理ブロック作成部141は、ユーザの操作入力を受け付け、機能ブロックライブラリ記憶部110に格納されている論理ブロックに対応する関数を参照し、そして、論理ブロックを作成する。   The logical block creation unit 141 receives a user operation input, refers to a function corresponding to the logical block stored in the functional block library storage unit 110, and creates a logical block.

切り替えブロック領域作成部142は、ユーザの操作入力を受け付け、切り替えブロック領域を作成する。ブロック列作成部143にて作成されるブロック列の全て、もしくは一部の機能ブロックが、切り替えブロック領域作成部142にて作成された切り替えブロック領域に囲まれる。複数の機能ブロックが中に配置された切り替えブロック領域は、論理ブロックと接続され、論理ブロックに対応する関数から返される真の時のみ、切り替えブロック領域の中の機能ブロックによる処理が行われる。   The switching block area creation unit 142 receives a user operation input and creates a switching block area. All or some of the block strings created by the block string creating unit 143 are surrounded by the switching block area created by the switching block area creating unit 142. A switching block area in which a plurality of functional blocks are arranged is connected to a logical block, and processing by the functional block in the switching block area is performed only when it is returned from a function corresponding to the logical block.

ブロック列作成部143は、ユーザの操作入力を受け付け、機能ブロックライブラリ記憶部110に格納されてある各種ブロックに対応する関数を参照して、複数の機能ブロックを接続させてブロック列を作成する。   The block string creation unit 143 receives a user operation input, refers to functions corresponding to various blocks stored in the function block library storage unit 110, and creates a block string by connecting a plurality of function blocks.

ブロック接続部144は、ブロック列作成部143によって作成されたブロック列が中に配置された、切り替えブロック領域作成部142によって作成された切り替えブロック領域に対して、論理ブロック作成部141によって作成された論理ブロックを接続させることによって、データフロー図が作成される。   The block connection unit 144 is created by the logical block creation unit 141 for the switching block area created by the switching block area creation unit 142 in which the block sequence created by the block sequence creation unit 143 is placed. A data flow diagram is created by connecting logic blocks.

ソースコード生成部150は、データフロー図記憶部120に格納されているデータフロー図から、機能ブロックライブラリ記憶部110に格納されてある各種ブロックに対応する関数を参照して、プログラムの自動生成が行われる。   The source code generation unit 150 refers to the functions corresponding to various blocks stored in the functional block library storage unit 110 from the data flow diagram stored in the data flow diagram storage unit 120, and automatically generates a program. Done.

次に、プログラム自動生成装置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 code generation unit 150 from the data flow diagram created by the data flow diagram creation unit 140 will be described with reference to FIG.

[ステップS11]ソースコード生成部150は、選択した機能ブロックに対応するソースファイル記憶領域を確保する。
[ステップS12]ソースコード生成部150は、データフロー図記憶部120から受け取ったデータフロー図のうち、開始ブロックから近い順に、未選択の機能ブロックを1つ選択する。
[Step S11] The source code generation unit 150 secures a source file storage area corresponding to the selected functional block.
[Step S12] The source code generation unit 150 selects one unselected functional block from the data flow diagram received from the data flow diagram storage unit 120 in order from the start block.

[ステップS13]ソースコード生成部150は、ステップS12にて選択したブロックが通常ブロックであるか判断する。通常ブロックである場合はステップS14へ進められ、違う場合はステップS15へ進められる。   [Step S13] The source code generation unit 150 determines whether the block selected in Step S12 is a normal block. If it is a normal block, the process proceeds to step S14; otherwise, the process proceeds to step S15.

[ステップS14]ソースコード生成部150は、ステップS13で選択した通常ブロックに対応する関数を機能ブロックライブラリ記憶部110から選択し、通常ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。   [Step S14] The source code generation unit 150 selects a function corresponding to the normal block selected in Step S13 from the function block library storage unit 110, creates a function call statement corresponding to the normal block, and secures it in Step S11. Append to the source file storage area.

[ステップS15]ソースコード生成部150は、ステップS12にて選択したブロックが保持ブロックであるか判断する。保持ブロックである場合はステップS16へ進められ、違う場合はステップS17へ進められる。   [Step S15] The source code generation unit 150 determines whether the block selected in step S12 is a holding block. If it is a holding block, the process proceeds to step S16; otherwise, the process proceeds to step S17.

[ステップS16]ソースコード生成部150は、ステップS15で選択した保持ブロックに対応する関数を機能ブロックライブラリ記憶部110から選択し、保持ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。   [Step S16] The source code generation unit 150 selects a function corresponding to the holding block selected in Step S15 from the functional block library storage unit 110, creates a function call statement corresponding to the holding block, and secures it in Step S11. Append to the source file storage area.

[ステップS17]ソースコード生成部150は、ステップS12にて選択したブロックが論理ブロックであるか判断する。論理ブロックである場合はステップS18へ進められ、違う場合はステップS29へ進められる。   [Step S17] The source code generation unit 150 determines whether the block selected in Step S12 is a logical block. If it is a logical block, the process proceeds to step S18; otherwise, the process proceeds to step S29.

[ステップS18]ソースコード生成部150は、ステップS17で選択した論理ブロックに対応する関数を機能ブロックライブラリ記憶部110から選択し、論理ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。   [Step S18] The source code generation unit 150 selects a function corresponding to the logical block selected in Step S17 from the functional block library storage unit 110, creates a function call statement corresponding to the logical block, and secures it in Step S11. Append to the source file storage area.

[ステップS19]ソースコード生成部150は、論理ブロックの次に、切り替えブロック領域の有無を判断する。切り替えブロック領域がある場合は、ステップS20へ進められ、無い場合は、ステップS23へ進められる。   [Step S19] The source code generation unit 150 determines whether there is a switching block area next to the logical block. If there is a switching block area, the process proceeds to step S20; otherwise, the process proceeds to step S23.

[ステップS20]ソースコード生成部150は、ステップS19で切り替えブロック領域があると判断すると、切り替えブロック領域内に、通常ブロックを選択する。
[ステップS21]ソースコード生成部150は、ステップS20で通常ブロックを選択すると、それに対応する関数を機能ブロックライブラリ記憶部110から選択し、通常ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。
[Step S20] When the source code generation unit 150 determines in step S19 that there is a switching block area, it selects a normal block in the switching block area.
[Step S21] When the source code generation unit 150 selects a normal block in step S20, the source code generation unit 150 selects a corresponding function from the function block library storage unit 110, creates a function call statement corresponding to the normal block, and in step S11. Append to the secured source file storage area.

[ステップS22]ソースコード生成部150は、ステップS20で選択した通常ブロックの次にさらにブロックがあるか判断する。次にブロックがある場合は、ステップS21へ進められ、無い場合は、ステップS23へ進められる。なお、次にブロックが無い場合は、切り替えブロック領域内の処理が終了し、切り替えブロック領域の外に続くブロックの処理となる。   [Step S22] The source code generation unit 150 determines whether there is another block after the normal block selected in Step S20. Next, when there is a block, the process proceeds to step S21, and when there is no block, the process proceeds to step S23. If there is no next block, the process in the switching block area is completed, and the process continues for the block that is outside the switching block area.

[ステップS23]ソースコード生成部150は、切り替えブロック領域の外にあるブロックが通常ブロックであるか判断する。通常ブロックである場合は、ステップS24へ進められ、違う場合は、ステップS25へ進められる。   [Step S23] The source code generation unit 150 determines whether a block outside the switching block area is a normal block. If it is a normal block, the process proceeds to step S24, and if not, the process proceeds to step S25.

[ステップS24]ソースコード生成部150は、ステップS23で選択した通常ブロックに対応する関数を機能ブロックライブラリ記憶部110から選択し、通常ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。   [Step S24] The source code generation unit 150 selects a function corresponding to the normal block selected in Step S23 from the function block library storage unit 110, creates a function call statement corresponding to the normal block, and secures it in Step S11. Append to the source file storage area.

[ステップS25]ソースコード生成部150は、切り替えブロック領域の外にあるブロックが保持ブロックであるか判断する。保持ブロックである場合は、ステップS26へ進められ、違う場合は、ステップS27へ進められる。   [Step S25] The source code generation unit 150 determines whether a block outside the switching block area is a holding block. If it is a holding block, the process proceeds to step S26, and if not, the process proceeds to step S27.

[ステップS26]ソースコード生成部150は、ステップS25で選択した保持ブロックに対応する関数を機能ブロックライブラリ記憶部110から選択し、保持ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。   [Step S26] The source code generation unit 150 selects a function corresponding to the holding block selected in Step S25 from the functional block library storage unit 110, creates a function call statement corresponding to the holding block, and secures it in Step S11. Append to the source file storage area.

[ステップS27]ソースコード生成部150は、切り替えブロック領域の外にあるブロックが論理ブロックであるか判断する。論理ブロックである場合は、ステップS28へ進められ、違う場合は、ステップS29へ進められる。   [Step S27] The source code generation unit 150 determines whether a block outside the switching block area is a logical block. If it is a logical block, the process proceeds to step S28; otherwise, the process proceeds to step S29.

[ステップS28]ソースコード生成部150は、ステップS27で選択した論理ブロックに対応する関数を機能ブロックライブラリ記憶部110から選択し、論理ブロックに対応する関数呼び出し文を作成し、ステップS11で確保したソースファイル記憶領域に追記する。   [Step S28] The source code generation unit 150 selects a function corresponding to the logical block selected in Step S27 from the functional block library storage unit 110, creates a function call statement corresponding to the logical block, and secures it in Step S11. Append to the source file storage area.

[ステップS29]ソースコード生成部150は、データフロー図のうち、ステップS12で未選択のブロックがあるか判断する。未選択のブロックがある場合は、処理がステップS12へ進められ、未選択のブロックが無い場合は、処理がステップS30へ進められる。   [Step S29] The source code generation unit 150 determines whether there is an unselected block in step S12 in the data flow diagram. If there is an unselected block, the process proceeds to step S12. If there is no unselected block, the process proceeds to step S30.

[ステップS30]ソースコード生成部150は、ステップS11で確保したコード記憶領域にある実装コードをファイルに出力し、ソースファイル記憶部130に記憶して、処理がソースコード生成処理を終了する。   [Step S30] The source code generation unit 150 outputs the implementation code in the code storage area secured in step S11 to a file, stores it in the source file storage unit 130, and the process ends the source code generation process.

このようにして、ソースコード生成部150は、データフロー図のブロックごとにソースファイルに出力し、ソースファイル記憶部130に格納する。
このようなプログラム自動生成装置100による、プログラム化されるデータフロー図について、以下に具体例として、データフロー図を挙げて説明する。
In this way, the source code generation unit 150 outputs each block of the data flow diagram to the source file and stores it in the source file storage unit 130.
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 start block 121a, a logical block 121b, normal blocks 121d, 121e, and 121f, an end block 121g, and a switching block area 121aa surrounding them.

なお、データフロー図121は、開始ブロック121aに対応する入力値が、論理ブロック121bに入力する。論理ブロック121bに対応する関数は、入力値に応じて、真または偽の値を返す。そして、真の時は、切り替えブロック領域121aa内の通常ブロック121d,121e,121fに対応する関数が順に処理を行って、終端ブロック121gに対応する出力値を出力する。   In the data flow diagram 121, an input value corresponding to the start block 121a is input to the logical block 121b. The function corresponding to the logic block 121b returns a true or false value depending on the input value. When true, the functions corresponding to the normal blocks 121d, 121e, and 121f in the switching block area 121aa sequentially process, and output an output value corresponding to the terminal block 121g.

図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 file storage unit 130.
The argument of the function declaration statement 131a corresponds to the start block 121a of the data flow diagram 121 of FIG. 5 and the function call statement 131b corresponds to the logical block 121b of the data flow diagram 121 of FIG. in_1 "is given to the function to obtain the output data" out_f ".

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 statement 131c corresponds to the switching block 121aa in the data flow diagram 121 in FIG. When the output data “out_f” is true, this corresponds to the processing sequentially performed in the normal blocks 121d, 121e, and 121f in the switching block area 121aa in the data flow diagram 121 in FIG. The output data “out_a” is output (131d), the output data “out_b” is output (131e) for the input data “out_a”, and the output data “out_c” is acquired for the input data “out_b” ( 131f).

なお、関数131g,131h,131i,131jは、関数呼び出し文131b,131d,131e,131fで呼び出される関数である。
なお、図5では、切り替えブロック領域121aaに直接、論理ブロック121bの出力が接続されているが、その間に通常ブロックが挿入されても切り替えブロック121aaなどの意味は同等である。
The functions 131g, 131h, 131i, and 131j are functions that are called by the function call statements 131b, 131d, 131e, and 131f.
In FIG. 5, the output of the logical block 121b is directly connected to the switching block area 121aa, but the meaning of the switching block 121aa and the like is equivalent even if a normal block is inserted therebetween.

次に第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 start block 122a, a logical block 122b, normal blocks 122d, 122e, 122f, and 122g, and a switching block area 122aa surrounding them, a normal block 122h, and a termination block 122i.

なお、データフロー図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 start block 122a is input to the logic block 122b. The function corresponding to the logic block 122b returns a true or false value depending on the input value. When true, the functions corresponding to the normal blocks 122d, 122e, 122f, 122g in the switching block area 122aa perform processing in order. Then, processing is performed by inputting from the normal block 122g to the normal block 122h connected from outside the switching block area 122aa. Finally, an output value corresponding to the termination block 122i is output.

図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 file storage unit 130.
The argument of the function declaration statement 132a corresponds to the start block 122a of the data flow diagram 122 of FIG. 7 and the function call statement 132b corresponds to the logic block 122b of the data flow diagram 122 of FIG. in_1 "is given to the function to obtain the output data" out_f ".

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 statement 132c corresponds to the switching block 122aa in the data flow diagram 122 in FIG. When the output data “out_f” is true, this corresponds to the processing sequentially performed in the normal blocks 122d, 122e, 122f, and 122g in the switching block area 122aa in the data flow diagram 122 of FIG. The output data “out_a” is output (132d), the output data “out_b” is output (132e) with respect to the input data “out_a”, and the output data “out_c” is output with respect to the input data “out_b”. Output (132f) and output data “out_d” is obtained (132g) for input data “out_c”. On the other hand, when the output data “out_f” is false, the process is not performed in the switching block area 122aa of the data flow diagram 122 of FIG. 7, and thus the output data is set to “out_d = 0” (132h).

そして、関数呼び出し文132iは、図7のデータフロー図122の通常ブロック122hに対応するものであり、図7のデータフロー図122の切り替えブロック領域122aaからの出力データ“out_d”が入力されて、出力データ“out_g”が取得される。   The function call statement 132i corresponds to the normal block 122h in the data flow diagram 122 in FIG. 7, and the output data “out_d” from the switching block area 122aa in the data flow diagram 122 in FIG. Output data “out_g” is acquired.

なお、関数132j,132k,132l,132m,132n,132oは、関数呼び出し文132b,132d,132e,132f,132g,132iで呼び出される関数である。   The functions 132j, 132k, 132l, 132m, 132n, and 132o are functions that are called by the function call statements 132b, 132d, 132e, 132f, 132g, and 132i.

次に第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 start block 123a, a logical block 123b, normal blocks 123d, 123e, 123f, and 123g, a switching block area 123aa that surrounds them, a holding block 123h, and a termination block 123i.

なお、データフロー図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 start block 123a is input to the logical block 123b. The function corresponding to the logic block 123b returns a true or false value depending on the input value. When true, the functions corresponding to the normal blocks 123d, 123e, 123f, and 123g in the switching block area 123aa sequentially process. Then, processing is performed by inputting from the normal block 123g to the holding block 123h connected from outside the switching block area 123aa. Finally, an output value corresponding to the termination block 123i is output.

図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 file storage unit 130.
The function declaration statement 133a corresponds to the argument of the start block 123a in the data flow diagram 123 of FIG. 9, and the function call statement 133b corresponds to the logical block 123b of the data flow diagram 123 of FIG. in_1 "is given to the function to obtain the output data" out_f ".

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 statement 133c corresponds to the switching block 123aa in the data flow diagram 123 in FIG. When the output data “out_f” is true, this corresponds to the processing sequentially performed in the normal blocks 123d, 123e, 123f, and 123g in the switching block area 123aa in the data flow diagram 123 of FIG. The output data “out_a” is output (133d), the output data “out_b” is output (133e) with respect to the input data “out_a”, and the output data “out_c” is output with respect to the input data “out_b”. The output (133f) is output, and the output data “out_d” is acquired (133g) for the input data “out_c”. On the other hand, when the output data “out_f” is false, the processing is not performed in the switching block area 123aa of the data flow diagram 123 of FIG. 9, but the output data is set to “out_d = var_i” and the data is held. Has been.

そして、関数呼び出し文133iは、図9のデータフロー図123の保持ブロック123hに対応するものであり、図9のデータフロー図123の切り替えブロック領域123aaの出力データ“out_d”が入力されて、出力データ“var_i”が取得される。   The function call statement 133i corresponds to the holding block 123h in the data flow diagram 123 in FIG. 9, and the output data “out_d” of the switching block area 123aa in the data flow diagram 123 in FIG. 9 is input and output. Data “var_i” is acquired.

なお、関数133j,133k,133l,133m,133n,133oは、関数呼び出し文133b,133d,133e,133f,133g,133iで呼び出される関数である。   Note that the functions 133j, 133k, 133l, 133m, 133n, and 133o are functions called by the function call statements 133b, 133d, 133e, 133f, 133g, and 133i.

次に第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 start block 124a, a logical block 124b, normal blocks 124d, 124e, and 124f, a logical block 124g, and a switching block area 124aa that surrounds them, a normal block 124i, and a termination block 124j.

なお、データフロー図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 start block 124a is input to the logic block 124b. The function corresponding to the logic block 124b returns a true or false value depending on the input value. When true, the functions corresponding to the normal blocks 124d, 124e, and 124f and the logical block 124g in the switching block area 124aa sequentially process. When the function corresponding to the logical block 124g returns true, the logical block 124g is input to the normal block 124i connected from outside the switching block area 124aa and processed. Finally, an output value corresponding to the termination block 124j is output.

図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 file storage unit 130.
The argument of the function declaration statement 134a corresponds to the start block 124a and the function call statement 134b of the data flow diagram 124 of FIG. 11 corresponding to the logical block 124b of the data flow diagram 124 of FIG. "Is given to the function to obtain the output data" out_f ".

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 statement 134c corresponds to the switching block 124aa in the data flow diagram 124 in FIG. When the output data “out_f” is true, this corresponds to the processing sequentially performed in the normal blocks 124d, 124e, 124f and the logical block 124g in the switching block area 124aa of the data flow diagram 124 of FIG. Output data “out_a” is output (134 d), output data “out_b” is output (134 e) to the input data “out_a”, and output data “out_c” is output to the input data “out_b”. "Is output (134f), and the output data" out_d "is obtained (134g) for the input data" out_c ". On the other hand, when the output data “out_f” is false, if “0” is set, a problem occurs in the output. Therefore, the output data is set to “out_d = false”.

そして、関数呼び出し文134iは、図11のデータフロー図124の通常ブロック124iに対応するものであり、図11のデータフロー図124の切り替えブロック領域124aaの出力データ“out_d”が入力されて、出力データ“out_j”が取得される。   The function call statement 134i corresponds to the normal block 124i in the data flow diagram 124 in FIG. 11, and the output data “out_d” of the switching block area 124aa in the data flow diagram 124 in FIG. 11 is input and output. Data “out_j” is acquired.

なお、関数134j,134k,134l,134m,134n,134oは、関数呼び出し文134b,134d,134e,134f,134g,134iで呼び出される関数である。   The functions 134j, 134k, 134l, 134m, 134n, and 134o are functions that are called by the function call statements 134b, 134d, 134e, 134f, 134g, and 134i.

次に第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 start block 125a, a logical block 125b, normal blocks 125d, 125e, 125f, and 125g, and a switching block area 125aa surrounding them, a normal block 125h, a holding block 125i, and end blocks 125j and 125k.

この図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.

本実施の形態の概念図である。It is a conceptual diagram of this Embodiment. プログラム自動生成装置のハードウェア構造を示す図である。It is a figure which shows the hardware structure of a program automatic generation apparatus. プログラム自動生成装置の機能を示すブロック図である。It is a block diagram which shows the function of a program automatic generation apparatus. 実装コード生成の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of mounting code generation. 第1の例のデータフロー図を示す図である。It is a figure which shows the data flow figure of a 1st example. 第1の例のデータフロー図から生成される実装コード例を示す図である。It is a figure which shows the example of the mounting code produced | generated from the data flow figure of a 1st example. 第2の例のデータフロー図を示す図である。It is a figure which shows the data flow figure of a 2nd example. 第2の例のデータフロー図から生成される実装コード例を示す図である。It is a figure which shows the example of the mounting code produced | generated from the data flow figure of a 2nd example. 第3の例のデータフロー図を示す図である。It is a figure which shows the data flow figure of a 3rd example. 第3の例のデータフロー図から生成される実装コード例を示す図である。It is a figure which shows the example of the mounting code produced | generated from the data flow figure of a 3rd example. 第4の例のデータフロー図を示す図である。It is a figure which shows the data flow figure of a 4th example. 第4の例のデータフロー図から生成される実装コード例を示す図である。It is a figure which shows the example of the mounting code produced | generated from the data flow figure of a 4th example. 第5の例のデータフロー図を示す図である。It is a figure which shows the data flow figure of a 5th example. 従来のデータフロー図の例を示す図である。It is a figure which shows the example of the conventional data flow figure. 従来のデータフロー図の別の例を示す図である。It is a figure which shows another example of the conventional data flow figure.

符号の説明Explanation of symbols

2 入力装置
3 実装コード
10 プログラム自動生成装置
11 機能ブロックライブラリ記憶手段
12 データフロー図記憶手段
12a データフロー図
13 データフロー図作成手段
13a 論理ブロック作成手段
13b 切り替えブロック領域作成手段
13c ブロック列作成手段
13d ブロック接続手段
14 実装コード生成手段
2 input device 3 implementation code 10 automatic program generation device 11 function block library storage means 12 data flow diagram storage means 12a data flow diagram 13 data flow diagram creation means 13a logical block creation means 13b switching block area creation means 13c block sequence creation means 13d Block connection means 14 Implementation code generation means

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:
前記実装コード生成手段は個々の前記機能ブロックに対応する前記関数が格納された機能ブロックライブラリ記憶手段をさらに有しており、前記機能ブロックライブラリ記憶手段に格納された前記関数を適用することで前記実装コードを生成することを特徴とする請求項1記載のプログラム自動生成装置。   The implementation code generation means further includes a function block library storage means in which the functions corresponding to the individual function blocks are stored, and by applying the function stored in the function block library storage means, 2. The automatic program generation apparatus according to claim 1, wherein the implementation code is generated. 前記データフロー図が、前記切り替えブロック領域内の前記ブロック列から、入力値を保持する関数に対応する保持ブロックに接続されている場合、前記実装コード生成手段は、前記出力値が偽の時のみ、前記保持ブロックに対応する前記関数は、入力の値を保持する実装コードを生成することを特徴とする請求項1記載のプログラム自動生成装置。   When the data flow diagram is connected to a holding block corresponding to a function that holds an input value from the block sequence in the switching block area, the implementation code generation means only when the output value is false 2. The automatic program generation apparatus according to claim 1, wherein the function corresponding to the holding block generates an implementation code that holds an input value. 前記データフロー図が、前記切り替えブロック領域内の前記ブロック列から、保持ブロック以外の前記機能ブロックが接続されている場合、前記実装コード生成手段は、前記出力値が偽の時のみ、前記保持ブロック以外の前記機能ブロックに対応する関数は、入力の値をゼロとする実装コードを生成することを特徴とする請求項1記載のプログラム自動生成装置。   When the functional block other than the holding block is connected from the block sequence in the switching block area in the data flow diagram, the implementation code generation means is configured so that the holding block is generated only when the output value is false. 2. The program automatic generation apparatus according to claim 1, wherein a function corresponding to the functional block other than the function block generates an implementation code in which an input value is zero. 前記データフロー図が、前記切り替えブロック領域内の前記論理ブロックと前記切り替えブロック領域外の通常ブロックとが接続されている場合、前記実装コード生成手段は、前記出力値が偽の時のみ、前記切り替えブロック領域内の前記論理ブロックに対応する関数からの出力値を偽とする実装コードを生成することを特徴とする請求項1記載のプログラム自動生成装置。   In the data flow diagram, when the logical block in the switching block area and the normal block outside the switching block area are connected, the implementation code generation means only performs the switching when the output value is false. 2. The automatic program generation apparatus according to claim 1, wherein an implementation code that generates an output value from a function corresponding to the logical block in a block area as false is generated. 前記データフロー図が、前記切り替えブロック領域から外へ分岐して接続されており、一方は、前記機能ブロックと接続されており、他方は保持ブロックと接続されている場合、前記実装コード生成手段は、異常を出力することを特徴とする請求項1記載のプログラム自動生成装置。   When the data flow diagram is branched and connected from the switching block area, one is connected to the functional block, and the other is connected to the holding block, the implementation code generation means 2. The automatic program generation apparatus according to claim 1, wherein an abnormality is output. プログラムによるデータ処理を表す機能ブロックと、前記機能ブロックのデータの受け渡し関係とを記述したデータフロー図から実装コードを生成するプログラム自動生成方法において、
論理ブロック作成手段が、ユーザによる操作入力を受け付け、前記機能ブロックの一種であり、入力値に応じて真偽の値を返す関数に対応する論理ブロックを作成し、
ブロック列作成手段が、前記操作入力を受け付け、複数の前記機能ブロックが接続されたブロック列を作成して、
切り替えブロック領域作成手段が、前記操作入力を受け付け、前記ブロック列を囲む切り替えブロック領域を作成して、
ブロック接続手段が、前記操作入力を受け付け、前記切り替えブロック領域に前記論理ブロックが接続された前記データフロー図を作成して、
実装コード生成手段が、前記データフロー図の前記論理ブロックに対応する前記関数に対して入力値を入力させるコードと、前記論理ブロックに対応する前記関数が返す出力値を判断し、実行時に前記出力値が真と判断されると、前記論理ブロックに接続された前記切り替えブロック領域内の前記ブロック列に対応する処理を実行させるコードと、前記切り替えブロック領域内の前記ブロック列を構成する前記機能ブロックに対応する関数の実行を指示するコードと、により構成される前記実装コードを生成する、
ことを特徴とするプログラム自動生成方法。
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.
JP2006266436A 2006-09-29 2006-09-29 Program automatic generation device, program automatic generation method, and program automatic generation program Pending JP2008084261A (en)

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)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
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