JP2012022425A - Device and method for automatically generating program and program - Google Patents

Device and method for automatically generating program and program Download PDF

Info

Publication number
JP2012022425A
JP2012022425A JP2010158495A JP2010158495A JP2012022425A JP 2012022425 A JP2012022425 A JP 2012022425A JP 2010158495 A JP2010158495 A JP 2010158495A JP 2010158495 A JP2010158495 A JP 2010158495A JP 2012022425 A JP2012022425 A JP 2012022425A
Authority
JP
Japan
Prior art keywords
code
previous value
information indicating
feedback loop
program
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
JP2010158495A
Other languages
Japanese (ja)
Inventor
Masatoshi Tsuyuki
正年 露木
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 Co 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 Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP2010158495A priority Critical patent/JP2012022425A/en
Publication of JP2012022425A publication Critical patent/JP2012022425A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a device and a method for automatically generating a program and a program insusceptible to restriction of resources and operating time in program development for built-in uses in which the restriction is tight.SOLUTION: A specification is described by a user using a control block diagram (S1). Next, connection information is extracted based on the control block diagram in which the specification is described (S2). Then, it is detected whether a feedback loop is contained in the connection information (S3). If a feedback loop is not contained in the connection information in the check, a control processing code in normal correspondence is automatically generated (S4). Or, if a feedback loop is contained, a control processing code in FB correspondence is automatically generated (S5-S7). If a control processing code is extracted for every piece of the connection information, this processing proceeds to a step S9, or otherwise this processing goes back to the step S3. The control processing code generated by FB correspondence control processing code generation processing and the normal correspondence control processing code are combined to be output (S9).

Description

本発明は、開発者や利用者などが作成した図形式の仕様に従ったプログラムソースコードを自動生成するプログラム自動生成装置、自動生成方法、および、プログラムに関する。   The present invention relates to an automatic program generation apparatus, an automatic generation method, and a program for automatically generating program source code in accordance with a diagram format specification created by a developer or a user.

従来、ブロック図の形式で記述されたプログラム仕様をもとにプログラムソースコードを自動生成する技術は、ビジュアルプログラミング技術として従来から一般的に制御分野などのプログラム開発で汎く利用されている。その中で、フィードバックループを含んだブロック図のコード生成に関しては、例えば下記特許文献1で、演算順序を決定する手法が提案されている。   Conventionally, a technique for automatically generating a program source code based on a program specification described in the form of a block diagram has been widely used as a visual programming technique in general in program development in the control field or the like. Among them, with regard to code generation of a block diagram including a feedback loop, for example, Patent Document 1 below proposes a method for determining an operation order.

図8は、制御ブロック図にフィードバックループが含まれている場合の従来の解決手法の一例を示す図である。図8においては、特許文献1に示されているように、自動生成対象の制御ブロック図にフィードバックループ(優先ブロックD)が含まれている場合、演算順序が正しく決定できない(開発者が望んだブロックの演算順A→B→D→Cが、A→D→B→Cと自動生成されてしまう)場合にブロック作成順序を図8の下右部に示すよう設定して、開発者の望むブロックの演算順序になるようにしている。   FIG. 8 is a diagram illustrating an example of a conventional solution when the control block diagram includes a feedback loop. In FIG. 8, as shown in Patent Document 1, when the feedback control block (priority block D) is included in the control block diagram to be automatically generated, the calculation order cannot be determined correctly (desired by the developer). When the block calculation order A → B → D → C is automatically generated as A → D → B → C), the block creation order is set as shown in the lower right part of FIG. The operation order of blocks is set.

この場合、特許文献1に示された従来の解決手法で正しい演算順序A→B→D→Cが決定されたとすると、生成されるプログラムのソースコードは、一般的な高級プログラミング言語、例えばC言語、を使って表記してみると、一般的には、図9に示されるようになる。   In this case, assuming that the correct calculation order A → B → D → C is determined by the conventional solution shown in Patent Document 1, the source code of the generated program is a general high-level programming language such as C language. In general, the notation is as shown in FIG.

特開2010−66847号公報JP 2010-66847 A

しかしながら、図9のコードが実際に実行されると、図9に下線で示している「Dの出力」は、演算D()が実行されて値が実際に確定する前に、演算B()の実行で「Dの出力」が参照されることになってしまう、という問題点がある。   However, when the code of FIG. 9 is actually executed, the “output of D” indicated by the underline in FIG. 9 indicates that the operation B () is executed before the operation D () is executed and the value is actually determined. There is a problem that "output of D" is referred to in execution of.

