JP2004318457A - Computer system - Google Patents

Computer system Download PDF

Info

Publication number
JP2004318457A
JP2004318457A JP2003111028A JP2003111028A JP2004318457A JP 2004318457 A JP2004318457 A JP 2004318457A JP 2003111028 A JP2003111028 A JP 2003111028A JP 2003111028 A JP2003111028 A JP 2003111028A JP 2004318457 A JP2004318457 A JP 2004318457A
Authority
JP
Japan
Prior art keywords
communication
external device
measuring devices
computer system
user program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003111028A
Other languages
Japanese (ja)
Inventor
Shinji Suzuki
伸二 鈴木
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.)
Yokogawa Electric Corp
Original Assignee
Yokogawa Electric 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 Yokogawa Electric Corp filed Critical Yokogawa Electric Corp
Priority to JP2003111028A priority Critical patent/JP2004318457A/en
Publication of JP2004318457A publication Critical patent/JP2004318457A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To realize a computer system which efficiently performs communication with an external device. <P>SOLUTION: A computer system is improved which performs communication with an external device according to an application program. This system is designed in object oriented system, and commands and functions to an external device are defined as methods. The system is provided with a storage unit which stores a class which defines device information on the external device as an attribute, and a processing means which builds an instance based on the class of the storage unit when connecting communication to the external device according to the application program. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、アプリケーションプログラムに従って外部装置と通信を行うコンピュータシステムに関し、詳しくは、効率よく外部装置と通信を行うコンピュータシステムに関するものである。
【0002】
【従来の技術】
近年のコンピュータシステムは、パーソナルコンピュータ(パソコン)と外部装置(例えば、計測機器)とをネットワークで接続して、イーサネット(登録商標)やGP−IB(General Purpose Interface Bus)等の通信方式によって通信を行い、計測機器の制御を行っている(例えば、特許文献1)。そして、計測機器に所望の動作を行わせるために、ユーザはアプリケーションプログラム(ユーザプログラム)を作成し、この作成したユーザプログラムをパソコン上で実行する。
【0003】
この際、パソコンと計測機器とを所定の通信方式で通信させ、計測機器に所望の動作を行わせるためには、多種の手順を必要とする。しかし、これらの手順全てを含んだユーザプログラムを作成するには、高度なプログラミング技術、計測機器および通信方式の詳細な仕様を理解する必要があり、ユーザにとって非常に困難である。
【0004】
そのため計測機器の製造メーカは、通信の手順や計測機器への動作の手順をまとめた専用のアプリケーションプログラムインターフェース(API:Application Program Interface)を計測機器ごとに提供している。APIは、計測機器へのコマンド(例えば、測定開始、測定条件の設定等)や機能(例えば、通信の接続、通信の切断等)ごとに必要な手順を定めた関数としてまとめられている。もちろん、異なる計測機器で共通する関数も少数だが存在する。
【0005】
そして、ユーザは、適当なパラメータを指定してAPIに含まれる関数を呼び出すだけで所望の動作を計測機器に行わせることができ、容易にユーザプログラムを作成することができる。なお、APIは、パソコンのオペレーティングシステム(OS)上で動作する。
【0006】
続いて、このような従来のコンピュータシステムの構成例を示す。
計測機器M1、M2は外部装置である。ユーザプログラム1は、ユーザによって作成されるプログラムである。通信処理手段2は、いわゆるAPIであり、コマンドや機能ごとに必要な手順を定めた関数を有し、ユーザプログラム1に従って、計測機器M1、M2と通信を行う。テーブル3は、記憶部であり、通信処理手段2が計測機器M1、M2と通信をして取得した計測機器M1、M2の機器情報を記憶する。
【0007】
この機器情報とは、例えば、計測機器M1、M2が設定できる測定レンジや測定周期等であり、さらに計測機器が1つの筐体に複数のモジュールが挿着されたモジュール計測機器の場合、各モジュールの種類(圧力測定用か温度測定用か等)や、何番目のスロットにどのモジュールが装着されているか等も含まれる。また、これらの機器情報は各関数が共通して必要とするものなので、共有情報とも呼ばれる。なお、通信処理手段2、テーブル3はパソコンに設けられる。
【0008】
このような装置の動作を説明する。
ユーザプログラム1は、
(a)初期化(通信の接続)
(b)コマンドの実行(送信、受信)
(c)終了処理(通信の切断)
の手順で記述され、通信処理手段2の関数を呼ぶ。なお、(b)コマンドの実行は、複数回行われることが多い。
【0009】
そして、通信処理手段2が、ユーザプログラム1に呼ばれた関数ごとに処理を行って、計測機器M1、M2の制御を行う。例えば、(a)初期化では、計測機器M1、M2との通信の接続を確立するとともに、機器情報を計測機器M1、M2から取得して、テーブル3に計測機器M1の機器情報31、計測機器M2の機器情報32を格納する。なお機器情報31、32は、通信処理手段2がインデックス値を付して管理する。
【0010】
さらに、(b)コマンドの実行では、テーブル3の機器情報31、32を参照しながら計測機器M1、M2と通信して、ユーザプログラム1のコマンドを計測機器M1、M2に実行させる。例えば、モジュール計測機器の計測機器M1に温度測定を開始させるコマンドならば、通信処理手段2が、機器情報31を参照して、何番目のモジュールに測定の開始をさせればよいかを判断して、測定を開始させる。
【0011】
そして(c)終了処理(通信の切断)では、計測機器M1、M2との接続を切断するとともに、切断した計測機器M1、M2の機器情報31、32を消去する。
【0012】
【特許文献1】
特開2000−121398号公報(段落番号0003〜0009、第8〜9図)
【0013】
【発明が解決しようとする課題】
このように通信処理手段2がユーザプログラム1に従って計測機器M1、M2と通信を行うが、通信処理手段2はユーザプログラム1が逐次処理されることを想定して設計され、テーブル3の機器情報31、32をパソコンのOSでなく、通信処理手段2が管理している。
【0014】
しかしながら、近年は効率的に計測機器M1、M2に計測させるため、マルチ・スレッド処理を意識してユーザプログラム1が作成されることが多くなっている。また、ユーザプログラム1自体も独立性を保ち、再利用し易いように、オブジェクト指向のプログラミング言語(例えば、C++言語)で記述されることが多くなっている。そのため、次のような問題が発生している。
【0015】
テーブル3を通信処理手段2が管理しているので、マルチ・スレッド処理を行うユーザプログラム1であっても、通信処理手段2がテーブル3の機器情報31、32の両方を参照すると競合が発生する。この競合を回避するために、テーブル3への参照をロックしてしまう。そのため、マルチ・スレッド処理を行うユーザプログラム1にもかかわらず、通信処理手段2は逐次処理を行う。
【0016】
また、テーブル3を通信処理手段2が管理しているので、オブジェクト指向のユーザプログラム1で、計測機器M1、M2ごとにクラスを定義して、インスタンスを構築しても、機器情報M1、M2は独立していない。そのため、通信処理手段2によって制限を受けてしまう。例えば、パソコンの記憶部にインスタンスを構築する余裕があったとしても、接続できる計測機器M1、M2の数(構築できるインスタンスの数)は、通信処理手段2がテーブル3で管理できるインデックス値に制限されてしまう。
【0017】
すなわち、ユーザプログラム1が計測機器M1、M2に対して効率よく通信できるものであっても、実際は通信処理手段2によって制限を受けてしまう。
【0018】
そこで本発明の目的は、効率よく外部装置と通信を行うコンピュータシステムを実現することを目的とする。
【0019】
【課題を解決するための手段】
請求項1記載の発明は、
アプリケーションプログラムに従って外部装置と通信を行うコンピュータシステムにおいて、
オブジェクト指向で設計され、前記外部装置へのコマンドや機能をメソッドとして定義し、前記外部装置の機器情報を属性として定義したクラスを記憶する記憶部と、
前記アプリケーションプログラムに従って前記外部装置に通信の接続をする時に、前記記憶部のクラスをもとにインスタンスを構築する処理手段と
を設けたことを特徴とするものである。
【0020】
請求項2記載の発明は、請求項1記載の発明において、
処理手段は、インスタンスを構築するときに前記外部装置から機器情報を取得することを特徴とするものである。
【0021】
請求項3記載の発明は、請求項1または2記載の発明において、
前記アプリケーションプログラムに呼び出され、前記処理手段の構築したインスタンスのメソッドを呼び出す関数を定義したインターフェース手段を設けたことを特徴とするものである。
【0022】
請求項4記載の発明は、請求項1〜3のいずれかに記載の発明において、
前記外部装置と通信の接続、通信の切断、データの送信、データの受信を行う手順を通信方式ごとに定義した通信手段を設け、
前記処理手段は、前記通信手段を介して前記外部装置と通信を行うことを特徴とするものである。
【0023】
請求項5記載の発明は、請求項1〜4のいずれかに記載の発明において、
外部装置は、計測機器であることを特徴とするものである。
【0024】
【発明の実施の形態】
以下図面を用いて本発明の実施の形態を説明する。
図1は本発明の第1の実施例を示す構成図である。ここで、図6と同一のものは同一符号を付し、説明を省略する。図1において、通信処理手段2、テーブル3の代わりにインターフェース手段4が設けられる。インタフェース手段4は、ユーザプログラム1からみると、通信処理手段2と同じように計測機器M1、M2のコマンドや機能ごとに設けられる関数であり、ユーザプログラム1によって呼び出される。
【0025】
記憶部5は、オブジェクト指向で設計され、計測機器M1、M2へのコマンドや機能をメソッドとして定義し、計測機器M1、M2の機器情報を属性として定義したクラスC1〜C3を記憶する。このクラスC1〜C3は、計測機器M1、M2の製造メーカから提供される。なお、クラスはオブジェクトを作成するための雛型であり、オブジェクトはデータ(属性)とそれを操作する手順(メソッド)を一塊としたものである。
【0026】
処理手段6は、インターフェース手段4からの指示によって記憶部5のクラスC1〜C3をもとにインスタンスを構築し、定義されたメソッドに基いて計測機器M1、M2への通信、制御を行う。
【0027】
通信手段7は、通信方式ごとに必要な手順が定められ、処理手段6からの指示によって、実際に計測機器M1、M2との通信の接続、通信の切断、データの送信、データの受信を行う。なお、インターフェース手段4、記憶部5、処理手段6、通信手段7はパソコンに設けられる。
【0028】
ここで図2に、記憶部5のクラスC1〜C3の一例を示す。計測機器M1、M2ごとにサブクラスC1、C2を定義し、計測機器M1、M2の機種に依存しないコマンドや機能をルートクラスC3として定義している。なお、ルートクラスC3を定義しているのは、機種を意識せずにクラスC3のオブジェクトに対して、ユーザが同じメソッドを実行できるようにするためである。
【0029】
このような装置の動作を図3、図4を用いて説明する。図3は、ユーザプログラム1のフローチャートであり、図4はシーケンス図である。
ユーザプログラム1は、図6に示す装置と同様に、
(a)初期化(通信の接続)(S11)
(b)コマンドの実行(送信、受信)(S12)
(c)終了処理(通信の切断)(S13)
の手順で記述され、インターフェース手段4の関数を呼ぶ。つまり、インターフェース手段4によって、ユーザ側からみると従来のユーザプログラム1と同様のの記述でよい。なお、(b)コマンドの実行は、複数回行われることが多い。
【0030】
そして、インターフェース手段4が、ユーザプログラム1より測定機器M1、M2への(a)初期化の関数が呼び出されると(SQ1)、処理手段6に測定機器M1、M2に対応するクラスC1、C2をもとにオブジェクトの実体(インスタンス)の構築を指示する(SQ2)。これにより処理手段6が、記憶部5からクラスC1、C2それぞれのインスタンス61、62を構築するとともに、通信手段7に所望の通信方式で通信の接続を行わせる。なお、通信方式はユーザによってあらかじめ指定されている(SQ3)。もちろん、通信の接続時に計測機器M1、M2の機器情報を取得し、インスタンス61、62のそれぞれが、計測機器M1、M2の機器情報を管理する。また、インスタンス61、62は、パソコンの図示しない記憶部に構築され、OSによって管理される。
【0031】
そして、インターフェース手段4が、ユーザプログラム1より測定機器M1、M2への(b)コマンド実行の関数が呼び出されると(SQ4)、読み出された関数に対応するインスタンス61、62のメソッドを呼び出す(SQ5)。これにより処理手段6が、インスタンス61、62のメソッドに従って通信手段7にコマンドの送信を行わせる。この際、インスタンス61のメソッドは計測機器M1の機器情報を参照し、インスタンス62のメソッドは計測機器M2の機器情報を参照している(SQ6)。そして、通信手段7が計測機器M1、M2と通信を行い、計測機器M1、M2の応答から受信したデータを処理手段6に出力する(SQ7)。
【0032】
インターフェース手段4が、ユーザプログラム1より測定機器M1、M2への(c)終了処理の関数が呼び出されると(SQ8)、処理手段6に測定機器M1、M2に対応するクラスC1、C2の消滅を指示する(SQ9)。これにより処理手段6が、インスタンス61、62を消滅するとともに、通信手段7に通信の切断を行わせる(SQ10)。
【0033】
ここで、図5に計測機器1と通信を行うユーザプログラム1の一例を示し、具体的に動作を説明する。まず、計測機器M1を初期化する初期化の関数(openM1)によって、処理手段6が、記憶部5のクラスC1をもとにインスタンス61を構築する。なお(addres)は、計測機器M1に割り振られているネットワークアドレスである。そして、インスタンス61を構築し、計測機器M1との通信の接続後、インスタンス61への参照ポインタを識別子(id)として返している。
【0034】
そして、コマンド実行の関数(runCommandM1)や終了処理の関数(closeM1)によって、受け取った識別子(id)で示されるインスタンス61のメソッドを呼び出す。そして、このメソッドは、通信手段7に送信、受信を行わせる。なお、パラメータ(parameter)は、コマンドごとに指定する値であり、コマンド実行の関数(runCommandM1)名も仮名称であり、コマンドごとに用意されている。
【0035】
終了処理の関数(closeM1)によって、処理手段6が通信手段7に通信を切断させた後、インスタンス61を消滅させる。
【0036】
このように、処理手段6が、計測機器M1、M2と通信の接続をするときに、計測機器M1、M2ごとに設けられたクラスC1、C2をもとに、機器情報を属性としてインスタンス61、62を構築するので、計測機器M1、M2の機器情報がインスタンス61、62ごとに独立している。これにより、効率よく計測機器M1、M2と通信を行うことができる。
【0037】
すなわち、計測機器M1、M2の機器情報がインスタンス61、62ごとに独立しているので、マルチ・スレッド処理のユーザプログラム1であっても、機器情報を参照時する時にインスタンス61、62が競合を起こすことがない。これにより、マルチ・スレッド処理で通信を行うことができ、効率よく外部装置と通信を行うことができる。また、ユーザも競合等を考慮せずにプログラムを作成できるので、ユーザプログラムの作成が効率よくなる。
【0038】
また、計測機器M1、M2の機器情報がインスタンス61、62ごとに独立しているので、図6に示す装置のように通信処理手段2による制限を受けない。つまり、オブジェクト指向では、インスタンス61、62の構築される領域はOSによって管理されているので、パソコンの性能によって制限される。
【0039】
そして、記憶部5に計測機器M1、M2ごとのクラスが記憶されているので、ユーザがオブジェクト指向でユーザプログラム1を作成する場合、図6に示す装置のように、ユーザ自らが計測機器M1、M2のクラスを設計する必要がない。これにより、ユーザプログラムの作成が効率よくなる。
【0040】
また、処理手段6がクラスC1〜C3をもとにインスタンスを構築して動作するので、製造メーカは処理手段6のデバック、メンテナンスが容易になる。すなわち、オブジェクト指向言語の場合、変更した部分、変更に関連する部分のみをデバックすればよく、C言語のようなコンパイラ言語のようにプログラム全体をデバックする必要がない。
【0041】
また、インターフェース手段4が従来のコンピュータシステムと同様の関数を提供し、ユーザプログラム1から読み出された関数に対応するインスタンス61、62のメソッドを呼び出す。これによりユーザは、新たにユーザプログラム1を作成する必要がなく、ユーザプログラム1の作成の効率がよくなる。
【0042】
さらに、通信手段7に通信方式ごとに通信を行う手順が定められ、通信手段7が計測機器M1、M2と実際の通信を行うので、製造メーカはクラスC1〜C3を作成する際に、通信方式の特性を考慮することなく作成することができる。
【0043】
なお、本発明はこれに限定されるものではなく、以下のようなものでもよい。
図1に示すシステムにおいて、計測機器M1、M2の2台が接続される構成を示したが、何台接続してもよく、通信を行う計測機器ごとに処理手段6がインスタンスを構築する。もちろん、計測機器の種類も何種類でもよく、記憶部5には計測機器の種類ごとにクラスが格納される。
【0044】
外部装置として、計測機器M1、M2を接続する構成を示したが、ネットワークを介してパソコンと接続され制御される装置、例えば、外付けのハードディスク、デジタルカメラ等でもよい。
【0045】
記憶部5のクラスC1〜C3には、通信方式に関する定義をしていないが、通信手段7を設けずに、クラスC1〜C3に通信方式に関する機能をメソッドとして定義してもよい。
【0046】
通信手段7をオブジェクト指向で設計し、通信方式ごとにクラスを定義し、処理手段6からの通信の接続要求の際に、このクラスをもとにインスタンスを構築してもよい。
【0047】
【発明の効果】
本発明によれば、以下のような効果がある。
請求項1〜5によれば、処理手段が、外部装置と通信の接続をするときに、外部装置ごとに設けられたクラスをもとに、機器情報を属性としてインスタンスを構築するので、外部装置の機器情報がインスタンスごとに独立している。これにより、効率よく外部装置と通信を行うことができる。
【0048】
請求項3によれば、インターフェース手段が従来のコンピュータシステムと同様の関数を提供し、ユーザプログラムから読み出された関数に対応するインスタンスのメソッドを呼び出す。これによりユーザは、新たにユーザプログラムを作成する必要がなく、ユーザプログラムの作成の効率がよくなる。
【0049】
請求項4によれば、通信手段に通信方式ごとに通信を行う手順が定められ、通信手段が外部装置と実際の通信を行うので、製造メーカはクラスを作成する際に、通信方式の特性を考慮することなく作成することができる。
【図面の簡単な説明】
【図1】本発明の一実施例を示した構成図である。
【図2】記憶部5のクラスC1〜C3を示した図である。
【図3】ユーザプログラム1の流れを示したフローチャートである。
【図4】図1に示す装置の動作を示したシーケンス図である。
【図5】ユーザプログラム1の記述例を示した図である。
【図6】従来のコンピュータシステムの構成図である。
【符号の説明】
1 ユーザプログラム
4 インターフェース手段
5 記憶部
6 処理手段
7 通信手段
61、62 インスタンス
C1〜C3 クラス
M1、M2 計測機器
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a computer system that communicates with an external device according to an application program, and more particularly, to a computer system that efficiently communicates with an external device.
[0002]
[Prior art]
In recent computer systems, a personal computer (personal computer) and an external device (e.g., a measuring device) are connected by a network, and communication is performed by a communication method such as Ethernet (registered trademark) or GP-IB (General Purpose Interface Bus). The measurement device is controlled (for example, Patent Document 1). Then, in order to cause the measuring device to perform a desired operation, the user creates an application program (user program) and executes the created user program on a personal computer.
[0003]
At this time, various procedures are required to cause the personal computer and the measuring device to communicate with each other by a predetermined communication method and to cause the measuring device to perform a desired operation. However, in order to create a user program including all of these procedures, it is necessary to understand advanced programming techniques, detailed specifications of measuring instruments and communication methods, which is very difficult for the user.
[0004]
Therefore, the manufacturer of the measuring device provides a dedicated application program interface (API) for each measuring device that summarizes a communication procedure and an operation procedure for the measuring device. The API is summarized as a function that defines a necessary procedure for each command (for example, start of measurement, setting of measurement conditions, etc.) and function (for example, connection of communication, disconnection of communication, etc.) to the measuring device. Of course, there are a few functions that are common to different measuring instruments.
[0005]
Then, the user can cause the measuring device to perform a desired operation only by designating appropriate parameters and calling a function included in the API, and can easily create a user program. The API operates on an operating system (OS) of a personal computer.
[0006]
Next, a configuration example of such a conventional computer system will be described.
The measuring devices M1 and M2 are external devices. The user program 1 is a program created by a user. The communication processing unit 2 is a so-called API, has a function that defines a necessary procedure for each command and function, and communicates with the measuring devices M1 and M2 according to the user program 1. The table 3 is a storage unit and stores device information of the measuring devices M1 and M2 obtained by the communication processing unit 2 communicating with the measuring devices M1 and M2.
[0007]
The device information is, for example, a measurement range or a measurement cycle that can be set by the measurement devices M1 and M2. Further, when the measurement device is a module measurement device in which a plurality of modules are inserted in one housing, each module is (For pressure measurement or temperature measurement, etc.), which module is installed in which slot, and the like. Further, these pieces of device information are commonly required by each function, and thus are also referred to as shared information. The communication processing means 2 and the table 3 are provided in a personal computer.
[0008]
The operation of such a device will be described.
User program 1
(A) Initialization (communication connection)
(B) Command execution (transmission, reception)
(C) Termination processing (disconnection of communication)
And the function of the communication processing means 2 is called. The execution of the command (b) is often performed a plurality of times.
[0009]
Then, the communication processing unit 2 performs processing for each function called by the user program 1 to control the measuring devices M1 and M2. For example, in (a) initialization, a communication connection with the measuring devices M1 and M2 is established, and device information is acquired from the measuring devices M1 and M2, and the device information 31 of the measuring device M1 and the measuring device The device information 32 of M2 is stored. The device information 31 and 32 are managed by the communication processing means 2 by adding an index value.
[0010]
Further, in the execution of the command (b), the communication with the measuring devices M1 and M2 is performed with reference to the device information 31 and 32 of the table 3, and the commands of the user program 1 are executed by the measuring devices M1 and M2. For example, if the command is a command for starting the temperature measurement by the measuring device M1 of the module measuring device, the communication processing unit 2 refers to the device information 31 and determines which module should start the measurement. To start the measurement.
[0011]
Then, in (c) end processing (communication disconnection), the connection with the measuring devices M1 and M2 is disconnected, and the device information 31 and 32 of the disconnected measuring devices M1 and M2 are deleted.
[0012]
[Patent Document 1]
JP-A-2000-121398 (paragraph numbers 0003 to 0009, FIGS. 8 to 9)
[0013]
[Problems to be solved by the invention]
As described above, the communication processing unit 2 communicates with the measuring devices M1 and M2 according to the user program 1. The communication processing unit 2 is designed on the assumption that the user program 1 is sequentially processed. , 32 are managed by the communication processing means 2 instead of the OS of the personal computer.
[0014]
However, in recent years, in order to make the measuring devices M1 and M2 measure efficiently, the user program 1 is often created in consideration of multi-thread processing. Further, the user program 1 itself is often described in an object-oriented programming language (for example, C ++ language) so as to maintain independence and to be easily reused. For this reason, the following problem has occurred.
[0015]
Since the communication processing unit 2 manages the table 3, even if the user program 1 performs multi-thread processing, a conflict occurs when the communication processing unit 2 refers to both the device information 31 and 32 in the table 3. . In order to avoid this conflict, the reference to the table 3 is locked. Therefore, the communication processing means 2 performs the sequential processing, despite the user program 1 performing the multi-thread processing.
[0016]
Further, since the communication processing means 2 manages the table 3, even if an object-oriented user program 1 defines a class for each of the measuring devices M1 and M2 and constructs an instance, the device information M1 and M2 remain Not independent. For this reason, the communication processing unit 2 is restricted. For example, even if there is room for constructing an instance in the storage unit of the personal computer, the number of connectable measuring devices M1 and M2 (the number of constructable instances) is limited to an index value that the communication processing means 2 can manage in the table 3. Will be done.
[0017]
In other words, even if the user program 1 can efficiently communicate with the measuring devices M1 and M2, it is actually limited by the communication processing unit 2.
[0018]
Therefore, an object of the present invention is to realize a computer system that efficiently communicates with an external device.
[0019]
[Means for Solving the Problems]
The invention according to claim 1 is
In a computer system that communicates with an external device according to an application program,
A storage unit that is designed in an object-oriented manner, defines a command or a function to the external device as a method, and stores a class in which device information of the external device is defined as an attribute.
Processing means for constructing an instance based on a class of the storage unit when communication is connected to the external device according to the application program.
[0020]
The invention according to claim 2 is the invention according to claim 1,
The processing means acquires device information from the external device when constructing an instance.
[0021]
The invention according to claim 3 is the invention according to claim 1 or 2,
Interface means defining a function called by the application program and calling a method of the instance constructed by the processing means is provided.
[0022]
The invention according to claim 4 is the invention according to any one of claims 1 to 3,
Provide a communication means that defines a procedure for performing communication connection, communication disconnection, data transmission, and data reception with the external device for each communication method,
The processing means communicates with the external device via the communication means.
[0023]
The invention according to claim 5 is the invention according to any one of claims 1 to 4,
The external device is a measuring device.
[0024]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 is a configuration diagram showing a first embodiment of the present invention. Here, the same components as those in FIG. 6 are denoted by the same reference numerals, and description thereof is omitted. In FIG. 1, an interface unit 4 is provided instead of the communication processing unit 2 and the table 3. When viewed from the user program 1, the interface unit 4 is a function provided for each command or function of the measuring devices M1 and M2, like the communication processing unit 2, and is called by the user program 1.
[0025]
The storage unit 5 is designed in an object-oriented manner, defines commands and functions to the measuring devices M1 and M2 as methods, and stores classes C1 to C3 in which device information of the measuring devices M1 and M2 is defined as attributes. The classes C1 to C3 are provided by manufacturers of the measuring devices M1 and M2. A class is a template for creating an object, and an object is a set of data (attributes) and procedures (methods) for operating the data (attributes).
[0026]
The processing unit 6 constructs an instance based on the classes C1 to C3 of the storage unit 5 according to an instruction from the interface unit 4, and performs communication and control to the measuring devices M1 and M2 based on the defined method.
[0027]
The communication unit 7 determines a necessary procedure for each communication method, and actually performs communication connection with the measuring devices M1 and M2, disconnection of communication, transmission of data, and reception of data in accordance with an instruction from the processing unit 6. . Note that the interface unit 4, the storage unit 5, the processing unit 6, and the communication unit 7 are provided in a personal computer.
[0028]
Here, FIG. 2 shows an example of the classes C1 to C3 of the storage unit 5. Subclasses C1 and C2 are defined for each of the measuring devices M1 and M2, and commands and functions that do not depend on the types of the measuring devices M1 and M2 are defined as a root class C3. Note that the root class C3 is defined so that the user can execute the same method on the object of the class C3 regardless of the model.
[0029]
The operation of such an apparatus will be described with reference to FIGS. FIG. 3 is a flowchart of the user program 1, and FIG. 4 is a sequence diagram.
The user program 1 is similar to the device shown in FIG.
(A) Initialization (communication connection) (S11)
(B) Command execution (transmission, reception) (S12)
(C) End processing (disconnection of communication) (S13)
And the function of the interface means 4 is called. That is, from the user side, the same description as the conventional user program 1 may be used by the interface means 4. The execution of the command (b) is often performed a plurality of times.
[0030]
Then, when the (a) initialization function for the measuring devices M1 and M2 is called from the user program 1 (SQ1), the interface unit 4 sends the classes C1 and C2 corresponding to the measuring devices M1 and M2 to the processing unit 6. Based on the instruction, construction of an object entity (instance) is instructed (SQ2). Thus, the processing unit 6 constructs the instances 61 and 62 of the classes C1 and C2 from the storage unit 5 and causes the communication unit 7 to perform communication connection in a desired communication method. The communication method is specified in advance by the user (SQ3). Of course, the device information of the measuring devices M1 and M2 is acquired at the time of communication connection, and each of the instances 61 and 62 manages the device information of the measuring devices M1 and M2. The instances 61 and 62 are constructed in a storage unit (not shown) of the personal computer and managed by the OS.
[0031]
Then, when the function of (b) command execution to the measuring devices M1 and M2 is called from the user program 1 (SQ4), the interface means 4 calls the methods of the instances 61 and 62 corresponding to the read functions (SQ4). SQ5). Thus, the processing unit 6 causes the communication unit 7 to transmit a command according to the method of the instances 61 and 62. At this time, the method of the instance 61 refers to the device information of the measuring device M1, and the method of the instance 62 refers to the device information of the measuring device M2 (SQ6). Then, the communication unit 7 communicates with the measuring devices M1 and M2, and outputs data received from the responses of the measuring devices M1 and M2 to the processing unit 6 (SQ7).
[0032]
When the interface means 4 calls the (c) termination processing function for the measuring devices M1 and M2 from the user program 1 (SQ8), the processing means 6 causes the classes C1 and C2 corresponding to the measuring devices M1 and M2 to disappear. Instruct (SQ9). Thereby, the processing means 6 causes the instances 61 and 62 to disappear, and causes the communication means 7 to disconnect the communication (SQ10).
[0033]
Here, FIG. 5 shows an example of the user program 1 for communicating with the measuring device 1, and the operation will be specifically described. First, the processing unit 6 constructs an instance 61 based on the class C1 of the storage unit 5 by an initialization function (openM1) for initializing the measuring device M1. (Address) is a network address assigned to the measuring device M1. Then, the instance 61 is constructed, and after the communication with the measuring device M1 is connected, the reference pointer to the instance 61 is returned as the identifier (id).
[0034]
Then, the method of the instance 61 indicated by the received identifier (id) is called by the command execution function (runCommandM1) or the termination processing function (closeM1). Then, this method causes the communication means 7 to perform transmission and reception. The parameter (parameter) is a value specified for each command, and the name of the command execution function (runCommandM1) is also a temporary name, and is prepared for each command.
[0035]
After the processing unit 6 causes the communication unit 7 to disconnect the communication by the function (closeM1) of the termination process, the instance 61 is deleted.
[0036]
As described above, when the processing unit 6 establishes communication connection with the measuring devices M1 and M2, based on the classes C1 and C2 provided for the measuring devices M1 and M2, the instance 61 Since 62 is constructed, the device information of the measuring devices M1 and M2 is independent for each of the instances 61 and 62. Thereby, it is possible to efficiently communicate with the measuring devices M1 and M2.
[0037]
That is, since the device information of the measuring devices M1 and M2 is independent for each of the instances 61 and 62, even if the user program 1 of the multi-thread processing is used, the instances 61 and 62 may conflict when referring to the device information. Never wake up. Accordingly, communication can be performed by multi-thread processing, and communication with an external device can be performed efficiently. In addition, since the user can create the program without considering the competition or the like, the creation of the user program becomes efficient.
[0038]
Further, since the device information of the measuring devices M1 and M2 is independent for each of the instances 61 and 62, there is no restriction by the communication processing unit 2 as in the device shown in FIG. That is, in the object orientation, the area in which the instances 61 and 62 are constructed is managed by the OS, so that the area is limited by the performance of the personal computer.
[0039]
Since the class for each of the measuring devices M1 and M2 is stored in the storage unit 5, when the user creates the user program 1 in an object-oriented manner, the user himself / herself can use the measuring device M1 and M2 as shown in FIG. There is no need to design a class for M2. Thereby, the creation of the user program becomes more efficient.
[0040]
Further, since the processing means 6 operates by constructing an instance based on the classes C1 to C3, the manufacturer can easily debug and maintain the processing means 6. That is, in the case of an object-oriented language, only the changed part and the part related to the change need to be debugged, and there is no need to debug the entire program as in a compiler language such as C language.
[0041]
Further, the interface means 4 provides functions similar to those of the conventional computer system, and calls the methods of the instances 61 and 62 corresponding to the functions read from the user program 1. This eliminates the need for the user to create a new user program 1 and improves the efficiency of creating the user program 1.
[0042]
Further, a procedure for performing communication for each communication method is defined in the communication means 7, and the communication means 7 performs actual communication with the measuring devices M1 and M2. Can be created without considering the characteristics of
[0043]
The present invention is not limited to this, and may be as follows.
In the system shown in FIG. 1, a configuration is shown in which two measuring devices M1 and M2 are connected. However, any number of measuring devices M1 and M2 may be connected, and the processing unit 6 constructs an instance for each measuring device that performs communication. Of course, any number of types of measuring devices may be used, and the storage unit 5 stores a class for each type of measuring device.
[0044]
Although the configuration in which the measuring devices M1 and M2 are connected as an external device has been described, a device that is connected to and controlled by a personal computer via a network, such as an external hard disk or a digital camera, may be used.
[0045]
Although the classes C1 to C3 of the storage unit 5 do not define the communication method, the functions related to the communication method may be defined as methods in the classes C1 to C3 without providing the communication unit 7.
[0046]
The communication means 7 may be designed in an object-oriented manner, a class may be defined for each communication method, and an instance may be constructed based on this class when a communication connection request is issued from the processing means 6.
[0047]
【The invention's effect】
According to the present invention, the following effects can be obtained.
According to the first to fifth aspects, the processing unit constructs an instance with device information as an attribute based on a class provided for each external device when making a communication connection with the external device. Device information is independent for each instance. Thereby, communication with an external device can be performed efficiently.
[0048]
According to the third aspect, the interface means provides a function similar to that of the conventional computer system, and calls a method of an instance corresponding to the function read from the user program. This eliminates the need for the user to create a new user program, and increases the efficiency of creating the user program.
[0049]
According to the fourth aspect, a procedure for performing communication for each communication method is determined in the communication means, and the communication means performs actual communication with an external device. Can be created without consideration.
[Brief description of the drawings]
FIG. 1 is a configuration diagram showing one embodiment of the present invention.
FIG. 2 is a diagram showing classes C1 to C3 of a storage unit 5;
FIG. 3 is a flowchart showing a flow of a user program 1.
FIG. 4 is a sequence diagram showing an operation of the device shown in FIG.
FIG. 5 is a diagram showing a description example of a user program 1.
FIG. 6 is a configuration diagram of a conventional computer system.
[Explanation of symbols]
Reference Signs List 1 User program 4 Interface means 5 Storage unit 6 Processing means 7 Communication means 61, 62 Instances C1 to C3 Classes M1, M2 Measuring equipment

