Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP3580348B2 - Data download control method, data download control device, and their recording media - Google Patents
[go: Go Back, main page]

JP3580348B2 - Data download control method, data download control device, and their recording media - Google Patents

Data download control method, data download control device, and their recording media Download PDF

Info

Publication number
JP3580348B2
JP3580348B2 JP20365398A JP20365398A JP3580348B2 JP 3580348 B2 JP3580348 B2 JP 3580348B2 JP 20365398 A JP20365398 A JP 20365398A JP 20365398 A JP20365398 A JP 20365398A JP 3580348 B2 JP3580348 B2 JP 3580348B2
Authority
JP
Japan
Prior art keywords
trigger
action
type
data
download
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 - Lifetime
Application number
JP20365398A
Other languages
Japanese (ja)
Other versions
JP2000035812A (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.)
Omron Corp
Original Assignee
Omron 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 Omron Corp filed Critical Omron Corp
Priority to JP20365398A priority Critical patent/JP3580348B2/en
Publication of JP2000035812A publication Critical patent/JP2000035812A/en
Application granted granted Critical
Publication of JP3580348B2 publication Critical patent/JP3580348B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)
  • Programmable Controllers (AREA)

Description

【0001】
【発明の属する技術分野】
この発明は、データダウンロード制御方法、データダウンロード制御装置及びそれらの記録媒体に関し、詳しくは、データベースに格納されたデータを所定のトリガの発生に対応してPLC(プログラマブルロジックコントローラ)等のダウンロード対象機器へ自動的にダウンロードするようにしたデータダウンロード制御方法、データダウンロード制御装置及びそれらの記録媒体に関する。
【0002】
【従来の技術】
最近のFA(ファクトリオートメーション)でのアプリケーションでは、「何か必要なタイミング」が発生したときに、「それに対応するする処理」を実行するという形で構築される場合が多い。
【0003】
例えば、
1)所定の時間が経過する毎にPLCのデータをユーザが指定する形で収集してデータベースに蓄積する
2)PLCによる生産が開始される時に、レシピデータ、マスタデータ、作業指示等の必要なデータを検索してPLCにダウンロードする
という形でアプリケーションが構築される。
【0004】
【発明が解決しようとする課題】
しかし、上記アプリケーションのプログラミングは、「何か必要なタイミング」が発生したとき、すなわち、トリガが発生したとき、「それに対応するする処理」を実行する、すなわち、アクションを実行するというように、各トリガ種別、各アクション種別に対応してそれぞれ別々にプログラミングしており、また、この種のプログラミングにおいては他のユーザアプリケーションとの連携が要求されることも多いので、その結果、この種のアプリケーションの開発コストが高くなり、また、処理変更時の対応にも時間がかかるという問題があった。
【0005】
そこで、この発明は、データベースに格納されたデータを所定のトリガの発生に対応してダウンロード対象機器へ自動的にダウンロードする機能を低開発コストで実現できるようにしたデータダウンロード制御方法、データダウンロード制御装置及びそれらの記録媒体を提供することを目的とする。
【0007】
上記目的を達成するために、本発明は、データベースに格納されたデータをダウンロード対象機器にダウンロードするデータダウンロード制御装置において、上記データベースから上記ダウンロード対象機器へデータをダウンロードするタイミングを示すトリガについて、トリガIDとトリガ名とトリガの種類を示すトリガ種別IDとを対応させて設定し、上記トリガを発生させるためのトリガ種別実行プログラムを上記トリガ種別IDに対応させて設定するトリガ設定手段と、上記データベースから上記ダウンロード対象機器へデータをダウンロードするアクションについて、アクションIDとアクション名とアクションの種類を示すアクション種別IDとを対応させて設定し、上記ダウンロードのアクションを実行するためのアクション種別実行プログラムを上記アクション種別IDに対応させて設定し、ダウンロード対象のデータをデータベースから検索する条件を設定するアクション設定手段と、上記トリガ設定手段で設定した上記トリガIDに対応して上記アクション設定手段で設定した上記アクションIDを関連付けることによりジョブを設定するジョブ設定手段と、上記トリガ設定手段で設定した上記トリガのトリガ種別IDに対応したトリガ種別実行プログラムを起動し実行することにより、トリガを発生させ、このトリガの発生によりそのトリガ種別実行プログラムのトリガ種別IDに対応するトリガIDを付加したイベント通知をし、このイベント通知中のトリガIDに対して上記ジョブ設定手段で関連付けられたアクションIDのアクション種別IDに対応したアクション種別実行プログラムを自動実行することにより、上記記憶した検索条件に基づいてSQL文を作成し、作成したSQL文を用いて上記データベースを検索し、該データベースから検索結果のデータを上記ダウンロード対象機器にダウンロードする制御手段と、を具備することを特徴とするデータダウンロード制御装置である。
【0009】
【発明の実施の形態】
以下、この発明に係るデータダウンロード制御方法、データダウンロード制御装置及びそれらの記録媒体の一実施の形態を添付図面を参照して詳細に説明する。
【0010】
図1は、この発明に係るデータダウンロード制御方法、データダウンロード制御装置及びそれらの記録媒体を適用して構成したデータダウンロード制御システムの一実施の形態を示すシステム構成図である。
【0011】
図1において、このデータダウンロード制御システムは、ダウンロード対象機器20にネットワーク等を介してデータダウンロード制御装置10を接続するとともに、所定のトリガと関連付けてデータダウンロード制御装置10のデータベース40のデータをダウンロード対象機器20のメモリ22にダウンロードするアクションを設定し、トリガの発生に対応して該トリガに対応する上記アクションを自動実行することによりデータダウンロード制御装置10のデータベース40からダウンロード対象機器20のメモリ22へのデータのダウンロードを行うように構成される。
【0012】
ここで、データダウンロード制御装置10は、FAパーソナルコンピュータ(パソコン)100から構成され、このFAパーソナルコンピュータ100により上記トリガおよびアクションの設定が行われる。
【0013】
また、ダウンロード対象機器20は、例えば、PLC21から構成され、上記メモリ22は、上記PLC21の制御に係る各種データを記憶するメモリとして構成される。
【0014】
また、このメモリ22は、変数エリア名DMを有し、オフセットは10chで最大レコード数が、例えば、レコード1から20の20件に設定されている。
【0015】
データダウンロード制御装置10のデータベース40からダウンロード対象機器20のメモリ22へのデータのダウンロードは後に詳述するオフセットタグを用いて行われる。
【0016】
図2は、図1に示したデータダウンロードシステムの具体的動作例を示した図である。
【0017】
図2において、データダウンロード制御装置10のデータベース40は、ダウンロード対象機器20のレシピデータを格納するレシピデータベースから構成される。
【0018】
ここで、レシピデータベースからなるデータベース40は、品種テーブルを格納し、この品種テーブルには、ダウンロード対象機器20で生産する品種に対応してその材料、処理が対応付けられて格納されている。
【0019】
例えば、品種「1」に対しては、材料「A」,処理「1」、材料「B」,処理「2」がそれぞれ対応付けられて格納され、品種「2」に対しては、材料「A」,処理「2」、材料「C」,処理「3」、材料「F」,処理「2」がそれぞれ対応付けられて格納され、品種「3」に対しては、材料「X」,処理「1」が対応付けられて格納されている。
【0020】
また、ダウンロード対象機器20のメモリ22の対象機器エリアの先頭タグ名「先頭材料」(DM0010)には、データダウンロード制御装置10のデータベース12からダウンロードされたDB(材料)A、タグ「現在値」、DB(処理):1、定数:0、DB(材料)B、タグ「現在値」、DB(処理):2、定数:0、…が格納される。
【0021】
すなわち、データダウンロード制御装置10のデータベース40からダウンロードされたデータは、以下の条件でダウンロード対象機器20のメモリ22の対象機器エリアに割り当てられる。
【0022】
レコードの並び1:DBフィールド(材料)
レコードの並び2:タグ「現在値」
レコードの並び3:DBフィールド(処理)
レコードの並び4:定数(0)
MAXレコード件数:20
MAX以上ある場合:MAXまでダウンロード
【0023】
図3は、図2に示したデータダウンロード制御装置の詳細構成を示すブロック図である。
【0024】
図3において、データダウンロード制御装置10は、このデータダウンロード制御装置10に対する各種設定を行う装置設定ツール11、装置設定ツール11で設定された設定内容を格納する設定テーブル12、このデータダウンロード制御装置10によるデータ転送のタグの設定を行うタグ設定ツール13、タグ設定ツール13で設定されたタグを格納するタグデータベース14、このデータダウンロード制御装置10によるデータ流れ制御のサービスを実行するサービス処理部15を具備して構成される。
【0025】
ここで、サービス処理部15は、このデータダウンロード制御装置10によるデータ流れ制御を実行する制御モジュール16、各種トリガを発生するトリガモジュール17、各種アクションを実行するアクションモジュール18を具備して構成される。
【0026】
また、サービス処理部15の制御モジュール16に対して、ユーザアプリケーション50からデータ収集開始、停止等の指令が通知され、トリガモジュール17に対して、ユーザアプリケーション50からトリガ発生等の指令が通知され、アクションモジュール18からユーザアプリケーション50に対してアプリケーションの通知(アプリ通知)がなされる。
【0027】
また、アクションモジュール18は、ユーザデータファイル40との間でデータの送受を行う。
【0028】
また、サービス処理部15は、ゲートウエイ60を介して複数のPLC20−1、20−2との間でデータの送受を行う。
【0029】
ここで、サービス処理部15によるサービスは、データのロギング処理、ダウンロード処理等を実現する。すなわち、サービス処理部15では、あるトリガが発生したときに、そのトリガに対応するアクションを実行する。これにより
1)PLC20−1、20−2のデータをユーザデータファイル40に格納する
2)ユーザ作成のデータベースを、指定した条件で検索し、その結果をPLC20−1、20−2に書込む
3)トリガが発生した際に、アクションとしてユーザアプリケーション50に通知する
等の処理を実現する。
【0030】
また、装置設定ツール11は、
1)サービス処理部15のサービスに必要な設定データの登録
2)サービス処理部15のサービスの開始、停止
3)あるトリガとそのときにロギングするアクション(作業)のまとまりの単位であるジョブの登録、開始、終了
等の機能を提供する。
【0031】
また、タグ設定ツール13は、
1)対象機器の変数エリアに対するタグの設定
2)対象機器との間でのイベントメモリのマッピングの設定
等の機能を提供する。
【0032】
また、タグデータベース14は、タグ設定ツール13で設定したタグ情報を格納するデータベースである。
【0033】
また、設定テーブル12は、サービス処理部15のサービスの実行に必要なデータの集まりを格納するデータベースである。
【0034】
また、ユーザデータファイル40は、実際にデータがロギングされるデータが格納されるデータベース、またはダウンロードするデータが格納されるデータベースである。このデータベースのテーブル構成(スキーマ)は、ユーザが設計、作成することができる。
【0035】
図4は、図2に示したデータダウンロード制御装置の詳細動作を示す機能ブロック図である。
【0036】
図4において、トリガ設定部111は、トリガ種別の設定プログラム、すなわち、トリガ種別1設定プログラム151−1、トリガ種別2設定プログラム151−2、トリガ種別3設定プログラム151−3を実行し、その結果をトリガ設定データベース(トリガ設定DB)121に設定する。
【0037】
また、ジョブ設定部112は、トリガとアクションを対応付けたジョブをジョブ設定データベース(ジョブ設定DB)122に設定する。
【0038】
アクション設定部113は、アクション種別の設定プログラム、すなわち、エリアダウンロードアクション設定プログラム152−1、アクション種別2設定プログラム152−2、アクション種別3設定プログラム152−3を実行し、その結果をアクション設定データベース(アクション設定DB)123に設定する。
【0039】
トリガ起動部151は、トリガ設定データベース(トリガ設定DB)121に設定されたトリガおよびジョブ設定データベース(ジョブ設定DB)122に設定されたジョブを読み込み、トリガ種別の実行プログラム、すなわち、トリガ種別1実行プログラム153−1、トリガ種別2実行プログラム153−2、トリガ種別3実行プログラム153−3、トリガ種別3実行プログラム153−4に対してその開始/停止の指令を通知する。
【0040】
トリガ種別1実行プログラム153−1、トリガ種別2実行プログラム153−2、トリガ種別3実行プログラム153−3、トリガ種別3実行プログラム153−4の実行により、イベントが発生すると、そのイベントをフローコントロール部152に通知する。
【0041】
イベントを実行するフローコントロール部152は、アクション設定データベース(アクション設定DB)123に設定されたアクションおよびジョブ設定データベース(ジョブ設定DB)122に設定されたジョブを読み込み、アクション種別の実行プログラム、すなわち、エリアダウンロード実行プログラム154−1、アクション種別2実行プログラム154−2、アクション種別3実行プログラム154−3、アクション種別4実行プログラム154−4に対してその実行の指令を通知する。
【0042】
図5は、図4に示したジョブ設定データベース(ジョブ設定DB)の一例を示す図である。
【0043】
図5において、ジョブ設定データベース(ジョブ設定DB)122は、ジョブテーブル122−1を具備して構成される。
【0044】
図5に示すジョブテーブル122−1は、トリガIDに対してアクションIDが対応して記憶されるテーブルである。
【0045】
すなわち、図5に示すジョブテーブル122−1においては、トリガID「100」に対してアクションID「200」が設定され、トリガID「100」に対してアクションID「210」が設定され、トリガID「110」に対してアクションID「230」が設定されていることを示している。
【0046】
図6は、図4に示したトリガ設定データベース(トリガ設定DB)の一例を示す図である。
【0047】
図6において、トリガ設定データベース(トリガ設定DB)121は、トリガテーブル121−1、トリガプログラム情報テーブル121−2、トリガ種別ごとのテーブル121−3を具備して構成される。
【0048】
図6に示すトリガテーブル121−1は、トリガIDに対してトリガ名、トリガ種別IDが対応して記憶されるテーブルである。
【0049】
すなわち、図6に示すトリガテーブル121−1においては、トリガID「100」に対してトリガ名「30秒ごと」、トリガ種別ID「1」が設定され、トリガID「110」に対してトリガ名「生産開始」、トリガ種別ID「3」が設定されていることを示している。
【0050】
また、図6に示すトリガプログラム情報テーブル121−2は、トリガ種別IDに対してトリガ種別名、設定プログラム、実行プログラムが対応して記憶されるテーブルである。
【0051】
すなわち、図6に示すトリガプログラム情報テーブル121−2においては、トリガ種別ID「1」に対してトリガ種別名「定周期」、設定プログラム「SetCyclic」、実行プログラム「CyclicExe」が設定され、トリガ種別ID「2」に対してトリガ種別名「指定時刻」、設定プログラム「SetTime」、実行プログラム「TimeExe」が設定され、トリガ種別ID「3」に対してトリガ種別名「条件一致」、設定プログラム「SetTag」、実行プログラム「TagExe」が設定されていることを示している。
【0052】
また、図6に示すトリガ種別ごとのテーブル121−3は、定周期トリガ用のテーブルを示すもので、トリガIDに対して定周期が対応して記憶されるテーブルである。
【0053】
すなわち、図6に示すトリガ種別ごとのテーブル121−3においては、トリガID「100」に対して定周期「0:0:30」が設定され、トリガID「101」に対して定周期「0:1:0」が設定されていることを示している。
【0054】
図7は、図4に示したアクション設定データベース(アクション設定DB)の一例を示す図である。
【0055】
図7において、アクション設定データベース(アクション設定DB)123は、アクションテーブル123−1、アクションプログラム情報テーブル123−2、アクション種別ごとのテーブル123−3を具備して構成される。
【0056】
図7に示すアクションテーブル123−1は、アクションIDに対してアクション名、アクション種別IDが対応して記憶されるテーブルである。
【0057】
すなわち、図7に示すアクションテーブル123−1においては、アクションID「200」に対してアクション名「実績データ収集」、アクション種別ID「1」が設定され、アクションID「210」に対してアクション名「設備異常」、アクション種別ID「1」が設定され、アクションID「230」に対してアクション名「指示ダウンロード」、アクション種別ID「3」が設定されていることを示している。
【0058】
また、図7に示すトリガプログラム情報テーブル123−2は、アクション種別IDに対してアクション種別名、設定プログラム、実行プログラムが対応して記憶されるテーブルである。
【0059】
すなわち、図7に示すアクションプログラム情報テーブル123−2においては、アクション種別ID「1」に対してアクション種別名「データ収集(ファイル)」、設定プログラム「SetCollectFile」、実行プログラム「CollectFileExe」が設定され、アクション種別ID「2」に対してアクション種別名「データ収集(DB)」、設定プログラム「SetCollectDB」、実行プログラム「CollectDBExe」が設定され、アクション種別ID「3」に対してアクション種別名「データダウンロード」、設定プログラム「SetDownLoadFile」、実行プログラム「DownLoadFileExe」が設定されていることを示している。
【0060】
また、図7に示すアクション種別ごとのテーブル123−3は、データ収集用のテーブルを示すもので、アクションIDに対してデータ収集ファイル、収集内容が対応して記憶されるテーブルである。
【0061】
すなわち、図7に示すアクション種別ごとのテーブル123−3においては、アクションID「200」に対してデータ収集ファイル「Collect1.log」が設定されていることを示している。
【0062】
なお、このデータダウンロード制御装置は、上記図5乃至7に示したテーブル以外に、データダウンロード機能を実現するためのデータダウンロード機能用のテーブルを有している。
【0063】
図8は、図4に示した構成においてデータダウンロード機能を実現するためのデータダウンロード機能用のテーブルを示す図である。
【0064】
図8において、データダウンロード機能用のテーブル124は、タグテーブル124−1、エリアダウンロードテーブル(アクション種別ごとのテーブル)124−2、検索テーブル124−3、ソートテーブル124−4、ダウンロード割当てテーブル124−5を具備して構成される。
【0065】
ここで、タグテーブル124−1は、タグ名に対してネットワーク番号、ノード番号、遠隔エリア、オフセット、チャネル数、データ型が対応して記憶されるテーブルである。
【0066】
すなわち、図8に示すタグテーブル124−1においては、タグ名「タグ1」に対してネットワーク番号「2」、ノード番号「3」、遠隔エリア「DM]、オフセット「700」、チャネル数「10」、データ型「BCD」が設定されていることを示している。
【0067】
また、エリアダウンロードテーブル(アクション種別ごとのテーブル)124−2は、アクションIDに対してデータベース名、テーブル名、ダウンロード先頭タグ、レコードサイズ、結果通知タグが対応して記憶されるテーブルである。
【0068】
すなわち、図8に示すエリアダウンロードテーブル(アクション種別ごとのテーブル)124−2においては、アクションID「300」に対してデータベース名「DB1」、テーブル名「TB1」、ダウンロード先頭タグ「AreaDown1」、レコードサイズ「10」、結果通知タグ「AnsTag」が設定されていることを示している。
【0069】
また、検索テーブル124−3は、アクションIDに対して検索順、フィールド名、記号、種別、値、接続条件が対応して記憶されるテーブルである。
【0070】
すなわち、図8に示す検索テーブル124−3においては、アクションID「300」に対して検索順「1」、フィールド名「Field1」、記号「>」、種別「定数」、値「10」、接続条件「AND」が設定され、アクションID「300」に対して検索順「2」、フィールド名「Field2」、記号「=」、種別「タグ名」、値「Tag1」、接続条件「END」が設定されていることを示している。
【0071】
また、ソートテーブル124−4は、アクションIDに対して検索順、フィールド名、記号が対応して記憶されるテーブルである。
【0072】
すなわち、図8に示すソートテーブル124−4には、アクションID「300」に対して検索順「1」、フィールド名「Field1」、記号「降順」が設定され、アクションID「300」に対して検索順「2」、フィールド名「Field2」、記号「昇順」が設定されていることを示している。
【0073】
また、ダウンロード割当てテーブル124−5は、アクションIDに対して割当て順、種別、サイズ、値が対応して記憶されるテーブルである。
【0074】
すなわち、図8に示すダウンロード割当てテーブル124−5においては、アクションID「300」に対して割当て順「1」、種別「DB」、サイズ「2」、値「DB(Field3)」が設定され、アクションID「300」に対して割当て順「2」、種別「定数」、サイズ「1」、値「1」が設定され、アクションID「300」に対して割当て順「3」、種別「DB」、サイズ「1」、値「DB(Field1)」が設定されていることを示している。
【0075】
この実施の形態のデータダウンロード制御システムにおいては、上記図8に示したデータダウンロード機能用のテーブル124から以下に示すようなSQL文を作成する。
【0076】
SELECT Field3,Field1 FROM DB1.TB1
WHERE Field1>10AND Field2=Tag(Tag1)
ORDER BY Field1,Field2 DESC;
【0077】
エリアダウンロード実行プログラムにおいては、
1)データベースDB1をオープンし上記SQL分を実行する
2)但し、実行する直前にWHERE文のTag(タグ名)のところはタグの値をPLCより読み込んでSQL文に反映させる
3)検索した結果を元にエリアへの書込みの先頭から以下の値を書き込む Field3の値、定数1、Field1の値がレコード分ダウンロードされる。
【0078】
ここでSQL(Structured Query Language)文とは、リレーショナルデータベースを操作する標準言語で、ISO/TC97/SC5/WG15やJISなどで規格が設定されている。SQL文を用いることにより異なるデータベース管理システムに対しても同一の方法でデータの追加、変更、削除などの操作が行える。
【0079】
データベースの検索の場合は、
SELECT フィールド1、フィールド2、フィールド3 FROM テーブル名
WHERE フィールドa=(または他の記号) 値1、フィールドb=値2、…
ORDER BY フィールドx、フィールドy;
のような形で記述することによりWHEREの条件に一致したデータをFROMのテーブルより検索し、結果のSELECTの後のフィールドのデータをORDER BYでソートして取得することができる。
【0080】
データベースへの追加の場合のSQL文の構分は以下のようになる。
【0081】
INSERT INTO [テーブル名](フィールド1、フィールド2、…)
VALUES(値1、値2、…)
【0082】
ここで[テーブル名]はデータを追加したいテーブル名、フィールド1、フィールド2、…はテーブルの中でデータを追加するフィールド名を表わす。また、VALUESの後の値1、値2、…は先のフィールド名に対応して実際に格納したいデータの値を示す。
【0083】
また、データベースへの更新の場合のSQL文の構分は以下のようになる。
【0084】
UPDATE [テーブル名] SET(フィールドA=値a、フィールドB=値b…)
WHERE(フィールドX=値xANDフィールドY=値y…)
【0085】
ここで、[テーブル名]はデータを更新したいテーブル名、フィールドA、フィールドB…はテーブルの中でデータを更新するフィールド名を表わす。値a、値bは更新する値を示す。また、WHEREの後のフィールドX=値xANDフィールドY=値y…は、テーブル内のどのレコードを更新したいかを特定する条件を記述する。
【0086】
図9は、図4に示したトリガ設定部の処理を示すフローチャートである。
【0087】
図9において、図4に示したトリガ設定部111の処理が開始されると、まず、図6に示したトリガプログラム情報テーブル121−2に登録されているトリガ種別名から1つをユーザに選択させる(ステップ201)。
【0088】
そして、登録されたトリガ種別名に対応する設定プログラムを実行する(ステップ202)。その後、このジョブ設定部111の処理を終了する。
【0089】
図10は、図9に示した処理で選択された種別ごとのトリガ設定プログラムにより実行される処理の一例を示すフローチャートである。
【0090】
なお、図10に示す処理は、トリガ種別が「定周期」の場合の設定プログラムにより実行される処理を示している。
【0091】
図10において、この処理が開始されると、まず、トリガ名を入力する(ステップ211)。次に、定周期で発生させる間隔を入力する(ステップ212)。
【0092】
そして、図6に示したトリガテーブル121−1を設定する(ステップ213)。ここで、トリガ名は、本プログラムで入力したトリガの名前、すなわちステップ211で入力されたトリガ名に設定され、トリガIDは、一意のIDを生成して設定され、トリガ種別は、定周期をあらわす種別IDに設定される。
【0093】
次に、図6に示したトリガ種別ごとのテーブル(定周期トリガテーブル)121−3を設定する(ステップ214)。ここで、トリガIDは、トリガテーブル121−1に設定したトリガIDと同じID、すなわち、ステップ213で設定したIDと同じIDが設定され、定周期は、ステップ212で入力された定周期の値が設定される。その後、この処理を終了する。
【0094】
図11は、図4に示したアクション設定部の処理を示すフローチャートである。
【0095】
図11において、図4に示したアクション設定部113の処理が開始されると、まず、図7に示したアクションプログラム情報テーブル123−2に登録されているアクション種別名から1つをユーザに選択させる(ステップ221)。
【0096】
そして、登録されたアクション種別名に対応する設定プログラムを実行する(ステップ202)。その後、このアクション設定部113の処理を終了する。
【0097】
図12は、図11に示した処理で選択された種別ごとのアクション設定プログラムにより実行される処理の一例を示すフローチャートである。
【0098】
なお、図12に示す処理は、アクション種別が「収集」の場合の設定プログラムにより実行される処理を示している。
【0099】
図12において、この処理が開始されると、まず、アクション名を入力する(ステップ231)。次に、データ収集に必要な情報を入力する(ステップ232)。
【0100】
そして、図7に示したアクションテーブル123−1を設定する(ステップ233)。ここで、アクション名は、本プログラムで入力したアクションの名前、すなわちステップ231で入力されたアクション名に設定され、アクションIDは、一意のIDを生成して設定され、アクション種別は、収集をあらわす種別IDに設定される。
【0101】
次に、図7に示したアクション種別ごとのテーブル(データ収集テーブル)123−3を設定する(ステップ234)。ここで、アクションIDは、アクションテーブル123−1に設定したトリガIDと同じID、すなわち、ステップ233で設定したIDと同じIDが設定され、ファイル名は、データ収集するファイル名に設定され、データ収集フォーマットは、どのデータをどのように収集するかを設定する。その後、この処理を終了する。
【0102】
図13は、図4に示したジョブ設定部の処理を示すフローチャートである。 図13において、図4に示したジョブ設定部112の処理が開始されると、まず、図6に示したトリガテーブル121−1に登録されているトリガの一覧を表示し、その中で発生させるトリガを選択する(ステップ241)。
【0103】
次に、図7に示したアクションテーブル123−1に登録されているアクションの一覧を表示し、その中で先ほど選択したトリガが発生したときに実行させるアクションを選択する(ステップ242)。
【0104】
そして、選択したトリガとアクションの組み合わせの各IDを図5に示したジョブテーブル122−1に登録し(ステップ243)、このジョブ設定部112の処理を終了する。
【0105】
図14は、図4に示したトリガ起動部による起動処理を示すフローチャートである。
【0106】
図14に示す起動処理においては、まず、図5に示したジョブテーブル122−1に登録されているジョブのトリガIDを取得する(ステップ251)。
【0107】
次に、上記トリガIDを図5に示したジョブテーブル122−1より検索し、トリガ種別を知る(ステップ252)。
【0108】
そして、上記トリガ種別に対応した実行プログラムを図6に示したトリガプログラム情報テーブル121−2より検索し対応する実行プログラムを起動する。この時、実行プログラムの起動パラメータとしてトリガIDを渡す(ステップ253)。
【0109】
次に、全てのジョブを終了したかを調べ(ステップ254)、全てのジョブを終了しない場合は(ステップ254でNO)、ステップ251に戻るが、全てのジョブを終了したと判断した場合は(ステップ254でYES)、ステップ255に進む。
【0110】
ステップ255では、図5に示したジョブテーブル122−1に登録されているジョブアクションIDを取得する。
【0111】
そして、上記アクションIDを図7に示したアクションテーブル123−1より検索し、アクション種別を知る(ステップ256)。
【0112】
次に、上記アクション種別に対応した実行プログラムを図7に示したアクションプログラム情報テーブル123−2より検索し対応する実行プログラムを起動する。この時、実行プログラムの起動パラメータとして、アクションIDを渡す(ステップ257)。
【0113】
そして、全てのジョブを終了したかを調べ(ステップ258)、全てのジョブを終了していない場合は(ステップ258でNO)、ステップ255に戻るが、全てのジョブを終了したと判断した場合は(ステップ258でYES)、この処理を終了する。
【0114】
図15は、図14に示した処理により起動された各トリガごとの実行プログラムによる処理を示すフローチャートである。
【0115】
図15において、この処理が開始されると、ます、起動時に渡されたトリガIDより図6に示したトリガ種別ごとのテーブル121−3、すなわち、例えば、定周期トリガテーブルよりなるトリガ種別ごとの設定テーブルを検索する(ステップ261)。
【0116】
そして、検索したトリガIDに対応する種別ごとの設定内容を取得する(ステップ261)。ここで、取得するトリガIDに対応する種別ごとの設定内容とは、例えば、定周期トリガテーブルでは定周期にトリガを発生させる間隔である。
【0117】
次に、取得した情報を元にトリガを発生させるための準備を行う(ステップ263)。ここで、取得した情報を元にトリガを発生させるための準備とは、例えば、トリガ種別が定周期である場合は、周期ごとにトリガを発生させるタイマを開始させることになる。
【0118】
そして、トリガが発生したことを認識すると、例えば、定周期トリガで、定周期にタイマ割り込みが発生すると、図4に示したフローコントロール部152に対してイベント通知を行う。このイベント通知においてはトリガIDを付加して通知する(ステップ264)。
【0119】
次にこの処理を終了するかを調べ(ステップ265)、終了しない場合は(ステップ264でNO)、ステップ263に戻るが、終了と判断されると(ステップ265でYES)、この処理を終了する。
【0120】
図16は、図4に示したフローコントロール部の処理を示すフローチャートである。
【0121】
図16において、図4に示したフローコントロール部152の処理が開始されると、まず、イベント受信待ちになる(ステップ271)。
【0122】
そして、次に、イベント受信かを調べる(ステップ272)。ここで、イベント受信でないと判断されると(ステップ272でNO)、ステップ271に戻るが、イベント受信と判断されると(ステップ272でYES)、渡されたトリガIDを元に図5に示したジョブテーブル122−1を検索し、対応するジョブIDを取得する(ステップ274)。
【0123】
そして、図14に示した起動処理で起動したアクションIDごとのアクション実行プログラムにトリガ発生を通知する(ステップ275)。
【0124】
次に、この処理を終了するかを調べ(ステップ276)、終了しないと判断されると(ステップ276でNO)、ステップ271に戻るが、終了すると判断されると(ステップ276でYES)、この処理を終了する。
【0125】
図17は、図14の処理により起動した各アクション種別ごとの実行プログラム初期化処理を示すフローチャートである。
【0126】
図17において、この処理が開始されると、まず、起動時に渡されたアクションIDにより、図7に示したアクションごとのテーブル123−3、すなわち、例えば、データ収集アクションテーブルからなるアクションごとの設定テーブルを検索する(ステップ281)。
【0127】
次に、検索したアクションIDに対応する種別ごとの設定内容、例えば、データ収集アクションテーブルでは、収集ファイル名と収集フォーマットの情報を取得する(ステップ282)。
【0128】
そして、各種別ごとの処理を行う(ステップ283)。例えば、データ収集では、指定データ収集ファイルをオープンするなどの処理を行う。
【0129】
この状態で、図4に示したフローコントロール部152からトリガ発生が通知されると、設定内容にしたがってデータ収集など、アクション種別固有の実行処理を行う(ステップ284)。
【0130】
次に、この処理を終了するかを調べ(ステップ285)、終了しないと判断されると(ステップ285でNO)、ステップ284に戻るが、終了すると判断されると(ステップ285でYES)、この処理を終了する。
【0131】
図18は、図4に示したエリアダウンロードアクション設定プログラムによる処理を示すフローチャートである。
【0132】
図18において、このエリアダウンロードアクション設定プログラムによる処理が開始されると、まず、このエリアダウンロードアクション設定プログラムに係るアクション名を入力する(ステップ301)。
【0133】
次に、ダウンロード元のデータベース情報の入力を行なう(ステップ302)。このダウンロード元のデータベース情報の入力は、
1)データベース名
2)テーブル名
を入力することにより行われる。
【0134】
そして、入力されたデータベースのテーブルからフィード情報、すなわち、フィード名、タイプ、サイズなどを取得する(ステップ303)。
【0135】
次に、検索条件の入力を行なう(ステップ304)。この検索条件の入力は、上記フィールドから以下の情報を入力することにより行われる。
【0136】
1)検索に使うフィード名
2)フィードと値を比較する記号
3)値の種別
4)値
5)検索式をつなぐ記号
【0137】
次に、ソート条件の入力を行なう(ステップ305)。このソート条件の入力は、上記フィールドから以下の情報を入力することにより行われる。
【0138】
1)ソートに使うフィールド名
2)降順、昇順の選択
【0139】
次に、ダウンロード先共通条件の入力を行なう(ステップ306)。このダウンロード先共通条件の入力は、以下の情報を入力することにより行われる。
【0140】
1)ダウンロード先タグ名
2)最大レコードサイズ
3)結果通知先タグ
【0141】
次に、ダウンロード先レコードフォーマットの入力を行なう(ステップ307)。このダウンロード先レコードファーマットの入力は、ダウンロード先の1レコード内のフィールド分以下の情報を入力することにより行われる。
【0142】
1)エリアフィールド番号
2)エリアフィールド種別
3)値
【0143】
次に、ダウンロードテーブルに以下の情報を設定する(ステップ308)。
【0144】
1)アクション名:本プログラムで入力した名前
2)アクションID:一意のIDを生成
3)アクション種別ID:エリアダウンロードを表わす種別ID
【0145】
次に、ダウンロード元のデータベース情報の入力を行なう(ステップ309)。このダウンロード元のデータベース情報の入力は、ステップ307のダウンロード先共通条件の入力をもとに図8に示したエリアダウンロードテーブル124−2に以下の情報を設定することにより行われる。
【0146】
1)アクションID:図7に示したアクションテーブル123−1のIDと同じID
【0147】
次に、ステップ304の検索条件の入力を元に図8の検索テーブル104−3の設定(ステップ310)、ステップ305のソート条件の入力を元に図8に示したソートテーブル124−4の設定(ステップ311)、ステップ307のダウンロード先レコードフォーマットの入力を元に図8に示したダウンロード割当てテーブル124−5の設定(ステップ312)を行ない、その後、この処理を終了する。
【0148】
図19は、図4に示したダウンロードアクション実行プログラム初期化処理を示すフローチャートである。
【0149】
図19において、図4に示したエリアダウンロード実行プログラム154−1の初期化処理が開始されると、まず、起動時に渡されたアクションIDより、図8に示したエリアダウンロードテーブル124−2、検索テーブル124−3、ソートテーブル124−4、ダウンロード割当てテーブル124−5を検索しデータを取得する(ステップ321)。
【0150】
次に、データソース名よりデータベースをオープンしておく(ステップ322)。
【0151】
そして、取得したデータよりSQL文を作成し(ステップ323)、トリガ発生待ちになる(ステップ324)。
【0152】
次に、データダウンロード処理を実行する(ステップ325)。そして、データダウンロード処理が終了したかを調べ(ステップ325)、データダウンロード処理が終了していないと判断された場合は(ステップ325でNO)、ステップ325に戻り、データダウンロード処理を続けるが、データダウンロード処理が終了したと判断されると(ステップ326でYES)、このダウンロードアクション実行プログラム初期化処理を終了する。
【0153】
図20は、図19に示したデータダウンロード処理の詳細を示すフローチャートである。
【0154】
図20において、このデータダウンロード処理が開始されると、まず、SQL文の中のWHERE文の中にタグ名の項目があれば、そのタグ名の対応するPLCの変数エリアのデータを取得する(ステップ332)。
【0155】
そして、取得したデータを元にSQL文を完成させ(ステップ332)、このSQL文を図19の初期化処理でオープンしたデータベースに対して実行する(ステップ333)。
【0156】
次に、検索データ有りかを調べる(ステップ334)。ここで、検索データが有ると(ステップ334でYES)、次に、最大件数以下かを調べる(ステップ335)。ここで、最大件数以下であると判断されると(ステップ335でYES)、SQL文の実行により得たデータを元に、ダウンロード先頭タグから図8に示したダウンロード割当てテーブルの内容に従ってデータを書き込む(ステップ336)。
【0157】
次に、結果通知タグに「正常ダウンロード完」のコードを書き込み(ステップ337)、このデータダウンロード処理を終了する。
【0158】
なお、ステップ334で、検索データ無しと判断された場合は(ステップ334でNO)、結果通知タグに「データなし」のコードを書き込み、このデータダウンロード処理を終了する。
【0159】
また、ステップ335で、最大件数を越えると判断された場合は(ステップ335でNO)、結果通知タグに「データオーバ」のコードを書き込み(ステップ339)、このデータダウンロード処理を終了する。なお、この場合の処理としては、エラー措置で終了するか、MAXまでダウンロードするか等の選択肢がある。
【0160】
図21は、タグダウンロードの場合に用いるテーブルの一例を示した図である。
【0161】
タグダウンロードの場合には、図8に示したデータダウンロード機能用のテーブルに加えて、タグダウンロードテーブル(アクション種別ごとのテーブル)124−6およびタグダウンロード割当てテーブル124−7が用いられる。
【0162】
ここで、タグダウンロードテーブル(アクション種別ごとのテーブル)124−6は、アクションIDに対してデータベース名、テーブル名、結果通知タグが対応して記憶されるテーブルである。
【0163】
すなわち、図21に示すタグダウンロードテーブル(アクション種別ごとのテーブル)124−6においては、アクションID「300」に対してデータベース名「DB1」、テーブル名「TB1」、結果通知タグ「AnsTag」が設定されていることを示している。
【0164】
また、タグダウンロード割当てテーブル124−7は、アクションIDに対して割当てタグ、種別、サイズ、値が対応して記憶されるテーブルである。
【0165】
すなわち、図21のタグダウンロード割当てテーブル124−7においては、アクションID「300」に対して割当てタグ「タグ1」、種別「DB」、サイズ「2」、値が「DB(Field3)」に設定され、アクションID「300」に対して割当てタグ「タグ2」、種別「定数」、サイズ「1」、値が「1」に設定され、アクションID「300」に対して割当てタグ「タグ3」、種別「DB」、サイズ「1」、値が「DB(Field1)」に設定されていることを示している。
【0166】
このように、この実施の形態においては、ダウンロード対象機器20であるPLCにネットワーク等を介してデータダウンロード制御装置10を接続するとともに、所定のトリガと関連付けてデータダウンロード制御装置10のデータベース40のデータをダウンロード対象機器20のメモリ22にダウンロードするアクションを設定し、トリガの発生に対応して該トリガに対応する上記アクションを自動実行することによりデータダウンロード制御装置10のデータベース40からダウンロード対象機器20のメモリ22へのデータのダウンロードを行うように構成するとともに上述した構成をとったので、以下のことが可能になる。
【0167】
1)PLCに対してデータをダウンロードする機能をユーザからのパラメータ設定で行なうことができる。
【0168】
2)データベースからの検索はPLC上の値を元に検索できる。
【0169】
3)ダウンロードをした結果、例えば、ダウンロードするデータがなかったなどをPLCから知ることができる。
【0170】
【発明の効果】
以上説明したように、請求項1の発明によれば、データベースに格納されたデータをダウンロード対象機器にダウンロードするデータダウンロード制御方法において、上記データベースから上記ダウンロード対象機器へのデータのダウンロードのタイミングを示すトリガに関連付けて該ダウンロードを行うアクションを設定し、上記トリガの発生に対応して該トリガに対応するアクションを自動実行することにより上記データベースから上記ダウンロード対象機器へのデータのダウンロードを行うように構成したので、データベースに格納されたデータを所定のトリガの発生に対応してダウンロード対象機器へ自動的にダウンロードする機能を低開発コストで実現できることが可能になる。
【0171】
また、請求項2記載の発明においては、データベースに格納されたデータをダウンロード対象機器にダウンロードするデータダウンロード制御装置において、上記データベースから上記ダウンロード対象機器へのデータのダウンロードのタイミングを示すトリガを設定するトリガ設定手段と、上記データベースから上記ダウンロード対象機器へのデータのダウンロードのアクションを設定するアクション設定手段と、上記トリガ設定手段で設定したトリガに対応して前記アクション設定手段で設定したアクションを関連付けることによりジョブを設定するジョブ設定手段と、上記トリガ設定手段で設定したトリガの発生に対応して上記ジョブ設定手段で関連付けられたアクションを実行する制御手段と、を具備して構成したので、データベースに格納されたデータを所定のトリガの発生に対応してダウンロード対象機器へ自動的にダウンロードする機能を低開発コストで実現できることが可能になるデータダウンロード制御装置を提供することができる。
【0172】
また、請求項3記載の発明においては、データベースに格納されたデータをダウンロード対象機器にダウンロードするプログラムが格納された記録媒体において、上記データベースから上記ダウンロード対象機器へのデータのダウンロードのタイミングを示すトリガを設定するトリガ設定手段と、上記データベースから上記ダウンロード対象機器へのデータのダウンロードのアクションを設定するアクション設定手段と、上記トリガ設定手段で設定したトリガに対応して前記アクション設定手段で設定したアクションを関連付けることによりジョブを設定するジョブ設定手段と、上記トリガ設定手段で設定したトリガの発生に対応して上記ジョブ設定手段で関連付けられたアクションを実行する制御手段と、を具備して構成したので、同じくデータベースに格納されたデータを所定のトリガの発生に対応してダウンロード対象機器へ自動的にダウンロードする機能を低開発コストで実現できることが可能になるデータダウンロード制御装置を提供することができる。
【図面の簡単な説明】
【図1】この発明に係るデータダウンロード制御方法、データダウンロード制御装置及びそれらの記録媒体を適用して構成したデータダウンロード制御システムの一実施の形態を示すシステム構成図。
【図2】図1に示したデータダウンロードシステムの具体的動作例を示した図。
【図3】図2に示したデータダウンロード制御装置の詳細構成を示すブロック図。
【図4】図2に示したデータダウンロード制御装置の詳細動作を示す機能ブロック図。
【図5】図4に示したジョブ設定データベース(ジョブ設定DB)の一例を示す図。
【図6】図4に示したトリガ設定データベース(トリガ設定DB)の一例を示す図。
【図7】図4に示したアクション設定データベース(アクション設定DB)の一例を示す図。
【図8】図4に示した構成においてデータダウンロード機能を実現するためのデータダウンロード機能用のテーブルを示す図。
【図9】図4に示したトリガ設定部の処理を示すフローチャート。
【図10】図9に示した処理で選択された種別ごとのトリガ設定プログラムにより実行される処理の一例を示すフローチャート。
【図11】図4に示したアクション設定部の処理を示すフローチャート。
【図12】図11に示した処理で選択された種別ごとのアクション設定プログラムにより実行される処理の一例を示すフローチャート。
【図13】図4に示したジョブ設定部の処理を示すフローチャート。
【図14】図4に示したトリガ起動部による起動処理を示すフローチャート。
【図15】図14に示した処理により起動された各トリガごとの実行プログラムによる処理を示すフローチャート。
【図16】図4に示したフローコントロール部の処理を示すフローチャート。
【図17】図14の処理により起動した各アクション種別ごとの実行プログラム初期化処理を示すフローチャート。
【図18】図4に示したエリアダウンロードアクション設定プログラムによる処理を示すフローチャート。
【図19】図4に示したダウンロードアクション実行プログラム初期化処理を示すフローチャート。
【図20】図19に示したデータダウンロード処理の詳細を示すフローチャート。
【図21】タグダウンロードの場合に用いるテーブルの一例を示した図。
【符号の説明】
10 データダウンロード制御装置
11 装置設定ツール
12 設定テーブル
13 タグ設定ツール
14 タグデータベース
15 サービス処理部
16 制御モジュール
17 トリガモジュール
18 アクションモジュール
20 ダウンロード対象機器
20−1、20−2 PLC(プログラマブルロジックコントローラ)
40 データベース
50 ユーザアプリケーション
60 ゲートウエイ
111 トリガ設定部
112 ジョブ設定部
113 アクション設定部
121 トリガ設定データベース(トリガ設定DB)
121−1 トリガテーブル
121−2 トリガプログラム情報テーブル
121−3 トリガ種別ごとのテーブル
122 ジョブ設定データベース(ジョブ設定DB)
122−1 ジョブテーブル
123 アクション設定データベース(アクション設定DB)
123−1 アクションテーブル
123−2 アクションプログラム情報テーブル
123−3 アクション種別ごとのテーブル
124 データダウンロード機能用のテーブル
124−1 タグテーブル
124−2 エリアダウンロードテーブル(アクション種別ごとのテーブル)
124−3 検索テーブル
124−4 ソートテーブル
124−5 ダウンロード割当てテーブル
142−6 タグダウンロードテーブル(アクション種別ごとのテーブル)
124−7 タグダウンロード割当てテーブル
151 トリガ起動部
151−1 トリガ種別1設定プログラム
151−2 トリガ種別2設定プログラム
151−3 トリガ種別3設定プログラム
152 フローコントロール部
152−1 エリアダウンロードアクション設定プログラム
152−2 アクション種別2設定プログラム
152−3 アクション種別3設定プログラム
153−1 トリガ種別1実行プログラム
153−2 トリガ種別2実行プログラム
153−3 トリガ種別3実行プログラム
153−4 トリガ種別4実行プログラム
154−1 エリアダウンロード実行プログラム
154−2 アクション種別2実行プログラム
154−3 アクション種別3実行プログラム
154−4 アクション種別4実行プログラム
[0001]
TECHNICAL FIELD OF THE INVENTION
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data download control method, a data download control device, and a recording medium thereof, and more particularly, to a device to be downloaded such as a PLC (programmable logic controller) in response to generation of a predetermined trigger for data stored in a database The present invention relates to a data download control method, a data download control device, and a recording medium for automatically downloading data to a data download control device.
[0002]
[Prior art]
In recent FA (factory automation) applications, when "something necessary timing" occurs, it is often constructed in such a way that "processing corresponding to it" is executed.
[0003]
For example,
1) Every time a predetermined time elapses, PLC data is collected in a form specified by the user and stored in a database.
2) When production by the PLC is started, necessary data such as recipe data, master data, and work instructions are searched and downloaded to the PLC.
The application is built in the form.
[0004]
[Problems to be solved by the invention]
However, the programming of the above-mentioned application is performed such that when "a necessary timing" occurs, that is, when a trigger occurs, a "corresponding process" is executed, that is, an action is executed. Programming is performed separately for each trigger type and each action type, and in this type of programming, it is often required to cooperate with other user applications. There has been a problem that the development cost is high and that it takes time to deal with the processing change.
[0005]
Therefore, the present invention provides a data download control method and a data download control which can realize, at a low development cost, a function of automatically downloading data stored in a database to a download target device in response to occurrence of a predetermined trigger. It is an object to provide devices and their recording media.
[0007]
In order to achieve the above object, the present invention provides In a data download control device for downloading data stored in a database to a download target device, a trigger indicating a timing of downloading data from the database to the download target device. The trigger ID, the trigger name, and the trigger type ID indicating the type of trigger are set in association with each other, and the trigger type execution program for generating the trigger is set in association with the trigger type ID. Set , Trigger setting means and an action for downloading data from the database to the download target device The action ID, the action name, and the action type ID indicating the action type are set in association with each other, and the action type execution program for executing the download action is set in association with the action type ID. Conditions for searching the target data from the database Set , Action setting means, job setting means for setting a job by associating the action ID set by the action setting means with the trigger ID set by the trigger setting means, and setting by the trigger setting means Trigger is generated by activating and executing a trigger type execution program corresponding to the trigger type ID of the trigger, and an event notification in which a trigger ID corresponding to the trigger type ID of the trigger type execution program is added by the occurrence of the trigger And during this event notification Trigger ID associated with the job setting means Action ID Corresponding to the action type ID of Action type execution program Automatically execute Thereby, an SQL sentence is created based on the stored search condition, the database is searched using the created SQL sentence, and data of a search result is downloaded from the database to the download target device. And a control means.
[0009]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, an embodiment of a data download control method, a data download control device, and a recording medium thereof according to the present invention will be described in detail with reference to the accompanying drawings.
[0010]
FIG. 1 is a system configuration diagram showing an embodiment of a data download control method, a data download control device, and a data download control system configured by applying a recording medium thereof according to the present invention.
[0011]
In FIG. 1, this data download control system connects a data download control device 10 to a download target device 20 via a network or the like, and associates a data in a database 40 of the data download control device 10 with a predetermined trigger. An action to be downloaded is set in the memory 22 of the device 20, and the action corresponding to the trigger is automatically executed in response to the generation of the trigger, so that the data is downloaded from the database 40 of the data download control device 10 to the memory 22 of the device 20 to be downloaded. Is configured to download data.
[0012]
Here, the data download control device 10 includes an FA personal computer (personal computer) 100, and the trigger and action are set by the FA personal computer 100.
[0013]
The download target device 20 is configured by, for example, a PLC 21, and the memory 22 is configured as a memory that stores various data related to control of the PLC 21.
[0014]
The memory 22 has a variable area name DM, an offset of 10 ch, and a maximum number of records set to, for example, 20 records 1 to 20.
[0015]
Downloading of data from the database 40 of the data download control device 10 to the memory 22 of the download target device 20 is performed using an offset tag described in detail below.
[0016]
FIG. 2 is a diagram showing a specific operation example of the data download system shown in FIG.
[0017]
In FIG. 2, the database 40 of the data download control device 10 includes a recipe database that stores recipe data of the download target device 20.
[0018]
Here, the database 40 including the recipe database stores a product type table, and the product type table stores the materials and processes corresponding to the product types produced by the download target device 20.
[0019]
For example, for the type “1”, the material “A”, the process “1”, the material “B”, and the process “2” are stored in association with each other, and for the type “2”, the material “A” is stored. A, process "2", material "C", process "3", material "F", process "2" are stored in association with each other, and for product type "3", material "X", The process “1” is stored in association with the process.
[0020]
The head tag name “head material” (DM0010) of the target device area of the memory 22 of the download target device 20 includes the DB (material) A downloaded from the database 12 of the data download control device 10 and the tag “current value”. , DB (process): 1, constant: 0, DB (material) B, tag “current value”, DB (process): 2, constant: 0,.
[0021]
That is, the data downloaded from the database 40 of the data download control device 10 is allocated to the target device area of the memory 22 of the download target device 20 under the following conditions.
[0022]
Record sequence 1: DB field (material)
Record sequence 2: Tag "current value"
Record arrangement 3: DB field (processing)
Record arrangement 4: Constant (0)
MAX records: 20
If there is more than MAX: Download up to MAX
[0023]
FIG. 3 is a block diagram showing a detailed configuration of the data download control device shown in FIG.
[0024]
3, the data download control device 10 includes a device setting tool 11 for performing various settings for the data download control device 10, a setting table 12 for storing setting contents set by the device setting tool 11, and a data download control device 10. A tag setting tool 13 for setting a tag for data transfer by a tag, a tag database 14 for storing tags set by the tag setting tool 13, and a service processing unit 15 for executing a data flow control service by the data download control device 10. It is configured with.
[0025]
Here, the service processing unit 15 includes a control module 16 for executing data flow control by the data download control device 10, a trigger module 17 for generating various triggers, and an action module 18 for executing various actions. .
[0026]
Further, a command such as data collection start and stop is notified from the user application 50 to the control module 16 of the service processing unit 15, and a command such as generation of a trigger is notified from the user application 50 to the trigger module 17. The action module 18 notifies the user application 50 of the application (application notification).
[0027]
The action module 18 sends and receives data to and from the user data file 40.
[0028]
The service processing unit 15 transmits and receives data to and from the plurality of PLCs 20-1 and 20-2 via the gateway 60.
[0029]
Here, the service by the service processing unit 15 realizes a data logging process, a download process, and the like. That is, when a certain trigger occurs, the service processing unit 15 executes an action corresponding to the trigger. This
1) Store the data of the PLCs 20-1 and 20-2 in the user data file 40
2) Search the database created by the user under specified conditions, and write the results to the PLCs 20-1 and 20-2.
3) Notify the user application 50 as an action when a trigger occurs
And so on.
[0030]
In addition, the device setting tool 11
1) Registration of setting data required for service of service processing unit 15
2) Starting and stopping the service of the service processing unit 15
3) Registration, start, and end of a job, which is a unit of a trigger and an action (work) to be logged at that time
And other functions.
[0031]
In addition, the tag setting tool 13
1) Setting tags for the variable area of the target device
2) Setting of event memory mapping with target device
And other functions.
[0032]
The tag database 14 is a database that stores tag information set by the tag setting tool 13.
[0033]
The setting table 12 is a database that stores a collection of data necessary for executing the service of the service processing unit 15.
[0034]
The user data file 40 is a database in which data for actually logging data is stored or a database in which data to be downloaded is stored. The table configuration (schema) of this database can be designed and created by the user.
[0035]
FIG. 4 is a functional block diagram showing a detailed operation of the data download control device shown in FIG.
[0036]
4, the trigger setting unit 111 executes a trigger type setting program, that is, a trigger type 1 setting program 151-1, a trigger type 2 setting program 151-2, and a trigger type 3 setting program 151-3. Is set in the trigger setting database (trigger setting DB) 121.
[0037]
The job setting unit 112 sets a job in which a trigger and an action are associated with each other in a job setting database (job setting DB) 122.
[0038]
The action setting unit 113 executes an action type setting program, that is, an area download action setting program 152-1, an action type 2 setting program 152-2, and an action type 3 setting program 152-3, and stores the results in an action setting database. (Action setting DB) 123 is set.
[0039]
The trigger starting unit 151 reads the trigger set in the trigger setting database (trigger setting DB) 121 and the job set in the job setting database (job setting DB) 122, and executes an execution program of the trigger type, that is, execution of the trigger type 1 The start / stop command is notified to the program 153-1, the trigger type 2 execution program 153-2, the trigger type 3 execution program 153-3, and the trigger type 3 execution program 153-4.
[0040]
When an event occurs due to execution of the trigger type 1 execution program 153-1, the trigger type 2 execution program 153-2, the trigger type 3 execution program 153-3, and the trigger type 3 execution program 153-4, the event is transmitted to the flow control unit. 152 is notified.
[0041]
The flow control unit 152 that executes the event reads the action set in the action setting database (action setting DB) 123 and the job set in the job setting database (job setting DB) 122, and executes the execution program of the action type, that is, The execution instruction is notified to the area download execution program 154-1, the action type 2 execution program 154-2, the action type 3 execution program 154-3, and the action type 4 execution program 154-4.
[0042]
FIG. 5 is a diagram showing an example of the job setting database (job setting DB) shown in FIG.
[0043]
In FIG. 5, a job setting database (job setting DB) 122 includes a job table 122-1.
[0044]
The job table 122-1 shown in FIG. 5 is a table in which an action ID is stored in correspondence with a trigger ID.
[0045]
That is, in the job table 122-1 shown in FIG. 5, the action ID "200" is set for the trigger ID "100", the action ID "210" is set for the trigger ID "100", and the trigger ID This indicates that the action ID “230” is set for “110”.
[0046]
FIG. 6 is a diagram showing an example of the trigger setting database (trigger setting DB) shown in FIG.
[0047]
6, the trigger setting database (trigger setting DB) 121 includes a trigger table 121-1, a trigger program information table 121-2, and a table 121-3 for each trigger type.
[0048]
The trigger table 121-1 shown in FIG. 6 is a table in which a trigger name and a trigger type ID are stored in association with a trigger ID.
[0049]
That is, in the trigger table 121-1 shown in FIG. 6, the trigger name “every 30 seconds” and the trigger type ID “1” are set for the trigger ID “100”, and the trigger name “110” is set for the trigger ID “110”. This indicates that “production start” and the trigger type ID “3” are set.
[0050]
The trigger program information table 121-2 shown in FIG. 6 is a table in which a trigger type name, a setting program, and an execution program are stored in correspondence with a trigger type ID.
[0051]
That is, in the trigger program information table 121-2 shown in FIG. 6, for the trigger type ID "1", the trigger type name "fixed period", the setting program "SetCyclic", and the execution program "CyclicExec" are set. The trigger type name “specified time”, the setting program “SetTime”, and the execution program “TimeExe” are set for the ID “2”, and the trigger type name “condition match” and the setting program “ SetTag ”and the execution program“ TagExe ”are set.
[0052]
Further, a table 121-3 for each trigger type shown in FIG. 6 is a table for a fixed period trigger, and is a table in which a fixed period is stored in correspondence with a trigger ID.
[0053]
That is, in the table 121-3 for each trigger type shown in FIG. 6, the fixed period “0: 0: 30” is set for the trigger ID “100”, and the fixed period “0” is set for the trigger ID “101”. : 1: 0 "is set.
[0054]
FIG. 7 is a diagram showing an example of the action setting database (action setting DB) shown in FIG.
[0055]
7, the action setting database (action setting DB) 123 includes an action table 123-1, an action program information table 123-2, and a table 123-3 for each action type.
[0056]
The action table 123-1 shown in FIG. 7 is a table in which an action name and an action type ID are stored in association with the action ID.
[0057]
That is, in the action table 123-1 shown in FIG. 7, the action name “Result data collection” and the action type ID “1” are set for the action ID “200”, and the action name “210” is set for the action ID “210”. "Facility abnormality", action type ID "1" are set, and action name "instruction download" and action type ID "3" are set for action ID "230".
[0058]
The trigger program information table 123-2 illustrated in FIG. 7 is a table in which an action type name, a setting program, and an execution program are stored in association with an action type ID.
[0059]
That is, in the action program information table 123-2 shown in FIG. 7, an action type name "data collection (file)", a setting program "SetCollectFile", and an execution program "CollectFileExec" are set for the action type ID "1". For the action type ID "2", the action type name "Data collection (DB)", the setting program "SetCollectDB", and the execution program "CollectDBExe" are set, and for the action type ID "3", the action type name "Data". "Download", a setting program "SetDownLoadFile", and an execution program "DownLoadFileExe" are set.
[0060]
Further, a table 123-3 for each action type shown in FIG. 7 shows a table for data collection, and is a table in which a data collection file and a collection content are stored in correspondence with an action ID.
[0061]
That is, the table 123-3 for each action type shown in FIG. 7 indicates that the data collection file "Collect1.log" is set for the action ID "200".
[0062]
This data download control device has a table for a data download function for realizing the data download function, in addition to the tables shown in FIGS.
[0063]
FIG. 8 is a diagram showing a data download function table for implementing the data download function in the configuration shown in FIG.
[0064]
8, a table 124 for the data download function includes a tag table 124-1, an area download table (table for each action type) 124-2, a search table 124-3, a sort table 124-4, and a download allocation table 124-. 5 is provided.
[0065]
Here, the tag table 124-1 is a table in which a network number, a node number, a remote area, an offset, the number of channels, and a data type are stored in association with a tag name.
[0066]
That is, in the tag table 124-1 shown in FIG. 8, the network number "2", the node number "3", the remote area "DM", the offset "700", the number of channels "10" for the tag name "tag 1". "Indicates that the data type" BCD "has been set.
[0067]
The area download table (table for each action type) 124-2 is a table in which a database name, a table name, a download head tag, a record size, and a result notification tag are stored in correspondence with the action ID.
[0068]
That is, in the area download table (table for each action type) 124-2 shown in FIG. 8, a database name "DB1", a table name "TB1", a download head tag "AreaDown1", a record for an action ID "300" This indicates that the size “10” and the result notification tag “AnsTag” are set.
[0069]
The search table 124-3 is a table in which a search order, a field name, a symbol, a type, a value, and a connection condition are stored in correspondence with an action ID.
[0070]
That is, in the search table 124-3 shown in FIG. 8, for the action ID "300", the search order "1", the field name "Field1", the symbol ">", the type "constant", the value "10", the connection The condition “AND” is set, and the search order “2”, the field name “Field2”, the symbol “=”, the type “tag name”, the value “Tag1”, and the connection condition “END” are set for the action ID “300”. Indicates that it has been set.
[0071]
The sort table 124-4 is a table in which a search order, a field name, and a symbol are stored in association with an action ID.
[0072]
That is, in the sort table 124-4 shown in FIG. 8, a search order "1", a field name "Field1", and a symbol "descending order" are set for the action ID "300", and the action ID "300" is set for the action ID "300". This indicates that the search order “2”, the field name “Field2”, and the symbol “ascending order” are set.
[0073]
In addition, the download assignment table 124-5 is a table in which the assignment order, type, size, and value are stored in association with the action ID.
[0074]
That is, in the download allocation table 124-5 shown in FIG. 8, the allocation order "1", type "DB", size "2", and value "DB (Field3)" are set for the action ID "300". Assignment order “2”, type “constant”, size “1”, value “1” are set for action ID “300”, and assignment order “3”, type “DB” for action ID “300”. , Size “1”, and value “DB (Field 1)” are set.
[0075]
In the data download control system of this embodiment, the following SQL statement is created from the data download function table 124 shown in FIG.
[0076]
SELECT Field3, Field1 FROM DB1. TB1
WHERE Field1> 10 AND Field2 = Tag (Tag1)
ORDER BY Field1, Field2 DESC;
[0077]
In the area download execution program,
1) Open the database DB1 and execute the above SQL
2) However, immediately before the execution, the tag value of the WHERE sentence is read from the PLC and reflected in the SQL sentence.
3) Write the following values from the beginning of writing to the area based on the search result. The value of Field3, the value of constant 1, and the value of Field1 are downloaded for the records.
[0078]
Here, the SQL (Structured Query Language) sentence is a standard language for operating a relational database, and the standard is set by ISO / TC97 / SC5 / WG15, JIS, and the like. By using an SQL statement, operations such as addition, change, and deletion of data can be performed in the same manner for different database management systems.
[0079]
For a database search,
SELECT field 1, field 2, field 3 FROM table name
WHERE field a = (or other symbol) value 1, field b = value 2, ...
ORDER BY field x, field y;
Thus, data matching the WHERE condition can be retrieved from the FROM table, and the data in the field after SELECT as a result can be sorted and obtained by ORDER BY.
[0080]
The structure of the SQL statement in the case of addition to the database is as follows.
[0081]
INSERT INTO [table name] (field 1, field 2, ...)
VALUES (value1, value2, ...)
[0082]
Here, [table name] represents a table name to which data is to be added, and field 1, field 2,... Represent field names to which data is added in the table. Also, the values 1, 2,... After VALUES indicate the values of the data to be actually stored corresponding to the previous field names.
[0083]
The structure of the SQL statement in the case of updating to the database is as follows.
[0084]
UPDATE [table name] SET (field A = value a, field B = value b ...)
WHERE (field X = value x AND field Y = value y ...)
[0085]
Here, [table name] represents a table name for which data is to be updated, and field A, field B... Represent field names for updating data in the table. The values a and b indicate the values to be updated. The field X = value x AND field Y = value y... After the WHERE describes a condition for specifying which record in the table is to be updated.
[0086]
FIG. 9 is a flowchart showing the processing of the trigger setting unit shown in FIG.
[0087]
In FIG. 9, when the processing of the trigger setting unit 111 shown in FIG. 4 is started, first, the user selects one of the trigger type names registered in the trigger program information table 121-2 shown in FIG. (Step 201).
[0088]
Then, a setting program corresponding to the registered trigger type name is executed (Step 202). Then, the process of the job setting unit 111 ends.
[0089]
FIG. 10 is a flowchart showing an example of a process executed by the trigger setting program for each type selected in the process shown in FIG.
[0090]
The process shown in FIG. 10 indicates a process executed by the setting program when the trigger type is “fixed period”.
[0091]
In FIG. 10, when this processing is started, first, a trigger name is input (step 211). Next, an interval to be generated at a fixed period is input (step 212).
[0092]
Then, the trigger table 121-1 shown in FIG. 6 is set (step 213). Here, the trigger name is set to the name of the trigger input in this program, that is, the trigger name input in step 211, the trigger ID is generated by generating a unique ID, and the trigger type is set to a fixed period. It is set to the type ID that represents.
[0093]
Next, a table (periodic trigger table) 121-3 for each trigger type shown in FIG. 6 is set (step 214). Here, the trigger ID is set to the same ID as the trigger ID set in the trigger table 121-1, that is, the same ID as the ID set in step 213, and the fixed cycle is the value of the fixed cycle input in step 212. Is set. After that, this processing ends.
[0094]
FIG. 11 is a flowchart showing the processing of the action setting unit shown in FIG.
[0095]
11, when the process of the action setting unit 113 shown in FIG. 4 is started, first, the user selects one of the action type names registered in the action program information table 123-2 shown in FIG. (Step 221).
[0096]
Then, a setting program corresponding to the registered action type name is executed (step 202). Then, the process of the action setting unit 113 ends.
[0097]
FIG. 12 is a flowchart illustrating an example of a process executed by the action setting program for each type selected in the process illustrated in FIG.
[0098]
Note that the processing illustrated in FIG. 12 indicates processing executed by the setting program when the action type is “collect”.
[0099]
In FIG. 12, when this processing is started, first, an action name is input (step 231). Next, information necessary for data collection is input (step 232).
[0100]
Then, the action table 123-1 shown in FIG. 7 is set (step 233). Here, the action name is set to the name of the action input in this program, that is, the action name input in step 231, the action ID is set by generating a unique ID, and the action type represents collection. Set to the type ID.
[0101]
Next, a table (data collection table) 123-3 for each action type shown in FIG. 7 is set (step 234). Here, the action ID is set to the same ID as the trigger ID set in the action table 123-1, that is, the same ID as the ID set in step 233. The file name is set to the file name for data collection. The collection format sets which data is collected and how. After that, this processing ends.
[0102]
FIG. 13 is a flowchart showing the processing of the job setting unit shown in FIG. 13, when the process of the job setting unit 112 shown in FIG. 4 is started, first, a list of triggers registered in the trigger table 121-1 shown in FIG. 6 is displayed and generated therein. A trigger is selected (step 241).
[0103]
Next, a list of actions registered in the action table 123-1 shown in FIG. 7 is displayed, and an action to be executed when the previously selected trigger occurs is selected from the list (step 242).
[0104]
Then, each ID of the selected combination of the trigger and the action is registered in the job table 122-1 shown in FIG. 5 (step 243), and the processing of the job setting unit 112 is ended.
[0105]
FIG. 14 is a flowchart illustrating the activation process by the trigger activation unit illustrated in FIG.
[0106]
In the activation process shown in FIG. 14, first, the trigger ID of the job registered in the job table 122-1 shown in FIG. 5 is obtained (step 251).
[0107]
Next, the trigger ID is searched from the job table 122-1 shown in FIG. 5, and the trigger type is known (step 252).
[0108]
Then, an execution program corresponding to the trigger type is searched from the trigger program information table 121-2 shown in FIG. 6, and the corresponding execution program is started. At this time, a trigger ID is passed as a start parameter of the execution program (step 253).
[0109]
Next, it is checked whether or not all jobs have been completed (step 254). If not all jobs have been completed (NO in step 254), the process returns to step 251. If it is determined that all jobs have been completed, (YES in step 254), and proceeds to step 255.
[0110]
In step 255, a job action ID registered in the job table 122-1 shown in FIG. 5 is obtained.
[0111]
Then, the action ID is retrieved from the action table 123-1 shown in FIG. 7 to know the action type (step 256).
[0112]
Next, an execution program corresponding to the action type is searched from the action program information table 123-2 shown in FIG. 7, and the corresponding execution program is started. At this time, an action ID is passed as a start parameter of the execution program (step 257).
[0113]
Then, it is checked whether or not all the jobs have been completed (step 258). If not all the jobs have been completed (NO in step 258), the process returns to step 255, but if it is determined that all the jobs have been completed, (YES in step 258), and ends this process.
[0114]
FIG. 15 is a flowchart showing the processing by the execution program for each trigger activated by the processing shown in FIG.
[0115]
In FIG. 15, when this processing is started, the trigger ID passed at the time of activation is first increased, and the table 121-3 for each trigger type shown in FIG. A setting table is searched (step 261).
[0116]
Then, the setting contents for each type corresponding to the searched trigger ID are acquired (step 261). Here, the setting content for each type corresponding to the acquired trigger ID is, for example, an interval at which a trigger is generated at a fixed cycle in the fixed cycle trigger table.
[0117]
Next, preparations are made for generating a trigger based on the acquired information (step 263). Here, the preparation for generating a trigger based on the acquired information means that, for example, when the trigger type is a fixed period, a timer for generating a trigger is started for each period.
[0118]
Then, upon recognizing that the trigger has occurred, for example, when a timer interrupt occurs at a fixed period with a fixed period trigger, an event notification is performed to the flow control unit 152 shown in FIG. In this event notification, a trigger ID is added and notified (step 264).
[0119]
Next, it is determined whether or not to end the processing (step 265). If not (NO in step 264), the process returns to step 263. If it is determined that the processing is ended (YES in step 265), the processing ends. .
[0120]
FIG. 16 is a flowchart showing the processing of the flow control unit shown in FIG.
[0121]
In FIG. 16, when the process of the flow control unit 152 shown in FIG. 4 is started, first, it waits for event reception (step 271).
[0122]
Then, it is checked whether an event has been received (step 272). Here, if it is determined that the event is not received (NO in step 272), the process returns to step 271. If it is determined that the event is received (YES in step 272), the process returns to FIG. 5 based on the passed trigger ID. The job table 122-1 is searched to obtain a corresponding job ID (step 274).
[0123]
Then, the occurrence of the trigger is notified to the action execution program for each action ID activated in the activation process shown in FIG. 14 (step 275).
[0124]
Next, it is determined whether or not to end the processing (step 276). If it is determined that the processing is not to be ended (NO in step 276), the process returns to step 271. If it is determined that the processing is to be ended (YES in step 276), The process ends.
[0125]
FIG. 17 is a flowchart showing the execution program initialization process for each action type started by the process of FIG.
[0126]
In FIG. 17, when this process is started, first, the action ID passed at the time of activation is used to set the table 123-3 for each action shown in FIG. 7, that is, for example, the setting for each action consisting of a data collection action table. The table is searched (step 281).
[0127]
Next, the setting contents for each type corresponding to the searched action ID, for example, the information of the collection file name and the collection format are acquired from the data collection action table (step 282).
[0128]
Then, processing for each type is performed (step 283). For example, in data collection, processing such as opening a specified data collection file is performed.
[0129]
In this state, when the occurrence of a trigger is notified from the flow control unit 152 shown in FIG. 4, execution processing specific to the action type such as data collection is performed according to the set contents (step 284).
[0130]
Next, it is determined whether or not to end the processing (step 285). If it is determined that the processing is not to be ended (NO in step 285), the process returns to step 284. If it is determined that the processing is to be ended (YES in step 285), The process ends.
[0131]
FIG. 18 is a flowchart showing processing by the area download action setting program shown in FIG.
[0132]
In FIG. 18, when the processing by the area download action setting program is started, first, an action name related to the area download action setting program is input (step 301).
[0133]
Next, database information of the download source is input (step 302). Enter the database information of this download source,
1) Database name
2) Table name
Is performed by inputting.
[0134]
Then, feed information, that is, feed name, type, size, and the like are obtained from the input database table (step 303).
[0135]
Next, search conditions are input (step 304). This search condition is input by inputting the following information from the above fields.
[0136]
1) Feed name used for search
2) Symbol to compare feed and value
3) Value type
4) Value
5) Symbols connecting search expressions
[0137]
Next, a sort condition is input (step 305). The input of this sort condition is performed by inputting the following information from the above fields.
[0138]
1) Field name used for sorting
2) Select descending or ascending order
[0139]
Next, the download destination common condition is input (step 306). The input of the download destination common condition is performed by inputting the following information.
[0140]
1) Download destination tag name
2) Maximum record size
3) Result notification destination tag
[0141]
Next, a download destination record format is input (step 307). The input of the download destination record format is performed by inputting information of a field or less in one record of the download destination.
[0142]
1) Area field number
2) Area field type
3) Value
[0143]
Next, the following information is set in the download table (step 308).
[0144]
1) Action name: Name entered in this program
2) Action ID: Generate unique ID
3) Action type ID: Type ID indicating area download
[0145]
Next, database information of the download source is input (step 309). The database information of the download source is input by setting the following information in the area download table 124-2 shown in FIG. 8 based on the input of the download destination common condition in step 307.
[0146]
1) Action ID: The same ID as the ID in the action table 123-1 shown in FIG.
[0147]
Next, the search table 104-3 shown in FIG. 8 is set based on the search condition input in step 304 (step 310), and the sort table 124-4 shown in FIG. 8 is set based on the sort condition input in step 305. (Step 311) Based on the input of the download destination record format in Step 307, the download allocation table 124-5 shown in FIG. 8 is set (Step 312), and then this processing ends.
[0148]
FIG. 19 is a flowchart showing the download action execution program initialization processing shown in FIG.
[0149]
In FIG. 19, when the initialization processing of the area download execution program 154-1 shown in FIG. 4 is started, first, the area download table 124-2 shown in FIG. The data is obtained by searching the table 124-3, the sort table 124-4, and the download allocation table 124-5 (step 321).
[0150]
Next, the database is opened from the data source name (step 322).
[0151]
Then, an SQL statement is created from the acquired data (step 323), and a trigger is awaited (step 324).
[0152]
Next, a data download process is executed (step 325). Then, it is checked whether the data download processing has been completed (step 325). If it is determined that the data download processing has not been completed (NO in step 325), the process returns to step 325 and the data download processing is continued. If it is determined that the download processing has been completed (YES in step 326), the download action execution program initialization processing ends.
[0153]
FIG. 20 is a flowchart showing details of the data download processing shown in FIG.
[0154]
In FIG. 20, when the data download processing is started, first, if there is a tag name item in the WHERE statement in the SQL statement, the data of the variable area of the PLC corresponding to the tag name is acquired ( Step 332).
[0155]
Then, an SQL statement is completed based on the acquired data (step 332), and the SQL statement is executed on the database opened in the initialization process of FIG. 19 (step 333).
[0156]
Next, it is checked whether or not there is search data (step 334). If there is search data (YES in step 334), it is next checked whether the number is equal to or less than the maximum number (step 335). Here, if it is determined that the number is equal to or less than the maximum number (YES in step 335), the data is written from the download head tag according to the contents of the download allocation table shown in FIG. 8 based on the data obtained by executing the SQL statement. (Step 336).
[0157]
Next, the code of "normal download completed" is written into the result notification tag (step 337), and the data download process ends.
[0158]
If it is determined in step 334 that there is no search data (NO in step 334), a code of “no data” is written in the result notification tag, and the data download process ends.
[0159]
If it is determined in step 335 that the maximum number is exceeded (NO in step 335), a code of “data over” is written in the result notification tag (step 339), and the data download process ends. In this case, as the processing in this case, there are options such as whether to end with an error measure or to download up to MAX.
[0160]
FIG. 21 is a diagram illustrating an example of a table used for tag download.
[0161]
In the case of tag download, a tag download table (table for each action type) 124-6 and a tag download assignment table 124-7 are used in addition to the data download function table shown in FIG.
[0162]
Here, the tag download table (table for each action type) 124-6 is a table in which a database name, a table name, and a result notification tag are stored in association with the action ID.
[0163]
That is, in the tag download table (table for each action type) 124-6 shown in FIG. 21, the database name "DB1", the table name "TB1", and the result notification tag "AnsTag" are set for the action ID "300". It is shown that it is.
[0164]
The tag download assignment table 124-7 is a table in which an assignment tag, a type, a size, and a value are stored in association with an action ID.
[0165]
That is, in the tag download assignment table 124-7 in FIG. 21, the assignment tag “tag 1”, type “DB”, size “2”, and value are set to “DB (Field 3)” for the action ID “300”. The assigned tag “tag 2”, type “constant”, size “1” and value “1” are set for the action ID “300”, and assigned tag “tag 3” for the action ID “300”. , The type “DB”, the size “1”, and the value are set to “DB (Field 1)”.
[0166]
As described above, in this embodiment, the data download control device 10 is connected to the PLC which is the download target device 20 via a network or the like, and the data in the database 40 of the data download control device 10 is associated with a predetermined trigger. Is set in the memory 22 of the download target device 20, and the above action corresponding to the trigger is automatically executed in response to the occurrence of the trigger, whereby the download target device 20 is downloaded from the database 40 of the data download control device 10. Since the configuration described above is used to download the data to the memory 22, the following is possible.
[0167]
1) The function of downloading data to the PLC can be performed by setting parameters from the user.
[0168]
2) Search from the database can be performed based on the value on the PLC.
[0169]
3) As a result of downloading, for example, there is no data to be downloaded from the PLC.
[0170]
【The invention's effect】
As described above, according to the first aspect of the present invention, in a data download control method for downloading data stored in a database to a download target device, a timing of downloading data from the database to the download target device is indicated. An action for performing the download is set in association with a trigger, and data is downloaded from the database to the download target device by automatically executing an action corresponding to the trigger in response to the occurrence of the trigger. Therefore, a function of automatically downloading data stored in the database to the download target device in response to the occurrence of a predetermined trigger can be realized at low development cost.
[0171]
In the data download control device for downloading data stored in a database to a download target device, a trigger indicating a timing of downloading data from the database to the download target device is set. Trigger setting means, action setting means for setting an action for downloading data from the database to the download target device, and associating the action set by the action setting means in response to the trigger set by the trigger setting means And a control unit for executing an action associated with the job setting unit in response to occurrence of the trigger set by the trigger setting unit. Automatically it is possible to provide a data download control apparatus makes it possible to be realized at a low development cost the ability to download the stored data to the download target device in response to occurrence of a predetermined trigger.
[0172]
According to the third aspect of the present invention, in a recording medium storing a program for downloading data stored in a database to a download target device, a trigger indicating a timing of downloading data from the database to the download target device. Trigger setting means for setting, an action setting means for setting an action of downloading data from the database to the download target device, and an action set by the action setting means corresponding to the trigger set by the trigger setting means. And a control means for executing an action associated with the job setting means in response to occurrence of a trigger set by the trigger setting means. , Also It is possible to provide a data download control apparatus makes it possible to be realized at a low development cost function to automatically download to the download target device and data stored in the database in response to occurrence of a predetermined trigger.
[Brief description of the drawings]
FIG. 1 is a system configuration diagram showing an embodiment of a data download control method, a data download control device, and a data download control system configured by applying a recording medium thereof according to the present invention.
FIG. 2 is a view showing a specific operation example of the data download system shown in FIG. 1;
FIG. 3 is a block diagram showing a detailed configuration of a data download control device shown in FIG. 2;
FIG. 4 is a functional block diagram showing a detailed operation of the data download control device shown in FIG. 2;
FIG. 5 is a view showing an example of a job setting database (job setting DB) shown in FIG. 4;
FIG. 6 is a view showing an example of a trigger setting database (trigger setting DB) shown in FIG. 4;
FIG. 7 is a view showing an example of an action setting database (action setting DB) shown in FIG. 4;
FIG. 8 is a diagram showing a table for a data download function for realizing the data download function in the configuration shown in FIG. 4;
FIG. 9 is a flowchart showing processing of a trigger setting unit shown in FIG. 4;
10 is a flowchart illustrating an example of a process executed by a trigger setting program for each type selected in the process illustrated in FIG. 9;
FIG. 11 is a flowchart showing processing of an action setting unit shown in FIG. 4;
FIG. 12 is a flowchart showing an example of a process executed by an action setting program for each type selected in the process shown in FIG. 11;
FIG. 13 is a flowchart illustrating processing of a job setting unit illustrated in FIG. 4;
FIG. 14 is a flowchart showing activation processing by a trigger activation unit shown in FIG. 4;
FIG. 15 is a flowchart showing processing by an execution program for each trigger activated by the processing shown in FIG. 14;
FIG. 16 is a flowchart showing the processing of the flow control unit shown in FIG. 4;
FIG. 17 is a flowchart showing an execution program initialization process for each action type started by the process of FIG. 14;
FIG. 18 is a flowchart showing processing by an area download action setting program shown in FIG. 4;
FIG. 19 is a flowchart showing a download action execution program initialization process shown in FIG. 4;
FIG. 20 is a flowchart showing details of the data download processing shown in FIG. 19;
FIG. 21 is a diagram showing an example of a table used for tag download.
[Explanation of symbols]
10 Data download control device
11 Device setting tool
12 Setting table
13 Tag setting tool
14 Tag database
15 Service processing unit
16 Control module
17 Trigger module
18 Action Module
20 Download target devices
20-1, 20-2 PLC (Programmable Logic Controller)
40 database
50 User Application
60 Gateway
111 Trigger setting section
112 Job setting section
113 Action setting section
121 Trigger setting database (Trigger setting DB)
121-1 Trigger table
121-2 Trigger program information table
121-3 Table for Each Trigger Type
122 Job Setting Database (Job Setting DB)
122-1 Job table
123 Action Setting Database (Action Setting DB)
123-1 Action table
123-2 Action program information table
123-3 Table for each action type
124 Table for data download function
124-1 Tag table
124-2 Area download table (table for each action type)
124-3 Search Table
124-4 Sort Table
124-5 Download Allocation Table
142-6 Tag Download Table (Table for Each Action Type)
124-7 Tag Download Allocation Table
151 Trigger activation unit
151-1 Trigger type 1 setting program
151-2 Trigger type 2 setting program
151-3 Trigger type 3 setting program
152 Flow control unit
152-1 Area download action setting program
152-2 Action type 2 setting program
152-3 Action type 3 setting program
153-1 Trigger type 1 execution program
153-2 Trigger Type 2 Execution Program
153-3 Trigger Type 3 Execution Program
153-4 Trigger Type 4 Execution Program
154-1 Area download execution program
154-2 Action type 2 execution program
154-3 Action type 3 execution program
154-4 Action type 4 execution program