制御ブロック図で記述される制御演算は、通常一定周期で繰り返し実行されることで連続的な制御を実現するものなので、「Dの出力」が処理終了後も保持されるならば、演算B()で参照される「Dの出力」は1回前の処理実行時に演算D()で確定した値になるので、制御遅れはあるものの制御演算は成立する。しかし、そのためにはすべての演算出力はそれぞれ異なる記憶領域に格納されるようコードが生成される必要があり、そのために高速な一時記憶手段(CPUの汎用レジスタなど)が活用できなくなってしまうという問題があるので、メモリリソースおよび演算時間の制約の厳しい組込み用途のプログラム開発ではコストパフォーマンスから見てデメリットとなる。   Since the control operation described in the control block diagram is usually executed repeatedly at a constant cycle to realize continuous control, if "D output" is retained even after the processing ends, operation B ( The “D output” referred to in () is a value determined by the calculation D () at the time of the previous processing execution, so that the control calculation is established although there is a control delay. However, for this purpose, it is necessary to generate code so that all operation outputs are stored in different storage areas, which makes it impossible to use high-speed temporary storage means (such as CPU general-purpose registers). As a result, there are disadvantages in terms of cost performance when developing programs for embedded applications with severe constraints on memory resources and computation time.

そこで本発明は、リソースや演算時間の制約が厳しい組込み用途のプログラム開発において当該制約を受けにくいプログラム自動生成装置、自動生成方法、および、プログラムを提供することを目的とする。   SUMMARY OF THE INVENTION An object of the present invention is to provide an automatic program generation apparatus, an automatic generation method, and a program that are less susceptible to restrictions in the development of embedded applications that have severe resource and computation time restrictions.

上記課題を解決するために本発明は、変数入出力端子要素と演算子要素を線によって接続することで制御処理の流れを表現する制御ブロック図の形式でプログラムの仕様を記述する制御ブロック図仕様記述手段と、前記制御ブロック図の接続関係を示す情報をもとに制御ブロック図で表現されたプログラムの仕様を満たすコンパイル可能なソースコードを自動生成する制御処理コード自動生成手段を有するプログラム自動生成装置において、前記制御処理コード自動生成手段は、前記記述された制御ブロック図の接続関係を示す情報を出力側から入力側に探索して、該接続関係を示す情報に出力側の演算結果出力が入力側の演算の入力に直接接続されるフィードバックループが含まれているか否かを検出する接続情報抽出手段と、該接続情報抽出手段が前記接続関係を示す情報に前記フィードバックループが含まれていないことを検出した場合には、入力側から出力側に一方向に演算順序を設定して自動的に制御処理コードを生成する通常対応制御処理コード生成手段と、前記接続情報抽出手段が前記接続関係を示す情報に前記フィードバックループが含まれていることを検出した場合には、該検出した接続関係を示す情報に対して対応する前回値変数の定義コードを自動生成する前回値変数定義自動生成手段、該定義された前回値変数に対してフィードバックループの出力側の演算結果を前回値変数に代入するための保存コードを自動生成する前回値保存コード自動生成手段、および、前記フィードバックループの入力の一方に前回値変数の値を代入する前回値入力コードを自動生成する前回値入力コード自動生成手段を有するフィードバック対応制御処理コード生成手段と、前記フィードバック対応制御処理コード生成手段によって前記自動生成された前回値変数の定義コード、前回値保存コード及び前回値入力コード、並びに、前記通常対応制御処理コード生成手段によって前記接続関係を示す情報に前記フィードバックループが含まれていない場合に前記自動生成される通常対応制御処理コード、をそれぞれ受け取って合成し、前記制御ブロック図の接続関係を示す情報にフィードバックループが含まれていた場合であっても、自動的にプログラムの仕様を満たすソースコードを生成する制御処理コード合成手段と、を備える、ことを特徴とする。   In order to solve the above-described problems, the present invention provides a control block diagram specification that describes the specification of a program in the form of a control block diagram that represents the flow of control processing by connecting variable input / output terminal elements and operator elements by lines. Program automatic generation having description means and control processing code automatic generation means for automatically generating compilable source code satisfying the specification of the program expressed in the control block diagram based on information indicating the connection relationship of the control block diagram In the apparatus, the control processing code automatic generation means searches the output side for information indicating the connection relationship of the described control block diagram from the output side, and outputs the calculation result output on the output side to the information indicating the connection relationship. Connection information extracting means for detecting whether or not a feedback loop directly connected to the input of the operation on the input side is included, and the connection information When the output means detects that the feedback loop is not included in the information indicating the connection relationship, the control processing code is automatically generated by setting the calculation order in one direction from the input side to the output side. When the normal response control processing code generation unit and the connection information extraction unit detect that the feedback loop is included in the information indicating the connection relationship, the information corresponding to the detected connection relationship is handled. Automatic generation of previous value variable definition means for automatically generating the previous value variable definition code to be saved, automatic saving code for substituting the calculation result on the output side of the feedback loop for the defined previous value variable into the previous value variable Automatic previous value storage code generation means to generate, and automatic previous value input code to assign the value of the previous value variable to one of the feedback loop inputs Feedback corresponding control processing code generating means having previous value input code automatic generating means to be formed; definition code of previous value variable automatically generated by the feedback corresponding control processing code generating means, previous value storage code, and previous value input code And the normal correspondence control processing code generated by the normal correspondence control processing code generation means when the feedback relationship is not included in the information indicating the connection relation, and the control block Control information code synthesizing means for automatically generating source code that satisfies the program specifications even when a feedback loop is included in the information indicating the connection relationship in the figure.

また本発明は、変数入出力端子要素と演算子要素を線によって接続することで制御処理の流れを表現する制御ブロック図の形式でプログラムの仕様を記述し、該制御ブロック図の接続関係を示す情報をもとに制御ブロック図で表現されたプログラムの仕様を満たすコンパイル可能なソースコードを自動生成するプログラム自動生成方法において、前記記述された制御ブロック図の接続関係を示す情報を出力側から入力側に探索して、該接続関係を示す情報に出力側の演算結果出力が入力側の演算の入力に直接接続されるフィードバックループが含まれているか否かを検出し、前記接続関係を示す情報に前記フィードバックループが含まれていないことを検出した場合には、入力側から出力側に一方向に演算順序を設定して自動的に制御処理コードを生成し、前記接続関係を示す情報に前記フィードバックループが含まれていることを検出した場合には、該検出した接続関係を示す情報に対して対応する前回値変数の定義コードを自動生成し、次いで該定義された前回値変数に対してフィードバックループの出力側の演算結果を前回値変数に代入するための保存コードを自動生成し、さらに、前記フィードバックループの入力の一方に前回値変数の値を代入する前回値入力コードを自動生成し、
前記接続関係を示す情報に前記フィードバックループが含まれていた場合に前記自動生成される前回値変数の定義コード、前回値保存コード及び前回値入力コード、並びに、前記接続関係を示す情報に前記フィードバックループが含まれていない場合に前記自動生成される通常対応制御処理コード、をそれぞれ受け取って合成し、前記制御ブロック図の接続関係を示す情報にフィードバックループが含まれていた場合であっても、自動的にプログラムの仕様を満たすソースコードを生成する、ことを特徴とする。
The present invention also describes the specification of a program in the form of a control block diagram that represents the flow of control processing by connecting variable input / output terminal elements and operator elements with lines, and shows the connection relationship between the control block diagrams. In the program automatic generation method for automatically generating compilable source code that satisfies the specifications of the program expressed in the control block diagram based on the information, information indicating the connection relationship of the control block diagram described above is input from the output side Information indicating the connection relationship by detecting whether or not the information indicating the connection relationship includes a feedback loop in which the output calculation result output is directly connected to the input of the input calculation. If it is detected that the feedback loop is not included in the input, the calculation sequence is set in one direction from the input side to the output side to automatically When the information indicating the connection relationship includes the feedback loop, the definition code of the corresponding previous value variable is automatically generated for the information indicating the detected connection relationship. Then, a storage code for automatically substituting the calculation result on the output side of the feedback loop for the defined previous value variable is substituted for the previous value variable, and the previous value variable is input to one of the feedback loop inputs. Automatically generate the previous value input code to assign the value of
When the feedback loop is included in the information indicating the connection relation, the automatically generated previous value variable definition code, the previous value storage code and the previous value input code, and the feedback to the information indicating the connection relation Even when a loop is not included, the normal correspondence control processing code that is automatically generated is received and synthesized, and even when a feedback loop is included in the information indicating the connection relationship of the control block diagram, It is characterized by automatically generating source code that satisfies the program specifications.

また本発明は、変数入出力端子要素と演算子要素を線によって接続することで制御処理の流れを表現する制御ブロック図の形式でプログラムの仕様を記述し、該制御ブロック図の接続関係を示す情報をもとに制御ブロック図で表現されたプログラムの仕様を満たすコンパイル可能なソースコードを自動生成するプログラム自動生成プログラムにおいて、コンピュータに、前記記述された制御ブロック図の接続関係を示す情報を出力側から入力側に探索して、該接続関係を示す情報に出力側の演算結果出力が入力側の演算の入力に直接接続されるフィードバックループが含まれているか否かを検出する機能、前記接続関係を示す情報に前記フィードバックループが含まれていないことを検出した場合には、入力側から出力側に一方向に演算順序を設定して自動的に制御処理コードを生成する機能、前記接続関係を示す情報に前記フィードバックループが含まれていることを検出した場合には、該検出した接続関係を示す情報に対して対応する前回値変数の定義コードを自動生成し、次いで該定義された前回値変数に対してフィードバックループの出力側の演算結果を前回値変数に代入するための保存コードを自動生成し、さらに、前記フィードバックループの入力の一方に前回値変数の値を代入する前回値入力コードを自動生成する機能、前記接続関係を示す情報に前記フィードバックループが含まれていた場合に前記自動生成される前回値変数の定義コード、前回値保存コード及び前回値入力コード、並びに、前記接続関係を示す情報に前記フィードバックループが含まれていない場合に前記自動生成される通常対応制御処理コード、をそれぞれ受け取って合成し、前記制御ブロック図の接続関係を示す情報にフィードバックループが含まれていた場合であっても、自動的にプログラムの仕様を満たすソースコードを生成する機能、を実現させることを特徴とする。   The present invention also describes the specification of a program in the form of a control block diagram that represents the flow of control processing by connecting variable input / output terminal elements and operator elements with lines, and shows the connection relationship between the control block diagrams. In a program automatic generation program that automatically generates compilable source code that satisfies the specifications of the program expressed in the control block diagram based on the information, information indicating the connection relationship of the described control block diagram is output to the computer A function of searching from the input side to the input side and detecting whether or not the information indicating the connection relation includes a feedback loop in which the output side operation result output is directly connected to the input side operation input, the connection When it is detected that the feedback loop is not included in the information indicating the relationship, the calculation order is unidirectional from the input side to the output side. A function for setting and automatically generating a control processing code, and when detecting that the feedback loop is included in the information indicating the connection relationship, corresponds to the information indicating the detected connection relationship A definition code for the previous value variable is automatically generated, and then a storage code for substituting the operation result on the output side of the feedback loop for the defined previous value variable is automatically generated for the previous value variable. A function of automatically generating a previous value input code for substituting the value of the previous value variable into one of the loop inputs, and the previous value variable automatically generated when the feedback loop is included in the information indicating the connection relationship The definition code, the previous value storage code, the previous value input code, and the information indicating the connection relation do not include the feedback loop. Each of the automatically generated normal correspondence control processing codes, and even if the information indicating the connection relationship in the control block diagram includes a feedback loop, the program specifications are automatically A function of generating a source code satisfying the above condition is realized.

本発明によるプログラム自動生成装置によれば、従来の手法ではすべての演算の出力変数を保持しなければ正しい動作が行われないような、フィードバックループが含まれている制御ブロック図であっても、フィードバックループを検出してその部分の演算結果のみを前回値変数として保持し、残りのフィードバックループを検出しない部分は一次変数で処理する制御処理コードを生成することが可能となり、リソースの制約が厳しい組込み分野のプログラム開発において格別の有利性を持つものである。   According to the automatic program generation device according to the present invention, even in a control block diagram including a feedback loop that does not perform correct operation unless the output variables of all operations are held in the conventional method, It is possible to generate a control processing code that detects a feedback loop and holds only the calculation result of that part as a previous value variable, and processes a part that does not detect the remaining feedback loop using a primary variable. It has a special advantage in program development in the embedded field.

本発明の実施形態に係るプログラム自動生成装置のシステム処理機能を示すブロック図である。It is a block diagram which shows the system processing function of the program automatic generation apparatus which concerns on embodiment of this invention. 本発明の実施形態に係るプログラム自動生成装置のハードウェア構成を示すブロック図である。It is a block diagram which shows the hardware constitutions of the program automatic generation apparatus which concerns on embodiment of this invention. 本発明の実施形態に係るプログラム自動生成装置の動作を説明するためのフローチャートである。It is a flowchart for demonstrating operation | movement of the program automatic generation apparatus which concerns on embodiment of this invention. 本発明の実施形態に係るプログラム自動生成装置で記述される制御ブロック図(フィードバックループが含まれていない場合)の例を示す図である。It is a figure which shows the example of the control block diagram (when a feedback loop is not included) described with the program automatic generation apparatus which concerns on embodiment of this invention. 本発明の実施形態に係るプログラム自動生成装置でフィードバックループが含まれていない場合に生成されるソースコードの例を示す図である。It is a figure which shows the example of the source code produced | generated when the feedback loop is not included in the automatic program generation apparatus which concerns on embodiment of this invention. 本発明の実施形態に係るプログラム自動生成装置で記述される制御ブロック図(フィードバックループが含まれている場合)の例を示す図である。It is a figure which shows the example of the control block diagram (when a feedback loop is included) described with the program automatic generation apparatus which concerns on embodiment of this invention. 本発明の実施形態に係るプログラム自動生成装置でフィードバックループが含まれている場合に生成されるソースコードの例を示す図である。It is a figure which shows the example of the source code produced | generated when the feedback loop is included in the program automatic generation apparatus which concerns on embodiment of this invention. 制御ブロック図にフィードバックループが含まれている場合の従来の解決手法の一例を示す図である。It is a figure which shows an example of the conventional solution method in case a feedback loop is included in a control block diagram. 図8に示された従来の解決手法の一例を一般的な高級プログラミング言語を使ってソースコードとして表記した図である。FIG. 9 is a diagram showing an example of the conventional solution shown in FIG. 8 expressed as source code using a general high-level programming language.

以下、本発明の実施の形態について、詳細に説明する。
図1は、本発明の実施形態に係るプログラム自動生成装置のシステム機能構成を示すブロック図である。図1では制御の流れを白抜き矢印で示し、また情報の流れを破線矢印で示している。
Hereinafter, embodiments of the present invention will be described in detail.
FIG. 1 is a block diagram showing a system functional configuration of an automatic program generation device according to an embodiment of the present invention. In FIG. 1, the flow of control is indicated by white arrows, and the flow of information is indicated by dashed arrows.

入力装置20を操作するユーザ(利用者)は、プログラム自動生成装置1200を用いて、制御ブロック図を記述することができる。プログラム自動生成装置1200は、記述された制御ブロック図からプログラムソースコードを自動的に生成する。より具体的に説明すれば、図1において、ユーザは入力装置20からプログラム自動生成装置1200を起動して、制御ブロック図仕様記述手段1210を動作させ、制御ブロック図仕様記述手段1210を用いてプログラムの仕様を制御ブロック図で記述する。ここでいう制御ブロック図は、例えば図4に示すように、変数入力端子要素(in_x)101,変数入力端子要素(in_y)102から出発して、いくつかの演算要素(図4に示すOp1演算要素103、加算要素104)を経て変数出力端子要素(out_a)105に至るまでの処理の流れを線で接続することで表現されるものである。   A user (user) who operates the input device 20 can describe a control block diagram using the automatic program generation device 1200. The automatic program generator 1200 automatically generates a program source code from the described control block diagram. More specifically, in FIG. 1, the user activates the automatic program generation device 1200 from the input device 20, operates the control block diagram specification description means 1210, and uses the control block diagram specification description means 1210 to execute the program. Is described in the control block diagram. The control block diagram here is, for example, as shown in FIG. 4, starting from a variable input terminal element (in_x) 101 and a variable input terminal element (in_y) 102, several calculation elements (Op1 calculation shown in FIG. 4). This is expressed by connecting the processing flow from the element 103 and the addition element 104) to the variable output terminal element (out_a) 105 by a line.