Claims (5)

アプリケーションプログラムに従って外部装置と通信を行うコンピュータシステムにおいて、
オブジェクト指向で設計され、前記外部装置へのコマンドや機能をメソッドとして定義し、前記外部装置の機器情報を属性として定義したクラスを記憶する記憶部と、
前記アプリケーションプログラムに従って前記外部装置に通信の接続をする時に、前記記憶部のクラスをもとにインスタンスを構築する処理手段と
を設けたことを特徴とするコンピュータシステム。
In a computer system that communicates with an external device according to an application program,
A storage unit that is designed in an object-oriented manner, defines a command or function to the external device as a method, and stores a class in which device information of the external device is defined as an attribute.
A computer system, comprising: processing means for constructing an instance based on the class of the storage unit when communication is connected to the external device according to the application program.
処理手段は、インスタンスを構築するときに前記外部装置から機器情報を取得することを特徴とする請求項1記載のコンピュータシステム。2. The computer system according to claim 1, wherein the processing unit acquires device information from the external device when constructing the instance. 前記アプリケーションプログラムに呼び出され、前記処理手段の構築したインスタンスのメソッドを呼び出す関数を定義したインターフェース手段を設けたことを特徴とする請求項1または2記載のコンピュータシステム。3. The computer system according to claim 1, further comprising an interface unit that defines a function that is called by the application program and calls a method of the instance constructed by the processing unit. 前記外部装置と通信の接続、通信の切断、データの送信、データの受信を行う手順を通信方式ごとに定義した通信手段を設け、
前記処理手段は、前記通信手段を介して前記外部装置と通信を行うことを特徴とする請求項1〜3のいずれかに記載のコンピュータシステム。
Provide a communication means that defines a procedure for connection of communication with the external device, disconnection of communication, transmission of data, reception of data for each communication method,
4. The computer system according to claim 1, wherein the processing unit communicates with the external device via the communication unit.
外部装置は、計測機器であることを特徴とする請求項1〜4のいずれかに記載のコンピュータシステム。The computer system according to claim 1, wherein the external device is a measuring device.
JP2003111028A 2003-04-16 2003-04-16 Computer system Pending JP2004318457A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003111028A JP2004318457A (en) 2003-04-16 2003-04-16 Computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003111028A JP2004318457A (en) 2003-04-16 2003-04-16 Computer system

