JP2002268896A - Method and device for generating control program - Google Patents

Method and device for generating control program

Info

Publication number
JP2002268896A
JP2002268896A JP2001068674A JP2001068674A JP2002268896A JP 2002268896 A JP2002268896 A JP 2002268896A JP 2001068674 A JP2001068674 A JP 2001068674A JP 2001068674 A JP2001068674 A JP 2001068674A JP 2002268896 A JP2002268896 A JP 2002268896A
Authority
JP
Japan
Prior art keywords
language
control program
general
user function
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
JP2001068674A
Other languages
Japanese (ja)
Inventor
Masahiro Koyama
昌宏 小山
Yuji Hosoda
祐司 細田
Tsurumasa Matsushita
鶴正 松下
Tadao Shimozu
忠夫 下津
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2001068674A priority Critical patent/JP2002268896A/en
Publication of JP2002268896A publication Critical patent/JP2002268896A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a method for generating a control program by which wasteful labor and time for quoting a user function is relieved and an input mistake is reduced. SOLUTION: A user function extracting means 105 generates the reference form definition information 102a of the user function to be utilized in the control program and a user function general purpose language source code 102b from a source code 102 which is described by a user through the use of a general purpose language. A general purpose language converting means 104 converts the control program 101 where the description of the user function is mixed into a control program general purpose language source code 101a and a machine language converting means 106 converts the source code 101a into a machine language through the use of definition information 102a and the source code 102b.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、問題向きの専用言
語により記述した制御プログラムを翻訳して制御装置が
実行可能な機械語を生成する制御プログラム作成方法と
その装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a control program creating method for generating a machine language executable by a control device by translating a control program described in a dedicated language suitable for a problem, and an apparatus therefor.

【0002】[0002]

【従来の技術】ロボット、プラント等の制御装置では、
問題向きの専用言語(例えば、ロボット言語やラダー図
など)により制御プログラムを記述し、この制御プログ
ラムをコンパイラにより機械語に翻訳したのちに実行す
るか、あるいはこの制御プログラムをインタプリタによ
り逐次解釈及び実行する。
2. Description of the Related Art In a control device such as a robot or a plant,
Write the control program in a problem-specific language (for example, robot language or ladder diagram) and execute it after translating this control program into machine language by a compiler, or interpret and execute this control program sequentially with an interpreter I do.

【0003】このような制御装置では、ユーザが容易に
制御プログラムを作成できるように、各種制御機能を実
現する標準関数ライブラリが用意されており、これを専
用言語の命令として利用できる。また、この標準関数に
含まれない制御機能をユーザが必要とする場合には、予
め用意された専用言語の命令を組み合わせてその機能を
実現するか、あるいは何らかの方法で標準関数ライブラ
リにユーザの仕様に基づいた新しい関数(ユーザ関数)
を追加して、これを専用言語の新しい命令として利用で
きるようにコンパイラあるいはインタプリタを改造する
必要がある。
In such a control device, a standard function library for implementing various control functions is prepared so that a user can easily create a control program, and this can be used as an instruction in a dedicated language. If the user needs a control function that is not included in this standard function, the function is realized by combining instructions of a special language prepared in advance, or the user's specification is stored in the standard function library by some method. New function based on the API (user function)
It is necessary to modify the compiler or interpreter so that it can be used as a new instruction in a special language.

【0004】しかし、前者の専用言語の命令を組み合わ
せた記述による場合には、その記述能力に限界があり、
ユーザの必要とする制御機能を記述できない可能性があ
る。あるいは、仮に記述できたとしても、記述が複雑に
なってしまい、プログラムとして解読性が低下する可能
性がある。また、インタプリタによる実行の場合、この
ように専用言語により複雑な演算処理を記述すると、プ
ログラムの解釈処理時間が増大して、制御システムの応
答性が低下する可能性がある。一方、ユーザ関数をライ
ブラリへ追加するためには、一般的にはメーカにソフト
ウェアの改造を依頼することになり、このために多額の
費用が発生する可能性がある。また、ユーザが必要とす
る制御機能をユーザ自身が汎用言語によるプログラムと
して所有している場合もあり、このような既存のソフト
ウェア資産を有効活用したいという要望もあったが、従
来の制御装置ではこれを容易に実現できなかった。
[0004] However, in the case of the description combining instructions of the former dedicated language, the description ability is limited,
Control functions required by the user may not be described. Alternatively, even if the description can be made, the description may be complicated and the decipherability of the program may be reduced. In the case of execution by an interpreter, if such a complicated operation is described in a special language, the interpretation processing time of the program increases, and the responsiveness of the control system may decrease. On the other hand, in order to add a user function to the library, generally, a manufacturer is requested to remodel the software, which may cause a large cost. In some cases, the user owns the control functions required by the user as a program in a general-purpose language, and there has been a demand for effective use of such existing software resources. Could not be easily realized.

【0005】このような問題点を解決する試みに関する
公知例としては、特開平11−338521号公報に記
載された制御装置が挙げられる。この公知例では、制御
装置の基本ソフトウェアにユーザ関数登録機能を備える
発明が述べられている。このユーザ関数登録機能では、
ユーザがユーザ関数の名称と引数等を定義する文法、ユ
ーザ関数の演算内容を汎用言語により記述したもの、さ
らにユーザ関数の実行モジュールのメモリ上でのエント
リアドレスを入力することにより、専用言語の標準関数
とは別のユーザ関数を登録できるようになっている。こ
の公知技術によれば、制御プログラムの作成時にはユー
ザ関数をそのまま記述できるので、プログラムの解読性
が低下することはなく、また制御プログラムの実行時に
はユーザ関数の実行コードを呼び出すので、その解釈処
理時間が大幅に増大することはないと考えられる。ま
た、制御装置の改造を第三者に依頼する必要はなく、ユ
ーザ自身が所望のユーザ関数を新たに登録することがで
きる。
As a known example of an attempt to solve such a problem, there is a control device described in Japanese Patent Application Laid-Open No. H11-338521. This known example describes an invention in which a basic function of a control device has a user function registration function. In this user function registration function,
The grammar that the user defines the name and arguments of the user function, the contents of the operation of the user function are described in a general-purpose language, and the entry address of the execution module of the user function in the memory is input to the special language standard. A user function different from the function can be registered. According to this known technique, the user function can be described as it is when the control program is created, so that the readability of the program does not deteriorate. Further, the execution code of the user function is called when the control program is executed. Is not expected to increase significantly. Further, there is no need to request a third party to modify the control device, and the user himself can newly register a desired user function.

【0006】[0006]

【発明が解決しようとする課題】上記した特開平11−
338521号公報に記載されたユーザ関数登録機能で
は、ユーザ自身がユーザ関数の名称と引数等を定義する
文法とユーザ関数の実行モジュールのエントリアドレス
等を所定の書式にしたがって入力する必要があるため、
ユーザに余計な手間をかけてしまうだけでなく、この段
階で入力ミスが発生する可能性もあり、プログラム作成
上の効率の面でさらなる改善が望まれる。また、ユーザ
が既に汎用言語によるソフトウェア資産を持っており、
これを部分的に利用したいと考えている場合、上記ユー
ザ関数登録機能では、そのソースコードを再編集する必
要が生じる可能性がある。さらに、上記公知例では、制
御プログラムをインタプリタ方式により実行することを
前提としているため、プログラム実行効率の面でも改善
の余地はある。
SUMMARY OF THE INVENTION The above-mentioned Japanese Patent Application Laid-Open No.
In the user function registration function described in Japanese Patent Publication No. 338521, it is necessary for the user himself to input the grammar for defining the name and arguments of the user function and the entry address of the execution module of the user function according to a predetermined format.
Not only does the user take extra time, but also an input error may occur at this stage, and further improvement in program creation efficiency is desired. Also, if the user already has software assets in a general-purpose language,
If the user wants to use this partly, the user function registration function may need to re-edit the source code. Further, in the above-mentioned known example, since it is assumed that the control program is executed by the interpreter method, there is room for improvement also in terms of program execution efficiency.