Claims (1)

データベースに格納されたデータをダウンロード対象機器にダウンロードするデータダウンロード制御装置において、
上記データベースから上記ダウンロード対象機器へデータをダウンロードするタイミングを示すトリガについて、トリガIDとトリガ名とトリガの種類を示すトリガ種別IDとを対応させて設定し、上記トリガを発生させるためのトリガ種別実行プログラムを上記トリガ種別IDに対応させて設定するトリガ設定手段と、
上記データベースから上記ダウンロード対象機器へデータをダウンロードするアクションについて、アクションIDとアクション名とアクションの種類を示すアクション種別IDとを対応させて設定し、上記ダウンロードのアクションを実行するためのアクション種別実行プログラムを上記アクション種別IDに対応させて設定し、ダウンロード対象のデータをデータベースから検索する条件を設定するアクション設定手段と、
上記トリガ設定手段で設定した上記トリガIDに対応して上記アクション設定手段で設定した上記アクションIDを関連付けることによりジョブを設定するジョブ設定手段と、
上記トリガ設定手段で設定した上記トリガのトリガ種別IDに対応したトリガ種別実行プログラムを起動し実行することにより、トリガを発生させ、このトリガの発生によりそのトリガ種別実行プログラムのトリガ種別IDに対応するトリガIDを付加したイベント通知をし、このイベント通知中のトリガIDに対して上記ジョブ設定手段で関連付けられたアクションIDのアクション種別IDに対応したアクション種別実行プログラムを自動実行することにより、上記記憶した検索条件に基づいてSQL文を作成し、作成したSQL文を用いて上記データベースを検索し、該データベースから検索結果のデータを上記ダウンロード対象機器にダウンロードする制御手段と、
を具備することを特徴とするデータダウンロード制御装置。
In a data download control device that downloads data stored in a database to a download target device,
For a trigger indicating the timing of downloading data from the database to the download target device , a trigger ID, a trigger name, and a trigger type ID indicating the type of trigger are set in association with each other, and a trigger type for generating the trigger is executed. the program set corresponding to the trigger type ID, a trigger setting means,
An action type execution program for executing an action of downloading by setting an action ID, an action name, and an action type ID indicating an action type in association with an action of downloading data from the database to the download target device. Corresponding to the action type ID, and setting a condition for searching data to be downloaded from a database , action setting means,
Job setting means for setting a job by associating the action ID set by the action setting means with the trigger ID set by the trigger setting means;
A trigger is generated by activating and executing a trigger type execution program corresponding to the trigger type ID of the trigger set by the trigger setting means, and the generation of the trigger corresponds to the trigger type ID of the trigger type execution program. An event notification to which a trigger ID is added is performed, and the action type execution program corresponding to the action type ID of the action ID associated with the job setting means is automatically executed with respect to the trigger ID in the event notification , whereby the storage is performed. Control means for creating an SQL sentence based on the searched search condition, searching the database using the created SQL sentence, and downloading search result data from the database to the download target device ;
A data download control device comprising:
JP20365398A 1998-07-17 1998-07-17 Data download control method, data download control device, and their recording media Expired - Lifetime JP3580348B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP20365398A JP3580348B2 (en) 1998-07-17 1998-07-17 Data download control method, data download control device, and their recording media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP20365398A JP3580348B2 (en) 1998-07-17 1998-07-17 Data download control method, data download control device, and their recording media