制御ブロック図仕様記述手段1210は、図4に示すような構成要素である変数入力端子要素、変数出力端子要素や演算要素などの記述手段をあらかじめ持っていて、ユーザはこれらの記述手段を入力装置20のモニタ画面上で配置、接続していくことでプログラムの仕様を記述して制御ブロック図を完成させる。制御ブロック図で記述されたプログラムの仕様は、制御処理コード自動生成手段2200に送られ、そこで変数入力端子要素で表現される変数の参照を出発点として、接続関係を示す情報(以下では単に“接続情報”ということがある)に従って演算子要素の演算を順次実行していった結果を変数出力端子要素で表現される変数に代入するまでの一連の処理を、一般的な高級プログラミング言語でいうところの関数またはサブルーチンとしてまとめた形のソースコードとして出力する。出力されるソースコードは、例えば一般的な高級プログラミング言語の一つであるC言語を用いると、図5に示すようなコード形式で表される。   The control block diagram specification description means 1210 has in advance description means such as variable input terminal elements, variable output terminal elements, and arithmetic elements as shown in FIG. 4, and the user inputs these description means to the input device. By arranging and connecting on the 20 monitor screens, the specification of the program is described and the control block diagram is completed. The specification of the program described in the control block diagram is sent to the control processing code automatic generation means 2200, where information indicating connection relations starting from the variable reference expressed by the variable input terminal element (hereinafter simply “ In a general high-level programming language, a series of processes until the results of sequential execution of operator element operations according to connection information are assigned to variables represented by variable output terminal elements However, the source code is output as a function or subroutine. The output source code is represented in a code format as shown in FIG. 5, for example, when the C language which is one of general high-level programming languages is used.

ここで本発明の実施形態に係るプログラム自動生成装置のハードウェア構成について説明する。図2は、本発明の実施形態に係るプログラム自動生成装置のハードウェア構成を示すブロック図である。プログラム自動生成装置1100は、CPU(Central Processing Unit)1101によって装置全体が制御されている。CPU1101には、バス1106を介してRAM(Random Access Memory)1102、ハードディスクドライブ(HDD:Hard Disc Drive)1103、グラフィック処理装置1104および入力インタフェース1105が接続されている。   Here, the hardware configuration of the automatic program generation device according to the embodiment of the present invention will be described. FIG. 2 is a block diagram showing a hardware configuration of the automatic program generation device according to the embodiment of the present invention. The entire automatic program generation device 1100 is controlled by a CPU (Central Processing Unit) 1101. A random access memory (RAM) 1102, a hard disk drive (HDD) 1103, a graphic processing device 1104, and an input interface 1105 are connected to the CPU 1101 via a bus 1106.

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

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

以上のようなハードウェア構成によって、上述した又は以下に示すような本実施形態の処理機能を実現することができる。
次に、本発明の実施形態に係るプログラム自動生成装置のシステム処理機能についてさらに説明する。いま図6に示すような制御ブロック図をユーザがキーボード22やマウス23を使用して仕様記述したとすると、本発明のプログラム自動生成装置では、この制御ブロック図にフィードバックループ(以下では単に“FB”と略記することがある)が含まれているか否かを接続情報抽出手段2210で調べる。接続情報抽出手段2210は、上述した特許文献1の0007段落や0008段落などに記載されているように、出力側から入力側に向かってブロックを探索して、入力側から出力側方向に演算順序の設定を試みるものである。その場合、出力側から入力側に向かってブロックを探索して、入力側から出力側に一方向に演算順序を設定できるものは、フィードバックループ(FB)が含まれていないケースであり、もしフィードバックループ(FB)が含まれているケースで入力側から出力側に一方向に演算順序を設定してしまうと異なるソースコードが自動生成されることになる。
With the hardware configuration described above, the processing functions of the present embodiment as described above or shown below can be realized.
Next, the system processing function of the automatic program generation device according to the embodiment of the present invention will be further described. If the user describes the control block diagram as shown in FIG. 6 using the keyboard 22 and the mouse 23, the automatic program generation apparatus of the present invention includes a feedback loop (hereinafter simply “FB”). The connection information extracting means 2210 checks whether or not “sometimes abbreviated as“ is included). The connection information extraction unit 2210 searches for blocks from the output side to the input side and describes the calculation order from the input side to the output side, as described in paragraphs 0007 and 0008 of Patent Document 1 described above. It tries to set. In that case, a block that is searched from the output side to the input side and the calculation order can be set in one direction from the input side to the output side is a case that does not include a feedback loop (FB). If the calculation order is set in one direction from the input side to the output side in the case where the loop (FB) is included, different source codes are automatically generated.