Publications (1)

Publication Number Publication Date
JP2004318457A true JP2004318457A (en) 2004-11-11

Family

ID=33471694

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003111028A Pending JP2004318457A (en) 2003-04-16 2003-04-16 Computer system

Country Status (1)

Country Link
JP (1) JP2004318457A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009154893A3 (en) * 2008-06-20 2010-04-01 Microsoft Corporation Association of an input and output of a peripheral device in a computing system
WO2015063902A1 (en) * 2013-10-30 2015-05-07 株式会社アイ・エル・シー Inter-apparatus control method, inter-apparatus control program, and inter-apparatus control system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009154893A3 (en) * 2008-06-20 2010-04-01 Microsoft Corporation Association of an input and output of a peripheral device in a computing system
US9280494B2 (en) 2008-06-20 2016-03-08 Microsoft Technology Licensing, Llc System method for associating an application runnng on computing system by selectively altering an attribute of the input and output of connected peripheral device
WO2015063902A1 (en) * 2013-10-30 2015-05-07 株式会社アイ・エル・シー Inter-apparatus control method, inter-apparatus control program, and inter-apparatus control system
WO2015063959A1 (en) * 2013-10-30 2015-05-07 株式会社アイ・エル・シー Inter-apparatus control method, inter-apparatus control program, and inter-apparatus control system