【0007】そこで、本発明では、ユーザが汎用言語で
作成した関数を、簡単な操作で制御プログラムに組み込
んで利用でき、かつその組み込みにより実行速度が特に
低下しない制御プログラム作成方法とその装置を提供す
ることを目的とする。
In view of the above, the present invention provides a control program creation method and a control program creation method in which a function created in a general-purpose language by a user can be incorporated into a control program by a simple operation and the execution speed is not particularly reduced by the incorporation. The purpose is to do.

【0008】[0008]

【課題を解決するための手段】本発明は、問題向きの専
用言語により記述された制御プログラムを制御装置が実
行可能な機械語に変換するための制御プログラム作成装
置において、ユーザが汎用言語により記述したソースコ
ード群から、制御プログラムの中で利用するユーザ関数
の参照形式定義情報と、前記ユーザ関数に関連する処理
のみを抽出したユーザ関数汎用言語ソースコードとを生
成するユーザ関数抽出手段と、専用言語の記述の中に前
記ユーザ関数の記述を混在させた制御プログラムから制
御プログラムの汎用言語ソースコードを生成する汎用言
語変換手段と、前記ユーザ関数抽出手段により生成され
た参照形式定義情報及びユーザ関数汎用言語ソースコー
ドを用いて、前記汎用言語変換手段により生成された制
御プログラムの汎用言語ソースコードを前記機械語に変
換する機械語変換手段と、を備えたことを特徴とする制
御プログラム作成装置を開示する。
SUMMARY OF THE INVENTION The present invention provides a control program creating apparatus for converting a control program described in a dedicated language suitable for a problem into a machine language executable by a control apparatus. User function extraction means for generating, from the source code group, reference format definition information of a user function used in a control program and a user function general-purpose language source code obtained by extracting only a process related to the user function, General-purpose language conversion means for generating a general-purpose language source code of a control program from a control program in which the description of the user function is mixed in the description of the language; reference format definition information and user functions generated by the user function extraction means The general-purpose language source code is used to generate a generalized control program generated by the general-purpose language conversion means. It discloses a machine language conversion means for converting the language source code into the machine language, a control program creating device characterized by comprising a.

【0009】更に本発明は、前記ユーザ関数抽出手段
は、前記汎用言語により記述したソースコード群に含ま
れる関数の宣言文とこれらの関数対応のチェックボック
スを持つチェックリストを生成、表示するチェックリス
ト表示手段を備え、チェックボックスにより選択された
ユーザ関数に対して前記参照形式定義情報と前記ユーザ
関数汎用言語ソースコードとを自動的に生成することを
特徴とする制御プログラムの作成装置を開示する。
Further, according to the present invention, the user function extracting means generates and displays a checklist having function declaration statements included in a source code group described in the general-purpose language and check boxes corresponding to these functions. Disclosed is a control program creating apparatus, comprising a display unit, which automatically generates the reference format definition information and the user function general-purpose language source code for a user function selected by a check box.

【0010】更に本発明は、前記専用言語は、ユーザ関
数を利用して汎用言語により記述されたブロックを指示
するための指示コマンドを有しており、前記汎用言語変
換手段は、前記制御プログラムの、前記指示コマンドで
指定されていない専用言語のコマンドを汎用言語の標準
関数に変換し、前記指示コマンドで指示されたブロック
の内容をそのままコピーすることにより制御プログラム
の汎用言語ソースコードを生成することを特徴とする制
御プログラム作成装置を開示する。
Further, according to the present invention, the dedicated language has an instruction command for designating a block described in a general-purpose language using a user function. Generating a general-purpose language source code of a control program by converting a command in a special-purpose language not specified by the instruction command into a standard function in a general-purpose language, and copying the contents of the block specified by the instruction command as it is. A control program creation device characterized by the following.

【0011】更に本発明は、前記プログラムは、シーケ
ンシャル・ファンクション・チャートの図形形式の記述
とテキスト形式の記述を組み合わせて作成プログラム
を、シーケンスの各ステップの状態遷移に対応したIF
〜THEN形式のルールによる記述に変換して保存され
たプログラムであり、前記汎用言語変換手段は、前記ル
ールの各々をステップが活性化されたときに実行される
関数に変換して制御プログラムの汎用言語ソースコード
を生成することを特徴とする制御プログラム作成装置を
開示する。
Further, according to the present invention, the program combines a graphic format description of a sequential function chart with a text format description to generate a creation program by using an IF corresponding to a state transition of each step of a sequence.
A general-purpose language conversion unit that converts each of the rules into a function that is executed when a step is activated, and converts the rule into a function that is executed when a step is activated. Disclosed is a control program creation device that generates a language source code.

【0012】更に本発明は、問題向きの専用言語により
記述された制御プログラムを制御装置が実行可能な機械
語に変換するための制御プログラム作成方法において、
ユーザ関数を利用して汎用言語により記述されたブロッ
クを、そのブロックを指示するための指示コマンドを用
いて制御プログラム中に記述し、前記ユーザ関数の各々
のソースコードから当該ユーザ関数の参照定義情報と当
該ユーザ関数の処理を記述するユーザ関数汎用言語ソー
スコードとを生成し、前記制御プログラムの、前記指示
コマンドで指示されていない専用言語の記述を制御プロ
グラム汎用言語ソースコードに変換した後、この制御プ
ログラム汎用言語ソースコードを前記参照定義情報及び
前記ユーザ関数汎用言語ソースコードを用いて機械語に
変換することを特徴とする制御プログラム作成方法を開
示する。
Further, the present invention relates to a control program creating method for converting a control program described in a dedicated language suitable for a problem into a machine language executable by a control device.
A block described in a general-purpose language using a user function is described in a control program using an instruction command for designating the block, and reference definition information of the user function is obtained from each source code of the user function. And a user function general-purpose language source code describing the processing of the user function, and converting the description of the dedicated language of the control program not specified by the instruction command into a control program general-purpose language source code. A method of creating a control program, characterized by converting a control program universal language source code into a machine language using the reference definition information and the user function universal language source code, is disclosed.

【0013】[0013]

【発明の実施の形態】以下、本発明の実施の形態につい
て、添付図面を参照して説明する。図1は、本発明にな
る制御プログラム作成装置の処理手順例を示す図であ
る。この制御プログラム作成装置は、プログラマブルロ
ジックコントローラ用のシーケンス制御言語、モーショ
ンコントローラ用のモーション制御言語、ロボットコン
トローラ用のロボット言語などの専用言語に用意された
標準関数ライブラリを用いて記述された専用言語プログ
ラム101中に、ユーザの作成した汎用言語ソースコー
ド102中に含まれるユーザ関数を組み込み、それらを
最終的に機械語に翻訳して制御プログラム機械語オブジ
ェクトコード103を生成するものである。
Embodiments of the present invention will be described below with reference to the accompanying drawings. FIG. 1 is a diagram showing an example of a processing procedure of the control program creating device according to the present invention. This control program creation device is a dedicated language program written using standard function libraries prepared in dedicated languages such as a sequence control language for programmable logic controllers, a motion control language for motion controllers, and a robot language for robot controllers. A user function included in a general-purpose language source code 102 created by a user is incorporated in 101, and these are finally translated into a machine language to generate a control program machine language object code 103.