そこで、本発明の実施形態においては、接続情報抽出手段2210において、フィードバックループ(FB)が含まれているか否かを検出するようにしている。すなわち、FBを検出しなければ、上述した特許文献1の0007段落や0008段落などに記載されているような既存技術でもって、入力側から出力側に一方向に演算順序を設定できるので、仕様記述された制御ブロック図を通常対応制御処理コード生成手段2220に渡して、通常対応の制御処理コードを生成する。つまり、FBが含まれていない制御ブロック図は、処理の流れが一例として図4に示すようになり、変数入力端子要素(in_x)101,変数入力端子要素(in_y)102から出発して、Op1演算要素103、加算要素104を経て変数出力端子要素(out_a)105に至る線で表現されるものとなり、これは通常対応の制御ブロック図の形式として解釈されて通常対応制御処理コード生成手段2220が既存の技術を用いて、例えばC言語を使用して自動的に制御処理コードを図5のような形式で出力することになる。なおこの場合、後述するFB対応制御処理コード生成手段2230からの出力が無いため、制御処理コード合成生成手段2240からの出力は、通常対応制御処理コード生成手段2220の出力がそのまま図5のような形式で出力されることとなる。   Therefore, in the embodiment of the present invention, the connection information extraction means 2210 detects whether or not a feedback loop (FB) is included. In other words, if the FB is not detected, the calculation order can be set in one direction from the input side to the output side with the existing technology described in paragraphs 0007 and 0008 of Patent Document 1 described above. The described control block diagram is passed to the normal correspondence control processing code generation means 2220 to generate a normal control processing code. That is, in the control block diagram that does not include the FB, the flow of processing is as shown in FIG. 4 as an example, and starting from the variable input terminal element (in_x) 101 and the variable input terminal element (in_y) 102, Op1 This is expressed by a line from the calculation element 103 and the addition element 104 to the variable output terminal element (out_a) 105. This is interpreted as a normal control block diagram format, and the normal control processing code generation means 2220 The control processing code is automatically output in the format as shown in FIG. 5 using the existing technology, for example, using C language. In this case, since there is no output from the FB correspondence control processing code generation means 2230 described later, the output from the control processing code synthesis generation means 2240 is the output of the normal correspondence control processing code generation means 2220 as shown in FIG. It will be output in the format.

