JP2004280306A - Device for programmable controller, method for changing program, and method for changing content to be controlled - Google Patents

Device for programmable controller, method for changing program, and method for changing content to be controlled Download PDF

Info

Publication number
JP2004280306A
JP2004280306A JP2003068924A JP2003068924A JP2004280306A JP 2004280306 A JP2004280306 A JP 2004280306A JP 2003068924 A JP2003068924 A JP 2003068924A JP 2003068924 A JP2003068924 A JP 2003068924A JP 2004280306 A JP2004280306 A JP 2004280306A
Authority
JP
Japan
Prior art keywords
program
variable
area
address information
task
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.)
Granted
Application number
JP2003068924A
Other languages
Japanese (ja)
Other versions
JP4247664B2 (en
Inventor
Fumiaki Narutani
文明 成谷
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.)
Omron Corp
Original Assignee
Omron Corp
Omron Tateisi Electronics Co
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 Omron Corp, Omron Tateisi Electronics Co filed Critical Omron Corp
Priority to JP2003068924A priority Critical patent/JP4247664B2/en
Publication of JP2004280306A publication Critical patent/JP2004280306A/en
Application granted granted Critical
Publication of JP4247664B2 publication Critical patent/JP4247664B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Programmable Controllers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a device for a PLC that makes it possible to rewrite a program being held during the operation of a program. <P>SOLUTION: The device has a program code area P in which to store a plurality of user applications A, B constituting a program described in C language, and a data area D in which to store programs to be used among the plurality of user applications stored in the program area, as well as a task management program TCB specifying the order of execution of the programs. A variable data mapping block VMB that stores an address for accessing variables stored in a BBS area B is also provided in the data area. By updating an address that shows a program being executed within the TCB during system operation, the user application can be switched from A to B. By changing the reference address of the VMB within the TCB from a solid line to a broken line, the variables for reference can be changed from a, b to c, d. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
この発明は、C言語などのコンパイル方式の言語で記述されたプログラムを実行可能なプログラマブルコントローラ用機器並びにプログラム変更方法及び制御内容変更方法に関する。
【0002】
【従来の技術】
ファクトリーオートメーション(FA)の制御装置として、プログラマブルコントローラ(PLC)が用いられている。このPLCは、複数のユニットから構成される。すなわち、電源供給源の電源ユニット,PLC全体の制御を統率するCPUユニット,FAの生産装置や設備装置の適所に取り付けたスイッチやセンサの信号を入力する入力ユニット,アクチュエータなどに制御出力を出す出力ユニット,通信ネットワークに接続するための通信ユニットなどの各種のユニットを適宜組み合わせて構成される。
【0003】
PLCのCPUユニットにおける制御は、入力ユニットで入力した信号をCPUユニットのI/Oメモリに取り込み(INリフレッシュ)、予め登録されたユーザプログラム記述言語(例えばラダー言語)で組まれたユーザプログラムに基づき論理演算をし(演算実行)、その演算実行結果をI/Oメモリに書き込んで出力ユニットに送り出し(OUTリフレッシュ)、その後、いわゆる周辺処理を行うということをサイクリックに繰り返し処理するようになる。そして、上記したユーザプログラムは、CPUユニットのユーザメモリに格納される。
【0004】
ところで、PLCの一般的な使われ方としては、複数のINデータの論理演算をして、その演算結果によってOUTデータを出力して、被制御装置を制御するような使われ方がある。この場合のユーザプログラムは、ラダー言語を用いることが多い。その理由は、ラダーによるプログラミングは、入力機器の接点のON/OFF状態と出力機器へのOUT信号の状態との論理関係を表しやすく、目視でわかりやすいためである。
【0005】
しかし、最近ではPLCの制御内容も単なる論理演算だけでなく、関数演算や数式演算,アナログ情報を扱う処理をすることもある。このような比較的高度な演算や処理をする場合のプログラミング言語としてC言語を使用することがある。そこで、PLCの中に、ラダープログラムを実行するCPUと、C言語を実行するCPUとの両方を持たせたものがある。このようなPLCでは、C言語などのコンパイル方式の言語でプログラムを記述して演算処理可能となっている。そのようなPLCにおいては、プログラムは、外部のプログラミング開発環境(プログラミングツール)で作成したのち、コンパイル→アセンブル→リンクの工程を経てオブジェクトコードに変換し、その変換されたオブジェクトコードをPLCのCPUユニットにダウンロードして、CPUユニット内に記憶される。そのプログラムはCPUユニット内にて実行される。
【0006】
そして、現在実行中のプログラムを変更すべくメモリ内容を書き換えるには、通常、以下のような手順を実行する。すなわち、(1)まずジャンパーピンやディップスイッチ等のモード切替手段によって、PLCをプログラム転送モードに変更する。(2)次いで、オブジェクトコードのダウンロードを実行する。これにより、PLCが持つプログラムを格納するメモリに、オブジェクトコードが格納される。(3)ダウンロードが完了したらならば、PLCをプログラム実行モードに変更した後、立ち上げ直す。
【0007】
【発明が解決しようとする課題】
しかしながら、PLCにおける動作モードの決定は、電源ON時に決定されることが多いため、プログラムのダウンロードを行うに際し、PLCの再起動が必要となる場合があった。
【0008】
従って、C言語で記述された制御プログラムの内容を、コントローラの稼働中に安全に入れ換えることができなかった。つまり、たとえ制御プログラムの実行内容を部分的に入れ替えたり、パラメータ等の設定を変更したい場合でも、一旦電源をOFFにし、PLCの再起動をしなければならず、その作業が煩雑である。
【0009】
この発明は、C言語等のコンパイル方式の言語で記述されたプログラムに対応するプログラマブルコントローラ用機器において、メモリに記録されたプログラム自体を修正・再コンパイルすることなくプログラムによる制御内容,参照メモリエリアの変更などを行うことができるようにしたプログラマブルコントローラ用機器並びにプログラム変更方法及び制御内容変更方法を提供することを目的とする。
【0010】
【課題を解決するための手段】
この発明によるプログラマブルコントローラ用機器は、プログラマブルコントローラを構成する機器であって、C言語などのコンパイル方式の言語で記述されたプログラムを実行可能なものである。そして、ワークメモリ中に、前記プログラムを構成する複数のアプリケーションプログラムを格納するプログラムエリアと、前記プログラムエリアに格納された複数のアプリケーションプログラムのうち、使用するプログラム並びにその実行順を規定するタスク管理ブロックを格納するデータエリアを備える。さらに、前記タスク管理ブロックは、各タスクで実行するアプリケーションプログラムを指定するアドレス情報を含むとともに、そのアドレス情報を外部から書き換え可能にした。
【0011】
また、この発明では、使用するプログラム並びにその実行順を書き換えするのに代えて、プログラム実行に使用する変数を変えるような構成にもした。
【0012】
ここで、「プログラマブルコントローラ用機器」とは、例えば、プログラマブルコントローラを構成する1つのユニットでも良いし、ボードのように所定のユニットに実装されるものでも良いし、プログラマブルコントローラそのものでも良い。また、「実行順」というのは、各タスクを実行する順番のことで、実際にはアプリケーションプログラムにとっての実行順が相当する。
【0013】
また、本発明に係るプログラム変更方法は、C言語などのコンパイル方式の言語で記述されたプログラムを実行可能なプログラマブルコントローラ用機器におけるプログラム変更方法であって、プログラマブルコントローラ用機器が持つワークメモリ中に、前記プログラムを構成する複数のアプリケーションプログラムを格納するプログラムエリアと、前記プログラムエリアに格納された複数のアプリケーションプログラムのうち、使用するプログラム並びにその実行順を規定するタスク管理ブロックを格納するデータエリアを備えておく。そして、前記タスク管理ブロックは、各タスクで実行するアプリケーションプログラムを指定するアドレス情報を含むように構成し、システムの動作稼働中に、前記アドレス情報を外部から書き換える。これにより、それ以降、そのアドレス情報が書き換えられたタスクを実行する際には、書き換えられたアドレス情報により指定されるアプリケーションプログラムを実行することにより再コンパイルすることなく実行するプログラムが変更される。
【0014】
外部プログラムからタスク管理ブロックの情報を書き換えることができる。従って、タスク管理ブロック中の実行するアプリケーションプログラムを指定するアドレス情報を書き換えることより、実行するプログラム自身を変えてしまうことができる。しかも、係る変更は、データエリアにあるタスク管理ブロックに格納されたデータを変更するだけで、再コンパイルなども不要となる。もちろん、プログラムエリアには、予め変更対象のアプリケーションプログラムを格納しておく必要はある。
【0015】
また、本発明に係るプログラマブルコントローラ用機器の他の解決手段としては、上記した発明を前提とし、さらに、前記データエリアには、前記アプリケーションプログラムを実行する際に使用する変数が格納されたデータ領域をアクセスするための変数アドレス情報を備えた変数データマッピングブロックを設け、前記タスク管理ブロックは、前記変数データマッピングブロックのアクセス先を特定する情報を含み、その情報を外部から書き換え可能にすることである。
【0016】
また、前記データエリアには、前記アプリケーションプログラムを実行する際に使用する変数が格納されたデータ領域をアクセスするための変数アドレス情報を備えた変数データマッピングブロックを設け、前記変数アドレス情報を外部から書き換え可能にするようにしてもよい。
【0017】
そして、本発明に係るプログラム変更方法の他の解決手段では、上記した発明を前提とし、前記データエリアには、前記アプリケーションプログラムを実行する際に使用する変数が格納されたデータ領域をアクセスするための変数アドレス情報を備えた変数データマッピングブロックを備えており、前記タスク管理ブロックは、前記変数データマッピングブロックのアクセス先を特定する情報を持たせるようにし、システムの動作稼働中に、前記アクセス先を特定する情報を外部から書き換え、それ以降に、アクセス先を特定する情報が書き換えられたタスクを実行する際に、そのタスクに関連するアプリケーションプログラムが使用・参照するメモリエリアを変更することにより、プログラムの実行内容を変更するようにしてもよい。
【0018】
また、前記データエリアには、前記アプリケーションプログラムを実行する際に使用する変数が格納されたデータ領域をアクセスするための変数アドレス情報を備えた変数データマッピングブロックを設け、システムの動作稼働中に、前記変数アドレス情報を外部から書き換え、それ以降に、前記変数アドレス情報が書き換えられた変数データマッピングブロックを参照しているタスクを実行する際に、そのタスクに関連するアプリケーションプログラムが使用・参照するメモリエリアを変更することにより、プログラムの実行内容を変更するようにすることもできる。
【0019】
上記した各発明では、タスク管理ブロックの情報や、変数データマッピングブロックの情報を書き換えることにより、タスクが管理するアプリケーションプログラムを実行する際に参照・使用されるメモリエリアが変わる。これにより、実質的に動作するプログラムの内容を変更することができる。
【0020】
そして、タスク管理ブロックや変数データマッピングブロックは、外部からアクセス可能なデータエリアに配置したため、システムの動作を稼働状態のまま、再コンパイルすることなく変更することができ、その結果、システムの稼働中にプログラムを大きく変更することができる。
【0021】
また、本発明に係るプログラマブルコントローラ用機器の制御内容の変更方法は、C言語などのコンパイル方式の言語で記述されたプログラムを実行可能なプログラマブルコントローラ用機器におけるプログラムの制御内容変更方法であって、プログラマブルコントローラ用機器が持つワークメモリ中に、前記プログラムを実行する際に使用する変数を格納する変数エリアと、前記変数エリアに格納された変数のうち、使用する変数を変数アドレスにて規定する変数データマッピングブロックとを格納するデータエリアを備えておく。そして、前記変数データマッピングブロックは、プログラムで使用するパラメータを指定するアドレス情報を含むように構成し、システムの動作稼働中に、前記アドレス情報を外部から書き換える。これにより、それ以降、プルグラム実行する際には、書き換えられたアドレス情報により指定されるパラメータを用いてプログラムを実行することにより再コンパイルすることなく実行される制御内容を変更される。
【0022】
【発明の実施の形態】
図1は、本発明の好適な一実施の形態を示している。図1に示すように、PLC1は、CPUユニット10や、拡張CPUユニット20等を備えて構成される。もちろん、図示省略するが、通信ユニット,I/Oユニット,マスタユニット,電源ユニットなど、その他のユニットも存在する。
【0023】
CPUユニット10は、図示省略するシステムROMに格納されたシステムプログラムにしたがって、CPU11が所定の処理をサイクリックに実行するものである。ここで所定の処理とは、共通処理,演算処理,サイクルタイム算出処理,I/Oリフレッシュ処理,周辺サービス処理がある。演算処理は、プログラムメモリ12に格納されたユーザプログラムを順次実行するもので、その演算実行時に、適宜IOメモリ13にアクセスし、IOデータを読み書きしたり、パラメータを取得する。そして、I/Oリフレッシュ処理では、IOメモリ13に対して、IOデータの更新処理を行う。CPU11は、バスコントローラ14を介してIOメモリ13にアクセスしたり、拡張CPUユニット20にアクセスしたりできるようになっている。なお、このCPU11で実行されるユーザプログラムは、従来と同様にラダー言語で作成されている。
【0024】
一方、拡張CPUユニット20は、高級言語(例えばC言語)で作成されたプログラムを実行可能なユニットであって、係るC言語のプログラムを保持するフラッシュメモリ21と、プログラム稼働用のワークメモリ22を備えている。この拡張CPUユニット20の形態は、CPUユニット10とは別体のユニットで、CPUユニット10とPLCバス(内部バス)を介して、他のユニット(通信ユニット,I/Oユニットなど)と同様にユニット接続されている。なお、拡張CPUユニット20の別の形態として、CPUユニット10内に挿入して内蔵できるような増設基板タイプであってもよい。また別の形態として、CPUユニット10に対する増設ユニットタイプでもよい。増設基板タイプや増設ユニットタイプの場合の接続バスは、他のユニットがつながるPLCバスとは別のバスで、CPUユニット10自体の内部バスでもよい(この場合もバスも回線は別でもPLCバスには経由接続できるようになっている)。要するに、CPU11とバスを介してつながれ、拡張CPUとしてCPU11とは別途に独自に動作するもので、CPUユニット10のIOメモリ13に対してアクセスする機能を持っていれば形態はなんでもよい。
【0025】
フラッシュメモリ21は、不揮発性のフラッシュメモリから構成され、ワークメモリ22は高速に実行させる必要から、揮発性のRAMから構成される。そして、プログラムを実行するための初めの準備として、電源投入時または手動によるリセット操作時など起動するときに、フラッシュメモリ21に格納されたプログラムを、ワークメモリ22にコピーをする。そしてそのワークメモリ22に記憶保持されたプログラムを読み出し、そのプログラムに基づいてCPU23が所定のアルゴリズムを実行するようになる。
【0026】
また、拡張CPUユニット20は、専用バスを介してメインのCPUユニット10と連携されている。具体的には、バスコントローラ14とアドレスデコーダ25の間でデータの送受を行うことにより、CPUユニット10がアドレスデコーダ25経由で各種のメモリにアクセスしたり、CPU23に所定の命令を与えたりする。また、拡張CPUユニット20からのイベント等も、アドレスデコーダ25からバスコントローラ14経由でCPUユニット10(CPU11)に伝えられる。イベントというのは、例えばメインCPUユニット10の処理中の周辺処理において、拡張CPUユニット20に対して行われるメッセージ通信である。イベントメッセージ通信によって、拡張CPUユニット20は、メインCPUユニット10との間で読み出し要求コマンドを受けてそのレスポンスを渡したり、書き込みコマンド(書き込みデータ)を受け取ってワークメモリ22に格納したりする。
【0027】
ところで、ワークメモリ22に格納されるプログラムのコンテキスト(C言語のプログラムをコンパイルした後のコード配置)は、図2に示すようになっている。すなわち、プログラムコードエリアPと、定数エリアCと、データエリアDとBBSエリアBと、スタックエリアStackを備えている。プログラムコードエリアPには、プログラムのロジックが格納される。また、定数エリアCには、const宣言されたデータが格納される。このデータはプログラムの実行に伴って変化しない定数である。データエリアDには、const宣言されていないデータ、つまり変数が格納される。この変数データは、プログラムの実行時にとりこむINデータや、プログラム実行途中に生じるデータ、プログラムの実行結果によるOUTデータを含んでいる。もちろんデータエリアDに格納するデータには、メインCPUユニット10が入力機器から取り込んだINデータや、メインCPUユニット10にてプログラム実行された結果のOUTデータ、つまりはメインCPUユニット10のIOメモリ13のデータを含んでいても良い。なお、データエリアDの初期値はブートローダにより任意のデータ値に設定される。BBSエリアBは、初期化されていない変数が格納される領域であり、起動時にはゼロクリアされる。このBBSエリアBの変数データは、拡張CPUユニット20におけるプログラムの実行時にとりこむINデータや、プログラム実行途中に生じるデータ、プログラムの実行結果によるOUTデータを含んでいてもよい。もちろんメインCPUユニット10IOメモリ13のデータが含まれていても良い。
【0028】
なお、変数データには、アプリケーションプログラムで利用されるいわゆるパラメータも含まれている。パラメータの例を挙げると、プログラム実行のループ数や、温度に関する制御における気温や湿度など、PID制御をする際のP,I,Dそれぞれのパラメータがある。
【0029】
さらに、スタックエリアStackには、スタックが格納されて、プログラム同士のリンクするときに使われる。具体的にはサブルーチン処理をするときのプログラム呼び出し先情報や、サブルーチン処理後の戻り情報などが格納される。そして、プログラムコードおよび変数は、プログラムのリンク時に図2に示す各エリアに配置される。
【0030】
さらに具体的には、図3に示すように、プログラムコードエリアPに格納されるプログラムは、データエリアDに格納されたタスク管理ブロックTCBを参照し、登録されているタスクを呼び出すタスクマネージャ部TMと、特定の機能を実施するためのユーザアプリ部UAとを備えている。ユーザアプリ部UAには、複数のユーザアプリケーションプログラム(図の例では、ユーザアプリAとB)が格納される。ユーザアプリ部UAは、開始アドレスから所定領域ぶんのアドレスまでにわたって、連続的にプログラムコードエリアPに格納されている。
【0031】
タスク管理ブロックTCBは、データエリアに格納され、実行するタスクを特定するとともに、その実行順も決定するものである。タスクマネージャ部TMは、タスク管理ブロックTCBに記録された順番に従って、順次タスクを実行する。
【0032】
ここで、タスク管理ブロックTCBは、図4に示すようなデータ構造を採っている。すなわち、先頭から順に、そのタスクを特定するためのユニークな番号となるタスクIDを格納する「Task_id」と、次に実行するタスクIDを格納してリンクを張るための「forward」と、前に実行されたタスクIDを格納する「backward」と、このタスクが活性状態なのか非活性状態なのかを特定するタスクステータスフラグを格納する「state」と、タスクレベル(実行頻度)を格納する「level」と、プログラムコードの先頭アドレスを格納する「pProgram」と、変数エリアアドレス定義の先頭アドレスを格納する「pData」などを関連付けたテーブル構造となっている。
【0033】
ここで、「pProgram」に格納される先頭アドレスは、プログラムコードエリアPのユーザアプリ部UAに記録された所望のユーザアプリケーションプログラムの先頭アドレスである。つまり、タスクマネージャ部TMは、このタスク管理ブロックTCBにアクセスし、決められたタスクの順番に従って、順次ユーザアプリケーションを呼び出して実行することになる。図4のタスク管理ブロックTCBのテーブルの例では、Task_id=0(タスク0)をまず実行する。そして、Task_id=0のテーブル行にあるfoward数値は「1」なので、その次に実行されるタスクは、Task_id=1(タスク1)である。Task_id=1のテーブル行にはfoward数値が「2」と設定されているので、タスク1の実行の次にはタスク2が実行される。
【0034】
また、「pData」に格納される変数アドレスは、データエリアDに格納された変数データマッピングブロックVMBのアクセス先を登録する。この変数データマッピングブロックVMBは、図4に示すように、変数名を格納する「dname」と、その変数の実体を示すアドレス「pAddr」を関連付けたテーブルからなる。このアドレスは、変数名に対応する具体的なデータが格納されたBSSエリアB中の所望のアドレスが格納される。
【0035】
つまり、タスク管理ブロックTCB中の各タスクの「pData」には、この変数データマッピングブロックVMBの参照先アドレスが登録され、タスク実行時に実際に使用・参照するデータは、変数データマッピングブロックVMBの「pAddr」に格納されたアドレスで規定されるBBSエリア内のデータとなる。
【0036】
そして、本実施の形態では、タスク管理ブロックTCB並びに変数データマッピングブロックVMBを、外部からアクセス可能なデータエリアDの固定アドレスに配置することによって、外部のプログラミングツールからのテーブル操作が容易に行える。その結果、ツール等を用いてCPUユニット経由でデータエリアのタスク管理ブロックTCBと変数データマッピングブロックVMBを編集するだけで、動作するプログラムや参照するメモリを変更することができる。より具体的には、タスク管理ブロックTCB中の「pProgram」,「pData」や、変数データマッピングブロックVMBの「pAddr」のアドレスを変更することになる。
【0037】
例えば、図4のタスク管理ブロックTCBのテーブル中のあるタスク(Task_id=2)の「pProgram」にユーザアプリAの先頭アドレスの数値が設定されているとした場合は、図3の実線で示されるように、タスク管理ブロックTCBで記述された同じタスク(Task_id=2)はユーザアプリAに対応している。そこで、図4のタスク管理ブロックTCBのテーブル中の同じタスク(Task_id=2)の「pProgram」の先頭アドレスをユーザアプリBの先頭アドレスに書き換えたとする。そうすると、以降でその同じタスクを実行する際には、図3の点線に示されるようにユーザアプリBを実行するようになる。
【0038】
また、例えば、図4のタスク管理ブロックTCBのテーブル中のあるタスク(Task_id=2)の「pData」に、変数a,bを参照する変数データマッピングブロックVMBのアドレスの数値を格納しているとした場合は、図3中の実線で示すように、タスク管理ブロックTCBで記述された同じタスク(Task_id=2)は変数a,bを参照するようになっている。そこで、図4のタスク管理ブロックTCBのテーブル中の同じタスク(Task_id=2)の「pData」を変数c,dを参照するようにアドレスを書き換えることにより、以降のそのタスクを実行する際に使用される変数は、図3の点線に示されるようにc,dと変わる。つまり、参照する変数データのアドレスがBBSエリアのアドレスa,bからc、dに切り変わる。
【0039】
さらに、参照する変数の変更は、上記したようにタスク管理ブロックTCBの「pData」を変更する方法に限ることはなく、変数データマッピングブロックVMBの「pAdder」を書き換える(現在の変数a,bを変数c,dのアドレスに変更)ことによっても対応することができる。
【0040】
なお、変数データには、前述したようにアプリケーションプログラムで利用されるいわゆるパラメータが含まれている。例えばプログラム実行のループ数をパラメータだとすると、ループ数を変えることでループ回数が変わるので、プログラム自体を変えなくても制御内容を変えることができる。他に例えば、温度に関する制御であれば、気温や湿度がパラメータとなり、具体的な例では晴れの日と雨の日とでパラメータを変えたり、季節やその日の温度・湿度でパラメータを変えることが実際に行われている。このパラメータ変更だけをすることで、プログラム変更せずに、最適な温度制御ができることもある。他にもPID制御をする際のパラメータP,I,Dそれぞれを変えることで、プログラムのロジックは変更せずに、制御内容もしくは動作内容が変わる。
【0041】
また、タスク管理ブロックTCBと変数データマッピングブロックVMBとは、それぞれ独立して、別々にその参照先アドレスを書き換えることができる。
【0042】
従って、本実施の形態では、プログラムを稼動中に、変数データマッピングブロックVMBの参照先アドレスはそのまま変更せずに、タスク管理ブロックTCBの参照先アドレスを書き換えることで、PLCを停止・再起動することなくアプリケーションプログラムを入れ替えることにより、システム全体として制御内容を大きく変更することができる。
【0043】
また、プログラムを稼動中に、タスク管理ブロックTCBは変更せずに、変数データマッピングブロックVMBの参照先アドレスを書き換えることで、PLCを停止・再起動することなく、プログラム実行に使用するパラメータ変数を変更できる。よって、アプリケーションプログラムのロジックはそのまま変更しないけれども、システム全体としての異なる制御動作をすることができる。これはパラメータが変われば自ずと制御動作も変わるからである。
【0044】
もちろん、プログラムを稼動中に、タスク管理ブロックTCB及び変数データマッピングブロックVMBの両方の参照先アドレスを書き換えることで、PLCを停止・再起動することなく、プログラム及びパラメータ変数の両方を入れ替えることができ、システム全体としての動作を大きく変更することができる。
【0045】
また、上記した実施の形態では、データエリアDに変数データマッピングブロックVMBを設け、変数へのアクセスはこの変数データマッピングブロックVBMを介して行うようにしたが、本発明はこれに限ることはなく、タスク管理ブロックTCBが直接BBSエリアの変数のアドレスを管理し、そのアドレスを変更することにより、再コンパイルすることなしに参照する変数を切り替えるようにすることもできる。
【0046】
【発明の効果】
以上のように、この発明では、C言語で記述されたプログラムソースを修正しなくても、タスク管理テーブル及びまたは変数データマッピングブロックを変更するだけで、実行するプログラムシステムの動作条件やシステムそのものを組替えることができる。
【図面の簡単な説明】
【図1】本発明に係るPLCの一実施の形態を示すブロック図である。
【図2】ワークメモリ22に格納(コピー・展開)されるプログラムのコンテキストの一例を示す図である。
【図3】本発明の機能を説明する図である。
【図4】タスク管理ブロックの一例を示す図である。
【図5】変数データマッピングブロックVMBを示す図である。
【符号の説明】
1 PLC
10 CPUユニット
11 CPU
12 プログラムメモリ
13 IOメモリ
14 バスコントローラ
20 拡張CPUユニット
21 フラッシュメモリ
22 ワークメモリ
23 CPU
25 アドレスデコーダ
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a programmable controller device capable of executing a program described in a compilation language such as the C language, a program changing method, and a control content changing method.
[0002]
[Prior art]
A programmable controller (PLC) is used as a control device for factory automation (FA). This PLC is composed of a plurality of units. That is, a power supply unit of a power supply source, a CPU unit for directing the control of the entire PLC, an input unit for inputting a signal of a switch or a sensor installed at an appropriate position in an FA production device or an equipment device, an output for outputting a control output to an actuator or the like Various units such as a unit and a communication unit for connecting to a communication network are appropriately combined and configured.
[0003]
The control in the CPU unit of the PLC is performed by taking a signal input from the input unit into the I / O memory of the CPU unit (IN refresh), and based on a user program written in a user program description language (eg, a ladder language) registered in advance. A logical operation is performed (operation execution), the operation execution result is written to an I / O memory and sent to an output unit (OUT refresh), and thereafter, so-called peripheral processing is cyclically and repeatedly performed. Then, the above-described user program is stored in the user memory of the CPU unit.
[0004]
By the way, as a general usage of the PLC, there is a usage in which a logical operation is performed on a plurality of IN data and OUT data is output based on the operation result to control the controlled device. In this case, the user program often uses a ladder language. The reason is that the ladder programming is easy to express the logical relationship between the ON / OFF state of the contact point of the input device and the state of the OUT signal to the output device, and is easy to visually recognize.
[0005]
However, recently, the control content of the PLC may be not only a mere logical operation but also a function operation, a mathematical operation, and a process for handling analog information. In some cases, C language is used as a programming language for performing such relatively advanced calculations and processes. Therefore, some PLCs have both a CPU that executes a ladder program and a CPU that executes the C language. In such a PLC, arithmetic processing can be performed by writing a program in a compilation language such as the C language. In such a PLC, a program is created in an external programming development environment (programming tool), then converted into object code through a process of compiling, assembling, and linking, and the converted object code is converted into a CPU unit of the PLC. And stored in the CPU unit. The program is executed in the CPU unit.
[0006]
Then, to rewrite the contents of the memory so as to change the currently running program, the following procedure is usually executed. That is, (1) First, the PLC is changed to the program transfer mode by mode switching means such as a jumper pin or a dip switch. (2) Next, the object code is downloaded. Thus, the object code is stored in the memory for storing the program of the PLC. (3) When the download is completed, change the PLC to the program execution mode and restart.
[0007]
[Problems to be solved by the invention]
However, since the operation mode of the PLC is often determined when the power is turned on, the PLC may need to be restarted when the program is downloaded.
[0008]
Therefore, the contents of the control program described in the C language cannot be safely replaced while the controller is operating. That is, even if it is desired to partially replace the execution contents of the control program or change the settings of parameters and the like, it is necessary to turn off the power once and restart the PLC, which is troublesome.
[0009]
The present invention relates to a device for a programmable controller corresponding to a program described in a language such as a C language or the like in a compiling system, without modifying or recompiling the program itself recorded in a memory, and controlling the contents of the program and the reference memory area. It is an object of the present invention to provide a programmable controller device capable of performing a change and the like, a program changing method, and a control content changing method.
[0010]
[Means for Solving the Problems]
A device for a programmable controller according to the present invention is a device constituting a programmable controller, and is capable of executing a program described in a compile-type language such as C language. And a task management block for defining, in the work memory, a program area for storing a plurality of application programs constituting the program, and a program to be used and an execution order among the plurality of application programs stored in the program area. And a data area for storing. Further, the task management block includes address information for specifying an application program to be executed in each task, and the address information can be externally rewritten.
[0011]
Further, in the present invention, instead of rewriting the program to be used and the execution order thereof, a configuration is adopted in which variables used for executing the program are changed.
[0012]
Here, the “programmable controller device” may be, for example, one unit constituting the programmable controller, a device mounted on a predetermined unit such as a board, or the programmable controller itself. The “execution order” refers to the order in which the tasks are executed, and actually corresponds to the execution order for the application program.
[0013]
Further, a program changing method according to the present invention is a program changing method in a programmable controller device capable of executing a program described in a language of a compiling method such as C language, wherein the program changing method is performed in a work memory of the programmable controller device. A program area for storing a plurality of application programs constituting the program, and a data area for storing a program to be used among the plurality of application programs stored in the program area and a task management block for defining an execution order thereof. Be prepared. The task management block is configured to include address information that specifies an application program to be executed in each task, and externally rewrites the address information during operation of the system. As a result, when the task whose address information is rewritten thereafter is executed, the program to be executed without recompiling by executing the application program specified by the rewritten address information is changed.
[0014]
The information of the task management block can be rewritten from an external program. Therefore, by rewriting the address information specifying the application program to be executed in the task management block, the program to be executed can be changed. In addition, such a change merely changes the data stored in the task management block in the data area, and does not require recompilation. Of course, it is necessary to previously store the application program to be changed in the program area.
[0015]
Further, as another solution of the device for a programmable controller according to the present invention, the above-described invention is premised, and the data area further includes a data area in which variables used when executing the application program are stored. A variable data mapping block having variable address information for accessing the variable data mapping block is provided, and the task management block includes information for specifying an access destination of the variable data mapping block, and the information can be externally rewritten. is there.
[0016]
Further, the data area is provided with a variable data mapping block including variable address information for accessing a data area in which a variable used when executing the application program is stored, and the variable address information is externally provided. You may make it rewritable.
[0017]
In another solution of the program changing method according to the present invention, the above-mentioned invention is premised, and in the data area, a data area storing a variable used when executing the application program is accessed. The task management block has information specifying an access destination of the variable data mapping block, and the access destination during the operation of the system. The information specifying the access destination is rewritten from the outside, and thereafter, when executing the task in which the information specifying the access destination is rewritten, by changing the memory area used / referenced by the application program related to the task, The execution contents of the program may be changed.
[0018]
Further, the data area is provided with a variable data mapping block including variable address information for accessing a data area in which a variable used when executing the application program is stored. A memory used and referred to by an application program related to the task when executing a task that references the variable data mapping block in which the variable address information is rewritten from the outside and thereafter refers to the rewritten variable data mapping block. By changing the area, the execution contents of the program can be changed.
[0019]
In each of the above-mentioned inventions, the memory area that is referenced and used when executing the application program managed by the task changes by rewriting the information of the task management block and the information of the variable data mapping block. Thereby, the contents of the program that operates substantially can be changed.
[0020]
Since the task management block and the variable data mapping block are located in a data area that can be accessed from the outside, the operation of the system can be changed without recompiling while the operation of the system is running. Can greatly change the program.
[0021]
Further, the method of changing the control content of the programmable controller device according to the present invention is a method of changing the control content of a program in a programmable controller device capable of executing a program described in a compilation language such as C language, In a work memory of the programmable controller device, a variable area for storing a variable used when executing the program, and a variable for defining a variable to be used by a variable address among variables stored in the variable area A data area for storing a data mapping block is provided. The variable data mapping block is configured to include address information that specifies parameters used in a program, and externally rewrites the address information during operation of the system. As a result, when the program is executed thereafter, the control content executed without recompiling by executing the program using the parameters specified by the rewritten address information is changed.
[0022]
BEST MODE FOR CARRYING OUT THE INVENTION
FIG. 1 shows a preferred embodiment of the present invention. As shown in FIG. 1, the PLC 1 includes a CPU unit 10, an extended CPU unit 20, and the like. Of course, although not shown, there are other units such as a communication unit, an I / O unit, a master unit, and a power supply unit.
[0023]
In the CPU unit 10, the CPU 11 executes predetermined processing cyclically according to a system program stored in a system ROM (not shown). Here, the predetermined processing includes common processing, arithmetic processing, cycle time calculation processing, I / O refresh processing, and peripheral service processing. The arithmetic processing sequentially executes a user program stored in the program memory 12, and at the time of performing the arithmetic, accesses the IO memory 13 as appropriate, reads and writes IO data, and acquires parameters. Then, in the I / O refresh processing, the IO memory 13 is updated with IO data. The CPU 11 can access the IO memory 13 and the extended CPU unit 20 via the bus controller 14. It should be noted that the user program executed by the CPU 11 is created in a ladder language as in the prior art.
[0024]
On the other hand, the extended CPU unit 20 is a unit capable of executing a program created in a high-level language (for example, C language), and includes a flash memory 21 for holding the C language program and a work memory 22 for operating the program. Have. The form of the extended CPU unit 20 is a unit separate from the CPU unit 10 and is similar to other units (communication unit, I / O unit, etc.) via the CPU unit 10 and a PLC bus (internal bus). Unit is connected. As another form of the extension CPU unit 20, an extension board type that can be inserted into the CPU unit 10 and built in may be used. As another form, an extension unit type for the CPU unit 10 may be used. The connection bus in the case of the extension board type or the extension unit type is a bus different from the PLC bus to which other units are connected, and may be the internal bus of the CPU unit 10 itself. Connection via the Internet). In short, the CPU 11 is connected to the CPU 11 via a bus and operates independently of the CPU 11 as an extended CPU. The CPU 11 may have any form as long as it has a function of accessing the IO memory 13 of the CPU unit 10.
[0025]
The flash memory 21 is composed of a nonvolatile flash memory, and the work memory 22 is composed of a volatile RAM because it is necessary to execute the work at high speed. Then, as an initial preparation for executing the program, the program stored in the flash memory 21 is copied to the work memory 22 at the time of startup such as when the power is turned on or when a manual reset operation is performed. Then, the program stored in the work memory 22 is read, and the CPU 23 executes a predetermined algorithm based on the program.
[0026]
The extended CPU unit 20 is linked with the main CPU unit 10 via a dedicated bus. Specifically, by transmitting and receiving data between the bus controller 14 and the address decoder 25, the CPU unit 10 accesses various memories via the address decoder 25 and gives a predetermined command to the CPU 23. Further, events and the like from the extended CPU unit 20 are also transmitted from the address decoder 25 to the CPU unit 10 (CPU 11) via the bus controller 14. The event is, for example, a message communication performed to the extended CPU unit 20 in the peripheral processing during the processing of the main CPU unit 10. By the event message communication, the extended CPU unit 20 receives a read request command from the main CPU unit 10 and passes a response thereto, or receives a write command (write data) and stores it in the work memory 22.
[0027]
The context of the program stored in the work memory 22 (code arrangement after compiling the C language program) is as shown in FIG. That is, it has a program code area P, a constant area C, a data area D, a BBS area B, and a stack area Stack. The program code area P stores program logic. The constant area C stores data declared const. This data is a constant that does not change with the execution of the program. The data area D stores data not declared const, that is, variables. The variable data includes IN data taken in during the execution of the program, data generated during the execution of the program, and OUT data resulting from the execution of the program. Of course, the data stored in the data area D includes IN data taken in from the input device by the main CPU unit 10 and OUT data obtained by executing a program in the main CPU unit 10, that is, the IO memory 13 of the main CPU unit 10. May be included. The initial value of the data area D is set to an arbitrary data value by the boot loader. The BBS area B is an area in which uninitialized variables are stored, and is cleared to zero at startup. The variable data in the BBS area B may include IN data taken in when the extended CPU unit 20 executes the program, data generated during the execution of the program, and OUT data resulting from the execution result of the program. Of course, the data of the main CPU unit 10 IO memory 13 may be included.
[0028]
Note that the variable data includes so-called parameters used in the application program. Examples of the parameters include P, I, and D parameters for performing PID control, such as the number of loops for executing a program, and the temperature and humidity in control relating to temperature.
[0029]
Further, a stack is stored in the stack area Stack, and is used when linking programs. Specifically, program call destination information when performing subroutine processing, return information after subroutine processing, and the like are stored. Then, the program code and the variables are arranged in each area shown in FIG. 2 when the program is linked.
[0030]
More specifically, as shown in FIG. 3, the program stored in the program code area P refers to the task management block TCB stored in the data area D, and calls up the registered task. And a user application unit UA for performing a specific function. The user application unit UA stores a plurality of user application programs (in the example shown, user applications A and B). The user application unit UA is stored in the program code area P continuously from the start address to the address of the predetermined area.
[0031]
The task management block TCB is stored in the data area, specifies a task to be executed, and also determines the execution order. The task manager unit TM sequentially executes tasks according to the order recorded in the task management block TCB.
[0032]
Here, the task management block TCB has a data structure as shown in FIG. That is, in order from the beginning, “Task_id” that stores a task ID that is a unique number for identifying the task, “forward” that stores a task ID to be executed next and establishes a link, "Backward" for storing the executed task ID, "state" for storing a task status flag for specifying whether the task is active or inactive, and "level" for storing the task level (execution frequency). , "PProgram" for storing the start address of the program code, and "pData" for storing the start address of the variable area address definition.
[0033]
Here, the start address stored in “pProgram” is the start address of a desired user application program recorded in the user application unit UA of the program code area P. That is, the task manager unit TM accesses the task management block TCB, calls and executes the user applications sequentially according to the determined task order. In the example of the table of the task management block TCB in FIG. 4, Task_id = 0 (task 0) is first executed. Since the forward numerical value in the table row of Task_id = 0 is “1”, the next task to be executed is Task_id = 1 (task 1). Since the forward numerical value is set to “2” in the table row of Task_id = 1, task 2 is executed after execution of task 1.
[0034]
The variable address stored in “pData” registers the access destination of the variable data mapping block VMB stored in the data area D. As shown in FIG. 4, the variable data mapping block VMB includes a table in which “dname” storing a variable name is associated with an address “pAddr” indicating the substance of the variable. As this address, a desired address in the BSS area B in which specific data corresponding to the variable name is stored.
[0035]
That is, the reference address of this variable data mapping block VMB is registered in “pData” of each task in the task management block TCB, and the data actually used / referenced at the time of task execution is stored in the “pData” of the variable data mapping block VMB. The data is in the BBS area specified by the address stored in “pAddr”.
[0036]
In the present embodiment, by arranging the task management block TCB and the variable data mapping block VMB at a fixed address of the data area D accessible from the outside, the table operation from an external programming tool can be easily performed. As a result, the operating program and the memory to be referred can be changed only by editing the task management block TCB and the variable data mapping block VMB in the data area via the CPU unit using a tool or the like. More specifically, the addresses of “pProgram” and “pData” in the task management block TCB and “pAddr” of the variable data mapping block VMB are changed.
[0037]
For example, when it is assumed that the numerical value of the start address of the user application A is set in “pProgram” of a certain task (Task_id = 2) in the table of the task management block TCB in FIG. 4, a solid line in FIG. As described above, the same task (Task_id = 2) described in the task management block TCB corresponds to the user application A. Therefore, it is assumed that the start address of “pProgram” of the same task (Task_id = 2) in the table of the task management block TCB in FIG. Then, when the same task is subsequently executed, the user application B is executed as shown by the dotted line in FIG.
[0038]
Further, for example, it is assumed that the numerical value of the address of the variable data mapping block VMB that refers to the variables a and b is stored in “pData” of a certain task (Task_id = 2) in the table of the task management block TCB in FIG. In this case, as shown by the solid line in FIG. 3, the same task (Task_id = 2) described in the task management block TCB refers to the variables a and b. Therefore, by rewriting the address of “pData” of the same task (Task_id = 2) in the table of the task management block TCB in FIG. The variable to be used changes to c and d as shown by the dotted line in FIG. That is, the address of the variable data to be referred to is switched from the addresses a and b in the BBS area to c and d.
[0039]
Further, the change of the variable to be referred to is not limited to the method of changing “pData” of the task management block TCB as described above, but rewrites “pAdder” of the variable data mapping block VMB (the current variables a and b are changed). (Addresses of variables c and d).
[0040]
Note that the variable data includes so-called parameters used in the application program as described above. For example, if the number of loops of the program execution is a parameter, changing the number of loops changes the number of loops, so that the control content can be changed without changing the program itself. In addition, for example, in the case of control relating to temperature, temperature and humidity are parameters, and in a specific example, parameters can be changed between a sunny day and a rainy day, and parameters can be changed according to season and temperature / humidity of that day. Has actually been done. Optimum temperature control can be achieved by changing only these parameters without changing the program. In addition, by changing each of the parameters P, I, and D when performing the PID control, the control content or the operation content is changed without changing the logic of the program.
[0041]
In addition, the task management block TCB and the variable data mapping block VMB can independently and independently rewrite their reference addresses.
[0042]
Therefore, in this embodiment, the PLC is stopped and restarted by rewriting the reference address of the task management block TCB without changing the reference address of the variable data mapping block VMB while the program is running. By exchanging the application programs without any change, the control contents of the entire system can be largely changed.
[0043]
Also, while the program is running, the task management block TCB is not changed and the reference destination address of the variable data mapping block VMB is rewritten, so that the parameter variables used for the program execution can be changed without stopping and restarting the PLC. Can be changed. Therefore, although the logic of the application program is not changed as it is, different control operations of the entire system can be performed. This is because the control operation naturally changes when the parameter changes.
[0044]
Of course, by rewriting the reference addresses of both the task management block TCB and the variable data mapping block VMB while the program is running, both the program and the parameter variables can be replaced without stopping and restarting the PLC. The operation of the entire system can be greatly changed.
[0045]
In the above-described embodiment, the variable data mapping block VMB is provided in the data area D, and the access to the variable is performed through the variable data mapping block VBM. However, the present invention is not limited to this. Alternatively, the task management block TCB directly manages the addresses of the variables in the BBS area, and by changing the addresses, the variables to be referred can be switched without recompiling.
[0046]
【The invention's effect】
As described above, according to the present invention, the operating conditions of the program system to be executed and the system itself can be changed only by changing the task management table and / or the variable data mapping block without modifying the program source described in the C language. Can be rearranged.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of a PLC according to the present invention.
FIG. 2 is a diagram showing an example of a context of a program stored (copied / developed) in a work memory 22.
FIG. 3 is a diagram illustrating functions of the present invention.
FIG. 4 is a diagram illustrating an example of a task management block.
FIG. 5 is a diagram showing a variable data mapping block VMB.
[Explanation of symbols]
1 PLC
10 CPU unit 11 CPU
12 Program Memory 13 IO Memory 14 Bus Controller 20 Extended CPU Unit 21 Flash Memory 22 Work Memory 23 CPU
25 Address decoder