【0014】このために、図1の制御プログラム作成装
置には、汎用言語ソースコード102から、制御プログ
ラムの中でユーザ関数を利用するためのユーザ関数参照
形式定義情報102aと、ユーザ関数に関連する処理の
みを抽出したユーザ関数汎用言語ソースコード102b
とを自動的に生成するユーザ関数抽出手段105を設け
る。ここで抽出されたユーザ関数は、専用言語制御プロ
グラム101の中で記述することが可能となる。このよ
うに専用言語の記述の中にユーザ関数の記述を混在させ
た専用言語制御プログラム101は、汎用言語変換手段
104によって制御プログラム汎用言語ソースコード1
01aに変換される。機械語変換手段106は、以上の
ように生成された制御プログラム汎用言語ソースコード
101a、ユーザ関数参照形式定義情報102a、及び
ユーザ関数汎用言語ソースコード102bから、最終的
に制御装置内で実行可能な形式の制御プログラム機械語
オブジェクトコード103を生成する。以下では、汎用
言語としては一般に広く普及しているC言語を用いるも
のとする。
For this purpose, the control program creating apparatus shown in FIG. 1 includes, from the general language source code 102, user function reference format definition information 102a for using a user function in the control program, and information related to the user function. User function general-purpose language source code 102b extracting only processing
Is provided automatically. The user functions extracted here can be described in the dedicated language control program 101. As described above, the dedicated language control program 101 in which the description of the user function is mixed in the description of the dedicated language is used by the universal language conversion unit 104 to generate the control program universal language source code 1.
01a. The machine language conversion means 106 can be finally executed in the control device from the control program general-purpose language source code 101a, the user function reference format definition information 102a, and the user function general-purpose language source code 102b generated as described above. A control program machine language object code 103 is generated. In the following, it is assumed that the C language, which is generally widely used, is used as a general-purpose language.

【0015】機械語変換手段106では、制御プログラ
ム汎用言語ソースコード101a、ユーザ関数汎用言語
ソースコード102bは、中間機械語変換手段106c
によって、それぞれ制御プログラム中間機械語オブジェ
クトコード101b、ユーザ関数中間機械語オブジェク
トコード102cに変換される。ここで、制御プログラ
ム汎用言語ソースコード101aにはユーザ関数が記述
されており、このユーザ関数の実体は別のソースコード
であるユーザ関数汎用言語ソースコード102bに記述
されている。このようなユーザ関数の外部参照を可能と
するためにユーザ関数参照形式定義情報102aが必要
となり、制御プログラム汎用言語ソースコード101a
を中間機械語に変換する際に用いられる。これと同様
に、専用言語及び汎用言語に含まれる各種標準関数の実
体は、汎用言語処理システムに備えられている標準関数
ライブラリに含まれており、これらの標準関数を外部参
照するために標準関数参照形式定義情報106aが必要
であり、制御プログラム汎用言語ソースコード101
a、ユーザ関数汎用言語ソースコード102bを中間機
械語に変換する際に用いられる。
The machine language conversion means 106 converts the control program general-purpose language source code 101a and the user function general-purpose language source code 102b into intermediate machine language conversion means 106c.
Thus, they are converted into a control program intermediate machine language object code 101b and a user function intermediate machine language object code 102c, respectively. Here, a user function is described in the control program general-purpose language source code 101a, and the substance of the user function is described in another user function general-purpose language source code 102b. The user function reference format definition information 102a is required to enable external reference of such a user function, and the control program general-purpose language source code 101a
Is used to convert to an intermediate machine language. Similarly, the entities of various standard functions included in the dedicated language and the general-purpose language are included in the standard function library provided in the general-purpose language processing system. The reference format definition information 106a is required, and the control program general-purpose language source code 101
a, User function Used when converting the general-purpose language source code 102b into an intermediate machine language.

【0016】中間機械語オブジェクトコード結合手段1
06dは、制御プログラム中間機械語オブジェクトコー
ド101b、ユーザ関数中間機械語オブジェクトコード
102c、さらに標準関数ライブラリを中間機械語に変
換した標準関数中間機械語オブジェクトコード106b
から、標準関数及びユーザ関数の外部参照を解決すると
同時にそれぞれの中間機械語オブジェクトコードを結合
して、最終的な実行モジュールである制御プログラム機
械語オブジェクトコード103を生成する。
Intermediate machine language object code combining means 1
06d is a control program intermediate machine language object code 101b, a user function intermediate machine language object code 102c, and a standard function intermediate machine language object code 106b obtained by converting a standard function library into an intermediate machine language.
, The external reference of the standard function and the user function are resolved, and at the same time, the respective intermediate machine language object codes are combined to generate the control program machine language object code 103 which is the final execution module.

【0017】前記のように汎用言語としてC言語を用い
るものとすると、制御プログラム汎用言語ソースコード
101a、ユーザ関数汎用言語ソースコード102b
は、それぞれC言語のソースコードであり、標準関数参
照形式定義情報106a、ユーザ関数参照形式定義情報
102aは、それぞれ標準関数、ユーザ関数のC言語の
extern宣言を記述したヘッダファイル(インクル
ードファイル)に相当する。なお、これらのヘッダファ
イルは制御プログラム汎用言語ソースコード101aの
冒頭部分において,プリプロセッサ命令#includ
eによって取り込まれる。また、中間機械語変換手段1
06c、及び中間機械語オブジェクトコード結合手段1
06dは、それぞれC(クロス)コンパイラ、及びリン
カに相当する。
Assuming that the C language is used as the general language as described above, the control program general language source code 101a and the user function general language source code 102b
Are the source code of the C language, and the standard function reference format definition information 106a and the user function reference format definition information 102a are stored in a header file (include file) describing the C language external declaration of the standard function and the user function, respectively. Equivalent to. These header files are included in the preprocessor instruction #include at the beginning of the control program general-purpose language source code 101a.
captured by e. In addition, intermediate machine language conversion means 1
06c and intermediate machine language object code combining means 1
06d corresponds to a C (cross) compiler and a linker, respectively.

【0018】以上の図1に示したプログラム作成装置に
おいて、本発明の特徴とするのは、ユーザ関数抽出手段
105及び汎用言語変換手段104であり、以下、これ
らを中心とした動作を具体例を用いて説明する。
In the program creating apparatus shown in FIG. 1, the features of the present invention are the user function extracting means 105 and the general-purpose language converting means 104. Hereinafter, the operation centering on these will be described in a specific example. It will be described using FIG.

【0019】図2は、制御プログラムの編集画面の一例
を示す図である。ここで、制御プログラムの処理の流れ
(シーケンス)はSFC(シーケンシャル・ファンクシ
ョン・チャート)により記述し、シーケンスの各ステッ
プの処理はテキスト形式の専用言語により記述する。シ
ーケンス編集ウィンドウ201では、制御対象となる各
機器のシーケンスをSFCの図形形式により記述する。
コマンド編集ウィンドウ202では、シーケンスの各ス
テップの動作を専用言語のコマンドとして記述する。終
了条件編集ウィンドウ203では、各ステップが終了す
るための条件を条件式として記述する。シーケンス編集
ウィンドウ201で記述されるSFCのステップS10
0、S101…の各々は各機器の単位動作を示し、その
動作内容はコマンド列としてコマンド編集ウィンドウ2
02において記述される。
FIG. 2 is a diagram showing an example of a control program editing screen. Here, the processing flow (sequence) of the control program is described by SFC (sequential function chart), and the processing of each step of the sequence is described by a text-format dedicated language. In the sequence edit window 201, the sequence of each device to be controlled is described in the SFC graphic format.
In the command editing window 202, the operation of each step of the sequence is described as a command in a special language. In the end condition edit window 203, a condition for ending each step is described as a conditional expression. Step S10 of SFC described in the sequence edit window 201
0, S101... Indicate the unit operation of each device.
02.

【0020】図2右側のコマンド編集ウィンドウ202
には、ステップS103のコマンド列が記述されてお
り、これとポジショナの目標位置を計算するためのパラ
メータを取得し、ユーザ関数を用いて目標位置を計算
し、さらに、この目標位置へポジショナを移動させ、ワ
ークを把持するためのチャックを開いて、チャック開動
作を監視するためのオンディレイタイマを起動するステ
ップである。また、トランジション201b、201c
は、ステップ間の状態遷移を示し、その遷移条件はこれ
らのトランジションの入力ステップS103の終了条件
として、終了条件編集ウィンドウ203に記述される。
ステップS103の終了条件は2種類あり、制限時間内
にチャックが完全に開いた場合(終了条件T1)、制限
時間内にチャックが完全に開かない場合(終了条件T
2)を定義する条件式が記述されている。終了条件T
1、T2はステップS103から次のステップに遷移す
るための条件として、その出力トランジション201
b、201cの右横に付記される。
The command editing window 202 on the right side of FIG. 2
Describes the command sequence of step S103, obtains parameters for calculating the target position of the positioner, calculates the target position using a user function, and further moves the positioner to this target position. This is a step of opening a chuck for gripping the workpiece, and starting an on-delay timer for monitoring the chuck opening operation. Also, transitions 201b, 201c
Indicates a state transition between steps, and the transition condition is described in the end condition edit window 203 as the end condition of the input step S103 of these transitions.
There are two types of ending conditions in step S103. When the chuck is completely opened within the time limit (end condition T1), when the chuck is not completely opened within the time limit (end condition T).
The conditional expression that defines 2) is described. Termination condition T
1, T2 is a condition for transitioning from step S103 to the next step, as the output transition 201
b, 201c.

【0021】コマンド編集ウィンドウ202では、制御
装置側で予め用意された専用言語のコマンドを記述する
だけでなく、ユーザがC言語などの汎用言語により作成
したユーザ関数を記述することができる。図1の構成で
は、このようにコマンド列の中にC言語によるユーザ関
数を記述した部分(以下、ユーザ関数ブロック)を明示
するためにコマンド#C、#END_Cが用意されてお
り、これらで囲まれた部分がユーザ関数ブロックを表し
ている。図2のコマンド編集ウィンドウ202に示した
コマンド列の中にある#Cと#END_Cで囲まれた部
分、すなわちユーザ関数ブロック202aには、C言語
で別途定義されたユーザ関数calc_pos_
x()、calc_pos_y()によりポジショナの
目標位置を計算し、これらを専用言語の変数VR4、V
R5(それぞれC言語表記では、VR〔4〕、VR
〔5〕)に代入する処理が記述されている。変数VR
4、VR5は、ユーザ関数ブロック202aに続く専用
言語のコマンド(MOVE AXIS1VR4 AXI
S2 VR5 F 2000.)のパラメータとして参
照されている。なお、ここに示すように、ユーザ関数ブ
ロック202aの中の表記は、C言語の文法に従った表
記となる。また、専用言語で用意される番号付きの各種
変数(VRnなど)はユーザ関数ブロック202aの中
でも利用可能であり、これらはC言語の配列(VR
〔n〕など)として表記される。
In the command editing window 202, not only commands in a dedicated language prepared in advance on the control device side but also user functions created by a user in a general-purpose language such as C language can be described. In the configuration of FIG. 1, commands #C and #END_C are prepared in order to clearly indicate a portion (hereinafter, a user function block) describing a user function in C language in a command sequence, and are surrounded by these. The shaded portion represents a user function block. In the part of the command sequence shown in the command editing window 202 shown in FIG. 2 that is surrounded by #C and #END_C, that is, in the user function block 202a, a user function calc_pos_ defined separately in C language is included.
The target position of the positioner is calculated by x () and calc_pos_y (), and these are converted into variables VR4, V
R5 (in C language notation, VR [4], VR
The processing to be substituted in [5]) is described. Variable VR
4, VR5 is a command (MOVE AXIS1VR4 AXI) of a special language following the user function block 202a.
S2 VR5 F 2000. ) Parameter. Note that, as shown here, the notation in the user function block 202a is a notation according to the grammar of the C language. Also, various numbered variables (VRn and the like) prepared in a dedicated language can be used in the user function block 202a, and these can be used in the C language array (VR
[N] etc.).

【0022】このようなユーザ関数ブロック202aを
示すコマンドを設けたことにより、ユーザが慣れ親しん
だC言語の文法に従って容易にユーザ関数を記述するこ
とが可能となる。また、このようにユーザ関数ブロック
202aを明示するコマンドを利用すれば、後述のよう
に、専用言語制御プログラム101から制御プログラム
汎用言語ソースコード101aに変換する汎用言語変換
手段104の処理を簡単にすることができる。
By providing such a command indicating the user function block 202a, the user function can be easily described in accordance with the C language grammar that the user is familiar with. Also, by using the command that explicitly specifies the user function block 202a, the processing of the general-purpose language conversion unit 104 that converts the dedicated language control program 101 into the control program general-purpose language source code 101a is simplified as described later. be able to.

【0023】なお、図2のようなSFCでは、並行して
実行される各シーケンスの間の同期を表現するためのス
テップが用意されており、これを同期ステップと呼ぶ。
例えば、シーケンス編集ウィンドウ201に示した同期
ステップREQ1は、ステップS103の入力トランジ
ション(201f)に対する入力となっており、これは
入力トランジション(201f)において他のシーケン
スが出力する同期信号を待つことを意味する。すなわ
ち、ステップS103への遷移は、直前のステップS1
02が終了条件T1で終了し、さらに同期ステップRE
Q1が活性化されることにより発生する。
In the SFC as shown in FIG. 2, steps for expressing the synchronization between the sequences executed in parallel are prepared, and these steps are called synchronization steps.
For example, the synchronization step REQ1 shown in the sequence editing window 201 is an input to the input transition (201f) in step S103, which means that the input transition (201f) waits for a synchronization signal output by another sequence. I do. That is, the transition to step S103 is performed in the immediately preceding step S1.
02 ends with the end condition T1, and the synchronization step RE
This occurs when Q1 is activated.