次に接続情報抽出手段2210がFBを検出した場合には、仕様記述された制御ブロック図をFB対応制御処理コード生成手段2230に渡す。FB対応制御処理コード生成手段2230は、検出したFBが含まれる接続情報を処理するため、先ず前回値変数定義自動生成手段2231において、前回値の変数定義を自動的に生成する。次いで、前回値保存コード自動生成手段2232において、定義された前回値変数に対して、フィードバックループ(FB)の出力側である演算要素の演算結果を前回値変数に代入するためのコードを前回値保存コードとして自動生成する。そして前回値入力コード自動生成手段2233において、フィードバックループ(FB)の入力側である演算要素の入力の一方に前回値変数の値を代入するコードを前回値入力コードとして自動生成する。その上でこれら自動生成した前回値変数定義、前回値保存コード、前回値入力コードを制御処理コード合成手段2240に出力する。つまり、FB対応制御処理コード生成手段2230は、フィードバックループ(FB)が含まれる接続情報を処理するために前回値変数定義、前回値保存コード、前回値入力コードを自動生成してこれらを制御処理コード合成手段2240に渡す。   Next, when the connection information extraction unit 2210 detects the FB, the control block diagram described in the specification is transferred to the FB correspondence control processing code generation unit 2230. In order to process the connection information including the detected FB, the FB correspondence control processing code generation unit 2230 first automatically generates a variable definition of the previous value in the previous value variable definition automatic generation unit 2231. Next, in the previous value storage code automatic generation means 2232, for the defined previous value variable, a code for substituting the calculation result of the calculation element on the output side of the feedback loop (FB) into the previous value variable is the previous value. Automatically generated as saved code. Then, in the previous value input code automatic generation means 2233, a code for substituting the value of the previous value variable into one of the inputs of the calculation element on the input side of the feedback loop (FB) is automatically generated as the previous value input code. Then, the automatically generated previous value variable definition, previous value storage code, and previous value input code are output to the control processing code composition means 2240. That is, the FB correspondence control processing code generation means 2230 automatically generates the previous value variable definition, the previous value storage code, and the previous value input code to process the connection information including the feedback loop (FB), and controls them. Passed to the code synthesis means 2240.

FB対応制御処理コード生成手段における処理を具体例に基づいて説明する。例えば、制御ブロック図にフィードバックループ(FB)が含まれる接続情報が抽出される図6に示されるケースの場合、Op2演算要素203の出力が、その前に演算される加算要素201の入力となるフィードバックループ(FB)が含まれているので、接続情報抽出手段2210においてFBが検出されて、FB対応制御処理コード生成手段2230に処理が渡される。FB対応制御処理コード生成手段2230では、検出されたフィードバックループ(FB)、すなわち演算要素203から加算要素201への接続に対して、前回値変数定義自動生成手段2231によって、前回値変数b_prevの定義が自動的に生成される(図7の(1)参照))。次に、前回値変数定義自動生成手段2231で定義された前回値変数b_prevに対して、前回値保存コード生成手段2232によって、フィードバックループ(FB)の出力側にあたる演算要素203の演算結果から前回値変数に代入するコード、すなわち前回値保存コード、が自動的に生成される(図7の(3)参照))。そして最後に、前回値入力コード生成手段2233によって、フィードバックループ(FB)の入力側にあたる加算要素201の入力の一方に前回値変数b_revの値を代入するコード、すなわち前回値入力コード、が自動的に生成される(図7の(2)参照))。   The processing in the FB correspondence control processing code generation means will be described based on a specific example. For example, in the case shown in FIG. 6 where connection information including a feedback loop (FB) is extracted in the control block diagram, the output of the Op2 computing element 203 becomes the input of the adding element 201 computed before that. Since the feedback loop (FB) is included, the connection information extraction unit 2210 detects the FB and passes the processing to the FB correspondence control processing code generation unit 2230. In the FB correspondence control processing code generation means 2230, the previous value variable definition automatic generation means 2231 defines the previous value variable b_prev for the detected feedback loop (FB), that is, the connection from the calculation element 203 to the addition element 201. Is automatically generated (see (1) in FIG. 7)). Next, with respect to the previous value variable b_prev defined by the previous value variable definition automatic generation unit 2231, the previous value storage code generation unit 2232 calculates the previous value from the calculation result of the calculation element 203 corresponding to the output side of the feedback loop (FB). A code to be assigned to a variable, that is, a previous value storage code is automatically generated (see (3) in FIG. 7)). Finally, the previous value input code generation means 2233 automatically generates a code for substituting the value of the previous value variable b_rev into one of the inputs of the addition element 201 corresponding to the input side of the feedback loop (FB), that is, the previous value input code. (See (2) in FIG. 7)).