Claims (8)

プログラマブルコントローラを構成する機器であって、
C言語などのコンパイル方式の言語で記述されたプログラムを実行可能であり、
ワークメモリ中に、前記プログラムを構成する複数のアプリケーションプログラムを格納するプログラムエリアと、前記プログラムエリアに格納された複数のアプリケーションプログラムのうち、使用するプログラム並びにその実行順を規定するタスク管理ブロックを格納するデータエリアを備え、
前記タスク管理ブロックは、各タスクで実行するアプリケーションプログラムを指定するアドレス情報を含むとともに、そのアドレス情報を外部から書き換え可能にしたことを特徴とするプログラマブルコントローラ用機器。
A device constituting a programmable controller,
A program written in a compilation language such as C language can be executed,
In a work memory, a program area for storing a plurality of application programs constituting the program, and a task management block for defining a program to be used and an execution order among the plurality of application programs stored in the program area are stored. Data area,
The device for a programmable controller, wherein the task management block includes address information designating an application program to be executed in each task, and the address information is externally rewritable.
前記データエリアには、前記アプリケーションプログラムを実行する際に使用する変数が格納されたデータ領域をアクセスするための変数アドレス情報を備えた変数データマッピングブロックを設け、
前記タスク管理ブロックは、前記変数データマッピングブロックのアクセス先を特定する情報を含み、その情報を外部から書き換え可能にしたことを特徴とする請求項1に記載のプログラマブルコントローラ用機器。
The data area is provided with a variable data mapping block having variable address information for accessing a data area in which a variable used when executing the application program is stored,
2. The programmable controller device according to claim 1, wherein the task management block includes information for specifying an access destination of the variable data mapping block, and the information can be externally rewritten.
前記データエリアには、前記アプリケーションプログラムを実行する際に使用する変数が格納されたデータ領域をアクセスするための変数アドレス情報を備えた変数データマッピングブロックを設け、
前記変数アドレス情報を外部から書き換え可能にしたことを特徴とする請求項1または2に記載のプログラマブルコントローラ用機器。
The data area is provided with a variable data mapping block having variable address information for accessing a data area in which a variable used when executing the application program is stored,
3. The programmable controller device according to claim 1, wherein the variable address information is rewritable from outside.
プログラマブルコントローラを構成する機器であって、
C言語などのコンパイル方式の言語で記述されたプログラムを実行可能であり、
ワークメモリ中に、前記プログラムを実行する際に使用する変数を格納する変数エリアと、前記変数エリアに格納された変数のうち、使用する変数を変数アドレスにて規定する変数データマッピングブロックとを格納するデータエリアを備え、
前記変数データマッピングブロックは、プログラムで使用するパラメータを指定するアドレス情報を含むとともに、そのアドレス情報を外部から書き換え可能にしたことを特徴とするプログラマブルコントローラ用機器。
A device constituting a programmable controller,
A program written in a compilation language such as C language can be executed,
In a work memory, a variable area for storing variables used when executing the program and a variable data mapping block for defining a variable to be used by a variable address among the variables stored in the variable area are stored. Data area,
The variable data mapping block includes address information that specifies parameters used in a program, and the address information is externally rewritable.
C言語などのコンパイル方式の言語で記述されたプログラムを実行可能なプログラマブルコントローラ用機器におけるプログラム変更方法であって、
プログラマブルコントローラ用機器が持つワークメモリ中に、前記プログラムを構成する複数のアプリケーションプログラムを格納するプログラムエリアと、前記プログラムエリアに格納された複数のアプリケーションプログラムのうち、使用するプログラム並びにその実行順を規定するタスク管理ブロックを格納するデータエリアを備えておき、
前記タスク管理ブロックは、各タスクで実行するアプリケーションプログラムを指定するアドレス情報を含むように構成し、
システムの動作稼働中に、前記アドレス情報を外部から書き換え、
それ以降、そのアドレス情報が書き換えられたタスクを実行する際には、書き換えられたアドレス情報により指定されるアプリケーションプログラムを実行することにより再コンパイルすることなく実行するプログラムを変更することを特徴とするプログラム変更方法。
A program changing method in a programmable controller device capable of executing a program described in a language of a compile method such as C language,
In a work memory of the programmable controller device, a program area for storing a plurality of application programs constituting the program, and, among the plurality of application programs stored in the program area, a program to be used and an execution order thereof are defined. A data area for storing task management blocks
The task management block is configured to include address information specifying an application program to be executed in each task,
During operation of the system, the address information is externally rewritten,
Thereafter, when executing the task whose address information has been rewritten, executing the application program specified by the rewritten address information changes the program to be executed without recompiling. How to change the program.
前記データエリアには、前記アプリケーションプログラムを実行する際に使用する変数が格納されたデータ領域をアクセスするための変数アドレス情報を備えた変数データマッピングブロックを備えており、
前記タスク管理ブロックは、前記変数データマッピングブロックのアクセス先を特定する情報を持たせるようにし、
システムの動作稼働中に、前記アクセス先を特定する情報を外部から書き換え、
それ以降に、アクセス先を特定する情報が書き換えられたタスクを実行する際に、そのタスクに関連するアプリケーションプログラムが使用・参照するメモリエリアを変更することにより、プログラムの実行内容を変更することを特徴とする請求項5に記載のプログラム変更方法。
The data area includes a variable data mapping block including variable address information for accessing a data area in which a variable used when executing the application program is stored.
The task management block has information for specifying an access destination of the variable data mapping block,
While the operation of the system is in operation, the information for specifying the access destination is externally rewritten,
Thereafter, when executing a task whose information specifying the access destination has been rewritten, it is necessary to change the memory area used and referenced by the application program related to the task, thereby changing the execution contents of the program. 6. The method according to claim 5, wherein the program is changed.
前記データエリアには、前記アプリケーションプログラムを実行する際に使用する変数が格納されたデータ領域をアクセスするための変数アドレス情報を備えた変数データマッピングブロックを設け、
システムの動作稼働中に、前記変数アドレス情報を外部から書き換え、
それ以降に、前記変数アドレス情報が書き換えられた変数データマッピングブロックを参照しているタスクを実行する際に、そのタスクに関連するアプリケーションプログラムが使用・参照するメモリエリアを変更することにより、プログラムの実行内容を変更することを特徴とする請求項5または6に記載のプログラム変更方法。
The data area is provided with a variable data mapping block having variable address information for accessing a data area in which a variable used when executing the application program is stored,
During operation of the system, the variable address information is externally rewritten,
Thereafter, when executing a task that refers to the variable data mapping block in which the variable address information has been rewritten, by changing the memory area used and referred to by the application program related to the task, 7. The method according to claim 5, wherein the content of execution is changed.
C言語などのコンパイル方式の言語で記述されたプログラムを実行可能なプログラマブルコントローラ用機器における制御内容変更方法であって、
プログラマブルコントローラ用機器が持つワークメモリ中に、前記プログラムを実行する際に使用する変数を格納する変数エリアと、前記変数エリアに格納された変数のうち、使用する変数を変数アドレスにて規定する変数データマッピングブロックとを格納するデータエリアを備えておき、
前記変数データマッピングブロックは、プログラムで使用するパラメータを指定するアドレス情報を含むように構成し、
システムの動作稼働中に、前記アドレス情報を外部から書き換え、
それ以降、プルグラム実行する際には、書き換えられたアドレス情報により指定されるパラメータを用いてプログラムを実行することにより再コンパイルすることなく実行される制御内容を変更することを特徴とするプログラマブルコントローラ用機器における制御内容変更方法。
A method for changing control contents in a device for a programmable controller capable of executing a program described in a language of a compile method such as C language,
In a work memory of the programmable controller device, a variable area for storing a variable used when executing the program, and a variable for defining a variable to be used by a variable address among variables stored in the variable area A data area for storing the data mapping block is provided,
The variable data mapping block is configured to include address information specifying parameters used in the program,
During operation of the system, the address information is externally rewritten,
Thereafter, when the program is executed, the control content executed without recompiling is changed by executing the program using the parameters specified by the rewritten address information. How to change the control content of the device.
JP2003068924A 2003-03-13 2003-03-13 Programmable controller equipment Expired - Fee Related JP4247664B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003068924A JP4247664B2 (en) 2003-03-13 2003-03-13 Programmable controller equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003068924A JP4247664B2 (en) 2003-03-13 2003-03-13 Programmable controller equipment