【0024】図4は、ユーザ関数抽出手段105の概略
処理を示すフローチャート、図3はその処理例を示す説
明図である。通常、ユーザに関連するユーザ関数を記述
したソースコード群を1つのファイルにまとめているか
ら、この中のいくつかのユーザ関数を利用するときは、
まずユーザが該当するファイルを指定して記述されたソ
ースコードをオープンする(処理401)。図3のC言
語のソースコード301はその記述例で、float型
の変数x、y、cからfloat型の値を算出する関数
calc_vel_x、calc_vel_y、cal
c_pos_x、calc_pos_y…が記述されて
いる。但し、各関数の処理を定義する{…}の部分は、
通常複数の行に分けて記述されるが、図3ではこれを
{…}の一行で表している。次に、表示されたソースコ
ードから、その中のユーザ関数を調べて、ユーザ関数の
チェックリスト302を作成し、これをユーザに対して
提示する(処理402)。このチェックリスト302
は、関数宣言文と各関数に設けたチェックボックスより
成っている。ユーザはこのチェックリストを参照し、制
御プログラムの中で使用するユーザ関数をチェックボッ
クスをクリックして選択する(処理403)。
FIG. 4 is a flowchart showing a schematic process of the user function extracting means 105, and FIG. 3 is an explanatory diagram showing an example of the process. Normally, a group of source codes describing user functions related to the user is collected in one file. When using some of the user functions,
First, the user opens the source code described by designating the corresponding file (process 401). The source code 301 of the C language in FIG. 3 is a description example thereof, and functions calc_vel_x, calc_vel_y, and calc_vel_x, calc_vel_y, and cal which calculate a float type value from the float type variables x, y, and c
c_pos_x, calc_pos_y... are described. However, the part of {...} that defines the processing of each function is
Usually, the description is divided into a plurality of lines, but in FIG. 3, this is represented by one line {{}. Next, the user functions in the displayed source code are checked, a checklist 302 of the user functions is created, and this is presented to the user (process 402). This checklist 302
Consists of function declaration statements and check boxes provided for each function. The user refers to this checklist and clicks a check box to select a user function to be used in the control program (process 403).

【0025】ユーザ関数の選択が終了すれば、選択され
たユーザ関数の中で直接的または間接的に呼び出される
すべての関数を調べ(処理404)、選択されたユーザ
関数とそれに関連する関数のソースコードを抜き出した
新たなユーザ関数ソースコード304を生成する(処理
405)。さらに、ユーザ関数のチェックリスト302
のユーザ関数宣言文から、選択されたユーザ関数の外部
参照宣言ヘッダファイル303を生成する(処理40
6)。ここで生成されたユーザ関数生成コード304及
び外部参照ヘッダファィル303は、それぞれ図1のユ
ーザ関数汎用言語ソースコード102b及びユーザ関数
参照形式定義情報102aに相当する。また外部参照ヘ
ッダファィル303は、選択されたユーザ関数の関数宣
言文に外部参照可能であることを示す“extern”
を付加したリストである。
When the selection of the user function is completed, all the functions that are directly or indirectly called in the selected user function are examined (operation 404), and the source of the selected user function and its related functions are checked. A new user function source code 304 from which the code is extracted is generated (process 405). Further, a checklist 302 of the user function
The external reference declaration header file 303 of the selected user function is generated from the user function declaration sentence (process 40).
6). The user function generation code 304 and the external reference header file 303 generated here correspond to the user function general-purpose language source code 102b and the user function reference format definition information 102a in FIG. 1, respectively. The external reference header file 303 includes “extern” indicating that external reference is possible in the function declaration statement of the selected user function.
Is a list to which is added.

【0026】以上に述べたユーザ関数抽出手段105を
利用すれば、ユーザはC言語ソースコード301から生
成されるユーザ関数のチェックリスト302にチェック
するという簡単な操作を行うだけで選択したユーザ関数
を専用言語プログラム中で利用できるようになるので、
ユーザ関数を引用するためのユーザの手間と入力ミスを
極力省くことができる。また、ユーザが既に汎用言語に
よるソフトウェア資産を所有している場合、これを容易
かつ有効に活用することが可能となる。
By using the user function extracting means 105 described above, the user can select a user function by simply performing a simple operation of checking a user function check list 302 generated from the C language source code 301. Since it will be available in a dedicated language program,
It is possible to minimize the trouble and input mistakes of the user for citing the user function. Also, if the user already owns a software asset in a general-purpose language, it can be used easily and effectively.

【0027】図6は、汎用言語変換手段104の概略処
理を示すフローチャート、図5はその処理例を示す図
で、図2に示した専用言語制御プログラム101の一部
を制御プログラム汎用言語ソースコード101aに変換
する場合を示している。図2で説明したように、制御プ
ログラムをSFCで作成するときには、制御プログラム
のシーケンスを図2のウィンドウ201のようなSFC
の図形形式で記述し、シーケンスの各ステップの動作と
終了条件を図2のウィンドウ202のようにテキスト形
式の言語により記述する。このような図形形式とテキス
ト形式を組み合わせて記述された専用言語制御プログラ
ム101は、図5に示すようなテキスト形式の専用言語
制御プログラム510に自動的に変換され、ファイルと
して保存されている。
FIG. 6 is a flowchart showing the general processing of the general-purpose language conversion means 104, and FIG. 5 is a diagram showing an example of the processing. A part of the dedicated language control program 101 shown in FIG. It shows the case of converting to 101a. As described with reference to FIG. 2, when the control program is created by the SFC, the sequence of the control program is changed to an SFC
The operation and the end condition of each step of the sequence are described in a text format language as shown in a window 202 in FIG. The dedicated language control program 101 described by combining such a graphic form and a text form is automatically converted into a dedicated language control program 510 in a text form as shown in FIG. 5 and stored as a file.

【0028】この専用言語制御プログラム510はIF
〜THEN形式のルールによって記述されており、各ル
ールの条件部にはシーケンスのあるステップから次のス
テップへの状態遷移を定義する条件、実行部には遷移し
た次のステップで実行されるコマンド列が記述される。
例えば、ルール511の条件部511aには、ステップ
S102が正常終了(CompleteNormall
y)し、さらに同期ステップREQ1が活性化される
(ON)という条件式が記述されている。ルール511
の実行部の最初のブロック511bは、ステップの遷移
に関するコマンド列であり、ステップS102と同期ス
テップREQ1を不活性状態にし(TERM S10
2、TERM REQ1)、ステップS103を実行中
状態にする(EXEC S103)。次に続くブロック
511c、511d、511eは、図2のコマンド編集
ウィンドウ202に示したステップS103のコマンド
列であり、ブロック511c、511eは専用言語によ
るコマンド列、ブロック511dはC言語によるユーザ
関数ブロック202aである。最後のEND_IF文5
11fは、ルール511の終わりを示す。
This dedicated language control program 510
Are described by the rules of the THEN format, the condition part of each rule is a condition defining a state transition from a certain step in the sequence to the next step, and the execution part is a command sequence executed in the next step after the transition. Is described.
For example, in the condition part 511a of the rule 511, step S102 is normally completed (Complete Normally).
y), and the conditional expression that the synchronization step REQ1 is activated (ON) is further described. Rule 511
The first block 511b of the execution unit is a command sequence related to the transition of the step, and inactivates the step S102 and the synchronization step REQ1 (TERM S10
2, TERM REQ1), and set the step S103 to the executing state (EXEC S103). Subsequent blocks 511c, 511d, and 511e are the command strings in step S103 shown in the command editing window 202 in FIG. 2, blocks 511c and 511e are command strings in a special language, and block 511d is a user function block 202a in C language. It is. Last END_IF statement 5
11f indicates the end of the rule 511.