以上までの処理で生成された制御処理コードついて制御処理コード合成手段2240は、最終的に一般的な高級プログラミング言語でいうところの関数またはサブルーチンとしてまとめた形のソースコード30を生成し出力する。すなわち、出力側から入力側に向かってブロックを探索して、入力側から出力側に一方向に演算順序を設定できるようなフィードバックループ(FB)が含まれていない場合には、通常対応制御処理コード生成手段2220によって出力される制御処理コードに基づいて、図5に示すような制御処理コードを出力し、また、出力側から入力側に向かってブロックを探索して、入力側から出力側に一方向に演算順序を設定できないようなフィードバックループ(FB)が含まれている場合には、FB対応制御処理コード生成手段2230によって出力されるFB対応制御処理コードと、通常対応制御処理コード生成手段2220によって出力されるフィードバックループ(FB)が含まれていない残りの部分、言い換えれば、図4に示されるような制御ブロック図で表現されることになる残りの部分に対する制御処理コードとを合成して、例えば一般的な高級プログラミング言語の一つであるC言語を使用して、図7に示すような制御処理コードを出力する。   The control processing code synthesizing means 2240 for the control processing code generated by the above processing finally generates and outputs the source code 30 in the form of functions or subroutines in a general high-level programming language. That is, when a block is searched from the output side to the input side and a feedback loop (FB) that can set the calculation order in one direction from the input side to the output side is not included, the normal handling control process Based on the control processing code output by the code generation means 2220, a control processing code as shown in FIG. 5 is output, and a block is searched from the output side to the input side, and from the input side to the output side. When a feedback loop (FB) that cannot set the calculation order in one direction is included, the FB correspondence control processing code output by the FB correspondence control processing code generation means 2230 and the normal correspondence control processing code generation means The rest of the feedback loop (FB) output by 2220 is not included, in other words, the control block as shown in FIG. 7 is synthesized with the control processing code for the remaining part to be expressed by, for example, using C language which is one of general high-level programming languages, and the control processing code as shown in FIG. 7 is output. To do.

図3は、本発明の実施形態に係るプログラム自動生成装置の動作を説明するためのフローチャートである。図3においてステップを“S”と略記する。本発明の実施形態に係るプログラム自動生成装置の動作開始で、先ず、ユーザにより制御ブロック図を用いた仕様記述がなされる(ステップS1)。次に、プログラム自動生成装置は、仕様記述された制御ブロック図を基に接続情報の抽出を行う(ステップS2)。そして接続情報の抽出の過程で接続情報にフィードバックループ(FB)が含まれるかを検出する(ステップS3)。当該チェックで接続情報にフィードバックループ(FB)が含まれていないことを検出したならば、通常対応による制御処理コードを自動生成する(ステップS4)。   FIG. 3 is a flowchart for explaining the operation of the automatic program generation device according to the embodiment of the present invention. In FIG. 3, the step is abbreviated as “S”. At the start of the operation of the automatic program generation device according to the embodiment of the present invention, first, a specification description using a control block diagram is made by the user (step S1). Next, the automatic program generation device extracts connection information based on the control block diagram described in the specification (step S2). In the process of extracting connection information, it is detected whether the connection information includes a feedback loop (FB) (step S3). If it is detected in the check that the connection information does not include a feedback loop (FB), a control processing code corresponding to normal correspondence is automatically generated (step S4).

ステップS3で接続情報にフィードバックループ(FB)が含まれていることを検出したならば、フィードバックループ(FB)対応による制御処理コードを自動生成する(ステップS5〜S7)。すなわち、まずフィードバックループ(FB)が検出された接続情報に対して前回値変数定義を自動生成する(ステップS5)。次いで、定義された前回値変数に対して、フィードバックループ(FB)の出力側にあたる演算要素の演算結果から前回値保存コードを自動生成する(ステップS6)。さらに、フィードバックループ(FB)の入力側にあたる加算要素の入力の一方に前回値変数の値を代入するための前回値入力コードを自動生成する(ステップS7)。   If it is detected in step S3 that the connection information includes a feedback loop (FB), a control processing code corresponding to the feedback loop (FB) is automatically generated (steps S5 to S7). That is, first, a previous value variable definition is automatically generated for connection information in which a feedback loop (FB) is detected (step S5). Next, a previous value storage code is automatically generated from the calculation result of the calculation element corresponding to the output side of the feedback loop (FB) for the defined previous value variable (step S6). Furthermore, a previous value input code for substituting the value of the previous value variable into one of the inputs of the addition element corresponding to the input side of the feedback loop (FB) is automatically generated (step S7).

そしてステップS8では、全接続情報について制御処理コードを抽出したかを判断する。その結果、全接続情報について制御処理コードを抽出していなければ、ステップS3に戻り、ステップS3以降ステップS7までを再度実行して残された接続情報についての制御処理コードの抽出を行うが、全接続情報について制御処理コードを抽出していればステップS9に進む。   In step S8, it is determined whether control processing codes have been extracted for all connection information. As a result, if the control processing code has not been extracted for all connection information, the process returns to step S3, and the control processing code for the remaining connection information is extracted by executing again from step S3 to step S7. If the control processing code is extracted for the connection information, the process proceeds to step S9.

ステップS9では、以上までのFB対応制御処理コード生成処理により生成された制御処理コードと、FBが含まれていない残りの部分に対する通常対応制御処理コードとを合成して出力する(ステップS9)。そしてプログラム自動生成装置の処理を終了する。   In step S9, the control processing code generated by the above FB correspondence control processing code generation processing and the normal correspondence control processing code for the remaining portion not including the FB are synthesized and output (step S9). Then, the process of the automatic program generation device is terminated.

20 入力装置
21 モニタ
22 キーボード
23 マウス
101 ,102 ブロック図記述要素(変数入力端子要素)
103 ,203 ブロック図記述要素(演算要素)
104 ,201 ブロック図記述要素(加算要素)
105 ブロック図記述要素(変数出力端子要素)
202 ブロック図記述要素(分岐要素)
1100 プログラム自動生成装置
1101 CPU(Central Processing Unit)
1102 RAM(Random Access Memory)
1103 HDD(Hard Disc Drive)
1104 グラフィック処理装置
1105 入力インタフェース
1106 バス
1200 プログラム自動生成装置
1210 制御ブロック図仕様記述手段
2200 制御処理コード自動生成手段
2210 接続情報抽出手段
2220 通常対応制御処理コード生成手段
2230 FB対応制御処理コード生成手段
2231 前回値変数定義自動生成手段
2232 前回値保存コード自動生成手段
2233 前回値入力コード自動生成手段
2240 制御処理コード合成手段
20 Input device 21 Monitor 22 Keyboard 23 Mouse
101, 102 Block diagram description element (variable input terminal element)
103, 203 Block diagram description element (arithmetic element)
104, 201 Block diagram description element (addition element)
105 Block diagram description element (variable output terminal element)
202 Block diagram description element (branch element)
1100 Automatic program generator
1101 CPU (Central Processing Unit)
1102 RAM (Random Access Memory)
1103 HDD (Hard Disc Drive)
1104 Graphics processing unit
1105 Input interface
1106 bus
1200 automatic program generator
1210 Control block diagram specification description means
2200 Control processing code automatic generation means
2210 Connection information extraction means
2220 Normal correspondence control processing code generation means
2230 Control processing code generation means for FB
2231 Previous value variable definition automatic generation means
2232 Previous value storage code automatic generation means
2233 Previous value input code automatic generation means
2240 Control processing code synthesis means

Claims (3)