Similar Documents

Publication Publication Date Title
US9979627B2 (en) Systems and methods for bare-metal network topology discovery
WO2008014647A1 (en) A maintenance method for the capability management object, capability management method, the system and the terminal thereof
US7886102B2 (en) Apparatus for determining compatibility between devices
WO2020143199A1 (en) Application program plug-in method and system, and related apparatus
CN107483243A (en) A kind of automatic deployment method and equipment of OpenStack platforms
WO2022057756A1 (en) Method and apparatus for starting device, electronic device, and computer storage medium
EP2922267A1 (en) Method for achieving communication based on mbim interface and device therefor
CN110069288B (en) USB equipment sharing method, device and system
CN104679566B (en) Update the method and terminal device of SMBIOS
CN102073524B (en) A kind of method of wireless communication terminal and self-starting thereof
CN115114219B (en) PCI-E topology method, device, equipment and storage medium
CN102364445A (en) Automatic program burning system and method for wireless sensor network testing platform
CN103092648B (en) A kind of image upgrade method, system and subscriber equipment and personal computer
WO2014169589A1 (en) Intelligent terminal synchronous operation method and device
Ruimei et al. Design of ARM-based embedded Ethernet interface
WO2011088648A1 (en) Mac os system device and its network connection configuration method
CN106100971B (en) Information creating, method for sending information and information creating, information transmitting apparatus
CN105868132B (en) A kind of Digital Oscillograph Module functions expanding method and system based on usb communication
JP2004318457A (en) Computer system
CN108234174A (en) The management method and device of virtual network function
JP2004362577A (en) Method and device for generating graphical user interface
CN109039777A (en) A kind of wifi equipment and its match network method
CN104407714A (en) Main board and use method thereof for remote multi-computer switching
Cisco Performing a Basic Startup Configuration
Cisco System Startup and Basic Configuration Tasks

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051205

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080609

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080808

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20081021

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20081222

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20090312