【0029】汎用言語変換手段104は、まず、ユーザ
により指定された専用言語制御プログラム101のファ
イルをオープンし(処理601)、上記のような形式で
記述された専用言語制御プログラム510を一行ずつ取
り込む(処理602)。次に取り込んだ行がIF文かを
調べ(処理603)、IF文であればこの行から次に現
れるEND_IF文までのルールを1つの関数とすべ
く、IF文の第1条件式から関数宣言部(関数の型と名
称)を生成し(処理604)、さらにこの第1条件式か
らif条件文を生成する(処理605)。ここで生成さ
れるルール対応の関数は、各ステップが活性化されたと
きに実行される関数であり、関数名は活性化されるステ
ップ番号に対応している。図5のルール511の場合に
は、図2のステップS102が活性化(ステップS10
2のすべてのコマンド発行が終わっている状態)してい
ることが第1条件式であるので、処理504ではルール
511対応の関数名はステップS102に対して“st
t102”とされ、そして処理605では、第1条件式
から対応するif条件文“if(stt〔102〕==
Complete Normally”が生成される。
First, the general-purpose language conversion means 104 opens the file of the special-purpose language control program 101 specified by the user (process 601), and fetches the special-purpose language control program 510 described in the above format line by line. (Process 602). Next, it is checked whether the fetched line is an IF statement (process 603). If the line is an IF statement, a function declaration is made from the first conditional expression of the IF statement so that the rule from this line to the next END_IF statement becomes one function. A part (function type and name) is generated (process 604), and an if conditional statement is generated from the first conditional expression (process 605). The function corresponding to the rule generated here is a function executed when each step is activated, and the function name corresponds to the step number to be activated. In the case of the rule 511 of FIG. 5, step S102 of FIG. 2 is activated (step S10).
2 is the first conditional expression), and in step 504, the function name corresponding to the rule 511 is “st” for step S102.
t102 ”, and in the process 605, the corresponding if conditional statement“ if (stt [102] ==
Complete Normally "is generated.

【0030】次の一行を取り込み、これがIF文でなか
ったときは(処理603でNO)、それが&(アンド)
条件であれば(処理606でYES)、その条件式から
if条件文の続きを生成し(処理607)、&条件でな
いときは処理608へ移行する。図5の例では、2行目
はIF文の続きの&条件“& REQ1=ON”である
から、これに対応するif条件式“&& Req〔1〕
==ON”が生成される。処理607は&条件がなくな
るまで繰り返される。こうして、ルール511の条件部
511aは、C言語のif文に変換され、ブロック52
1aが生成される。
The next line is fetched, and if this is not an IF statement (NO in step 603), it is a & (and)
If the condition is satisfied (YES in step 606), the continuation of the if conditional statement is generated from the conditional expression (step 607). If the condition is not &, the process proceeds to step 608. In the example of FIG. 5, since the second line is the & condition “& REQ1 = ON” following the IF statement, the corresponding if conditional expression “&& Req [1]
== ON ”is generated. The process 607 is repeated until the & condition is no longer present. Thus, the condition part 511a of the rule 511 is converted into an if sentence of the C language, and the block 52 is executed.
1a is generated.

【0031】取り込んだ行がIF文でも&条件でもない
ときは(処理603、606でNO)、その行がTHE
N文かを判定し(処理608)、THEN文でないとき
は注釈行等の処理に関係ない文として無視して処理60
2へ戻る。処理608の判定結果がTHEN文であれ
ば、if文の実行部の生成に移る。ここで、さらに1行
ずつ取り込み(処理609)、これが#C文でなく(処
理610でNO)、END_IF文でもなければ(処理
611でNO)、これは専用言語のコマンドであり、こ
れをC言語の標準関数に変換する(処理612)。ま
た、取り込んだ行が「#C」であれば(処理610でY
ES)、ここからユーザ関数ブロックが始まることにな
り、さらに1行ずつ取り込んで(処理614)、これが
#END_C文でなければ(処理615でNO)、取り
込んだ文字列、すなわちC言語による表記をそのままコ
ピーする(処理616)。この処理を#END_C文に
到達するまで(処理615でYES)繰り返す。このよ
うにユーザ関数ブロックの終わりに到達すれば、再び1
行ずつ取り込み(処理609)、これがEND_IF文
になるまで、以上のようなif文の実行部の生成処理を
繰り返す(処理611でYES)。END_IF文に到
達すれば(処理611)、if文の終了部分と関数の終
了部分を生成する(処理613)。以上のような変換の
処理を最終行に到達するまで繰り返す(処理614)。
If the fetched line is neither an IF statement nor a & condition (NO in steps 603 and 606), the line is
It is determined whether the sentence is an N sentence (process 608).
Return to 2. If the determination result of the process 608 is a THEN statement, the process proceeds to generation of an if statement execution unit. Here, one more line is fetched (process 609). This is not a #C statement (NO in process 610), and if it is not an END_IF statement (NO in process 611), this is a command in a special language. It is converted into a language standard function (process 612). If the fetched line is “#C” (Y in step 610)
ES), the user function block starts from here, and the user function block is fetched line by line (process 614). If this is not a #END_C statement (NO in process 615), the fetched character string, that is, the notation in C language It is copied as it is (process 616). This process is repeated until a #END_C statement is reached (YES in process 615). When the end of the user function block is reached in this manner, 1 is returned again.
The line is fetched line by line (process 609), and the generation process of the execution part of the if sentence as described above is repeated until this becomes an END_IF sentence (YES in process 611). When the END_IF statement is reached (process 611), the end part of the if statement and the end part of the function are generated (process 613). The above conversion process is repeated until the last line is reached (process 614).

【0032】以上実行部生成処理(図6の処理608〜
614)を図5のルール511に対して実行すると、関
数521のif文の実行部にあたるブロック521b、
521c、521d、521eが、それぞれルール51
1のブロック511b、511c、511d、511e
から生成され、このうちブロック521b、521c、
521eは専用言語のコマンド列を対応するC言語の標
準関数に変換したもの、ブロック521dはC言語によ
るユーザ関数ブロック511dの内容をコピーしたもの
となっている。また関数521の最終部分のブロック5
21fは、ルール511の最後のEND_IF文に対応
して処理613で生成される。図5の続くルール512
からも同様にして関数522が生成される。
The execution unit generation processing (processing 608 to 608 in FIG. 6)
614) with respect to the rule 511 of FIG. 5, the block 521b corresponding to the execution part of the if statement of the function 521,
521c, 521d, and 521e are rules 51, respectively.
One block 511b, 511c, 511d, 511e
From among the blocks 521b, 521c,
Numeral 521e is obtained by converting a command sequence in a special language into a corresponding standard function in C language, and block 521d is obtained by copying the contents of a user function block 511d in C language. Block 5 of the last part of the function 521
21f is generated in the process 613 corresponding to the last END_IF statement of the rule 511. Rule 512 following FIG.
Similarly, a function 522 is generated.

【0033】以上のように、制御プログラムを汎用言語
に変換することにより、汎用言語によるユーザ関数の引
用が容易になり、さらにこれらの汎用言語のソースコー
ドをコンパイル、リンクすることで、制御装置において
高速実行可能な機械語のオブジェクトコードを生成する
ことが可能となる。
As described above, by converting the control program into a general-purpose language, it is easy to cite user functions in the general-purpose language, and further, by compiling and linking the source codes of these general-purpose languages, the It is possible to generate a machine language object code that can be executed at high speed.

【0034】なお、本実施の形態では汎用言語としてC
言語を用いた例を示したが、別の汎用言語(例えば、C
++など)を用いて同様の制御プログラム作成装置を実
現することも可能である。また、本実施の形態ではユー
ザ関数を記述するための汎用言語と専用言語を変換して
得られる汎用言語を同じC言語とした例を示したが、こ
れをそれぞれ異なった汎用言語(例えば、前者をアセン
ブリ言語、後者をC言語など)とすることも可能であ
る。この場合、ユーザ関数汎用言語ソースコードと制御
プログラム汎用言語ソースコードを、それぞれ別の中間
機械語変換手段(コンパイラ)により中間機械語オブジ
ェクトコードに変換し、それらを中間機械語オブジェク
トコード結合手段により結合することで、同様の制御プ
ログラムの作成方法を実現することが可能である。
In this embodiment, C is used as a general-purpose language.
Although an example using a language is shown, another general-purpose language (for example, C
++) can be used to realize a similar control program creation device. Further, in the present embodiment, an example is shown in which a general-purpose language for describing a user function and a general-purpose language obtained by converting a special-purpose language are the same C language, but these are respectively different general-purpose languages (for example, the former language). In assembly language, and the latter in C language). In this case, the user function general-purpose language source code and the control program general-purpose language source code are respectively converted into intermediate machine language object codes by different intermediate machine language conversion means (compilers), and they are connected by the intermediate machine language object code connection means. By doing so, it is possible to realize a similar control program creation method.

【0035】[0035]