変数入出力端子要素と演算子要素を線によって接続することで制御処理の流れを表現する制御ブロック図の形式でプログラムの仕様を記述する制御ブロック図仕様記述手段と、前記制御ブロック図の接続関係を示す情報をもとに制御ブロック図で表現されたプログラムの仕様を満たすコンパイル可能なソースコードを自動生成する制御処理コード自動生成手段を有するプログラム自動生成装置において、
前記制御処理コード自動生成手段は、
前記記述された制御ブロック図の接続関係を示す情報を出力側から入力側に探索して、該接続関係を示す情報に出力側の演算結果出力が入力側の演算の入力に直接接続されるフィードバックループが含まれているか否かを検出する接続情報抽出手段と、
該接続情報抽出手段が前記接続関係を示す情報に前記フィードバックループが含まれていないことを検出した場合には、入力側から出力側に一方向に演算順序を設定して自動的に制御処理コードを生成する通常対応制御処理コード生成手段と、
前記接続情報抽出手段が前記接続関係を示す情報に前記フィードバックループが含まれていることを検出した場合には、該検出した接続関係を示す情報に対して対応する前回値変数の定義コードを自動生成する前回値変数定義自動生成手段、該定義された前回値変数に対してフィードバックループの出力側の演算結果を前回値変数に代入するための保存コードを自動生成する前回値保存コード自動生成手段、および、前記フィードバックループの入力の一方に前回値変数の値を代入する前回値入力コードを自動生成する前回値入力コード自動生成手段を有するフィードバック対応制御処理コード生成手段と、
前記フィードバック対応制御処理コード生成手段によって前記自動生成された前回値変数の定義コード、前回値保存コード及び前回値入力コード、並びに、前記通常対応制御処理コード生成手段によって前記接続関係を示す情報に前記フィードバックループが含まれていない場合に前記自動生成される通常対応制御処理コード、をそれぞれ受け取って合成し、前記制御ブロック図の接続関係を示す情報にフィードバックループが含まれていた場合であっても、自動的にプログラムの仕様を満たすソースコードを生成する制御処理コード合成手段と、
を備える、ことを特徴とするプログラム自動生成装置。
Control block diagram specification description means for describing program specifications in the form of a control block diagram expressing the flow of control processing by connecting variable input / output terminal elements and operator elements with lines, and the connection relationship between the control block diagrams In a program automatic generation device having a control processing code automatic generation means for automatically generating compilable source code that satisfies the specifications of a program expressed in a control block diagram based on information indicating
The control processing code automatic generation means includes:
Search for information indicating the connection relationship in the above described control block diagram from the output side to the input side, and feedback indicating that the operation result output on the output side is directly connected to the input of the operation on the input side in the information indicating the connection relationship Connection information extracting means for detecting whether or not a loop is included;
When the connection information extraction means detects that the feedback loop is not included in the information indicating the connection relationship, the control processing code is automatically set by setting the calculation order in one direction from the input side to the output side. A normal correspondence control processing code generation means for generating
When the connection information extraction unit detects that the feedback loop is included in the information indicating the connection relationship, the definition code of the corresponding previous value variable is automatically set for the information indicating the detected connection relationship. Previous value variable definition automatic generation means for generating the previous value storage code automatic generation means for automatically generating a storage code for substituting the operation result on the output side of the feedback loop for the defined previous value variable into the previous value variable And a feedback corresponding control processing code generation means having a previous value input code automatic generation means for automatically generating a previous value input code for substituting the value of the previous value variable into one of the inputs of the feedback loop;
The definition code of the previous value variable, the previous value storage code and the previous value input code automatically generated by the feedback corresponding control processing code generating means, and the information indicating the connection relation by the normal corresponding control processing code generating means Even when a feedback loop is included in the information indicating the connection relationship in the control block diagram, the normal correspondence control processing code automatically generated when the feedback loop is not included is received and synthesized. Control processing code synthesis means for automatically generating source code that satisfies the program specifications;
An automatic program generation device comprising:
変数入出力端子要素と演算子要素を線によって接続することで制御処理の流れを表現する制御ブロック図の形式でプログラムの仕様を記述し、該制御ブロック図の接続関係を示す情報をもとに制御ブロック図で表現されたプログラムの仕様を満たすコンパイル可能なソースコードを自動生成するプログラム自動生成方法において、
前記記述された制御ブロック図の接続関係を示す情報を出力側から入力側に探索して、該接続関係を示す情報に出力側の演算結果出力が入力側の演算の入力に直接接続されるフィードバックループが含まれているか否かを検出し、
前記接続関係を示す情報に前記フィードバックループが含まれていないことを検出した場合には、入力側から出力側に一方向に演算順序を設定して自動的に制御処理コードを生成し、
前記接続関係を示す情報に前記フィードバックループが含まれていることを検出した場合には、該検出した接続関係を示す情報に対して対応する前回値変数の定義コードを自動生成し、次いで該定義された前回値変数に対してフィードバックループの出力側の演算結果を前回値変数に代入するための保存コードを自動生成し、さらに、前記フィードバックループの入力の一方に前回値変数の値を代入する前回値入力コードを自動生成し、
前記接続関係を示す情報に前記フィードバックループが含まれていた場合に前記自動生成される前回値変数の定義コード、前回値保存コード及び前回値入力コード、並びに、前記接続関係を示す情報に前記フィードバックループが含まれていない場合に前記自動生成される通常対応制御処理コード、をそれぞれ受け取って合成し、前記制御ブロック図の接続関係を示す情報にフィードバックループが含まれていた場合であっても、自動的にプログラムの仕様を満たすソースコードを生成する、
ことを特徴とするプログラム自動生成方法。
Describe program specifications in the form of a control block diagram that represents the flow of control processing by connecting variable I / O terminal elements and operator elements with lines, and based on information that indicates the connection relationship of the control block diagram In a program automatic generation method for automatically generating compilable source code that satisfies the specification of a program expressed in a control block diagram,
Search for information indicating the connection relationship in the above described control block diagram from the output side to the input side, and feedback indicating that the operation result output on the output side is directly connected to the input of the operation on the input side in the information indicating the connection relationship Detect if a loop is included,
When it is detected that the feedback loop is not included in the information indicating the connection relationship, the control processing code is automatically generated by setting the calculation order in one direction from the input side to the output side,
When it is detected that the feedback loop is included in the information indicating the connection relation, a definition code of a previous value variable corresponding to the detected information indicating the connection relation is automatically generated, and then the definition Automatically generates a storage code for substituting the calculation result on the output side of the feedback loop for the previous value variable, and assigns the value of the previous value variable to one of the inputs of the feedback loop. The previous value input code is automatically generated,
When the feedback loop is included in the information indicating the connection relation, the automatically generated previous value variable definition code, the previous value storage code and the previous value input code, and the feedback to the information indicating the connection relation Even when a loop is not included, the normal correspondence control processing code that is automatically generated is received and synthesized, and even when a feedback loop is included in the information indicating the connection relationship of the control block diagram, Automatically generate source code that meets the specifications of the program,
A method for automatically generating a program.
変数入出力端子要素と演算子要素を線によって接続することで制御処理の流れを表現する制御ブロック図の形式でプログラムの仕様を記述し、該制御ブロック図の接続関係を示す情報をもとに制御ブロック図で表現されたプログラムの仕様を満たすコンパイル可能なソースコードを自動生成するプログラム自動生成プログラムにおいて、
コンピュータに、
前記記述された制御ブロック図の接続関係を示す情報を出力側から入力側に探索して、該接続関係を示す情報に出力側の演算結果出力が入力側の演算の入力に直接接続されるフィードバックループが含まれているか否かを検出する機能、
前記接続関係を示す情報に前記フィードバックループが含まれていないことを検出した場合には、入力側から出力側に一方向に演算順序を設定して自動的に制御処理コードを生成する機能、
前記接続関係を示す情報に前記フィードバックループが含まれていることを検出した場合には、該検出した接続関係を示す情報に対して対応する前回値変数の定義コードを自動生成し、次いで該定義された前回値変数に対してフィードバックループの出力側の演算結果を前回値変数に代入するための保存コードを自動生成し、さらに、前記フィードバックループの入力の一方に前回値変数の値を代入する前回値入力コードを自動生成する機能、
前記接続関係を示す情報に前記フィードバックループが含まれていた場合に前記自動生成される前回値変数の定義コード、前回値保存コード及び前回値入力コード、並びに、前記接続関係を示す情報に前記フィードバックループが含まれていない場合に前記自動生成される通常対応制御処理コード、をそれぞれ受け取って合成し、前記制御ブロック図の接続関係を示す情報にフィードバックループが含まれていた場合であっても、自動的にプログラムの仕様を満たすソースコードを生成する機能、
を実現させるためのプログラム。
Describe program specifications in the form of a control block diagram that represents the flow of control processing by connecting variable I / O terminal elements and operator elements with lines, and based on information that indicates the connection relationship of the control block diagram In an automatic program generation program that automatically generates compilable source code that satisfies the specifications of the program expressed in the control block diagram,
On the computer,
Search for information indicating the connection relationship in the above described control block diagram from the output side to the input side, and feedback indicating that the operation result output on the output side is directly connected to the input of the operation on the input side in the information indicating the connection relationship The ability to detect whether a loop is included,
When it is detected that the feedback loop is not included in the information indicating the connection relationship, a function for automatically generating a control processing code by setting a calculation order in one direction from the input side to the output side;
When it is detected that the feedback loop is included in the information indicating the connection relation, a definition code of a previous value variable corresponding to the detected information indicating the connection relation is automatically generated, and then the definition Automatically generates a storage code for substituting the calculation result on the output side of the feedback loop for the previous value variable, and assigns the value of the previous value variable to one of the inputs of the feedback loop. A function to automatically generate the previous value input code,
When the feedback loop is included in the information indicating the connection relation, the automatically generated previous value variable definition code, the previous value storage code and the previous value input code, and the feedback to the information indicating the connection relation Even when a loop is not included, the normal correspondence control processing code that is automatically generated is received and synthesized, and even when a feedback loop is included in the information indicating the connection relationship of the control block diagram, A function that automatically generates source code that satisfies the program specifications,
A program to realize
JP2010158495A 2010-07-13 2010-07-13 Device and method for automatically generating program and program Pending JP2012022425A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010158495A JP2012022425A (en) 2010-07-13 2010-07-13 Device and method for automatically generating program and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010158495A JP2012022425A (en) 2010-07-13 2010-07-13 Device and method for automatically generating program and program