Publications (2)

Publication Number Publication Date
JP2004280306A true JP2004280306A (en) 2004-10-07
JP4247664B2 JP4247664B2 (en) 2009-04-02

Family

ID=33286086

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003068924A Expired - Fee Related JP4247664B2 (en) 2003-03-13 2003-03-13 Programmable controller equipment

Country Status (1)

Country Link
JP (1) JP4247664B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102830649B (en) * 2012-08-22 2015-02-04 国电联合动力技术有限公司 Method used for cross-platform transplantation of software of PLC (Programmable Logic Controller) of wind power control system

Also Published As

Publication number Publication date
JP4247664B2 (en) 2009-04-02

Similar Documents

Publication Publication Date Title
JP5291912B2 (en) Method and dynamic modifier functional block for modifying and changing the operation of a functional block used in a process control system
US7110837B2 (en) Control system and method for on-line editing of user program
JP5583305B2 (en) Programmable logic controller, programming tool, and program parameter editing system
US20140005805A1 (en) Cpu of plc, system program for plc, and recording medium storing system program for plc
JP6257506B2 (en) Method for changing software in the memory of an electronic control unit
CN106062649A (en) Control device and control system
JP4366575B2 (en) tool
JP2001265412A (en) Programmable controller
JP7085305B2 (en) Control system and control method
JP6954191B2 (en) Control systems, development support equipment, and development support programs
JP4247664B2 (en) Programmable controller equipment
WO2020075351A1 (en) Control device
JP6119452B2 (en) Programmable controller system, its support device, programmable controller, program
JP2004280299A (en) Controller, developing device and system
JP2009009444A (en) Programmable controller, programmable controller support apparatus, and programmable controller system
JP2006059308A (en) General-purposed and real-timed information processor
JP4877257B2 (en) Programmable controller, programmable controller support apparatus, and programmable controller system
JP3659399B2 (en) Programmable logic controller
JP2004272629A (en) Device for programmable controller, and programmable updating method and program starting method for the same
JP4366576B2 (en) Programmable controller equipment
JPH11259308A (en) Programmable controller
JPH0410081B2 (en)
JP2003248514A (en) Supervision and control system
JP4747990B2 (en) Programmable controller
JP2000267707A (en) Sequence controller, maintenance method for maintenance area in the same device, and recording medium for storing computer program for executing the same method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20060130

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080909

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080916

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081117

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: 20081218

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20081231

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

Free format text: PAYMENT UNTIL: 20120123

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4247664

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20130123

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20140123

Year of fee payment: 5

LAPS Cancellation because of no payment of annual fees