【発明の効果】本発明によれば、ユーザが汎用言語ソー
スコードに含まれる関数の中から必要なユーザ関数を選
択するだけで、専用言語の制御プログラムの中にユーザ
関数の記述を混在させるための情報が自動的に生成され
るので、ユーザ関数を引用するための余計な手間と入力
ミスを削減し、プログラム作成効率を向上することが可
能となる。さらに、本発明によれば、制御プログラムか
ら制御装置のマイクロプロセッサが直接実行可能なオブ
ジェクトコードが生成されるので、プログラム実行効率
を向上することも可能となる。
According to the present invention, it is possible to mix user function descriptions in a control program in a special language only by selecting a necessary user function from functions included in a general language source code. Is automatically generated, it is possible to reduce unnecessary labor and input mistakes for quoting a user function, and to improve program creation efficiency. Further, according to the present invention, since an object code that can be directly executed by the microprocessor of the control device is generated from the control program, it is possible to improve the program execution efficiency.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明になる制御プログラム作成装置の処理手
順例を示す図である。
FIG. 1 is a diagram showing an example of a processing procedure of a control program creating device according to the present invention.

【図2】制御プログラムの編集画面の一例を示す図であ
る。
FIG. 2 is a diagram illustrating an example of an edit screen of a control program.

【図3】ユーザ関数抽出手段による処理の一例を示す。FIG. 3 shows an example of processing by a user function extracting means.

【図4】ユーザ関数抽出手段の概略処理を示すフローチ
ャートである。
FIG. 4 is a flowchart showing a schematic process of a user function extracting unit.

【図5】汎用言語変換手段により、図2に示した専用言
語制御プログラムの一部を制御プログラム汎用言語ソー
スコードに変換した例を示す図である。
5 is a diagram showing an example in which a part of the dedicated language control program shown in FIG. 2 is converted into a control program general-purpose language source code by a general-purpose language conversion unit.

【図6】汎用言語変換手段の概略処理を示すフローチャ
ートである。
FIG. 6 is a flowchart illustrating a schematic process of a general-purpose language conversion unit.

【符号の説明】[Explanation of symbols]

101 専用言語制御プログラム 101a 制御プログラム汎用言語ソースコード 101b 制御プログラム中間機械語オブジェクトコー
ド 102 汎用言語ソースコード 102a ユーザ関数参照形式定義情報 102b ユーザ関数汎用言語ソースコード 102c ユーザ関数中間機械語オブジェクトコード 103 制御プログラム機械語オブジェクトコード 104 汎用言語変換手段 105 ユーザ関数抽出手段 106 機械語変換手段 106a 標準関数参照形式定義情報 106b 標準関数中間機械語オブジェクトコード 106c 中間機械語変換手段 106d 中間機械語オブジェクトコード結合手段 201 シーケンス編集ウィンドウ 202 コマンド編集ウィンドウ 202a ユーザ関数ブロック 203 終了条件編集ウィンドウ 301 C言語ソースコード 302 ユーザ関数のチェックリスト 302a チェックボックス 302b ユーザ関数の宣言文 303 ユーザ関数の外部参照宣言ヘッダファイル 304 ユーザ関数ソースコード 510 専用言語制御プログラム 511 ルール 520 制御プログラム汎用言語ソースコード 521 関数
101 Dedicated language control program 101a Control program general-purpose language source code 101b Control program intermediate machine language object code 102 General-purpose language source code 102a User function reference format definition information 102b User function general-purpose language source code 102c User function intermediate machine language object code 103 Control program Machine language object code 104 General-purpose language conversion unit 105 User function extraction unit 106 Machine language conversion unit 106a Standard function reference format definition information 106b Standard function intermediate machine language object code 106c Intermediate machine language conversion unit 106d Intermediate machine language object code combining unit 201 Sequence Edit window 202 Command edit window 202a User function block 203 End condition edit window 301C Word source 302 user function checklist 302a checkbox 302b user function declaration 303 user function as external references the header file 304 user function source code 510 dedicated language control program 511 rules 520 control program general purpose language source code 521 functions in

───────────────────────────────────────────────────── フロントページの続き (72)発明者 松下 鶴正 東京都千代田区神田駿河台四丁目6番地 株式会社日立製作所内 (72)発明者 下津 忠夫 東京都千代田区神田駿河台四丁目6番地 株式会社日立製作所内 Fターム(参考) 5B081 AA10 CC01 5H220 BB12 CC05 CX02 DD04 DD07 JJ12 JJ24 JJ53  ──────────────────────────────────────────────────続 き Continuing from the front page (72) Inventor Tsurumasa Matsushita 4-6-6 Kanda Surugadai, Chiyoda-ku, Tokyo Inside Hitachi, Ltd. (72) Inventor Tadao Shimotsu 4-6-6 Kanda Surugadai, Chiyoda-ku, Tokyo Hitachi, Ltd. F term in the factory (reference) 5B081 AA10 CC01 5H220 BB12 CC05 CX02 DD04 DD07 JJ12 JJ24 JJ53

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 問題向きの専用言語により記述された制
御プログラムを制御装置が実行可能な機械語に変換する
ための制御プログラム作成装置において、 ユーザが汎用言語により記述したソースコード群から、
制御プログラムの中で利用するユーザ関数の参照形式定
義情報と、前記ユーザ関数に関連する処理のみを抽出し
たユーザ関数汎用言語ソースコードとを生成するユーザ
関数抽出手段と、 専用言語の記述の中に前記ユーザ関数の記述を混在させ
た制御プログラムから制御プログラムの汎用言語ソース
コードを生成する汎用言語変換手段と、 前記ユーザ関数抽出手段により生成された参照形式定義
情報及びユーザ関数汎用言語ソースコードを用いて、前
記汎用言語変換手段により生成された制御プログラムの
汎用言語ソースコードを前記機械語に変換する機械語変
換手段と、 を備えたことを特徴とする制御プログラム作成装置。
1. A control program creation device for converting a control program described in a dedicated language suitable for a problem into a machine language executable by a control device, comprising:
A user function extracting means for generating reference format definition information of a user function used in the control program and a user function general-purpose language source code extracting only a process related to the user function; and A general-purpose language conversion unit that generates a general-purpose language source code of the control program from a control program in which the description of the user function is mixed; and a reference format definition information and a user function general-purpose language source code generated by the user function extraction unit. And a machine language conversion unit for converting a universal language source code of the control program generated by the universal language conversion unit into the machine language.
【請求項2】 前記ユーザ関数抽出手段は、前記汎用言
語により記述したソースコード群に含まれる関数の宣言
文とこれらの関数対応のチェックボックスを持つチェッ
クリストを生成、表示するチェックリスト表示手段を備
え、チェックボックスにより選択されたユーザ関数に対
して前記参照形式定義情報と前記ユーザ関数汎用言語ソ
ースコードとを自動的に生成することを特徴とする請求
項1記載の制御プログラムの作成装置。
2. The user function extracting unit according to claim 1, wherein the checklist display unit generates and displays a checklist having function declaration statements included in the source code group described in the general-purpose language and check boxes corresponding to these functions. 2. The control program creating apparatus according to claim 1, wherein said reference format definition information and said user function general-purpose language source code are automatically generated for a user function selected by a check box.
【請求項3】 前記専用言語は、ユーザ関数を利用して
汎用言語により記述されたブロックを指示するための指
示コマンドを有しており、前記汎用言語変換手段は、前
記制御プログラムの、前記指示コマンドで指定されてい
ない専用言語のコマンドを汎用言語の標準関数に変換
し、前記指示コマンドで指示されたブロックの内容をそ
のままコピーすることにより制御プログラムの汎用言語
ソースコードを生成することを特徴とする請求項1記載
の制御プログラム作成装置。
3. The general-purpose language has an instruction command for designating a block described in a general-purpose language using a user function, and the general-purpose language conversion unit includes an instruction command of the control program. Converting a dedicated language command not specified by the command into a standard function of a general language, and generating a general language source code of the control program by directly copying the contents of the block specified by the instruction command. The control program creation device according to claim 1, wherein
【請求項4】 前記制御プログラムは、シーケンシャル
・ファンクション・チャートの図形形式の記述とテキス
ト形式の記述を組み合わせて作成したプログラムを、シ
ーケンスの各ステップの状態遷移に対応したIF〜TH
EN形式のルールによる記述に変換して保存されたプロ
グラムであり、前記汎用言語変換手段は、前記ルールの
各々をステップが活性化されたときに実行される関数に
変換して制御プログラムの汎用言語ソースコードを生成
することを特徴とする請求項1記載の制御プログラム作
成装置。
4. The control program according to claim 1, wherein the control program is a program created by combining a graphic format description of the sequential function chart and a text format description with IF-TH corresponding to the state transition of each step of the sequence.
A general-purpose language conversion unit that converts each of the rules into a function to be executed when a step is activated, and converts the rule into a function to be executed when a step is activated. 2. The control program creation device according to claim 1, wherein the control program creation device generates a source code.
【請求項5】 問題向きの専用言語により記述された制
御プログラムを制御装置が実行可能な機械語に変換する
ための制御プログラム作成方法において、 ユーザ関数を利用して汎用言語により記述されたブロッ
クを、そのブロックを指示するための指示コマンドを用
いて制御プログラム中に記述し、 前記ユーザ関数の各々のソースコードから当該ユーザ関
数の参照定義情報と当該ユーザ関数の処理を記述するユ
ーザ関数汎用言語ソースコードとを生成し、 前記制御プログラムの、前記指示コマンドで指示されて
いない専用言語の記述を制御プログラム汎用言語ソース
コードに変換した後、この制御プログラム汎用言語ソー
スコードを前記参照定義情報及び前記ユーザ関数汎用言
語ソースコードを用いて機械語に変換することを特徴と
する制御プログラム作成方法。
5. A control program creating method for converting a control program described in a dedicated language suitable for a problem into a machine language executable by a control device, wherein a block described in a general-purpose language is utilized by using a user function. A user function general language source that is described in a control program using an instruction command for instructing the block, and from each source code of the user function, reference definition information of the user function and processing of the user function are described. After converting a description of the dedicated language of the control program that is not specified by the instruction command into a control program general language source code, the control program general purpose language source code is referred to as the reference definition information and the user. Control characterized by conversion to machine language using function general-purpose language source code How to create a program.
JP2001068674A 2001-03-12 2001-03-12 Method and device for generating control program Pending JP2002268896A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001068674A JP2002268896A (en) 2001-03-12 2001-03-12 Method and device for generating control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001068674A JP2002268896A (en) 2001-03-12 2001-03-12 Method and device for generating control program