Publications (1)

Publication Number Publication Date
JP2012022425A true JP2012022425A (en) 2012-02-02

Family

ID=45776692

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010158495A Pending JP2012022425A (en) 2010-07-13 2010-07-13 Device and method for automatically generating program and program

Country Status (1)

Country Link
JP (1) JP2012022425A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933566A (en) * 2017-01-24 2017-07-07 北京广利核系统工程有限公司 Graphic configuration language transfer method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0916223A (en) * 1995-06-30 1997-01-17 Meidensha Corp System for sorting sequence program
JP2009193181A (en) * 2008-02-13 2009-08-27 Meidensha Corp Software development support system and method, and program for the method

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0916223A (en) * 1995-06-30 1997-01-17 Meidensha Corp System for sorting sequence program
JP2009193181A (en) * 2008-02-13 2009-08-27 Meidensha Corp Software development support system and method, and program for the method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106933566A (en) * 2017-01-24 2017-07-07 北京广利核系统工程有限公司 Graphic configuration language transfer method and device

Similar Documents

Publication Publication Date Title
US5961610A (en) Systems, methods and apparatus for generating and controlling display of medical images
EP3005089B1 (en) Resolution of textual code in a graphical hierarchical model of a technical computing environment
US5950002A (en) Learn mode script generation in a medical imaging system
US10176270B2 (en) Performance of template based javascript widgets
US9372683B2 (en) Automatic generation of class identifiers from source code annotations
US20080127060A1 (en) Dynamic mating of a modified user interface with pre-modified user interface code library
KR20140017649A (en) Methods to adapt user interfaces and input controls
US5831612A (en) Cell overlap detection and correction in a medical imaging system
JPH11513512A (en) Method of manufacturing digital signal processor
CN109408354B (en) Data processing method and device for application component
KR20150061203A (en) Method for providing embedded software development tools for supporting embedded software development environment based on native building and apparatus thereof
JP5176478B2 (en) Data flow analysis device, data flow analysis method, and data flow analysis program
US20210096830A1 (en) Incremental code generation method
US11256481B2 (en) Software development environment with compilation and read-evaluate-print-loop operations
CN117931190A (en) Code management method and related equipment
JP2007193423A (en) Program processor, parallel processing program, program processing method, parallel processing compiler, and recording medium storing parallel processing compiler
KR20160098794A (en) Apparatus and method for skeleton code generation based on device program structure modeling
JP2009075965A (en) Software development method and software development device
JP5657183B2 (en) Method and apparatus for enabling a first computer program to execute application logic of a second computer program, for interfacing the first computer program and the second computer program And apparatus for generating computer program code for the same, a computer program, and a software interface for enabling a first computer program to execute application logic of a second computer program For providing information (computer program interface)
Hu et al. Addressing dynamic dispatching issues in WCET analysis for object-oriented hard real-time systems
JP2012022425A (en) Device and method for automatically generating program and program
JP5702265B2 (en) Program automatic generation apparatus and program automatic generation method
Tkachuk et al. Research of possibilities of default refactoring actions in Swift language
JP2007080049A (en) Built-in program generation method, built-in program development system and information table section
CN111782196A (en) MVP architecture-based development method and device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120713

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130319

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130319

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20130723