Publications (2)

Publication Number Publication Date
JP2000035812A JP2000035812A (en) 2000-02-02
JP3580348B2 true JP3580348B2 (en) 2004-10-20

Family

ID=16477626

Family Applications (1)

Application Number Title Priority Date Filing Date
JP20365398A Expired - Lifetime JP3580348B2 (en) 1998-07-17 1998-07-17 Data download control method, data download control device, and their recording media

Country Status (1)

Country Link
JP (1) JP3580348B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4244677B2 (en) * 2003-03-31 2009-03-25 三菱電機株式会社 FA controller
JP4538749B2 (en) * 2005-12-21 2010-09-08 横河電機株式会社 Integrated control system

Also Published As

Publication number Publication date
JP2000035812A (en) 2000-02-02

Similar Documents

Publication Publication Date Title
CN112711411B (en) A CI/CD pipeline system based on Kubernetes and docker
JP2023016369A (en) Generation assistance device, generation assistance method, and generation assistance program
CN109657803B (en) Construction of machine learning models
US20080154925A1 (en) Select/refresh method and apparatus
US20220027808A1 (en) Process model creation system, and process model creation method
WO2014008757A1 (en) Method for manufacturing process tracking based on manufacturing events
JP3580348B2 (en) Data download control method, data download control device, and their recording media
CN114490594A (en) A database management method, device, electronic device and computer storage medium
JP2001100830A (en) Production history management search method
JP3738803B2 (en) Data collection controller
JP5978775B2 (en) PROGRAMMABLE CONTROLLER, ITS SUPPORT DEVICE, PROGRAM, PROGRAM TRANSFER METHOD
US7225043B2 (en) System, method and program for tracing manufacturing processes
JP2017068418A (en) Plan support system and plan support method
CN120315658A (en) A label printing method, manufacturing execution system, device and storage medium
JP3867470B2 (en) Document history management apparatus and document history management method
JP2019121181A (en) Data management system and data management method
JPH08179896A (en) Logging data analysis system
JP2000035811A (en) Data management method, data management device, and their recording media
CN117171215B (en) Processing method, device, equipment and storage medium based on historical data
JP2015191389A (en) Migration processing result search device
JPH0273424A (en) Control system for software constitution
JP7538700B2 (en) Manufacturing instruction/repair instruction slip creation device, manufacturing instruction/repair instruction slip creation method, and manufacturing instruction/repair instruction slip creation program
Grigelova et al. Proposal of data pre-processing for purpose of analysis in accordance with the concept industry 4.0
Neumann et al. Engineering of field devices using device descriptions
CN118578617A (en) Method for operating a molding machine

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040329

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040528

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040713

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080730

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20080730

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20090730

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20090730

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100730

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20110730

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110730

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20120730

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20130730

Year of fee payment: 9

EXPY Cancellation because of completion of term