Publications (1)

Publication Number Publication Date
JP2002268896A true JP2002268896A (en) 2002-09-20

Family

ID=18926826

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001068674A Pending JP2002268896A (en) 2001-03-12 2001-03-12 Method and device for generating control program

Country Status (1)

Country Link
JP (1) JP2002268896A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004036420A1 (en) * 2002-10-18 2004-04-29 Advantest Corporation Program development support device, program execution device, compile method and debug method
JP2006171898A (en) * 2004-12-13 2006-06-29 Denso Corp Object static combining method and object combining tool
JP2007334469A (en) * 2006-06-13 2007-12-27 Hitachi Industrial Equipment Systems Co Ltd Programmable controller and equipment control method using the same
JP2011170419A (en) * 2010-02-16 2011-09-01 Mitsubishi Electric Corp Control program creation device
WO2012104959A1 (en) * 2011-01-31 2012-08-09 三菱電機株式会社 Motion sfc program component creation device
JP2016131646A (en) * 2015-01-16 2016-07-25 ナレルシステム株式会社 Fight command simulator, method for that purpose or programming
CN110928544A (en) * 2019-11-11 2020-03-27 浙江大搜车软件技术有限公司 Program block generation method and device, computer equipment and storage medium
JP2020149300A (en) * 2019-03-13 2020-09-17 オムロン株式会社 Device, method, and program for displaying graphs

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004036420A1 (en) * 2002-10-18 2004-04-29 Advantest Corporation Program development support device, program execution device, compile method and debug method
JP2006171898A (en) * 2004-12-13 2006-06-29 Denso Corp Object static combining method and object combining tool
JP2007334469A (en) * 2006-06-13 2007-12-27 Hitachi Industrial Equipment Systems Co Ltd Programmable controller and equipment control method using the same
JP4528284B2 (en) * 2006-06-13 2010-08-18 株式会社日立産機システム Programmable controller
JP2011170419A (en) * 2010-02-16 2011-09-01 Mitsubishi Electric Corp Control program creation device
CN103339573A (en) * 2011-01-31 2013-10-02 三菱电机株式会社 Motion SFC program component creation device
WO2012104959A1 (en) * 2011-01-31 2012-08-09 三菱電機株式会社 Motion sfc program component creation device
JPWO2012104959A1 (en) * 2011-01-31 2014-07-03 三菱電機株式会社 Motion SFC program parts creation device
KR101447846B1 (en) 2011-01-31 2014-10-13 미쓰비시덴키 가부시키가이샤 Motion sfc program component creation device
CN103339573B (en) * 2011-01-31 2015-12-16 三菱电机株式会社 Motion sfc program component creation device
US9342064B2 (en) 2011-01-31 2016-05-17 Mitsubishi Electric Corporation Motion SFC program component creation device
JP2016131646A (en) * 2015-01-16 2016-07-25 ナレルシステム株式会社 Fight command simulator, method for that purpose or programming
JP2020149300A (en) * 2019-03-13 2020-09-17 オムロン株式会社 Device, method, and program for displaying graphs
US11762363B2 (en) 2019-03-13 2023-09-19 Omron Corporation Graph display device, graph display method, and recording medium
CN110928544A (en) * 2019-11-11 2020-03-27 浙江大搜车软件技术有限公司 Program block generation method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US5504902A (en) Multi-language generation of control program for an industrial controller
JPH0760326B2 (en) Programmable logic controller hardware form for use on a first programmable logic controller for use on a second programmable logic controller and corresponding control program conversion method
JP5147240B2 (en) Method and system for reversible design tree transformation
JPWO2004025463A1 (en) Requirement definition method, software development method, requirement word change method and new specification method
WO2004012082A1 (en) Bi-directional programming system/method for program development
JPH11143511A (en) Numerical controller
JP2002268896A (en) Method and device for generating control program
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)
JP4443436B2 (en) Control system and control method
KR20060120004A (en) A dialog control for dialog systems
JP2002073120A (en) Device and method for programming of programmable controller
JP2003044106A (en) Generating method for sfc converting program and control program, and programmable logic controller
Gawron et al. Semi-automated synthesis of control system software through graph search
JP2009157534A (en) Programming support system, its programmable controller support device, and programmable indicator support device
JP2003076547A (en) System and method for automatically generating control software
JPS6139134A (en) Program converting method
JPH0689166A (en) Parts processing description expanding system
JPH05108372A (en) System for outputting compiler optimization processing content
CN110262802A (en) A kind of novel execution method of knockout machine Sequence data
CN115167860A (en) Method for converting and optimizing program code between different program languages
JPH04248624A (en) Program conversion processor
JPH05158706A (en) Optimization processing system for intermediate language
JPH02253443A (en) Program generating method
JP2003262696A (en) Engineering tool for nuclear power plant
JPH05108359A (en) Interactive expert system construction method