[go: up one dir, main page]

JP3819639B2 - Programming device - Google Patents

Programming device Download PDF

Info

Publication number
JP3819639B2
JP3819639B2 JP19645699A JP19645699A JP3819639B2 JP 3819639 B2 JP3819639 B2 JP 3819639B2 JP 19645699 A JP19645699 A JP 19645699A JP 19645699 A JP19645699 A JP 19645699A JP 3819639 B2 JP3819639 B2 JP 3819639B2
Authority
JP
Japan
Prior art keywords
program
language
programming
programming device
controller
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.)
Expired - Fee Related
Application number
JP19645699A
Other languages
Japanese (ja)
Other versions
JP2001022412A (en
Inventor
肇 垂石
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP19645699A priority Critical patent/JP3819639B2/en
Publication of JP2001022412A publication Critical patent/JP2001022412A/en
Application granted granted Critical
Publication of JP3819639B2 publication Critical patent/JP3819639B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、鉄鋼プラント、製紙プラント、上下水道などの公共システム、自動車産業などの生産工程、化学・石油プラントなどの制御を行うプログラムの開発を支援するプログラミング装置関する。
【0002】
【従来の技術】
一般的に、シーケンスプログラムはプログラミング装置によって作成され、この作成されたシーケンスプログラムは機械語に変換されてプログラマブルコントローラ(以下、「コントローラ」という)で実行可能な状態となる。そして、機械語に変換されたシーケンスプログラムは、コントローラに送られ、コントローラ側で機械語プログラムとして保存され、実行される。
【0003】
シーケンスプログラムの作成に利用される制御プログラミング言語には、様々な言語が存在するが、主なものにラダーダイヤグラム(LD言語)、ファンクションブロックダイヤグラム(FBD言語)、シーケンスフローチャート(SFC言語)などがある。このLD言語、FBD言語、SFC言語はIEC61131-3規格のグラフィカル3言語である。
【0004】
表1は、LD言語、FBD言語、SFC言語の特徴を示すテーブルである。
【0005】
【表1】

Figure 0003819639
【0006】
例えば、この表1より、LD言語は論理演算を利用する制御のプログラミングに向いている。また、論理演算はシーケンス制御に利用される傾向がある。したがって、LD言語はシーケンスコントローラで実行させるプログラムの作成に利用される傾向がある。
【0007】
また、FBD言語は数値演算を利用する制御のプログラミングに向いている。また、数値演算はループ制御に利用される傾向がある。したがって、FBC言語はループコントローラで実行させるプログラムの作成に利用される傾向がある。
【0008】
さらに、SFC言語は順次処理を利用する制御のプログラミングに向いているが、論理演算や、数値演算、文字処理は不可能である。
【0009】
このように、LD言語、FBD言語、SFC言語はぞれにおいて特徴が異なるため、ユーザ(例えばプログラマ)が制御対象や制御の内容、自己の理解度を判断し、いずれかの言語を任意に選択し、プログラミングに利用している。
【0010】
また、従来においては、上記したように、作成したシーケンスプログラムから機械語プログラムへの変換を行うのは、もっぱらプログラミング装置の役目であり、コントローラがこの機械語変換を行うことはない。
【0011】
【発明が解決しようとする課題】
以上のように、従来においては、ユーザがシーケンスプログラムの作成前に選択するいずれかの制御プログラミング言語によってプログラミングが行われている。
【0012】
しかしながら、近年、制御の対象や制御処理の内容が複雑化しており、複数種類の制御プログラミング言語を利用して一連の制御に関するプログラムを作成する機会が多くなっている。例えば演算処理と数値処理を組み合わせてシーケンスプログラムを作成する等の必要性が向上している。
【0013】
このような場合に、従来では、ユーザは一連の制御内容を分割し、各分割した内容毎に、適した制御プログラミング言語を利用してプログラミングを行っている。
【0014】
したがって、グラフィカルな制御プログラミング言語を利用したとしても、ユーザは、分割作成するプログラムの全体の状態を把握しにくいという問題がある。
【0015】
図20は、従来のプログラミング装置において異種の制御プログラミング言語を利用して作成したプログラムの表示例を示す画面図である。
【0016】
例えば、プログラミング装置として動作する計算機によってシーケンスプログラムのある部分をLD言語で記述し、他のある部分をSFC言語で記述したとする。
【0017】
すると、このシーケンスプログラムを計算機の画面100に表示させる場合には、LD言語で記述された部分がウィンドウ200a上に表示されるが、さらにSFC言語で記述された部分が別のウィンドウ200b上に表示される。このような画面100では、ユーザは異なるウィンドウ200a、200b間でプログラム間の呼び合いを辿る等しながらプログラムの内容(処理の流れ等)を確認しなければならなず、容易に内容を理解できない。
【0018】
また、従来においては、作成され機械語に変換された後のシーケンスプログラムがコントローラに保存され、実行されている。なお、この実行中のシーケンスプログラムの処理状態をプログラミング装置でモニタする場合には、機械語変換される前の元のシーケンスプログラムが必要である。
【0019】
しかしながら、シーケンスプログラムの作成・変換を行ったプログラミング装置とは異なるプログラミング装置で、この実行中のシーケンスプログラムをモニタしたい場合が生じる。
【0020】
図21は、このように、シーケンスプログラムの作成を行ったプログラミング装置とモニタを行うプログラミング装置とが異なる場合の例を示すブロック図である。
【0021】
プログラミング装置300aで生成された元のプログラム400aは、変換されて機械語のプログラム500aとなり、コントローラ600に保存、実行され、制御対象700の一部分が制御される。
【0022】
同様に、プログラミング装置300bで生成された元のプログラム400bは、変換されて機械語のプログラム500bとなり、コントローラ600に保存、実行され、制御対象700の他の部分が制御される。
【0023】
ここで、制御対象700の装置が変更されたため、プログラミング装置300bで新規のプログラムを作成する際に、他のプログラミング装置300aで作成した元のプログラム400aをモニタしたい場合がる。
【0024】
この場合、モニタを行うプログラミング装置300bには、モニタしたい元のプログラム300aが保持されていないため、モニタすることが困難である。なお、単に、コントローラ600に保持されている機械語のプログラム500aを逆変換して、モニタを行うプログラミング装置300bが元のプログラム400aを得るのは、プログラムの作成を行ったプログラミング装置300aとモニタを行うプログラミング装置300bとの間で利用する制御プログラミング言語が異なる場合に困難である。
【0025】
また、従来においては、複数の制御プログラミング言語を利用可能なプログラミング装置がある。
【0026】
しかしながら、この複数の言語を利用可能なプログラミング装置であっても、ある制御プログラミング言語で作成されたプログラムを、他の制御プログラミング言語で作成されたプログラムに変換して表示させるというユーザの要請に対処可能なプログラミング装置は存在しない。
【0027】
以上をまとめると、従来においては、異種の制御プログラミング言語で記述されたプログラムの混在表記ができず、また混在表記したプログラムの編集、コンパイル、制御実行、オンラインモニタができない。
【0028】
また、従来においては、異なる種類の制御プログラミング言語でシーケンスプログラムを作成すると、統一的に取り扱うことが困難である。
【0029】
本発明は、上記実情に鑑みてなされたもので、異種の制御プログラミングをまとめて取扱い可能とすることにより、ユーザによるプログラム記述性、理解度を向上させ、ユーザの作業効率を向上させるプログラミング装置提供することを目的とする。
【0030】
【課題を解決するための手段】
本発明の骨子は、複数種類の制御プログラミング言語を自由に利用可能とする点にある。
【0031】
以下、本発明を実現するに校閲あたって講じた具体的手段について説明する。
【0032】
第1の発明は、コントローラで実行させる制御プログラムの作成を支援するプログラミング装置において、左から右へパワー又はシグナルが流れるように解釈する制御プログラム言語と上から下に状態遷移するように解釈する制御プログラム言語とを含む複数種類の制御プログラム言語で混在表記された制御プログラムをネットワーク単位及びサブネットワーク単位による有向グラフとして扱い、有向グラフにおける各ノードに対して右下から左に向かい上段にあがって再び右から左に向かう順序でノード番号を付し、このノード番号の付された有向グラフに対する深さ優先探索アルゴリズムを適用して各ノードの拾い上げを行い、各ノードの実行順序を決定し、サブネットワーク単位で状態遷移の外部条件の演算、状態遷移の演算、状態遷移結果による外部動作演算の順序を守るように実行順序を決定し、ネットワーク単位で左から右、上から下の順序を守るように実行順序を決定し、ネットワーク及びサブネットワークにおける実行順序を考慮して、コントローラの理解する命令語を取得するように、混在表記された制御プログラムをコンパイルするコンパイラを備えたプログラミング装置である。
【0033】
これにより、ユーザが制御プログラムの内容を容易に理解することができる。
なお、制御手段の例としてはプログラマブルコントローラがあり、制御プログラムの例としてはシーケンスプログラムがある。
【0036】
これにより、混在表記させていたプログラムをそのままコンパイルすることができるため、各種言語の利点を活用したプログラムを作成し、このプログラムを制御手段に実行させることができる。
【0037】
の発明は、第の発明のプログラミング装置において、コンパイラは混在表記された制御プログラムの内容とモニタデータとを関係付けて保存するとし、コンパイラによるコンパイル時の関係付けに基づいて、モニタデータを混在表記された制御プログラム上に配置するモニタデータ重ね表示手段を付加するとした。
【0038】
この第の発明では、制御プログラムの内容とモニタデータとの関係を利用することで、混在表記された制御プログラム上にモニタデータを配置することができ、これによりユーザがプログラムの問題点を容易に認識できる。
【0092】
【発明の実施の形態】
以下、図面を参照しながら本発明の実施の形態について説明する。
【0093】
(第1の実施の形態)
本実施の形態においては、複数の制御プログラミング言語を混在表記(同一表記)可能としたプログラミング装置について説明する。
【0094】
また、本実施の形態においては、複数の言語により混在表記されたプログラムをコンパイルして実行可能なプログラムを得るプログラミング装置について説明する。
【0095】
なお、本実施の形態においては、LD言語、FBD言語、SFC言語の3種の制御プログラミング言語を利用する場合について説明するが、他の言語の場合も同様である。
【0096】
図1は、本実施の形態に係るプログラミング装置の構成を示すブロック図である。
【0097】
このプログラミング装置1は、ユーザの指示にしたがった制御プログラミング言語でプログラムを表示するが、さらに3種類の言語を混在させた状態でもプログラムを表示する。また、ユーザの指示に従って3種類の制御プログラミング言語を混在させて作成されたプログラムを変換し、プログラマブルコントローラ2に送信する。
【0098】
このプログラミング装置1は、主に、入力装置3、表示装置4、伝送装置5を備え、プログラム編集6、プログラム表示7、プログラムコンパイル8、ファイル送信9、モニタデータ取得10、モニタ重ね表示11等の各種処理を実行する。
【0099】
このうち、本実施の形態において特徴的な部分は。プログラムコンパイル8の処理内容と、このプログラムコンパイル8やプログラム編集6等の処理で扱われるプログラムファイル12と、モニタデータ重ね表示11で扱われるモニタデータ13にある。
【0100】
なお、図1に示すプログラミング装置1においては、通常のプログラミング装置と同様の構成装置を備え同様の処理を実行可能であるが、説明を簡略にするために他の構成装置及び処理の記載を省略している。
【0101】
このプログラミング装置1の入力装置3は、対人的な指示インターフェイスであり、この入力装置3からプログラム編集6、プログラム表示7、プログラムコンパイル8、モニタ重ね表示11の各処理への指示が出力される。一般的には、キーボード、マウスが利用される。
【0102】
表示装置4は、グラフィック及びキャラクタを表示可能な装置であり、CRTや液晶ディスプレイが利用される。
【0103】
伝送装置5は、このプログラミング装置1とコントローラ2の間を伝送接続する装置であり、一般にはRS232CやEthernet等の伝送ボードやケーブルを指す。
【0104】
プログラム編集6は、入力装置3からの指示にしたがい、3種類の制御プログラミング言語による回路グラフィックを入力、切り取り、貼り付け、コピー、削除する処理である。すなわち、このプログラム編集6の処理により、3種類の制御プログラミング言語が混在したプログラムの作成がなされ、作成されたプログラムをプログラムファイル12の一要素として保存する。
【0105】
なお、プログラムファイル12は、プログラムの表示及び実行に関連するファイル群の総称である。例えば、上記のようなプログラム編集6から得られる3種類の制御プログラミング言語により記述されたコンパイル前のプログラムや、プログラムコンパイル8によるコンパイル後のプログラムを含む。
【0106】
プログラム表示7は、プログラムファイル12に基づいて、プログラム編集6等で扱われる回路グラフィック等を表示する処理である。
【0107】
すなわち、このプログラム編集6とプログラム表示7とにより、ユーザは3種の言語の記述要素を利用してグラフィカルなプログラムの作成が可能となる。
【0108】
例えば、各種の制御プログラム言語で利用される要素(LD言語における接点、コイル、FBD言語におけるファンクション、ファンクションブロック、SFC言語におけるステップ、トランジション、その他処理の流れを示す線等)をマウスでドラッグし、移動させてリリースするなどにより、3種の言語が混在した回路グラフィックを表示させつつ、プログラムの編集が可能となる。
【0109】
プログラムコンパイル8は、3種類の言語が混在している環境に適用される特別のコンパイル理論により、3種の言語が混在している回路グラフィックをコンパイルし、コントローラ2が実時間に実行できる命令語(コントローラが処理する順序に並べられた命令語)にコンパイル可能な形式を生成し、プログラムファイルの一部として保存する処理である。なお、コントローラ2が実時間に実行できる命令語にコンパイル可能な形式とは、グラフィカルに記述されたプログラムから実際にコントローラ2によって処理する順序を定めた形式をいう。
【0110】
また、プログラムコンパイル8は、適切な順序の命令語にコンパイル可能な形式をさらに機械語のプログラムにコンパイルし、プログラムファイル12の一部として保存する。なお、グラフィカルに記述されたプログラムが例えばコントローラ2におけるマクロ命令等のように、そのままコントローラ2上で実行可能であれば、この機械語への変換は必要ない。
【0111】
ファイル送信9は、伝送装置5を利用してプログラムファイル12のうち少なくとも機械語によるプログラムをコントローラ2の指定箇所へ送信する処理である。
【0112】
モニタデータ取得10は、伝送装置5を利用してモニタデータ13をコントローラから取得する処理である。
【0113】
なお、モニタデータ13は、プログラム中の演算結果や変数の現在値を示すデータである。このモニタデータは、3種類の言語が混在している環境において、回路グラフィック上に重ねて描画可能とするための特別なデータ構造を持ち、回路グラフィック上に重ねて描写することでモニタリングが可能となる。
【0114】
モニタ重ね表示11は、モニタデータ13を回路グラフィックに重ねてモニタ表示する処理である。
【0115】
コントローラ2は、プログラミング装置1から受信した機械語のプログラムに基づいて図示しない制御対象を制御する。また、この制御対象の状態やプログラムの実行結果から得られるモニタデータ13をプログラミング装置1に送信する。
【0116】
このコントローラ2は、主に、伝送装置14とI/O装置15とを備え、ファイル受信16、プログラム実行17、モニタデータ出力18、モニタデータ返信19等の各種処理を実行する。なお、図1に示すコントローラ2においては、説明を簡略にするために他の構成装置及び処理の記載を省略しているが、通常のコントローラと同様の構成装置を備え、同様の処理を実行可能である。
【0117】
伝送装置14は、先の伝送装置5と同様に、プログラミング装置1とコントローラ2の間を伝送接続する装置である。
【0118】
I/O装置15は、このコントローラ2が図示しない制御対象のプロセスからのI/O信号を入出力するための装置であり、一般的にはI/OカードやI/Oバスなどが利用される。
【0119】
ファイル受信16は、伝送装置14を利用してプログラムファイル12のうちの少なくとも機械語によるプログラムをプログラミング装置1から受信し、指定箇所に配置する処理である。
【0120】
プログラム実行17は、ファイル受信16の処理によって受信されたプログラムファイル16の内容を解釈し、I/O信号を入出力しながら機械語(命令語)を実行する。
【0121】
モニタデータ出力18は、実行されたプログラムの演算結果や変数の値からモニタデータ18を生成する処理である。
【0122】
モニタデータ返信19は、モニタデータ出力18によって生成されたモニタデータ13を、伝送装置14を利用してプログラミング装置1に送信する処理である。
【0123】
上記のような構成を持つプログラミング装置1におけるプログラムコンパイル8で採用されたコンパイル理論について以下に説明する。このコンパイル理論により、3種混在した制御プログラミング言語のコンパイルが実現される。
【0124】
なお、ここでいうコンパイルとは、ネットワークの集合体からコントローラ2の理解する最終的な命令語を、IEC61131-3規格にしたがった解釈で並べることをいう。したがって、命令語への変換と実行順決定がここで説明しているコンパイル論理の骨子である。
【0125】
図2は、本実施の形態に係るプログラミング装置1で採用されたコンパイル理論を説明するためのフロー図である。
【0126】
まず、3種の言語が混在したプログラムをノード及び矢印の要素に分解する処理が実行される(s1)。
【0127】
図3は、本実施の形態に係るプログラミング装置によって混在表記されているプログラムの例を示す図である。
【0128】
このプログラム20においては、LD言語、FBD言語、SFC言語が混在して記述されている。
【0129】
LD言語による記述部分には接点21やコイル22等のグラフィックシンボルが記述されている。FBD言語による記述部分にはファンクション(ファンクションブロック)23等のグラフィックシンボルが記述されている。SFC言語による記述部分にはステップ24、トランジション25等のグラフィックシンボルが記述されている。
【0130】
ここでは、上記のような各言語のグラフィックシンボルを「ノード」として扱う。
またノードを接続する線を「矢印」として扱う。
【0131】
LD言語では、IEC61131-3規格において、左から右へパワーが流れるように解釈すると約束されている(Power flow)。
【0132】
同様に、FBD言語では、左から右へシグナルが流れるように解釈すると約束されている(Signal Flow)。
【0133】
さらに、SFC言語では、上から下に状態遷移するように解釈すると約束されている(Activity flow)。
【0134】
したがって、LD言語及びFBD言語で記述されているノードを「○」とし、SFC言語で記述されているノードを「△」とし、矢印の方向をパワー、シグナル、状態遷移の方向で表せば、ノード及び矢印で3種混在したプログラムを書き換えることができる。
【0135】
図4は、ノードと矢印でプログラムを表した場合の状態図である。この図4では先の図3に示すプログラム20を書き換えた状態26を示している。
【0136】
次に、ノードと矢印で示された状態26に対するネットワーク単位のグルーピング処理が実行される(s2)。
【0137】
このネットワーク単位のグルーピング処理においては、ノードと矢印が接触されている集合体の単位が1つのネットワークとされる。図4の状態26においては、グルーピングの結果、3つのネットワークNetwork1、Network2、Network3が取得される。
【0138】
次に、ノードと矢印で示された状態26に対するサブネットワーク単位のグルーピング処理が実行される(s3)。
【0139】
このサブネットワーク単位のグルーピング処理においては、先のネットワーク単位のグルーピング処理において取得されたネットワークがSFCのノードを含む場合に、SFC言語のトランジションに接続されたLD言語あるいはFBD言語のネットワーク部分がサブネットワークとされる。また、SFCのステップ・トランジションのみで構成されたネットワーク部分がサブネットワークとされる。さらに、SFC言語のステップに接続されたLD言語あるいはFBD言語のネットワーク部分がサブネットワークとされる。
【0140】
上記のサブネットワークのグルーピング処理により、図4の状態26においては、ネットワークNetwork2がSFC言語のノードを含むため、まずネットワークNetwork2のうちのLD言語を含む部分がサブネットワークAction1とされる。また、ネットワークNetwork2のうちSFC言語のステップ・トランジションのみで構成された部分がサブネットワークState1とされる。さらに、ネットワークNetwork2のうちのFBD言語を含む部分がサブネットワークCondition1とされる。
【0141】
次に、上記処理により取得されたネットワーク単位、及びサブネットワーク単位は、ノードとそれを接続する矢印から構成されるため、このネットワーク単位及びサブネットワーク単位をグラフ理論における「有向グラフ」とみなして実行順序が決定される(s4)。
【0142】
なお、有向グラフとはノード間の相対順序が決められたグラフをいい、この有向グラフで結ばれているノードを整列させる一般的な手法としてトポロジカル・ソートがある。しかしながら、例えばIEC1131-3規格にしたがうとすると、ネットワーク単位又はサブネットワーク単位による有向グラフが必ずしもトポロジカル・ソートで順序を比較できない半順序関係を形成する場合がある。有向グラフがこのような半順序関係を含む場合には、トポロジカル・ソートの解が一つとならない。
【0143】
そこで、本実施の形態におけるプログラムコンパイル8のコンパイル理論においては、以下のような手順にしたがって、ネットワーク単位及びサブネットワーク単位による有向グラフの実行順序を決定する。
【0144】
図5は、本実施の形態で採用されたノードの順序決定手法を示す概念図である。
【0145】
ネットワークあるいはサブネットワークが図5(a)のような有向グラフで示されるとする。
【0146】
まず、横書き文章の逆順(右下から左へ移動し、上段にあがって再び右から左へ移動する動作を繰り返す順序)に、各ノードが番号付けされる。
【0147】
このノード番号付けにより得られる状態が図5(b)である。
【0148】
次に、ネットワークあるいはサブネットワークによる有向グラフに対して、深さ優先探索(depth first search)のアルゴリズムを適用して各ノードの拾い上げが行われ、図5(c)の結果が得られる。
【0149】
なお、深さ優先探索のアルゴリズムとは、まず視点を出発し、番号の若い順に進む位置を調べ、行けるところ(辺で連結されていてまだ訪問していない)まで進む。行き場所がなくなったら、行き場所があるところまで戻り、再び行けることろまで進む。そして、行き場所がすべてなくなったら終わる(来た道を戻る)というアルゴリズムである。
【0150】
この深さ優先探索のアルゴリズムにより「6、3、5、8、4、2、1、7」というノードの実行順序が得られる。
【0151】
次に、上記のようなネットワーク及びサブネットワークにおける実行順序を考慮して、コントローラ2の理解する命令語を取得するためのコンパイラまとめ処理が実行される(s5)。
【0152】
上記の処理により、ネットワーク及びサブネットワーク単位内でのノードの実行順序が取得される。
【0153】
ここで、ノードは、実際にはグラフィック表記上「命令シンボル」であり、これがコントローラ1上の「マクロ命令」(命令語シンボルを実行するためのCPUの理解する命令の集合)と考えれば、ノードの実行順序はコントローラ2上の命令語実行順序に等しい。
【0154】
したがって、コンパイラまとめ処理では、最後の処理としてサブネットワーク単位間及びネットワーク単位間での実行順序を求める。
【0155】
サブネットワーク単位間の実行順序は、SFC言語がステートマシンとして動作する基本の順序を守るように決定される。
【0156】
すなわち、
順序1:状態遷移の外部条件(Condition)の演算
順序2:状態遷移(State)の演算
順序3:状態遷移(Action)結果による外部動作演算
の順序を守ればよい。
【0157】
したがって、サブネットワークはCondition1〜N、State、Action1〜Lの順で実行すればよく、先の図4に示すネットワークNetwork2の場合も同様にサブネットワークCondition1、State、Action1の順で実行すればよい。
【0158】
ネットワーク単位間の実行順序は、各ネットワーク単位の接続は独立であるため、例えばIEC61131-3規格の自然な流れにしたがって、左から右、上から下の順序を守るように決定される。
【0159】
以上のような順序決定により3種混在したプログラムのコンパイルが実行されるが、実際には編集画面を横書き文章の順(左上から右へ移動し、下段にさがって再び左から右へ移動する動作を繰り返す順序)に、ネットワークが取得され、この取得されたネットワーク内でもっとも若い順序となるノードをそのネットワークの代表と考え、そのノード間で最も若い順にネットワークを実行してゆけばよい。
【0160】
図6は、上記のコンパイル理論により得られるコンパイル結果を示す概念図である。
【0161】
このコンパイル結果27には、ネットワークNerwork1〜5、ネットワークNetwork3内に含まれるサブネットワークCondition1,2、Action1,2、ネットワークあるいはサブネットワーク内に含まれるノードNode1〜6が実行順に記述されている。
【0162】
続いて、上記のような構成を持つプログラミング装置1において扱われるモニタデータ13の構造について説明する。このモニタデータ13の構造により、3種類の言語の混在表記上に入力値及び出力値等を表示させ、制御動作のモニタが実現される。
【0163】
ここで、モニタとは、コンパイルした結果がコントローラ2で実行された場合に、このコントローラ2上で実行されている命令シンボル(命令語)の入力値、出力値を実時間でユーザが確認可能とすることをいう。実際には、表示装置4におけるグラフィック表記上の対応位置にこの入力値、出力値を重ね合わせて表示することで、モニタが実現させる。
【0164】
図7は、本実施の形態に係るプログラミング装置1によって扱われるモニタデータ13の構造、コンパイル結果の構造、及びモニタデータ構造テンプレートを示す関係図である。
【0165】
上記のコンパイル理論によるコンパイルの結果から知り得るのは、命令語とその命令語の位置(アドレス)であり、コンパイル結果の構造28として各ノードNode1〜8に対してアドレスAddress1〜8を割り当てた構造が得られる。
【0166】
ここで、命令語には、固有値として入力、出力の数とデータ型とがあるため、命令語に対して一意のモニタデータ構造があるといえる。
【0167】
したがって、コンパイル時にモニタデータ構造テンプレート29を作成しておくことで、コントローラ2の演算時に外部出力するモニタデータについて、その構造30を予め作成しておくことができる。
【0168】
なお、ここでは、モニタデータの構造30は、各モニタデータData1〜8に対してアドレスMaddress1〜8を割り当てた構造としている。
【0169】
また、モニタデータ構造テンプレート29では、各ノードNode1〜8のアドレスAddress1〜8と、各モニタデータのアドレスMaddress1〜8と、各データの型DataType1〜8とが関係付けられている。
【0170】
これにより、コンパイル結果の構造28に対応するモニタデータを取得可能となり、3種の言語を混在表記させたグラフィック上に配置可能となる。
【0171】
図8は、3種の制御プログラミング言語でプログラムを混在表記し、このグラフィック表記上にモニタデータを重ねて表示した場合の一例を示す画面図である。
【0172】
同様に、図9も、3種の言語でプログラムを混在表記し、このグラフィック表記上にモニタデータを重ねて表示した場合の他の例を示す画面図である。
【0173】
以上説明したように、本実施の形態に係るプログラミング装置1においては、複数の制御プログラミング言語を混在させて表示可能とした。
【0174】
これにより、各種言語を同一編集平面上に表記できるため、呼び合いを辿る等の必要がなくユーザが全体をまとめて認識することができる。
【0175】
また、各種言語を自然に混在させ、補完することができるため、仕様可読性を向上させることができる。
【0176】
すなわち、ユーザが制御処理の内容や作成するプログラムの内容を容易に理解することができる。
【0177】
ゆえに、プログラムの生産性を向上させることができ、またユーザの作業効率を向上させることができる。
【0178】
また、本実施の形態に係るプログラミング装置1においては、各種言語の記述要素をノードとして扱い、各種言語の流れを矢印として扱い、グラフ理論における深さ探索優先アルゴリズムにより処理順序を決定してコンパイルを行う。
【0179】
したがって、複数の制御プログラミング言語を自然に混在させて補完しつつ、編集したプログラムをそのままコンパイルし、コントローラ2にダウンロードして制御を実行させることができる。
これにより、各種言語の利点を活かしつつプログラムを作成することができ、仕様記述性を向上させることができる。
【0180】
また、本実施の形態に係るプログラミング装置1においては、コンパイル時に、各種言語の記述要素とモニタデータとを関連付けておくことで、各種の言語によるグラフィック表記上にモニタデータを重ねて表記できるため、ユーザが容易に問題点を発見することができる。
ゆえに、ユーザは品質の高い制御用のプログラムを作成することができる。
【0181】
(第2の実施の形態)
本実施の形態においては、制御プログラムの共用性を向上させるプログラミング装置について説明する。
【0182】
図10は、本実施の形態に係るプログラミング装置のハードウェア構成を示すブロック図である。
【0183】
プログラミング装置31は、コントローラのシーケンスプログラム実行状態を監視したり、シーケンスプログラムの作成・修正に使用される。また、CRT他の表示装置とキーボード他の入力装置をもつ。
【0184】
このプログラミング装置31は、CPU32、OS・プログラムメモリ33、ワークメモリ34、入出力インターフェイス35、表示インターフェイス36、通信インターフェイス37がマイコンパス41で相互に送受信可能に接続されて構成されている。また、入出力インターフェイス35に入力装置38が接続されており、さらに表示インターフェイス36に表示器39が接続されている。
【0185】
また、このプログラミング装置31は、通信インターフェイス37を介してプログラマブルコントローラ40と通信可能となっている。
【0186】
このプログラミング装置31の備えるCPU32は、プログラミング装置31の中枢部分であり、プログラミング装置31全体の実行制御を行う。
【0187】
OS・プログラム33は、CPU32が実行するプログラムが格納されているメモリであり、OSや制御プログラムが格納される。
【0188】
ワークメモリ34は、CPU32が全体制御を実行するときに作業領域として使用する。
【0189】
入出力インタフェース35は、キーボード他の入力機器を接続するためのインタフェース回路である。
【0190】
入力装置38はキーボードやタッチパネルなどで構成され、シーケンスプログラムを入力するのに使用される。
【0191】
表示インタフェース36は、表示器39を接続するためのインタフェース回路であり、表示データ用メモリなどを含む。
【0192】
表示器39は、シーケンスプログラム(制御プログラムの一種)やデータの表示に使用されるCRTや液晶表示器などの表示器である。
【0193】
通信インタフェース37はプログラミング装置31とプログラマブルコントローラ40などを通信媒体を介して接続するためのインタフェース回路である。
【0194】
マイコンバス41はプログラミング装置31内の要素をCPU32と接続するためのバスであり、アドレスバス、データバス、制御バスの総体である。
【0195】
図11は、上記のようなハードウェア構成を持つプログラミング装置31における処理内容を示すブロック図である。
【0196】
ユーザが、このプログラミング装置31を利用して、例えばLD言語で記述されたシーケンスプログラム42をソース・プログラムとして作成したとする。なお、このシーケンスプログラム42は、入力装置38から入力され、表示器39に表示されて編集され、図や変数と共にワークメモリ34内に格納される。
【0197】
プログラミング装置31は、ソース・プログラムを中間言語による記述に変換するための中間コンパイラ43を搭載しており、この中間コンパイラ43により、シーケンスプログラム42が中間言語プログラム44に書き換えられる。
【0198】
なお、中間言語とは、機械語にも変換可能であり、またソース・プログラムを記述した言語にも変換可能な状態でプログラムを記述する言語である。
【0199】
具体的には、例えばIL(Instruction List)言語のように命令コードとオペランドの組み合わせで表現され、テキスト形式で格納される言語が中間言語として適用できる。
【0200】
中間コンパイラ43によって得られた中間プログラム44は、ワークメモリ34に格納される。
【0201】
表2は、LD言語によって記述されたシーケンスプログラムを中間言語によって記述された中間言語プログラムに変換する変換ルールの一部を示すテーブルである。
【0202】
【表2】
Figure 0003819639
【0203】
このような変換ルールに従うことにより、LD言語のような図式プログラムをテキスト形式の中間プログラムに変換することが可能となる。命令文の区切りはスペース又は改行コードで示される。
【0204】
さらに、プログラミング装置31は、中間言語で記述された中間言語プログラムを機械語のプログラムによる記述に変換するための機械語コンパイラ45を搭載しており、この機械語コンパイラ45により、中間言語プログラム44がコントローラ40で実行可能な機械語プログラム46に書き換えられる。
【0205】
表3は、中間言語によって記述された中間言語プログラムを機械語によって記述された機械語プログラムに変換する変換ルールの一部を示すテーブルである。
【0206】
【表3】
Figure 0003819639
【0207】
このような変換ルールに従うことにより、中間言語プログラム44を機械語プログラム46に変換することが可能となる。
【0208】
なお、この機械語コンパイラ45による変換によって得られる機械語プログラムに含まれる機械語コードは、命令コード部分及びオペランドアドレス部分とからなるが、この命令コード部分及びオペランドアドレス部分は固定長とされる。
【0209】
これにより、変換後の機械語プログラムがコントローラ40で実行される際の演算処理が容易となる。
【0210】
さらに、プログラミング装置31は、中間言語で記述された中間言語プログラムをLD言語で記述されたソース・プログラムによる記述に変換するための逆コンパイラ47を搭載している。
【0211】
この逆コンパイラ47で利用される変換ルールは、先の表2を逆に適用する手法が採用される。
【0212】
この逆コンパイラ47により、中間言語プログラム44がシーケンスプログラム42に書き換えられる。
【0213】
以上説明したように、本実施の形態に係るプログラミング装置31においては、ソースの図式プログラムがテキスト形式の中間言語に変換されて格納される。
【0214】
したがって、プログラムの保存や伝送が容易になる。また、この中間言語により記述された中間プログラムを表示させた場合であっても人間が内容を確認しやすい。
【0215】
また、生成した機械語プログラム46を構成する命令語コードとオペランドアドレスとを固定長としたため、機械語プログラムをコントローラ40で処理しやすくなる。
【0216】
なお、本実施の形態においては、ソース・プログラムがLD言語によって記述された場合を例として説明しているが、これに限定されるものではなく、FBC言語、SFC言語、ST言語、ニーモニック言語等の各種制御プログラムに対して同様に適用できる。
【0217】
また、本実施の形態に係るプログラミング装置31においては、中間言語から機械語へ変換する機械語コンパイラ45を搭載しているが、例えば中間言語自体がコントローラ40で実行可能な言語であればこの機械語コンパイラ45を省略させることができる。
【0218】
(第3の実施の形態)
本実施の形態においては、上記第2の実施の形態に係るプログラミング装置31の変形例であり、制御プログラムを実行させるコントローラ毎に機械語コンパイラを切り換えるプログラミング装置について説明する。
【0219】
図12は、本実施の形態に係るプログラミング装置における処理内容を示すブロック図である。
【0220】
本実施の形態に係るプログラミング装置48において、中間言語プログラムを得るまでに関係する構成、処理は、上記第2の実施の形態に係るプログラミング装置31と同様であるため、説明を省略する。
【0221】
プログラミング装置48は、中間言語を機種の異なる複数のコントローラ40a〜40cのそれぞれに対応した機械語に変換する機械語コントローラ45a〜45cを搭載している。
【0222】
したがって、各機械語コンパイラ45a〜45cによる変換により、ある中間言語プログラム44から各コントローラ40a〜40cに対応した複数種類の機械語プログラム46a〜46cが得られる。
【0223】
以上説明したように、本実施の形態に係るプログラミング装置48においては、対象となるコントローラの種類に応じて複数のコンパイラを用意しており、同一の中間言語プログラムから複数の種類の機械語プログラムを作成することが可能である。
【0224】
これにより、例えば同一シリーズのコントローラにおいて、メモリ容量が異なる機種用に機械語プログラムを作成するために、アドレス範囲の変更やアドレス割付の変更を容易に実現でき、容易に機械語プログラムを作成することができる。
ゆえに、機種毎に図式プログラムを再入力する労力を削減することができる。
【0225】
(第4の実施の形態)
本実施の形態においては、上記第2又は第3の実施の形態に係るプログラミング装置31、48の変形例であり、各種ソース・プログラムを中間言語による記述に変換するために複数の中間コンパイラを備えたプログラミング装置について説明する。
【0226】
図13は、本実施の形態に係るプログラミング装置における処理内容を示すブロック図である。この図13において、図11と同一の部分については同一の符号を付してその説明を省略し、ここでは異なる部分についてのみ詳しく説明する。
【0227】
本実施の形態に係るプログラミング装置49において、中間言語プログラムを得た後に関係する構成、処理は、上記第2の実施の形態または第3の実施の形態に係るプログラミング装置31、48と同様であるため、説明を省略する。
【0228】
プログラミング装置49は、LD言語で図式に作成されたプログラム42を中間言語プログラム44に変換する中間コンパイラ43に加え、ST(ストラクチャードテキスト)言語、ニーモニック言語で記述されたシーケンスプログラム42a、42bを、同一の中間言語プログラム44に変換する中間コンパイラ43a、43bを搭載している。
【0229】
LD言語を中間言語に変換する変換ルールの一部は、先で説明した表2と同様であり、中間コンパイラ43で採用されている。
【0230】
表4は、ST言語を中間言語に変換する変換ルールの一部を示すテーブルである。この表4の変換ルールは、中間コンパイラ43aで採用されている。
【0231】
【表4】
Figure 0003819639
【0232】
表5は、ニーモニック言語を中間言語に変換する変換ルールの一部を示すテーブルである。この表5の変換ルールは、中間コンパイラ43bで採用されている。
【0233】
【表5】
Figure 0003819639
【0234】
以上説明したように、本実施の形態に係るプログラミング装置49においては、3種別々の言語にて作成されたシーケンスプログラムであっても同一の形式の中間言語プログラムに変換することが可能である。すなわち、複数のシーケンスプログラムに対してもその表現している論理が同一であれば、同一の中間言語プログラムに変換が可能となる。
【0235】
ユーザは、種々のシーケンスプログラムを統一した形式の中間言語プログラムとして管理することができる。
【0236】
また、複数のプログラミング言語で作成されたシーケンスプログラムに対する中間言語プログラムが同一の形式であることを利用し、中間コンパイラ43、43a、43bと逆の変換を行う逆コンパイラを加えることで、あるプログラミング言語で作成されたシーケンスプログラムを他のプログラミング言語にて自由に表示したり、編集したりすることも可能になる。
【0237】
さらに、ソース・プログラムの記述されている言語がどの言語であっても、中間言語に変換されていれば同様に機械語コンパイラにより機械語の記述に変換することができる。ゆえに、複数の種類のシーケンスプログラムから作成された中間言語プログラムであっても同様に機械語プログラムに変換することが可能である。
【0238】
なお、本実施の形態においては、LD言語、ST言語、ニーモニック言語を中間言語に変換、あるいは、逆変換可能としているが、これに限定されるものではなく、他の各種の制御プログラミング言語を同様に利用することができる。
【0239】
(第5の実施の形態)
本実施の形態においては、上記第2から第4の実施の形態に係るプログラミング装置で利用されているテキスト形式の中間言語ではなく、固定長の機械語の命令コードと固定長のアドレスとからなる形式の中間言語を利用するプログラミング装置について説明する。
【0240】
図14は、本実施の形態に係るプログラミング装置で採用される中間言語の記述形式を示す概念図である。
【0241】
ここでは、先の第2から第4の実施の形態における中間言語で採用されたテキスト形式に代えて、命令語と変数の表現とを、コントローラの命令語コード50aと変数アドレスコード50bからなるバイナリ形式50で表す。
【0242】
また、中間言語で採用される命令語コード50aと変数アドレスコード50bとを固定長とする。
【0243】
ただし、この場合は変数名がコントローラ内のメモリの物理アドレスまたは論理アドレスに変換されてしまう。
【0244】
したがって、本実施の形態に係るプログラミング装置は、ソース・プログラムへの逆変換を可能とするために、命令語と命令コードの対応テーブルを中間言語プログラムと同時に保存する。
【0245】
表6は、ソース・プログラムへの逆変換を可能とするための命令語と命令コードの対応テーブルである。
【0246】
【表6】
Figure 0003819639
【0247】
また、本実施の形態に係るプログラミング装置は、同様の理由により、変数名とアドレスコードの対応テーブルを中間言語プログラムと同時に保存する。
【0248】
表7は、ソース・プログラムへの逆変換を可能とするための変数名とアドレスコードの対応テーブルである。
【0249】
【表7】
Figure 0003819639
【0250】
以上説明したように、本実施の形態に係るプログラミング装置においては、中間言語によって記述される中間プログラムがコントローラの命令語コードと変数アドレスとにより記述される。
【0251】
したがって、中間言語自体がコントローラで実行可能な言語であるので機械語コンパイラを省略させることができ、中間プログラムをそのままコントローラで実行させることができる。
【0252】
また、中間プログラムをそのまま実行可能とすることにより、機械語プログラムが必要ないため、メモリを節約することができる。
【0253】
(第6の実施の形態)
本実施の形態においては、プログラミング装置との間でメモリ容量やCPU能力等に基づく負荷レベルが比較され、プログラミング装置よりも自己の方が負荷レベルが低い場合に、中間コンパイラ、機械語コンパイラ、逆コンパイラを動作させるプログラマブルコントローラについて説明する。
【0254】
図15は、本実施の形態に係るプログラマブルコントローラのハードウェア構成を示すブロック図である。
【0255】
このプログラマブルコントローラ51は、CPU52、プログラムメモリ53、ワークメモリ54、シーケンス演算装置55、シーケンスプログラムメモリ、データメモリ、通信インターフェイス、I/O装置がマイコンバス65で相互に送受信可能に接続されて構成されている。
【0256】
このプログラマブルコントローラ51は、通信インターフェイス58を介して分散部61を搭載したプログラミング装置60と通信可能となっている。
【0257】
このプログラマブルコントローラ51の備えるCPU52は、このプログラマブルコントローラ51の中枢部分であり、コントローラ全体の実行制御を行う。
【0258】
プログラムメモリ53は、CPU52が実行するプログラムが格納されているメモリであり、OSや制御プログラムが格納される。
【0259】
ワークメモリ54は、CPU52が全体制御を実行するときに作業領域として使用する。
【0260】
シーケンス演算装置(シーケンス演算プロセッサ)55は、シーケンスプログラムを実行するプロセッサである。
【0261】
シーケンスプログラムメモリ56は、ユーザが作成したシーケンスプログラムを格納するメモリである。
【0262】
データメモリ57はユーザが使用する変数などのデータを格納するメモリである。
【0263】
通信インタフェース58はこのプログラマブルコントローラ51とプログラミング装置60などを通信媒体を介して接続するためのインタフェース回路である。
【0264】
I/O装置59は、このプログラマブルコントローラ51と外部の制御対象を接続するための入出力装置である。
【0265】
マイコンバス65は、プログラマブルコントローラ51内の要素をCPU52やシーケンス演算装置55と接続するためのバスであり、アドレスバス、データバス、制御バスの総体である。
【0266】
さらに、プログラマブルコントローラ51は、先の第2から第5の実施の形態において説明した各種のコンパイラ(例えば中間コンパイラ43、43a、43b、機械語コンパイラ45、逆コンパイラ47)を搭載している。
【0267】
すなわち、このプログラマブルコントローラ51のプログラムメモリ53には、上記と同様の変換を行う中間コンパイラ、機械語コンパイラ、逆コンパイラが所持されている。
【0268】
一方、このプログラマブルコントローラ51と通信可能なプログラミング装置60は、上記第2から第5の実施の形態に係るプログラミング装置31、48、49と同様の構成を持ち、同様に動作可能であるが、さらに分散部61を備えている。
【0269】
分散部61は、プログラマブルコントローラ51とプログラミング装置60との間におけるCPU処理能力やメモリ容量を調査する。そして、この調査結果に基づいて、各種プログラムの保存やコンパイル処理の実行をプログラマブルコントローラ51とプログラミング装置60のいずれで行うかを決定し、指示する。
【0270】
上記のような構成を持つ本実施の形態に係るプログラマブルコントローラ51を利用することで、ソース・プログラムから中間言語プログラムへの変換処理、中間言語プログラムから機械語プログラムへの変換処理、中間言語プログラムからソース・プログラムへの逆変換処理が、プログラマブルコントローラ51とプログラミング装置60のいずれでも実行可能となる。
【0271】
したがって、プログラミング装置60の分散部61が、プログラマブルコントローラ51とプログラミング装置60との処理能力やメモリ容量にしたがって、ソース・プログラムや中間言語プログラムへの処理、及び配置を自由に選択する。
【0272】
図16は、本実施の形態におけるプログラムの配置関係の第1の例を示すブロック図である。
【0273】
プログラミング装置60の能力に余裕がある場合には、ソース・プログラム611、中間言語プログラム62をプログラミング装置60に配置して変換を行い、メモリ容量の少ないプログラマブルコントローラ51には機械語プログラム63を格納する。
【0274】
図17は、本実施の形態におけるプログラムの配置関係の第2の例を示すブロック図である。
【0275】
プログラミング装置60に比べてプログラマブルコントローラ51にメモリ容量の余裕がある場合には、プログラミング装置60にソース・プログラム611を格納し、中間言語プログラム62及び機プログラム63をプログラマブルコントローラ51に格納する。
【0276】
図18は、本実施の形態におけるプログラムの配置関係の第3の例を示すブロック図である。
【0277】
プログラミング装置60の処理能力に余裕がなく、プログラマブルコントローラ51のメモリ容量に余裕がある場合には、プログラミング装置60にソース・プログラム611を格納し、プログラマブルコントローラ51にソース・プログラム611を転送し、この転送後、プログラマブルコントローラ51で中間言語プログラム62及び機械語プログラム63に変換し、保存する。
【0278】
以上説明したように、本実施の形態に係るプログラマブルコントローラ51を適用することにより、プログラマブルコントローラ51やプログラミング装置60のメモリ容量やCPU能力にあわせて、シーケンスプログラムや、中間言語プログラム、機械語プログラムの格納場所や変換場所が選択される。
【0279】
ゆえに、プログラマブルコントローラ51やプログラミング装置60のどちらかの能力が低い場合でも、中間言語を利用することができる。
【0280】
なお、本実施の形態においては、プログラミング装置60側に分散部61を備えたが、これに限定されるものではなく、プログラマブルコントローラ51側にこの分散部61を備えてもよい。
【0281】
また、本実施の形態においても、上記各種のコンパイラを利用することで同様の効果を得ることができる。
【0282】
(第7の実施の形態)
本実施の形態においては、第6の実施の形態に係るプログラミング装置60の変形例について説明する。
【0283】
先の第6の実施の形態においては、プログラマブルコントローラ51とプログラミング装置60のいずれでもプログラムを変換、配置することができるとしている。しかしながら、ソース・プログラムを除く他のプログラム(中間プログラム及び機械語プログラム)をプログラマブルコントローラ51に固定的に配置するとし、変換処理もこのプログラマブルコントローラ51で実行すると定めてもよい。
【0284】
すなわち、プログラマブルコントローラ51は、プログラミング装置60からソース・プログラム611のみを受信して格納し、このプログラマブルコントローラ51で中間言語、機械語への変換がなされる。
【0285】
これにより、表示器と入力装置と簡単な処理装置と通信インターフェイスだけを持つプログラミング装置60を利用しても中間言語を利用したプログラミングが可能となる。
【0286】
なお、本実施の形態においても、上記各種のコンパイラを利用することで、上記と同様の効果を得ることができる。
【0287】
(第8の実施の形態)
本実施の形態においては、上記第2から第7の実施の形態の変形例であり、ソース・プログラムには含まれているが中間言語に変換した際に不要となる記述の取扱いについて説明する。
【0288】
シーケンスプログラムには、命令語の他に変数宣言、ラベル、コメントなどのような、コンパイル後には不要となる部分も含まれている場合がある。
【0289】
本実施の形態においては、中間コンパイラがコンパイル後に不要になる部分を特別の中間言語コードに変換し、中間言語プログラムに付加させる。
【0290】
表8は、コンパイル後に不要な部分を中間言語表記のコードに変換する変換ルールの一部を示すテーブルである。
【0291】
【表8】
Figure 0003819639
【0292】
図19は、本実施の形態における中間プログラムの記述形式を示す図であり、変換後の中間言語コード64aが中間プログラム64に付加されている状態を示している。
【0293】
以上説明したように、本実施の形態においては、コンパイル後に不要となる記述をソース・プログラムが含んでいる場合には、この不要となる記述をコード化して中間言語プログラムに含めておく。
【0294】
したがって、上記の変換処理を行う中間コンパイラを先で述べたプログラミング装置やプログラマブルコントローラに搭載することで、変数名やコメント文も含む元のシーケンスプログラムへ容易に逆変換可能となる。
【0295】
また、プログラミング言語の種類に関係しない中間言語形式にもなっているので、ユーザが選択したプログラミング言語に逆変換して表示や編集をすることが可能となる。
【0296】
さらに、中間言語プログラムから機械語プログラムへのコンパイル時にこの不要部分のコードのみを容易に分離できるため、機械語への変換を行うコンパイル作業が簡単化できる。
【0297】
(第9の実施の形態)
本実施の形態においては、上記第8の実施の形態の変形例であり、中間言語プログラムが機械語コードで記述される場合について説明する。
【0298】
先の第5の実施の形態と同様に、本実施の形態においては中間言語プログラムをプログラマブルコントローラの機械語コードを使用して、かつ固定長のコードで表現できるように構成する。
【0299】
ここで、第8の実施の形態と同様に、コメント文等のプログラムの実行に直接関与しない部分(コンパイル後に不要となる部分)の中間言語プログラムにはプログラマブルコントローラが演算処理において非実行命令であると解釈可能な命令コードを付与する。
【0300】
なお、ここではバイナリコードによってコンパイル後に不要となる部分のコードを記述する。
【0301】
表9は、コンパイル後に不要な部分をバイナリ形式の中間言語表記のコードに変換する変換ルールの一部を示すテーブルである。
【0302】
【表9】
Figure 0003819639
【0303】
以上説明したように、本実施の形態における変換処理を先で述べたプログラミング装置やプログラマブルコントローラに搭載されている中間コンパイラに適用すると、プログラマブルコントローラが機械語コードを使用して固定長化された中間言語プログラムを直接実行することが可能となる。
【0304】
また、この中間言語は変数名やコメント文も含んでいるので容易に元のシーケンスプログラムへ逆変換可能であるし、プログラミング言語の種類に関係しない中間言語形式にもなっているので、ユーザが選択したプログラミング言語に逆変換して表示や編集をすることが可能である。
【0305】
このように構成することにより、プログラマブルコントローラ内に1種類の中間言語プログラムをもたせるだけで、直接実行も可能であり、元のシーケンスプログラムへの逆変換も可能にできる。
【0306】
(第10の実施の形態)
本実施の形態においては、上記各実施の形態の変形例について説明する。
【0307】
第1の実施の形態で説明したプログラミング装置においては、3種混在したプログラムをコンパイル後、複数のコントローラに自動分散させて処理を実行させるとしてもよい。例えば、混在表記されたプログラムのうち所定の言語で記述された部分は所定のコントローラで実現させ、他の言語で記述された部分は他のコントローラで実現させる等の手法で自動的に処理を分散、実行させることができる。また、これにより、各処理に対する適切なコントローラを自動的に選択し、処理を実行させることができる。
【0308】
また、上記各実施の形態で説明したプログラミング装置やプログラマブルコントローラは、クライアント・サーバ型でも、スタンドアローン型でも利用可能とすることができる。サーバが存在する場合には、自装置に備えられていないサーバの機能を流用することができ、例えば自装置が持っていないファンクションやファンクションブロック、プログラムをサーバから読み出して利用することができる。
【0309】
また、上記各プログラミング装置において、トップダウン方式のプログラミングを可能としてもよい。このように、トップダウン方式によりプログラミングを行うことで、システム構成設計のブロックから順次、関連する下位のブロックを開いていき、機能、設計レベル、I/O設計レベル、モジュール設計レベル、取扱い説明書の参照などが可能となる。
【0310】
また、トップダウン方式のプログラミングを可能とすることで、プログラミング装置上で作成した設計仕様書などのドキュメントと、このドキュメントに関連するプログラムを有機的にリンクさせ、ドキュメントとプログラムの相関関係を規定することができる。機能ブロック図などでは、そのブロックからプログラム編集、モニタを実行することができ、ライブラリを活用することにより、システムエンジニアリングからプログラミング、メンテナンスまでをシームレスに実行することができる。
【0311】
また、上記各プログラミング装置において、ボトムダウン方式のプログラミングを可能としてもよい。このように、ボトムダウン方式によりプログラミングを行うことで、I/O設計、モジュール設計を並行に進行させた後に機能モジュールとして統合し、システムとしてもプログラムを作成することができる。
【0312】
また、上記各プログラミング装置を、従来のプログラマブルコントローラで使用されていたレジスタと同一名称の変数を自動的に定義し、あたかもレジスタを使用してプログラムを作成しているように利用できるとしてもよい。
【0313】
また、上記各プログラミング装置において、作成するプログラム間の参照関係図を表示するとしてもよい。これにより、一方のプログラムを変更した場合に、他方のプログラムの変更が必要か否かど、プログラム変更時の影響をユーザが容易に認識することができる。
【0314】
また、上記各実施の形態で説明したプログラミング装置やプログラマブルコントローラは、例えばLD言語によって記述された接点やコイル命令をフォースする際に、プログラム全体をコンパイルし直すことなくプログラム中の対象になる命令のコードだけを変更することにより、フォース機能を実現することができる。
【0315】
なお、上記各実施の形態に係るプログラミング装置及びプログラマブルコントローラの各機能、各要素(例えば異なる言語の混在表示機能、混在プログラムをコンパイルするコンパイラ、中間コンパイラ、機械語コンパイラ、逆コンパイラ等)は、コンピュータに実行させることのできるプログラムとして、例えば磁気ディスク(フロッピーディスク、ハードディスク等)、光ディスク(CD−ROM、DVD等)、半導体メモリなどの記録媒体に書き込んで適用したり、通信媒体により伝送して計算機あるいは計算機システム、プログラマブルコントローラに適用することも可能である。上記各機能を実現するコンピュータは、記録媒体に記録されたプログラムを読み込み、プログラムによって動作が制御されることにより、上述した処理を実行する。
【0316】
【発明の効果】
以上詳記したように本発明においては、複数種類の制御プログラミング言語を混在表記できるため、ユーザが制御プログラムの内容を容易に理解することができる。
【0317】
また、本発明においては、混在表記させていたプログラムをそのままコンパイルすることができるため、各種言語の利点を活用したプログラムを作成し、実行させることができる。
【0318】
また、本発明においては、モニタデータを混在表記させたプログラム上に表示させるため、ユーザが容易に問題点を発見することができる。
【図面の簡単な説明】
【図1】本発明の第1の実施の形態に係るプログラミング装置の構成を示すブロック図。
【図2】同実施の形態に係るプログラミング装置で採用されたコンパイル理論を説明するためのフロー図。
【図3】同実施の形態に係るプログラミング装置によって混在表記されているプログラムの例を示す画面図。
【図4】ノードと矢印でプログラムを表した場合を示す状態図。
【図5】同実施の形態で採用されたノードの順序決定手法を示す概念図。
【図6】同実施の形態で採用されたコンパイル理論により得られるコンパイル結果を示す概念図。
【図7】同実施の形態に係るプログラミング装置によって扱われるモニタデータの構造と、コンパイル結果の構造、及びモニタデータ構造テンプレートを示す関係図。
【図8】3種の制御プログラミング言語でプログラムを混在表記し、モニタデータを重ねて表示した場合の一例を示す画面図。
【図9】3種の制御プログラミング言語でプログラムを混在表記し、モニタデータを重ねて表示した場合の他の例を示す画面図。
【図10】本発明の第2の実施の形態に係るプログラミング装置のハードウェア構成を示すブロック図。
【図11】同実施の形態に係るプログラミング装置における処理内容を示すブロック図。
【図12】本発明の第3の実施の形態に係るプログラミング装置における処理内容を示すブロック図
【図13】本発明の第4の実施の形態に係るプログラミング装置における処理内容を示すブロック図
【図14】本発明の第5の実施の形態に係るプログラミング装置で採用される中間言語の記述形式を示す概念図。
【図15】本発明の第6の実施の形態に係るプログラマブルコントローラのハードウェア構成を示すブロック図。
【図16】同実施の形態におけるプログラムの配置関係の第1の例を示すブロック図。
【図17】同実施の形態におけるプログラムの配置関係の第2の例を示すブロック図。
【図18】同実施の形態におけるプログラムの配置関係の第3の例を示すブロック図。
【図19】本発明の第8の実施の形態における中間プログラムの記述形式を示す図。
【図20】従来のプログラミング装置において異種の制御プログラミング言語を利用して作成したプログラムを表示した例を示す画面図。
【図21】シーケンスプログラムを作成したプログラミング装置とモニタを行うプログラミング装置が異なる場合の例を示すブロック図。
【符号の説明】
1、31、48、49、60…プログラミング装置
2、40、40a〜40c、51…プログラマブルコントローラ
6…プログラム編集
7…プログラム表示
8…プログラムコンパイル
10…モニタデータ
11…モニタ重ね表示
12…プログラムファイル
13…モニタデータ
17…プログラム実行
18…モニタデータ出力
19…モニタデータ返信
32、52…CPU
33…OS・プログラムメモリ
34、54…ワークメモリ
42、42a、42b…シーケンスプログラム
43、43a、43b…中間コンパイラ
44、62…中間言語プログラム
45、45a〜45c…機械語コンパイラ
46、46a〜46c、63…機械語プログラム
47…逆コンパイラ
50…バイナリ形式中間言語
53…プログラムメモリ
55…シーケンス演算装置
56…シーケンスプログラムメモリ
57…データメモリ
61…処理分散部
611…ソース・プログラム[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a programming device that supports development of a program for controlling a steel plant, a paper manufacturing plant, a public system such as a water and sewage system, a production process in the automobile industry, a chemical / petroleum plant, etc. In Related.
[0002]
[Prior art]
Generally, a sequence program is created by a programming device, and the created sequence program is converted into a machine language so that it can be executed by a programmable controller (hereinafter referred to as “controller”). Then, the sequence program converted into the machine language is sent to the controller, stored as a machine language program on the controller side, and executed.
[0003]
There are various languages for the control programming language used to create the sequence program. The main ones are ladder diagram (LD language), function block diagram (FBD language), sequence flowchart (SFC language), etc. . The LD language, FBD language, and SFC language are graphical three languages of the IEC61131-3 standard.
[0004]
Table 1 is a table showing characteristics of the LD language, the FBD language, and the SFC language.
[0005]
[Table 1]
Figure 0003819639
[0006]
For example, from Table 1, the LD language is suitable for control programming using logical operations. In addition, logical operations tend to be used for sequence control. Therefore, the LD language tends to be used for creating a program to be executed by the sequence controller.
[0007]
The FBD language is suitable for control programming using numerical operations. Numerical computation tends to be used for loop control. Therefore, the FBC language tends to be used for creating a program to be executed by the loop controller.
[0008]
Furthermore, although the SFC language is suitable for control programming using sequential processing, logical operations, numerical operations, and character processing are impossible.
[0009]
In this way, since the LD language, FBD language, and SFC language have different characteristics, the user (for example, a programmer) determines the control target, the content of the control, and the level of understanding of the user, and arbitrarily selects one of the languages. And used for programming.
[0010]
Conventionally, as described above, the conversion from the created sequence program to the machine language program is solely the role of the programming device, and the controller does not perform this machine language conversion.
[0011]
[Problems to be solved by the invention]
As described above, conventionally, programming is performed by any control programming language selected by the user before creating the sequence program.
[0012]
However, in recent years, the object of control and the content of control processing have become complicated, and there are many opportunities to create a series of programs related to control using a plurality of types of control programming languages. For example, the necessity of creating a sequence program by combining arithmetic processing and numerical processing is improved.
[0013]
In such a case, conventionally, a user divides a series of control contents, and performs programming using a suitable control programming language for each divided content.
[0014]
Therefore, even if a graphical control programming language is used, there is a problem that it is difficult for the user to grasp the entire state of the program to be divided and created.
[0015]
FIG. 20 is a screen diagram showing a display example of a program created using different control programming languages in a conventional programming device.
[0016]
For example, it is assumed that a part of the sequence program is described in the LD language and another part is described in the SFC language by a computer operating as a programming device.
[0017]
Then, when this sequence program is displayed on the computer screen 100, the portion described in the LD language is displayed on the window 200a, but the portion described in the SFC language is further displayed on another window 200b. Is done. In such a screen 100, the user must confirm the contents of the program (processing flow, etc.) while following the call between the programs between the different windows 200a and 200b, and cannot easily understand the contents. .
[0018]
Conventionally, a sequence program that has been created and converted into a machine language is stored in a controller and executed. Note that when the processing state of the sequence program being executed is monitored by a programming device, the original sequence program prior to machine language conversion is required.
[0019]
However, there is a case where it is desired to monitor the sequence program being executed by a programming device different from the programming device that has created and converted the sequence program.
[0020]
FIG. 21 is a block diagram illustrating an example in which the programming device that created the sequence program is different from the programming device that performs monitoring.
[0021]
The original program 400a generated by the programming device 300a is converted into a machine language program 500a, stored and executed in the controller 600, and a part of the control object 700 is controlled.
[0022]
Similarly, the original program 400b generated by the programming device 300b is converted into a machine language program 500b, stored and executed in the controller 600, and the other parts of the control object 700 are controlled.
[0023]
Here, since the device of the control object 700 has been changed, when a new program is created by the programming device 300b, it may be desired to monitor the original program 400a created by another programming device 300a.
[0024]
In this case, since the original program 300a to be monitored is not held in the programming device 300b that performs monitoring, it is difficult to monitor. Note that the programming device 300b that performs the monitoring simply obtains the original program 400a by reversely converting the machine language program 500a held in the controller 600. The programming device 300a that created the program and the monitor This is difficult when the control programming language used with the programming device 300b to be used is different.
[0025]
Conventionally, there are programming devices that can use a plurality of control programming languages.
[0026]
However, even in a programming device that can use multiple languages, the user's request to convert a program created in one control programming language into a program created in another control programming language is displayed. There is no possible programming device.
[0027]
In summary, conventionally, programs written in different control programming languages cannot be mixedly written, and editing, compiling, control execution, and online monitoring of mixed programs cannot be performed.
[0028]
Conventionally, if a sequence program is created using different types of control programming languages, it is difficult to handle them in a unified manner.
[0029]
The present invention has been made in view of the above circumstances, and a programming device that improves the program description and understanding by the user and improves the work efficiency of the user by allowing different types of control programming to be handled collectively. The The purpose is to provide.
[0030]
[Means for Solving the Problems]
The gist of the present invention is that a plurality of types of control programming languages can be freely used.
[0031]
Hereinafter, specific means taken for reviewing the present invention will be described.
[0032]
The first invention is controller In a programming device that supports the creation of a control program to be executed in the system, a plurality of types including a control program language that interprets power or signals to flow from left to right and a control program language that interprets state transition from top to bottom Control programs written in mixed control program languages By network unit and sub-network unit Treated as a directed graph, assigns node numbers to the nodes in the directed graph from the lower right to the left, goes up to the upper row, and goes from the right to the left again, and uses the depth-first search algorithm for the directed graph with this node number. Apply to pick up each node and determine the execution order of each node The execution order is determined so that the order of external condition computation, state transition computation, and external operation computation based on the state transition result is maintained in subnetwork units, and the order from left to right and top to bottom in network units. The order of execution is determined so that the controller is protected, and the instruction word understood by the controller is acquired in consideration of the order of execution in the network and sub-network. As described above, the programming apparatus includes a compiler that compiles a control program written in a mixed manner.
[0033]
Thereby, the user can easily understand the contents of the control program.
An example of the control means is a programmable controller, and an example of the control program is a sequence program.
[0036]
As a result, since the mixed program can be compiled as it is, a program utilizing the advantages of various languages can be created, and this program can be executed by the control means.
[0037]
First 2 The invention of the 1 In the programming device of the invention, the compiler stores the contents of the control program written in a mixed manner and the monitor data in association with each other, and the monitor data is mixed on the control program written in a mixed manner based on the relationship at the time of compilation by the compiler. It is assumed that a monitor data superimposing display means to be arranged is added.
[0038]
This first 2 In this invention, by utilizing the relationship between the contents of the control program and the monitor data, the monitor data can be arranged on the control program expressed in a mixed manner, so that the user can easily recognize the problem of the program. .
[0092]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
[0093]
(First embodiment)
In the present embodiment, a description will be given of a programming device capable of mixed notation (same notation) for a plurality of control programming languages.
[0094]
Further, in the present embodiment, a description will be given of a programming device that obtains a program that can be executed by compiling a program that is mixedly expressed in a plurality of languages.
[0095]
In the present embodiment, a case where three types of control programming languages of LD language, FBD language, and SFC language are used will be described, but the same applies to other languages.
[0096]
FIG. 1 is a block diagram showing the configuration of the programming device according to the present embodiment.
[0097]
The programming device 1 displays a program in a control programming language according to a user instruction, but also displays a program in a state where three types of languages are mixed. In addition, a program created by mixing three types of control programming languages is converted in accordance with a user instruction, and transmitted to the programmable controller 2.
[0098]
The programming device 1 mainly includes an input device 3, a display device 4, and a transmission device 5, and includes a program editing 6, a program display 7, a program compilation 8, a file transmission 9, a monitor data acquisition 10, a monitor overlap display 11, and the like. Perform various processes.
[0099]
Among these, the characteristic part in this Embodiment is. The processing contents of the program compilation 8, the program file 12 handled by the processing such as the program compilation 8 and the program editing 6, and the monitor data 13 handled by the monitor data overlay display 11 are present.
[0100]
The programming device 1 shown in FIG. 1 has the same configuration device as that of a normal programming device and can execute the same processing. However, the description of other configuration devices and processing is omitted for the sake of simplicity. is doing.
[0101]
The input device 3 of the programming device 1 is an interpersonal instruction interface, and commands to the processing of the program editing 6, the program display 7, the program compilation 8, and the monitor overlap display 11 are output from the input device 3. Generally, a keyboard and a mouse are used.
[0102]
The display device 4 is a device capable of displaying graphics and characters, and a CRT or a liquid crystal display is used.
[0103]
The transmission device 5 is a device for transmission connection between the programming device 1 and the controller 2, and generally indicates a transmission board or cable such as RS232C or Ethernet.
[0104]
Program editing 6 is a process of inputting, cutting, pasting, copying, and deleting circuit graphics in three types of control programming languages in accordance with instructions from the input device 3. That is, a program in which three types of control programming languages are mixed is created by the processing of the program editing 6, and the created program is stored as one element of the program file 12.
[0105]
The program file 12 is a generic name for a group of files related to program display and execution. For example, a pre-compilation program described in the three types of control programming languages obtained from the program editing 6 as described above and a program after compilation by the program compilation 8 are included.
[0106]
The program display 7 is a process for displaying a circuit graphic or the like handled in the program editing 6 or the like based on the program file 12.
[0107]
That is, the program editing 6 and the program display 7 allow the user to create a graphical program using description elements in three languages.
[0108]
For example, drag the elements used in various control program languages (contact points in LD language, coils, functions in FBD language, function blocks, steps in SFC language, lines indicating other processing flows, etc.) with the mouse, By moving and releasing the program, it is possible to edit the program while displaying a circuit graphic in which three kinds of languages are mixed.
[0109]
The program compile 8 is a command word that can be executed in real time by the controller 2 by compiling a circuit graphic in which three languages are mixed according to a special compilation theory applied to an environment in which three languages are mixed. This is a process of generating a compilable format (instruction words arranged in the order processed by the controller) and storing it as a part of the program file. The format that can be compiled into an instruction word that can be executed in real time by the controller 2 is a format that defines the order in which the controller 2 actually processes from a graphically described program.
[0110]
The program compile 8 further compiles a format that can be compiled into an instruction word in an appropriate order into a machine language program and saves it as a part of the program file 12. If the graphically described program can be executed on the controller 2 as it is, for example, as a macro instruction in the controller 2, the conversion into the machine language is not necessary.
[0111]
The file transmission 9 is a process for transmitting at least a program in machine language in the program file 12 to a designated portion of the controller 2 using the transmission device 5.
[0112]
The monitor data acquisition 10 is a process of acquiring the monitor data 13 from the controller using the transmission device 5.
[0113]
The monitor data 13 is data indicating the calculation result in the program and the current value of the variable. This monitor data has a special data structure that can be drawn on the circuit graphic in an environment where three languages are mixed, and can be monitored by drawing it on the circuit graphic. Become.
[0114]
The monitor overlay display 11 is a process for superimposing the monitor data 13 on the circuit graphic for monitor display.
[0115]
The controller 2 controls a control object (not shown) based on the machine language program received from the programming device 1. Further, monitor data 13 obtained from the state of the control target and the execution result of the program is transmitted to the programming device 1.
[0116]
The controller 2 mainly includes a transmission device 14 and an I / O device 15, and executes various processes such as file reception 16, program execution 17, monitor data output 18, and monitor data return 19. In the controller 2 shown in FIG. 1, the description of other components and processes is omitted for the sake of simplicity, but the same components as those of a normal controller are provided and the same processes can be executed. It is.
[0117]
The transmission device 14 is a device that performs transmission connection between the programming device 1 and the controller 2 in the same manner as the previous transmission device 5.
[0118]
The I / O device 15 is a device for the controller 2 to input and output an I / O signal from a process to be controlled (not shown). Generally, an I / O card or an I / O bus is used. The
[0119]
The file reception 16 is a process of receiving at least a machine language program of the program file 12 from the programming device 1 using the transmission device 14 and arranging it at a designated location.
[0120]
The program execution 17 interprets the contents of the program file 16 received by the processing of the file reception 16, and executes a machine language (command word) while inputting / outputting an I / O signal.
[0121]
The monitor data output 18 is a process for generating the monitor data 18 from the calculation result of the executed program and the value of the variable.
[0122]
The monitor data reply 19 is a process for transmitting the monitor data 13 generated by the monitor data output 18 to the programming device 1 using the transmission device 14.
[0123]
The compile theory adopted in the program compilation 8 in the programming device 1 having the above configuration will be described below. With this compilation theory, compilation of a control programming language in which three types are mixed is realized.
[0124]
Compiling here refers to arranging the final command word understood by the controller 2 from the network aggregate according to the interpretation according to the IEC61131-3 standard. Therefore, conversion to instruction words and execution order determination are the essence of the compilation logic described here.
[0125]
FIG. 2 is a flowchart for explaining the compilation theory employed in the programming device 1 according to the present embodiment.
[0126]
First, a process of decomposing a program in which three languages are mixed into nodes and arrows is executed (s1).
[0127]
FIG. 3 is a diagram illustrating an example of a program that is mixedly represented by the programming device according to the present embodiment.
[0128]
In this program 20, LD language, FBD language, and SFC language are mixedly described.
[0129]
Graphic symbols such as the contacts 21 and the coils 22 are described in the description portion in the LD language. A graphic symbol such as a function (function block) 23 or the like is described in the description portion in the FBD language. In the description part in the SFC language, graphic symbols such as step 24 and transition 25 are described.
[0130]
Here, the graphic symbols of each language as described above are treated as “nodes”.
A line connecting nodes is treated as an “arrow”.
[0131]
In the LD language, the IEC61131-3 standard promises to interpret power to flow from left to right (Power flow).
[0132]
Similarly, in the FBD language, it is promised to interpret the signal to flow from left to right (Signal Flow).
[0133]
Furthermore, in the SFC language, it is promised to interpret the state transition from top to bottom (Activity flow).
[0134]
Therefore, if the node described in the LD language and the FBD language is “◯”, the node described in the SFC language is “Δ”, and the direction of the arrow is expressed by the direction of power, signal, and state transition, the node You can rewrite the program with three types with arrows and arrows.
[0135]
FIG. 4 is a state diagram when a program is represented by nodes and arrows. FIG. 4 shows a state 26 in which the program 20 shown in FIG. 3 is rewritten.
[0136]
Next, a group-by-network grouping process is executed for the state 26 indicated by the node and the arrow (s2).
[0137]
In this grouping process in units of networks, a unit of an aggregate in which nodes and arrows are in contact is a single network. In the state 26 of FIG. 4, as a result of grouping, three networks Network1, Network2, and Network3 are acquired.
[0138]
Next, a grouping process in units of sub-networks for the state 26 indicated by the nodes and arrows is executed (s3).
[0139]
In this grouping process in subnetwork units, when the network acquired in the grouping process in the previous network unit includes SFC nodes, the network part of LD language or FBD language connected to the SFC language transition is the subnetwork. It is said. Further, a network portion composed only of SFC step transitions is a sub-network. Furthermore, the LD or FBD language network portion connected to the SFC language step is set as a sub-network.
[0140]
Due to the above-described subnetwork grouping process, in the state 26 of FIG. 4, the network Network2 includes the SFC language nodes, so the portion of the network Network2 that includes the LD language is first set as the subnetwork Action1. In addition, a portion of the network Network2 that is configured only by step transitions in the SFC language is a subnetwork State1. Further, a portion including the FBD language in the network Network2 is set as a subnetwork Condition1.
[0141]
Next, since the network unit and subnetwork unit acquired by the above processing are composed of nodes and arrows connecting them, the network unit and subnetwork unit are regarded as a “directed graph” in the graph theory, and the execution order. Is determined (s4).
[0142]
A directed graph refers to a graph in which the relative order between nodes is determined, and there is a topological sort as a general technique for aligning nodes connected by the directed graph. However, for example, according to the IEC1131-3 standard, a directed graph in units of networks or subnetworks may form a partial order relationship in which the order cannot always be compared by topological sorting. When the directed graph includes such a partial order relationship, the topological sort solution is not one.
[0143]
Therefore, in the compilation theory of program compilation 8 in the present embodiment, the execution order of the directed graph in units of networks and sub-networks is determined according to the following procedure.
[0144]
FIG. 5 is a conceptual diagram showing the node order determination method employed in the present embodiment.
[0145]
Assume that the network or sub-network is represented by a directed graph as shown in FIG.
[0146]
First, the nodes are numbered in the reverse order of the horizontally written text (the order in which the operation of moving from the lower right to the left and moving up from the right to the right again is repeated).
[0147]
The state obtained by this node numbering is shown in FIG.
[0148]
Next, each node is picked up by applying a depth first search algorithm to the directed graph by the network or subnetwork, and the result of FIG. 5C is obtained.
[0149]
In the depth-first search algorithm, first, the viewpoint is departed, the positions of the numbers proceeding in ascending order are examined, and the process proceeds to a place where it can be reached (connected by an edge and not visited yet). When there is no place to go, go back to where you want to go and go to where you can go again. And it is an algorithm that ends when all the places to go are gone (return the way they came).
[0150]
By this depth-first search algorithm, the node execution order of “6, 3, 5, 8, 4, 2, 1, 7” is obtained.
[0151]
Next, in consideration of the execution order in the network and sub-network as described above, a compiler summarizing process for acquiring an instruction word understood by the controller 2 is executed (s5).
[0152]
Through the above processing, the execution order of the nodes in the network and sub-network units is acquired.
[0153]
Here, the node is actually an “instruction symbol” in graphic notation, and is considered as a “macro instruction” (a set of instructions understood by the CPU for executing the instruction word symbol) on the controller 1. Is equal to the instruction word execution order on the controller 2.
[0154]
Therefore, in the compiler summary process, the execution order between the sub-network units and between the network units is obtained as the last process.
[0155]
The execution order between the sub-network units is determined so as to keep the basic order in which the SFC language operates as a state machine.
[0156]
That is,
Order 1: Calculation of external condition (Condition) of state transition
Order 2: State transition (State) operation
Order 3: External motion calculation based on the state transition (Action) result
You can follow the order.
[0157]
Therefore, the sub-network may be executed in the order of Conditions 1 to N, State, and Action 1 to L. Similarly, in the case of the network Network 2 shown in FIG. 4, the sub-network may be executed in the order of Sub-network Condition 1, State, and Action 1.
[0158]
The execution order between the network units is determined so that the order from the left to the right and from the top to the bottom is observed in accordance with the natural flow of the IEC61131-3 standard, for example, because the connection of each network unit is independent.
[0159]
Compiling the mixed program of the three types is executed by determining the order as described above. Actually, the editing screen is moved in the order of horizontal writing (from the upper left to the right, and moved from the left to the right again in the lower row) In this order, the network is acquired, the node having the youngest order in the acquired network is regarded as the representative of the network, and the network may be executed in order of youngest among the nodes.
[0160]
FIG. 6 is a conceptual diagram showing a compilation result obtained by the above compilation theory.
[0161]
In the compilation result 27, the networks Network 1 to 5 and the sub-networks Conditions 1 and 2 and Actions 1 and 2 included in the network Network 3 and the nodes Node 1 to 6 included in the network or the sub-network are described in the execution order.
[0162]
Next, the structure of the monitor data 13 handled in the programming device 1 having the above configuration will be described. With the structure of the monitor data 13, an input value, an output value, and the like are displayed on a mixed notation of three types of languages, thereby realizing a control operation monitor.
[0163]
Here, the monitor means that when the compiled result is executed by the controller 2, the user can check the input value and output value of the instruction symbol (instruction word) executed on the controller 2 in real time. To do. Actually, the monitor is realized by superimposing and displaying the input value and the output value at the corresponding positions on the graphic notation in the display device 4.
[0164]
FIG. 7 is a relationship diagram showing the structure of the monitor data 13, the structure of the compilation result, and the monitor data structure template handled by the programming device 1 according to the present embodiment.
[0165]
What can be known from the result of compilation based on the above compilation theory is an instruction word and the position (address) of the instruction word, and a structure in which addresses Address 1 to 8 are assigned to the nodes Node 1 to 8 as the structure 28 of the compilation result. Is obtained.
[0166]
Here, since the instruction word has the number of inputs and outputs and the data type as eigenvalues, it can be said that the instruction word has a unique monitor data structure.
[0167]
Therefore, by creating the monitor data structure template 29 at the time of compilation, the structure 30 can be created in advance for the monitor data to be externally output during the calculation of the controller 2.
[0168]
Here, the monitor data structure 30 has a structure in which addresses Maddress1 to 8 are assigned to the monitor data Data1 to 8, respectively.
[0169]
In the monitor data structure template 29, the addresses Address1 to 8 of the nodes Node1 to 8, the addresses Maddress1 to 8 of the monitor data, and the types DataType1 to 8 of the data are associated with each other.
[0170]
As a result, monitor data corresponding to the structure 28 of the compilation result can be acquired and arranged on a graphic in which three languages are mixedly described.
[0171]
FIG. 8 is a screen diagram showing an example in which programs are mixedly described in three types of control programming languages and monitor data is displayed superimposed on the graphic notation.
[0172]
Similarly, FIG. 9 is also a screen diagram showing another example in which programs are mixedly described in three languages and monitor data is displayed superimposed on the graphic notation.
[0173]
As described above, in the programming device 1 according to the present embodiment, a plurality of control programming languages can be mixed and displayed.
[0174]
As a result, various languages can be written on the same editing plane, so that the user can recognize the whole as a whole without having to follow the call.
[0175]
Moreover, since various languages can be naturally mixed and complemented, specification readability can be improved.
[0176]
That is, the user can easily understand the contents of the control process and the contents of the program to be created.
[0177]
Therefore, the productivity of the program can be improved and the work efficiency of the user can be improved.
[0178]
In the programming device 1 according to the present embodiment, the description elements of various languages are treated as nodes, the flow of various languages is treated as an arrow, the processing order is determined by a depth search priority algorithm in graph theory, and compilation is performed. Do.
[0179]
Therefore, it is possible to compile the edited program as it is and supplement it by naturally mixing a plurality of control programming languages, and download it to the controller 2 to execute control.
As a result, a program can be created while taking advantage of various languages, and the specification description can be improved.
[0180]
Further, in the programming device 1 according to the present embodiment, by associating the descriptive elements of various languages with the monitor data at the time of compilation, the monitor data can be represented on the graphic notation in various languages. The user can easily find the problem.
Therefore, the user can create a high-quality control program.
[0181]
(Second Embodiment)
In the present embodiment, a programming device that improves the sharing of control programs will be described.
[0182]
FIG. 10 is a block diagram showing a hardware configuration of the programming device according to the present embodiment.
[0183]
The programming device 31 is used to monitor the sequence program execution state of the controller and to create and modify the sequence program. It also has a display device such as a CRT and an input device such as a keyboard.
[0184]
The programming device 31 includes a CPU 32, an OS / program memory 33, a work memory 34, an input / output interface 35, a display interface 36, and a communication interface 37 that are connected to each other via a microcomputer path 41 so as to be able to transmit and receive each other. An input device 38 is connected to the input / output interface 35, and a display 39 is connected to the display interface 36.
[0185]
The programming device 31 can communicate with the programmable controller 40 via the communication interface 37.
[0186]
The CPU 32 included in the programming device 31 is a central part of the programming device 31 and controls execution of the entire programming device 31.
[0187]
The OS program 33 is a memory storing a program executed by the CPU 32, and stores an OS and a control program.
[0188]
The work memory 34 is used as a work area when the CPU 32 executes overall control.
[0189]
The input / output interface 35 is an interface circuit for connecting a keyboard and other input devices.
[0190]
The input device 38 includes a keyboard, a touch panel, and the like, and is used to input a sequence program.
[0191]
The display interface 36 is an interface circuit for connecting the display device 39 and includes a display data memory.
[0192]
The display device 39 is a display device such as a CRT or a liquid crystal display device used for displaying a sequence program (a kind of control program) or data.
[0193]
The communication interface 37 is an interface circuit for connecting the programming device 31 and the programmable controller 40 through a communication medium.
[0194]
The microcomputer bus 41 is a bus for connecting elements in the programming device 31 to the CPU 32, and is an overall of an address bus, a data bus, and a control bus.
[0195]
FIG. 11 is a block diagram showing processing contents in the programming device 31 having the hardware configuration as described above.
[0196]
It is assumed that the user uses the programming device 31 to create a sequence program 42 described, for example, in the LD language as a source program. The sequence program 42 is input from the input device 38, displayed on the display device 39, edited, and stored in the work memory 34 together with figures and variables.
[0197]
The programming device 31 includes an intermediate compiler 43 for converting a source program into a description in an intermediate language. The intermediate compiler 43 rewrites the sequence program 42 into an intermediate language program 44.
[0198]
The intermediate language is a language that can be converted into a machine language and that describes a program in a state that can be converted into a language that describes a source program.
[0199]
Specifically, a language expressed by a combination of an instruction code and an operand such as an IL (Instruction List) language and stored in a text format can be applied as an intermediate language.
[0200]
The intermediate program 44 obtained by the intermediate compiler 43 is stored in the work memory 34.
[0201]
Table 2 is a table showing a part of conversion rules for converting a sequence program written in the LD language into an intermediate language program written in the intermediate language.
[0202]
[Table 2]
Figure 0003819639
[0203]
By following such a conversion rule, it is possible to convert a graphic program such as the LD language into a text intermediate program. The command sentence delimiter is indicated by a space or a line feed code.
[0204]
Further, the programming device 31 includes a machine language compiler 45 for converting an intermediate language program described in an intermediate language into a description in a machine language program. The machine language compiler 45 causes the intermediate language program 44 to be converted. The machine language program 46 that can be executed by the controller 40 is rewritten.
[0205]
Table 3 is a table showing a part of conversion rules for converting an intermediate language program described in an intermediate language into a machine language program described in a machine language.
[0206]
[Table 3]
Figure 0003819639
[0207]
By following such conversion rules, the intermediate language program 44 can be converted into the machine language program 46.
[0208]
The machine language code included in the machine language program obtained by the conversion by the machine language compiler 45 includes an instruction code portion and an operand address portion. The instruction code portion and the operand address portion have a fixed length.
[0209]
Thereby, the arithmetic processing when the machine language program after conversion is executed by the controller 40 is facilitated.
[0210]
Further, the programming device 31 includes a decompiler 47 for converting an intermediate language program described in an intermediate language into a description by a source program described in an LD language.
[0211]
As a conversion rule used in the decompiler 47, a method of applying the above Table 2 in reverse is adopted.
[0212]
The intermediate language program 44 is rewritten to the sequence program 42 by the decompiler 47.
[0213]
As described above, in the programming device 31 according to the present embodiment, the source graphical program is converted into a text intermediate language and stored.
[0214]
Therefore, storage and transmission of programs are facilitated. Further, even when an intermediate program written in this intermediate language is displayed, it is easy for humans to confirm the contents.
[0215]
In addition, since the instruction word code and the operand address constituting the generated machine language program 46 have a fixed length, the machine language program can be easily processed by the controller 40.
[0216]
In the present embodiment, the case where the source program is described in the LD language is described as an example. However, the present invention is not limited to this. It can be similarly applied to various control programs.
[0217]
Further, the programming device 31 according to the present embodiment includes a machine language compiler 45 that converts an intermediate language into a machine language. For example, if the intermediate language itself is a language that can be executed by the controller 40, this machine The word compiler 45 can be omitted.
[0218]
(Third embodiment)
In the present embodiment, a programming device that is a modification of the programming device 31 according to the second embodiment and switches a machine language compiler for each controller that executes a control program will be described.
[0219]
FIG. 12 is a block diagram showing processing contents in the programming device according to the present embodiment.
[0220]
In the programming device 48 according to the present embodiment, the configuration and processing related to obtaining the intermediate language program are the same as those of the programming device 31 according to the second embodiment, and thus description thereof is omitted.
[0221]
The programming device 48 includes machine language controllers 45a to 45c that convert the intermediate language into a machine language corresponding to each of a plurality of controllers 40a to 40c of different models.
[0222]
Therefore, a plurality of types of machine language programs 46a to 46c corresponding to the controllers 40a to 40c are obtained from an intermediate language program 44 by the conversion by the machine language compilers 45a to 45c.
[0223]
As described above, in the programming device 48 according to the present embodiment, a plurality of compilers are prepared according to the type of the target controller, and a plurality of types of machine language programs are obtained from the same intermediate language program. It is possible to create.
[0224]
Thus, for example, in the same series of controllers, in order to create a machine language program for models with different memory capacities, it is possible to easily change the address range and change the address assignment, and easily create a machine language program. Can do.
Therefore, the labor of re-inputting the graphical program for each model can be reduced.
[0225]
(Fourth embodiment)
The present embodiment is a modification of the programming devices 31 and 48 according to the second or third embodiment, and includes a plurality of intermediate compilers for converting various source programs into descriptions in an intermediate language. The programming device will be described.
[0226]
FIG. 13 is a block diagram showing the processing contents in the programming device according to the present embodiment. In FIG. 13, the same parts as those in FIG. 11 are denoted by the same reference numerals and the description thereof is omitted, and only different parts will be described in detail here.
[0227]
In the programming device 49 according to the present embodiment, the configuration and processing involved after obtaining the intermediate language program are the same as those of the programming devices 31 and 48 according to the second embodiment or the third embodiment. Therefore, the description is omitted.
[0228]
The programming device 49 includes, in addition to the intermediate compiler 43 that converts the program 42 schematically created in the LD language into the intermediate language program 44, the same sequence programs 42a and 42b described in the ST (structured text) language and the mnemonic language. Intermediate compilers 43a and 43b for converting the intermediate language program 44 into the intermediate language program 44 are installed.
[0229]
A part of the conversion rule for converting the LD language into the intermediate language is the same as in Table 2 described above, and is adopted by the intermediate compiler 43.
[0230]
Table 4 is a table showing a part of the conversion rule for converting the ST language into the intermediate language. The conversion rules in Table 4 are adopted by the intermediate compiler 43a.
[0231]
[Table 4]
Figure 0003819639
[0232]
Table 5 is a table showing a part of conversion rules for converting a mnemonic language into an intermediate language. The conversion rule in Table 5 is adopted by the intermediate compiler 43b.
[0233]
[Table 5]
Figure 0003819639
[0234]
As described above, in the programming device 49 according to this embodiment, even a sequence program created in three different languages can be converted into an intermediate language program of the same format. That is, if the expressed logic is the same for a plurality of sequence programs, conversion to the same intermediate language program is possible.
[0235]
The user can manage various sequence programs as a unified intermediate language program.
[0236]
Further, by utilizing the fact that intermediate language programs for sequence programs created in a plurality of programming languages have the same format, an intermediate compiler 43, 43a, 43b and a reverse compiler that performs the reverse conversion are added. It is also possible to freely display and edit the sequence program created in the above in other programming languages.
[0237]
Furthermore, any language in which the source program is described can be converted into a machine language description by a machine language compiler as long as it is converted into an intermediate language. Therefore, even an intermediate language program created from a plurality of types of sequence programs can be similarly converted into a machine language program.
[0238]
In this embodiment, the LD language, ST language, and mnemonic language can be converted into an intermediate language or reversely converted. However, the present invention is not limited to this, and other various control programming languages are similarly used. Can be used.
[0239]
(Fifth embodiment)
In this embodiment, it is not an intermediate language in the text format used in the programming devices according to the second to fourth embodiments, but consists of a fixed-length machine language instruction code and a fixed-length address. A programming device that uses a form of intermediate language will be described.
[0240]
FIG. 14 is a conceptual diagram showing an intermediate language description format employed in the programming device according to the present embodiment.
[0241]
Here, instead of the text format adopted in the intermediate language in the second to fourth embodiments, the instruction word and the variable expression are expressed as a binary comprising the instruction word code 50a and the variable address code 50b of the controller. This is expressed in format 50.
[0242]
Further, the instruction word code 50a and the variable address code 50b employed in the intermediate language are set to a fixed length.
[0243]
In this case, however, the variable name is converted into a physical address or a logical address of the memory in the controller.
[0244]
Therefore, the programming device according to the present embodiment stores a correspondence table of instruction words and instruction codes simultaneously with the intermediate language program in order to enable reverse conversion to the source program.
[0245]
Table 6 is a correspondence table between instruction words and instruction codes for enabling reverse conversion to a source program.
[0246]
[Table 6]
Figure 0003819639
[0247]
In addition, the programming device according to the present embodiment stores a correspondence table between variable names and address codes simultaneously with the intermediate language program for the same reason.
[0248]
Table 7 is a correspondence table of variable names and address codes for enabling reverse conversion to the source program.
[0249]
[Table 7]
Figure 0003819639
[0250]
As described above, in the programming device according to the present embodiment, the intermediate program described by the intermediate language is described by the instruction word code and the variable address of the controller.
[0251]
Therefore, since the intermediate language itself is a language that can be executed by the controller, the machine language compiler can be omitted, and the intermediate program can be directly executed by the controller.
[0252]
In addition, by making the intermediate program executable as it is, a machine language program is not necessary, so that memory can be saved.
[0253]
(Sixth embodiment)
In the present embodiment, load levels based on memory capacity, CPU capability, etc. are compared with a programming device, and when the load level is lower than that of the programming device, the intermediate compiler, machine language compiler, A programmable controller for operating the compiler will be described.
[0254]
FIG. 15 is a block diagram showing a hardware configuration of the programmable controller according to the present embodiment.
[0255]
The programmable controller 51 includes a CPU 52, a program memory 53, a work memory 54, a sequence calculation device 55, a sequence program memory, a data memory, a communication interface, and an I / O device that are connected to each other via a microcomputer bus 65 so as to be able to transmit and receive each other. ing.
[0256]
The programmable controller 51 can communicate with a programming device 60 equipped with a distribution unit 61 via a communication interface 58.
[0257]
The CPU 52 included in the programmable controller 51 is a central part of the programmable controller 51 and performs execution control of the entire controller.
[0258]
The program memory 53 is a memory storing a program executed by the CPU 52, and stores an OS and a control program.
[0259]
The work memory 54 is used as a work area when the CPU 52 executes overall control.
[0260]
The sequence operation device (sequence operation processor) 55 is a processor that executes a sequence program.
[0261]
The sequence program memory 56 is a memory for storing a sequence program created by the user.
[0262]
The data memory 57 is a memory for storing data such as variables used by the user.
[0263]
The communication interface 58 is an interface circuit for connecting the programmable controller 51 and the programming device 60 via a communication medium.
[0264]
The I / O device 59 is an input / output device for connecting the programmable controller 51 and an external control target.
[0265]
The microcomputer bus 65 is a bus for connecting the elements in the programmable controller 51 to the CPU 52 and the sequence calculation device 55, and is an entire address bus, data bus, and control bus.
[0266]
Further, the programmable controller 51 is loaded with various compilers (for example, intermediate compilers 43, 43a, 43b, machine language compiler 45, and decompiler 47) described in the second to fifth embodiments.
[0267]
That is, the program memory 53 of the programmable controller 51 has an intermediate compiler, a machine language compiler, and a decompiler that perform the same conversion as described above.
[0268]
On the other hand, the programming device 60 capable of communicating with the programmable controller 51 has the same configuration as the programming devices 31, 48, and 49 according to the second to fifth embodiments and can operate in the same manner. A dispersion unit 61 is provided.
[0269]
The distribution unit 61 investigates the CPU processing capacity and the memory capacity between the programmable controller 51 and the programming device 60. Then, based on the investigation result, it is determined and instructed which of the programmable controller 51 and the programming device 60 is to store various programs and execute the compilation process.
[0270]
By using the programmable controller 51 according to the present embodiment having the above-described configuration, conversion processing from a source program to an intermediate language program, conversion processing from an intermediate language program to a machine language program, from an intermediate language program The inverse conversion process to the source program can be executed by either the programmable controller 51 or the programming device 60.
[0271]
Accordingly, the distribution unit 61 of the programming device 60 freely selects processing and arrangement for the source program and intermediate language program according to the processing capability and memory capacity of the programmable controller 51 and the programming device 60.
[0272]
FIG. 16 is a block diagram showing a first example of the program arrangement relationship in the present embodiment.
[0273]
When the capacity of the programming device 60 is sufficient, the source program 611 and the intermediate language program 62 are arranged in the programming device 60 for conversion, and the machine language program 63 is stored in the programmable controller 51 having a small memory capacity. .
[0274]
FIG. 17 is a block diagram showing a second example of the program arrangement relationship in the present embodiment.
[0275]
When the programmable controller 51 has more memory capacity than the programming device 60, the source program 611 is stored in the programming device 60, and the intermediate language program 62 and the machine program 63 are stored in the programmable controller 51.
[0276]
FIG. 18 is a block diagram showing a third example of the program arrangement relationship in the present embodiment.
[0277]
When the processing capacity of the programming device 60 is not sufficient and the memory capacity of the programmable controller 51 is sufficient, the source program 611 is stored in the programming device 60, and the source program 611 is transferred to the programmable controller 51. After the transfer, the programmable controller 51 converts the program into an intermediate language program 62 and a machine language program 63 and stores them.
[0278]
As described above, by applying the programmable controller 51 according to the present embodiment, a sequence program, an intermediate language program, and a machine language program can be adapted to the memory capacity and CPU capability of the programmable controller 51 and the programming device 60. A storage location or conversion location is selected.
[0279]
Therefore, even if the ability of either the programmable controller 51 or the programming device 60 is low, the intermediate language can be used.
[0280]
In the present embodiment, the distribution unit 61 is provided on the programming device 60 side. However, the present invention is not limited to this, and the distribution unit 61 may be provided on the programmable controller 51 side.
[0281]
Also in this embodiment, the same effect can be obtained by using the above-mentioned various compilers.
[0282]
(Seventh embodiment)
In the present embodiment, a modification of the programming device 60 according to the sixth embodiment will be described.
[0283]
In the previous sixth embodiment, the program can be converted and arranged by either the programmable controller 51 or the programming device 60. However, other programs (intermediate program and machine language program) other than the source program may be fixedly arranged in the programmable controller 51, and the conversion process may be determined to be executed by the programmable controller 51.
[0284]
That is, the programmable controller 51 receives and stores only the source program 611 from the programming device 60, and the programmable controller 51 converts it into an intermediate language and a machine language.
[0285]
Thus, programming using an intermediate language is possible even if a programming device 60 having only a display, an input device, a simple processing device, and a communication interface is used.
[0286]
In this embodiment, the same effects as described above can be obtained by using the various compilers.
[0287]
(Eighth embodiment)
The present embodiment is a modification of the second to seventh embodiments, and the handling of descriptions that are included in the source program but become unnecessary when converted into an intermediate language will be described.
[0288]
In addition to instruction words, a sequence program may include parts that are unnecessary after compilation, such as variable declarations, labels, and comments.
[0289]
In the present embodiment, the intermediate compiler converts a part that becomes unnecessary after compilation into a special intermediate language code and adds it to the intermediate language program.
[0290]
Table 8 is a table showing a part of a conversion rule for converting an unnecessary part after compilation into a code expressed in an intermediate language.
[0291]
[Table 8]
Figure 0003819639
[0292]
FIG. 19 is a diagram showing a description format of the intermediate program in the present embodiment, and shows a state where the converted intermediate language code 64 a is added to the intermediate program 64.
[0293]
As described above, in the present embodiment, when the source program includes a description that is unnecessary after compilation, the unnecessary description is coded and included in the intermediate language program.
[0294]
Therefore, by installing the intermediate compiler that performs the above-described conversion processing in the above-described programming apparatus or programmable controller, it is possible to easily reversely convert the original sequence program including the variable name and the comment sentence.
[0295]
In addition, since the intermediate language format is not related to the type of programming language, it is possible to display and edit by reverse conversion to the programming language selected by the user.
[0296]
Further, since only the unnecessary portion of the code can be easily separated when compiling from the intermediate language program to the machine language program, the compiling operation for conversion to the machine language can be simplified.
[0297]
(Ninth embodiment)
In the present embodiment, a case will be described in which the intermediate language program is described by a machine language code, which is a modification of the eighth embodiment.
[0298]
Similar to the fifth embodiment, in this embodiment, the intermediate language program is configured to be able to be expressed by a fixed-length code using the machine language code of the programmable controller.
[0299]
Here, as in the eighth embodiment, the programmable controller is a non-executable instruction in the arithmetic processing in the intermediate language program of the part that is not directly related to the execution of the program such as the comment sentence (the part that becomes unnecessary after compilation). An instruction code that can be interpreted as is given.
[0300]
In this case, code that is unnecessary after compilation is described by binary code.
[0301]
Table 9 is a table showing a part of a conversion rule for converting an unnecessary part after compilation into a code in an intermediate language notation in a binary format.
[0302]
[Table 9]
Figure 0003819639
[0303]
As described above, when the conversion process according to the present embodiment is applied to the intermediate compiler installed in the programming device or the programmable controller described above, the programmable controller uses the machine language code to fix the intermediate length. Language programs can be executed directly.
[0304]
This intermediate language also includes variable names and comment sentences, so it can be easily converted back to the original sequence program, and it is also in an intermediate language format that is not related to the type of programming language. It is possible to display and edit by converting back to the programming language.
[0305]
By configuring in this way, it is possible to execute the program directly by simply having one kind of intermediate language program in the programmable controller, and it is possible to reversely convert it into the original sequence program.
[0306]
(Tenth embodiment)
In the present embodiment, modified examples of the above embodiments will be described.
[0307]
In the programming device described in the first embodiment, after compiling three types of programs, the processing may be automatically distributed to a plurality of controllers and executed. For example, a part of a program written in a mixed notation is automatically distributed by a method such that a part described in a predetermined language is realized by a predetermined controller and a part described in another language is realized by another controller. Can be executed. In addition, this makes it possible to automatically select an appropriate controller for each process and execute the process.
[0308]
Further, the programming device and the programmable controller described in each of the above embodiments can be used in a client / server type or a stand-alone type. When the server exists, it is possible to divert the function of the server that is not provided in the own device. For example, functions, function blocks, and programs that the own device does not have can be read from the server and used.
[0309]
Further, in each of the programming devices, top-down programming may be possible. In this way, by programming in a top-down manner, the related lower blocks are opened sequentially from the system configuration design block, and the function, design level, I / O design level, module design level, instruction manual are opened. Can be referred to.
[0310]
In addition, by enabling top-down programming, documents such as design specifications created on a programming device and a program related to this document are organically linked to define the correlation between the document and the program. be able to. In the functional block diagram, program editing and monitoring can be executed from the block, and system engineering, programming, and maintenance can be executed seamlessly by utilizing the library.
[0311]
Further, in each of the programming devices, bottom-down programming may be possible. In this way, by programming in a bottom-down manner, it is possible to integrate I / O design and module design in parallel and then integrate them as functional modules and create a program as a system.
[0312]
In addition, each of the programming devices may be used as if a variable having the same name as that of a register used in a conventional programmable controller is automatically defined and a program is created using the register.
[0313]
In each of the programming devices, a reference relationship diagram between programs to be created may be displayed. Thereby, when one program is changed, the user can easily recognize the influence at the time of program change whether or not the other program needs to be changed.
[0314]
In addition, the programming device and the programmable controller described in each of the above embodiments, for example, when a contact or coil instruction described in the LD language is forced, the instruction to be targeted in the program is not recompiled. The force function can be realized by changing only the code.
[0315]
In addition, each function and each element (for example, mixed display function of different languages, a compiler for compiling a mixed program, an intermediate compiler, a machine language compiler, a decompiler, etc.) of the programming device and the programmable controller according to each of the above embodiments are computers. As a program that can be executed by a computer, for example, a computer can be written and applied to a recording medium such as a magnetic disk (floppy disk, hard disk, etc.), an optical disk (CD-ROM, DVD, etc.), a semiconductor memory, or transmitted via a communication medium. Or it is also possible to apply to a computer system and a programmable controller. A computer that implements each of the above functions reads the program recorded on the recording medium and performs the above-described processing by controlling the operation by the program.
[0316]
【The invention's effect】
As described above in detail, in the present invention, a plurality of types of control programming languages can be described together, so that the user can easily understand the contents of the control program.
[0317]
Further, in the present invention, a program that has been written in a mixed manner can be compiled as it is, so that a program utilizing the advantages of various languages can be created and executed.
[0318]
In the present invention, since the monitor data is displayed on the program in which the monitor data is mixedly displayed, the user can easily find the problem.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a programming device according to a first embodiment of the present invention.
FIG. 2 is a flowchart for explaining a compile theory employed in the programming device according to the embodiment;
FIG. 3 is a screen diagram showing an example of a program that is mixedly represented by the programming device according to the embodiment;
FIG. 4 is a state diagram showing a case where a program is represented by a node and an arrow.
FIG. 5 is a conceptual diagram showing a node order determination method employed in the embodiment;
FIG. 6 is a conceptual diagram showing a compilation result obtained by the compilation theory adopted in the embodiment.
FIG. 7 is a relationship diagram showing a structure of monitor data, a structure of a compilation result, and a monitor data structure template handled by the programming device according to the embodiment;
FIG. 8 is a screen diagram showing an example of a case where programs are mixedly described in three types of control programming languages and monitor data is superimposed and displayed.
FIG. 9 is a screen diagram showing another example in which programs are mixedly described in three types of control programming languages and monitor data is displayed in an overlapping manner.
FIG. 10 is a block diagram showing a hardware configuration of a programming device according to a second embodiment of the present invention.
FIG. 11 is an exemplary block diagram showing processing contents in the programming device according to the embodiment;
FIG. 12 is a block diagram showing processing contents in a programming device according to a third embodiment of the present invention;
FIG. 13 is a block diagram showing processing contents in a programming device according to a fourth embodiment of the present invention;
FIG. 14 is a conceptual diagram showing an intermediate language description format employed in a programming device according to a fifth embodiment of the present invention;
FIG. 15 is a block diagram showing a hardware configuration of a programmable controller according to a sixth embodiment of the present invention.
FIG. 16 is an exemplary block diagram showing a first example of the program arrangement relationship in the embodiment;
FIG. 17 is an exemplary block diagram showing a second example of the program arrangement relationship in the embodiment;
FIG. 18 is a block diagram showing a third example of the program arrangement relationship in the embodiment;
FIG. 19 is a diagram showing a description format of an intermediate program in the eighth embodiment of the invention.
FIG. 20 is a screen diagram showing an example in which a program created using a different control programming language is displayed in a conventional programming device.
FIG. 21 is a block diagram showing an example where the programming device that created the sequence program is different from the programming device that performs monitoring.
[Explanation of symbols]
1, 31, 48, 49, 60 ... Programming device
2, 40, 40a to 40c, 51 ... programmable controller
6. Program editing
7 ... Program display
8 ... Program compilation
10 ... Monitor data
11 ... Monitor overlap display
12 ... Program file
13 ... Monitor data
17 ... Program execution
18 ... Monitor data output
19 ... Return monitor data
32, 52 ... CPU
33 ... OS / Program memory
34, 54 ... Work memory
42, 42a, 42b ... sequence program
43, 43a, 43b ... Intermediate compiler
44, 62 ... Intermediate language program
45, 45a-45c ... Machine language compiler
46, 46a-46c, 63 ... Machine language program
47 ... Decompiler
50 ... Binary format intermediate language
53 ... Program memory
55. Sequence arithmetic unit
56 ... Sequence program memory
57 ... Data memory
61. Processing distribution unit
611 ... Source program

Claims (2)

コントローラで実行させる制御プログラムの作成を支援するプログラミング装置において、
左から右へパワー又はシグナルが流れるように解釈する制御プログラム言語と上から下に状態遷移するように解釈する制御プログラム言語とを含む複数種類の制御プログラム言語で混在表記された制御プログラムをネットワーク単位及びサブネットワーク単位による有向グラフとして扱い、有向グラフにおける各ノードに対して右下から左に向かい上段にあがって再び右から左に向かう順序でノード番号を付し、このノード番号の付された有向グラフに対する深さ優先探索アルゴリズムを適用して前記各ノードの拾い上げを行い、前記各ノードの実行順序を決定し、前記サブネットワーク単位で状態遷移の外部条件の演算、状態遷移の演算、状態遷移結果による外部動作演算の順序を守るように実行順序を決定し、前記ネットワーク単位で左から右、上から下の順序を守るように実行順序を決定し、前記ネットワーク及び前記サブネットワークにおける実行順序を考慮して、前記コントローラの理解する命令語を取得するように、前記混在表記された制御プログラムをコンパイルするコンパイラを備えたことを特徴とするプログラミング装置。
In a programming device that supports creation of a control program to be executed by a controller,
A network of control programs written in multiple types of control program languages, including a control program language that interprets power or signals to flow from left to right and a control program language that interprets state transition from top to bottom In addition , each node in the directed graph is assigned a node number in the order from the lower right to the upper left and the upper row and from the right to the left again. The priority search algorithm is applied to pick up each of the nodes, determine the execution order of the nodes , calculate the external condition of the state transition, the operation of the state transition, and the external operation based on the result of the state transition The execution order is determined so that the order of operations is preserved, and left in the network unit. Luo right, determines the execution order to protect the order from top to bottom, in view of the execution order in the network and the subnetwork so as to obtain an instruction to understand the controller, which is the mixed notation A programming apparatus comprising a compiler for compiling a control program.
請求項1記載のプログラミング装置において、
前記コンパイラは、前記混在表記された制御プログラムの内容とモニタデータとを関係付けて保存するとし、
前記コンパイラによるコンパイル時の関係付けに基づいて、モニタデータを混在表記された制御プログラム上に配置するモニタデータ重ね表示手段を付加したことを特徴とするプログラミング装置。
The programming device of claim 1, wherein
The compiler associates and saves the contents of the mixed notation control program and monitor data,
A programming apparatus, comprising: monitor data overlay display means for arranging monitor data on a control program expressed in a mixed manner on the basis of the relation at the time of compilation by the compiler.
JP19645699A 1999-07-09 1999-07-09 Programming device Expired - Fee Related JP3819639B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19645699A JP3819639B2 (en) 1999-07-09 1999-07-09 Programming device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP19645699A JP3819639B2 (en) 1999-07-09 1999-07-09 Programming device

Publications (2)

Publication Number Publication Date
JP2001022412A JP2001022412A (en) 2001-01-26
JP3819639B2 true JP3819639B2 (en) 2006-09-13

Family

ID=16358121

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19645699A Expired - Fee Related JP3819639B2 (en) 1999-07-09 1999-07-09 Programming device

Country Status (1)

Country Link
JP (1) JP3819639B2 (en)

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4280964B2 (en) * 2001-05-30 2009-06-17 横河電機株式会社 Control data protection device
US7730415B2 (en) 2003-09-05 2010-06-01 Fisher-Rosemount Systems, Inc. State machine function block with a user modifiable state transition configuration database
US7269468B2 (en) * 2003-09-05 2007-09-11 Fisher-Rosemount Systems, Inc. State machine function block with a user modifiable output configuration database
JP4876537B2 (en) * 2005-11-07 2012-02-15 富士電機株式会社 Programmable controller programming device
JP4737441B2 (en) * 2006-03-15 2011-08-03 オムロン株式会社 PLC system
JP4730606B2 (en) * 2006-04-28 2011-07-20 横河電機株式会社 Plant operation support device
US7668608B2 (en) * 2006-09-01 2010-02-23 Fisher-Rosemount Systems, Inc. Graphical programming language object editing and reporting tool
DE102007062453A1 (en) * 2007-12-22 2009-06-25 Robert Bosch Gmbh Method for programming and / or diagnosing a programmable logic controller
JP5224926B2 (en) * 2008-06-19 2013-07-03 株式会社日立製作所 Engineering tools
WO2015067639A1 (en) 2013-11-05 2015-05-14 Schneider Electric Industries Sas Processing device and method for configuring an automation system
JP6340886B2 (en) * 2014-04-10 2018-06-13 株式会社ジェイテクト Program creation support apparatus for programmable logic controller and program creation support method for programmable logic controller
JP6150953B2 (en) 2015-06-01 2017-06-21 三菱電機株式会社 Debugging device, debugging method, and debugging program
JP6551565B2 (en) * 2017-06-02 2019-07-31 オムロン株式会社 Process analysis apparatus, process analysis method, and process analysis program
KR101974069B1 (en) * 2018-04-30 2019-04-30 한국과학기술원 System and method for visualizing binary structure
CN111026382B (en) * 2019-12-13 2024-01-16 深圳市杰美康机电有限公司 Hybrid programming method, terminal device and computer readable storage medium
JP6854982B1 (en) * 2020-03-26 2021-04-07 三菱電機株式会社 Programming support program, programming support device and programming support method
DE102021003647A1 (en) 2020-07-30 2022-02-03 Canon Kabushiki Kaisha Information processing apparatus, ladder program generating apparatus, information processing method, ladder program generating method, method of manufacturing a product, program and recording medium
WO2023119519A1 (en) * 2021-12-22 2023-06-29 三菱電機株式会社 Fa control test assistance program, fa control test assistance device, fa control test assistance method, and fa control test assistance system

Also Published As

Publication number Publication date
JP2001022412A (en) 2001-01-26

Similar Documents

Publication Publication Date Title
JP3819639B2 (en) Programming device
AU2022202972B2 (en) Tools and methods for real-time dataflow programming language
US8327316B2 (en) Compilation model
US9235381B2 (en) Method and device for the programming and configuration of a programmable logic controller
US7324856B1 (en) Autogeneration of code via human-machine interfaces (HMI) and self-building HMI
US20020147505A1 (en) Process for programming an automation application
US20010037362A1 (en) Automation system for solving a technical-process task and corresponding method
Jamro et al. An approach to SysML modeling of IEC 61131-3 control software
JP2009157533A (en) Programmable controller system
Koziolek et al. Industrial plant topology models to facilitate automation engineering
CN111954854A (en) Support device and support program
Casini et al. Operating remote laboratories through a bootable device
US20130218300A1 (en) Method for operating an automation system
JP5086296B2 (en) Programmable controller control program creation method and programmable controller control program creation system
JP2014199485A (en) Information processor and information processing program
Stec SFC graphic editor for CPDev environment
CN115702413A (en) Method for creating and executing a control program for controlling an automation system, and automation system
JP4877257B2 (en) Programmable controller, programmable controller support apparatus, and programmable controller system
JP2009157534A (en) Program creation support system, programmable controller support device thereof, programmable display support device
JP2008003841A (en) Build processing method, device and program
Bayó‐Puxan et al. A GRAFCET‐compiler methodology for C‐programmed microcontrollers
JP7631921B2 (en) Development support device, development support method, and development support program
JP7622483B2 (en) Development support device, development support method, and development support program
JP2005326909A (en) Plant engineering system
KR980009091A (en) Crane control system and communication method with integrated network

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20050531

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20050607

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20050808

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20051004

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20051205

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20060307

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20060426

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20060517

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20060613

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20060615

R151 Written notification of patent or utility model registration

Ref document number: 3819639

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090623

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100623

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100623

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110623

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120623

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120623

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130623

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees