JP2003281072A - Method and device for controlling device - Google Patents

Method and device for controlling device

Info

Publication number
JP2003281072A
JP2003281072A JP2002086153A JP2002086153A JP2003281072A JP 2003281072 A JP2003281072 A JP 2003281072A JP 2002086153 A JP2002086153 A JP 2002086153A JP 2002086153 A JP2002086153 A JP 2002086153A JP 2003281072 A JP2003281072 A JP 2003281072A
Authority
JP
Japan
Prior art keywords
address
virtual
computer
application
information
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.)
Withdrawn
Application number
JP2002086153A
Other languages
Japanese (ja)
Inventor
Hisashi Kobayashi
尚志 小林
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.)
Fujifilm Holdings Corp
Original Assignee
Fuji Photo Film Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Photo Film Co Ltd filed Critical Fuji Photo Film Co Ltd
Priority to JP2002086153A priority Critical patent/JP2003281072A/en
Publication of JP2003281072A publication Critical patent/JP2003281072A/en
Withdrawn legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To have a device connected to a computer with an interface capable of inserting or extracting live wire easily to use. <P>SOLUTION: In a device controller for controlling the device connected to the computer with the interface capable of inserting or extracting live wire, a device address ADDR is attached to each device when the device is connected. Meanwhile, a virtual device address HDA different from the device address ADDR is set in each device. The virtual device address HDA is notified to an application, and designation is made with the virtual device address HDA when the application 50 uses the device 20. Meanwhile, even when the device is disconnected through the computer and is further reconnected, a new device address ADDRn to be newly assigned is linked with the virtual device address HDA, and the application 50 can access the device designated by the new device address ADDRn if the application 50 designates the virtual device address HDA. <P>COPYRIGHT: (C)2004,JPO

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、活線挿抜可能なイ
ンターフェイスを用いてコンピュータに接続されたデバ
イスを制御するデバイス制御方法および装置に関するも
のである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a device control method and apparatus for controlling a device connected to a computer by using a hot-pluggable interface.

【0002】[0002]

【従来の技術】コンピュータにはたとえばハードディス
ク装置、光ディスク装置、プリンタ等様々なデバイスが
接続される。近年、このコンピュータとデバイスとを接
続するインターフェイスとして、USBインターフェイ
スが多用されている。USBインターフェイスの特徴は
活線挿抜と呼ばれる機能であり、コンピュータシステム
が起動した状態で、デバイスの接続および切断を行うこ
とができる。このUSBインターフェイスを用いれば、
1台のコンピュータに対して最大126個のデバイスを
接続して使用することができる。
2. Description of the Related Art A computer is connected to various devices such as a hard disk device, an optical disk device, and a printer. In recent years, a USB interface has been widely used as an interface for connecting the computer and the device. A characteristic of the USB interface is a function called hot-plugging / unplugging, which allows devices to be connected and disconnected while the computer system is running. With this USB interface,
Up to 126 devices can be connected and used for one computer.

【0003】また、USBインターフェイスを用いて接
続されるすべてのデバイスのコネクタ形状は統一されて
いる。さらに、すべてのUSBデバイスのデータ転送は
同一のプロトコルバスをタイムシェアリングすることで
行われる。すべてのUSBデバイスにおけるデータ転送
の基本プロトコルは同じものになるため、データの中身
に対して異なった意味を持たせるためには、ソフトウェ
アスタックで処理し、時間に対する概念を追加する必要
がある。
Further, the connector shapes of all devices connected using the USB interface are unified. Furthermore, data transfer of all USB devices is performed by time sharing the same protocol bus. Since the basic protocol for data transfer in all USB devices is the same, in order to give different meanings to the contents of data, it is necessary to process them with a software stack and add the concept of time.

【0004】このため、USBインターフェイスのデー
タ転送方式は上述した要件を満たすようにしている。具
体的にはInterrupt転送、Bulk転送、Is
ochronous転送およびControl転送の4
つの転送方式がある。各デバイスは、デバイス特性にあ
った転送方式を選択することで、最適なデータ転送を実
現することができる。特に、Control転送は、デ
バイスの制御等に必要な情報のやり取りに使用される転
送方式であって、すべてのデバイスに対して行われるも
のである。
For this reason, the data transfer method of the USB interface satisfies the above-mentioned requirements. Specifically, Interrupt transfer, Bulk transfer, Is
4 of Ochronous transfer and Control transfer
There are two transfer methods. Each device can realize optimum data transfer by selecting a transfer method suitable for the device characteristics. In particular, Control transfer is a transfer method used for exchanging information necessary for device control and the like, and is performed for all devices.

【0005】ところで、コンピュータがデバイスを認識
して使用可能な状態にする場合、エニュメレーション
(Enumeration)と呼ばれるプロセスを使用
してデバイスを認識管理する。具体的には、主としてデ
バイスの認識、デバイスアドレスの割り当ておよびデバ
イスの構成情報の読み込みが行われる。
By the way, when a computer recognizes a device and puts it in a usable state, the device is recognized and managed by using a process called enumeration. Specifically, device recognition, device address allocation, and device configuration information reading are mainly performed.

【0006】まず、ホストがデバイス側のデフォルトア
ドレスに反応することで、アドレスの接続が認識され
る。すなわち、デバイスのバッファには初期状態におい
てデバイスアドレス「0」が設定されている。一方、ホ
ストはデバイスアドレス「0」に反応するようになって
いる。したがって、ホストは新しく接続されたデバイス
を認識できるようになる。
First, the host responds to the default address on the device side to recognize the connection of the address. That is, the device address “0” is set in the buffer of the device in the initial state. On the other hand, the host responds to the device address "0". Therefore, the host can recognize the newly connected device.

【0007】次にデバイスアドレスの割り当てが行われ
る。上述したように、ホストには最大127個のデバイ
スが接続できるようになっており、ホストは各デバイス
を認識可能でなければならない。このため、ホストは、
各デバイスに対してそれぞれ競合しないデバイスアドレ
スを割り当てていく。具体的にはホストは7bit(0
〜127)のデバイスアドレスを割り当てることがで
き、ホストを含め最大127個のデバイスまで認識す
る。
Next, the device address is assigned. As described above, up to 127 devices can be connected to the host, and the host must be able to recognize each device. Therefore, the host
Assign device addresses that do not conflict with each device. Specifically, the host is 7 bit (0
Device addresses up to 127) can be assigned, and up to 127 devices including the host are recognized.

【0008】さらに、ホストはデバイスにContro
l転送によりデバイスリクエストを送りデバイスの構成
情報を得る。デバイスは、そのデバイスの有する機能を
記述したディスクリプタを有しており、デバイスリクエ
ストに応じてディスクリプタが読み出されていく。する
と、ホストはディスクリプタに記述されたデバイスの構
成情報とともにベンダIDやプロダクトIDを取得す
る。そして、ホストは読み込んだ構成情報に基づいてエ
ンドポイント番号を割り当てていく。
In addition, the host controls the device
A device request is sent by transfer to obtain device configuration information. The device has a descriptor describing the function of the device, and the descriptor is read in response to the device request. Then, the host acquires the vendor ID and the product ID together with the device configuration information described in the descriptor. Then, the host allocates the endpoint number based on the read configuration information.

【0009】ここで、エンドポイントとは、ホストコン
トローラにより転送方式と関連付けされたバッファのこ
という。たとえば、ファックス機能付きプリンタ複合機
は、1つのデバイスにプリンタの機能とファックスの機
能を有することになる。そして、それらの機能毎に扱う
データおよび転送方式が異なる。よって、デバイス側に
は各転送毎にバッファ(FIFO)が設けられて、ホス
ト側には転送方式を各バッファ毎に識別する機能が設け
られる。このホスト側で認識されたデバイスバッファの
ことをエンドポイントと呼び、バッファに付された番号
のことをエンドポイント番号という。
Here, the endpoint means a buffer associated with the transfer method by the host controller. For example, a printer multifunction peripheral with a fax function has a printer function and a fax function in one device. The data and the transfer method to be handled are different for each of these functions. Therefore, the device side is provided with a buffer (FIFO) for each transfer, and the host side is provided with a function for identifying the transfer method for each buffer. The device buffer recognized on the host side is called an endpoint, and the number attached to the buffer is called an endpoint number.

【0010】ここで、コンピュータに既にUSBインタ
ーフェイスを介してデバイスが接続されているとする。
このとき、ホストはデバイスを認識してデバイスアドレ
スを割り当てた状態になっている。よって、コンピュー
タ上で稼働するアプリケーションはデバイスアドレスを
指定すればデバイスにアクセスすることができる。
Here, it is assumed that the device is already connected to the computer via the USB interface.
At this time, the host recognizes the device and assigns the device address. Therefore, the application running on the computer can access the device by designating the device address.

【0011】一方、コンピュータ側もしくはデバイス側
のUSBコネクタからUSBケーブルが抜かれて、もし
くはデバイス側の電源がOFFになった場合、デバイス
へのアクセスができない状態になる。この状態で、アプ
リケーションからデバイスへのアクセス要求があると、
デバイスにデータが転送されないことによりホスト側で
エラーが出力される。しかし、アプリケーションからデ
バイスへアクセスがなければ、ホストはエラーを出力し
ないようになっている。
On the other hand, when the USB cable is pulled out from the USB connector on the computer side or the device side or the power source on the device side is turned off, the device cannot be accessed. In this state, if an application requests access to the device,
An error is output on the host side because the data is not transferred to the device. However, if the application does not access the device, the host will not output an error.

【0012】[0012]

【発明が解決しようとする課題】ここで、アプリケーシ
ョンからデバイスへのアクセスがないまま、デバイスが
コンピュータに再接続した場合、ホスト(コンピュー
タ)からエラーが出力されてないので、ユーザーはデバ
イスを切断する前と同じようにデバイスを使用できると
認識する。しかし、同一のデバイスが再接続された場合
であっても、ホストは上述したエニュメレーションモー
ドを実行してデバイスの認識を行う。ここで、ホストに
より割り当てられた同一のデバイスに対するデバイスア
ドレスが、最初に接続された際に割り当てられたものと
新しいものとでは異なる場合がある。すると、アプリケ
ーションから旧いデバイスアドレスを指定してデバイス
にアクセスしようとしても、デバイスにアクセスできな
い。よって、デバイスが再接続した場合には、ホストに
接続されたデバイスの中からアクセスしたいデバイスを
検索する時間が必要になるか、もしくはアプリケーショ
ンはエラーを発生するようになる。
If the device is reconnected to the computer without the application accessing the device, the host (computer) does not output an error, and the user disconnects the device. Recognize that you can use the device as before. However, even when the same device is reconnected, the host executes the enumeration mode described above to recognize the device. Here, the device address assigned to the same device by the host may be different from that assigned when the device was first connected. Then, even if the application tries to access the device by specifying the old device address, the device cannot be accessed. Therefore, when the device is reconnected, it takes time to search for the device to be accessed from the devices connected to the host, or the application causes an error.

【0013】このように、ユーザーにはデバイスを再接
続して切断する前と同様の条件で使用できるように見え
ても、コンピュータ上では認識作業を行う等しなければ
デバイスを認識できない状態になっている。すなわち、
ユーザーによる認識とコンピュータ上の認識がずれてし
まい、ユーザーインターフェイスが図れないという問題
がある。
As described above, even if the user can use the device under the same conditions as before the device is reconnected and disconnected, the device cannot be recognized on the computer unless the recognition work is performed on the computer. ing. That is,
There is a problem that the user interface cannot be achieved because the recognition by the user is different from the recognition on the computer.

【0014】そこで、本発明は、活線挿抜可能なインタ
ーフェイスでコンピュータと接続されたデバイスをより
使いやすくするデバイス制御方法および装置を提供する
ことを目的とする。
Therefore, an object of the present invention is to provide a device control method and apparatus that make it easier to use a device connected to a computer by means of a hot-pluggable interface.

【0015】[0015]

【課題を解決するための手段】本発明のデバイス制御方
法は、活線挿抜可能なインターフェイスを用いてコンピ
ュータに接続されたデバイスを制御するデバイス制御方
法において、前記デバイスが前記コンピュータに接続さ
れた際に、該デバイスからデバイス情報を取得するとと
もに、該デバイスを識別するためのデバイスアドレスを
該デバイスに割り当てるステップと、前記コンピュータ
上で稼働するアプリケーションが前記デバイスを使用す
る際に該デバイスを識別するための仮想デバイスアドレ
スを前記デバイスに割り当てるステップと、前記デバイ
スに割り当てられた前記仮想デバイスアドレスと前記デ
バイスアドレスと前記デバイス情報とをリンクさせたア
ドレステーブルを作成するステップと、前記アプリケー
ションが前記デバイスにアクセスした場合、前記アドレ
ステーブルを用いて、前記アプリケーションから送られ
るデータに含まれる前記仮想デバイスアドレスを、該仮
想デバイスアドレスにリンクした前記デバイスアドレス
に変換して前記デバイスに送るステップとを備え、前記
デバイスが前記コンピュータから切断されて更に再接続
された場合に、新たに前記デバイスから取得される新デ
バイス情報を用いて、前記アドレステーブルから同一の
前記デバイス情報を検索するステップと、前記アドレス
テーブル内に前記新デバイスアドレスと同一の前記デバ
イス情報がある場合、該デバイス情報にリンクした前記
デバイスアドレスを前記新デバイスアドレスに更新する
ステップとを有することを特徴とする。
A device control method of the present invention is a device control method for controlling a device connected to a computer by using a hot-swappable interface, when the device is connected to the computer. A step of obtaining device information from the device and assigning a device address for identifying the device to the device, and identifying the device when an application running on the computer uses the device. Assigning the virtual device address of the device to the device; creating an address table that links the virtual device address assigned to the device, the device address, and the device information; Access to the device, using the address table, converting the virtual device address included in the data sent from the application into the device address linked to the virtual device address and sending the device address. A step of retrieving the same device information from the address table using new device information newly acquired from the device when the device is disconnected from the computer and reconnected again; Updating the device address linked to the device information to the new device address when the device information identical to the new device address is present in the table.

【0016】また、本発明のデバイス制御装置は、活線
挿抜可能なインターフェイスを用いてコンピュータに接
続されたデバイスを制御するデバイス制御装置におい
て、前記デバイスが前記コンピュータに接続されたこと
を認識して、該デバイスからデバイス情報を取得するデ
バイス管理手段と、該デバイス管理手段により前記デバ
イスが認識された際に、前記デバイスを識別するための
デバイスアドレスを該デバイスに割り当てるアドレス設
定手段と、前記コンピュータ上で稼働するアプリケーシ
ョンが前記デバイスを使用する際に前記アプリケーショ
ンが前記デバイスを識別するための仮想デバイスアドレ
スを割り当てる仮想アドレス設定手段と、該仮想アドレ
ス設定手段により割り当てられた前記仮想デバイスアド
レスと、前記アドレス設定手段により割り当てられた前
記デバイスアドレスと、前記デバイス管理手段で取得さ
れた前記デバイス情報とをリンクさせたアドレステーブ
ルを作成して記憶するアドレス管理手段と、前記アプリ
ケーションが前記デバイスにアクセスした場合、前記ア
ドレステーブルを用いて、前記アプリケーションから送
られるデータに含まれる前記仮想デバイスアドレスを、
該仮想デバイスアドレスにリンクした前記デバイスアド
レスに変換して前記デバイスに送るアドレス変換手段と
を備え、前記アドレス管理手段は、前記デバイスが前記
コンピュータから切断されて更に再接続された場合に、
新たに前記デバイスから取得される新デバイス情報を用
いて、前記アドレステーブルから新たに割り当てられた
新デバイス情報と同一の前記デバイス情報を検索して、
前記アドレステーブル内に前記新デバイスアドレスと同
一のデバイス情報がある場合、前記仮想デバイスアドレ
スは同じままで該デバイス情報にリンクした前記デバイ
スアドレスを前記新デバイスアドレスに更新するもので
あることを特徴とする。
Further, the device control apparatus of the present invention is a device control apparatus for controlling a device connected to a computer by using a hot-pluggable interface, recognizing that the device is connected to the computer. A device management unit that acquires device information from the device; an address setting unit that allocates a device address for identifying the device to the device when the device management unit recognizes the device; A virtual address setting unit that assigns a virtual device address for the application to identify the device when the application running on the device uses the device, the virtual device address assigned by the virtual address setting unit, and the address. When the device accesses the device, the address management unit that creates and stores an address table in which the device address assigned by the setting unit and the device information acquired by the device management unit are linked, Using the address table, the virtual device address included in the data sent from the application,
Address conversion means for converting the device address linked to the virtual device address and sending it to the device, wherein the address management means, when the device is disconnected from the computer and reconnected,
Using the new device information newly acquired from the device, search the same device information as the newly assigned new device information from the address table,
If the same device information as the new device address exists in the address table, the virtual device address remains the same and the device address linked to the device information is updated to the new device address. To do.

【0017】ここで、「デバイスがコンピュータに接続
された」とは、コンピュータが認識可能な状態で、デバ
イスが接続されたことを意味する。また、「仮想デバイ
スアドレスの割り当て」は、アプリケーションが起動し
たときに行ってもよいし、コンピュータの起動と同時に
行ってもよい。
Here, "the device is connected to the computer" means that the device is connected in a state in which the computer can recognize it. Further, the “assignment of virtual device address” may be performed when the application is activated, or may be performed at the same time when the computer is activated.

【0018】さらに、「アドレステーブル」は、バッフ
ァに格納されてコンピュータが起動するたびに作成して
もよいし、一度作成したアドレステーブルをコンピュー
タに記憶させて、コンピュータが起動するたびに同じア
ドレステーブルを使用してもよい。また「デバイス情
報」とは、コンピュータに接続されたデバイスを特定す
るための各デバイス特有の情報を意味する。
Further, the "address table" may be stored in a buffer and created every time the computer is started, or the created address table may be stored in the computer and the same address table may be created each time the computer is started. May be used. The “device information” means information unique to each device for identifying the device connected to the computer.

【0019】[0019]

【発明の効果】本発明のデバイス制御方法および装置に
よれば、アプリケーションがデバイスにデータ転送する
場合、デバイスがコンピュータに再接続されても変わら
ない仮想デバイスアドレスを用いて行うため、デバイス
が一度切断されて更に再接続された場合に、アプリケー
ションがデバイスにアクセス使用としたときのシークタ
イムを短縮もしくはエラーの発生を防止することがで
き、ユーザーインターフェイスの向上を図ることができ
る。
According to the device control method and apparatus of the present invention, when an application transfers data to a device, the device is disconnected once because it uses a virtual device address that does not change even if the device is reconnected to the computer. When the application is reconnected to the device, the seek time when the application attempts to access and use the device can be shortened or the occurrence of an error can be prevented, and the user interface can be improved.

【0020】なお、作成したアドレステーブルをコンピ
ュータに保存して、コンピュータが起動するたびに同一
のアドレステーブルを用いるようにすることで、仮想デ
バイスアドレスをコンピュータが起動するたびに割り当
てる必要がなくなり、仮想デバイスアドレスを割り当て
るための処理の軽減化および時間の短縮化を図ることが
できる。
By saving the created address table in the computer and using the same address table each time the computer is started, it is not necessary to assign a virtual device address each time the computer is started, and the virtual device address is not required. It is possible to reduce the processing for allocating the device address and the time.

【0021】[0021]

【発明の実施の形態】図1はデバイスとコンピュータと
の構成例を示す模式図である。図1において、コンピュ
ータ1とデバイス20はUSBケーブル10によって直
接つながれている。そして、コンピュータ1が起動する
ときにデバイス20が認識可能な状態で接続されていれ
ば、コンピュータ1起動時にはデバイス20が認識され
て使用可能な状態になる。一方、コンピュータ1が起動
している状態でデバイス20が接続された場合、接続さ
れた時点でデバイスの認識がコンピュータ1内で行われ
る。そして、認識完了時からデバイスが使用可能な状態
になる。
1 is a schematic diagram showing a configuration example of a device and a computer. In FIG. 1, the computer 1 and the device 20 are directly connected by a USB cable 10. If the device 20 is connected in a recognizable state when the computer 1 starts up, the device 20 is recognized and becomes usable when the computer 1 starts up. On the other hand, when the device 20 is connected while the computer 1 is running, the device is recognized in the computer 1 when the device 20 is connected. Then, the device is ready to use after the recognition is completed.

【0022】なお、図1において、デバイス20はコン
ピュータ1に直接接続された場合について例示している
が、コンピュータ1に複数のデバイス20を接続する場
合、コンピュータ1と複数のデバイス20とが接続され
たハブを介して接続されもよいし、複数のデバイス20
同士をUSBケーブル10で接続して、コンピュータ1
と接続するようにしてもよい。
Although FIG. 1 illustrates the case where the device 20 is directly connected to the computer 1, when the plurality of devices 20 are connected to the computer 1, the computer 1 and the plurality of devices 20 are connected. Connected via a hub or a plurality of devices 20
Connect each other with a USB cable 10
May be connected to.

【0023】図2はコンピュータ1およびデバイス20
における階層構造を示す概念図である。図2のコンピュ
ータ1内にUSBインターフェイス全体を制御するホス
トが構成されており、ホストはバスインターフェイス3
0、デバイス制御装置(論理デバイス)40、アプリケ
ーション50の3つの階層構造を有する。バスインター
フェイス30は、デバイス20とのデータの送受信を行
う物理的な階層であって、USBケーブル10と接続す
るSIE(Serial InterfaceEngi
ne)31が設けられている。
FIG. 2 shows a computer 1 and a device 20.
3 is a conceptual diagram showing a hierarchical structure in FIG. A host that controls the entire USB interface is configured in the computer 1 of FIG. 2, and the host is the bus interface 3
0, a device control device (logical device) 40, and an application 50 have three hierarchical structures. The bus interface 30 is a physical layer that transmits and receives data to and from the device 20, and is a SIE (Serial Interface Engine) that is connected to the USB cable 10.
ne) 31 is provided.

【0024】デバイス制御装置(論理デバイス)40
は、バスインターフェイス30にコンピュータ1で生成
されるデータを出力し、もしくはデバイス20から送ら
れるデータを処理するソフトウェアからなる階層であ
る。このソフトウェアは、バスインターフェイスのホス
トコントローラおよびコンピュータ1のCPUによって
稼働する。アプリケーション50は、様々なベンダから
提供される機能を提供する応用ソフトウェアやデバイス
20の動作を制御するためのデバイスドライバ等からな
る階層である。
Device control device (logical device) 40
Is a layer of software that outputs data generated by the computer 1 to the bus interface 30 or processes data transmitted from the device 20. This software is run by the host controller of the bus interface and the CPU of the computer 1. The application 50 is a layer including application software that provides functions provided by various vendors, a device driver for controlling the operation of the device 20, and the like.

【0025】デバイス20は、バスインターフェイス2
1、USB論理デバイス22、ファンクション23の階
層構造を有する。バスインターフェイス21は、コンピ
ュータ1とデータの送受信を行う物理的な階層であっ
て、USBケーブル10と接続するSIE(Seria
l Interface Engine)21が設けら
れている。論理デバイス22は、デバイス20のエンド
ポイントでのデータの入出力処理を行う階層である。フ
ァンクション23は、ホストに対して機能を提供する階
層であって、ホスト側にスクリプトを送信することで、
ホスト側でデバイスが提供できる機能を用いることがで
きるようになる。
The device 20 is a bus interface 2
1, a USB logical device 22, and a function 23 have a hierarchical structure. The bus interface 21 is a physical layer that transmits / receives data to / from the computer 1, and is a SIE (Serial) connected to the USB cable 10.
l Interface Engine) 21 is provided. The logical device 22 is a layer that performs data input / output processing at the endpoint of the device 20. The function 23 is a layer that provides a function to the host, and by sending a script to the host side,
The host side can use the functions that the device can provide.

【0026】図3は本発明のデバイス制御装置の好まし
い実施の形態を示すブロック図であり、図3を参照して
デバイス制御装置40について説明する。デバイス制御
装置40は、このコンピュータ1もしくはホストコント
ローラ32に組み込まれたプログラムをコンピュータ1
上で稼働することにより実現される。
FIG. 3 is a block diagram showing a preferred embodiment of the device control apparatus of the present invention, and the device control apparatus 40 will be described with reference to FIG. The device control device 40 executes the program installed in the computer 1 or the host controller 32 on the computer 1
Realized by running on.

【0027】デバイス制御装置40は、デバイス管理手
段41、アドレス設定手段42、仮想アドレス設定手段
43、アプリケーション監視手段44、アドレス管理手
段46等を備える。デバイス管理手段41は、コンピュ
ータ1に接続されたデバイス20に対して様々なデバイ
スリクエストをデバイスに送信し、デバイス20からの
応答を受信するものである。またデバイス管理手段41
は、バスインターフェイス30に対してデータパケット
の送受信を行い、デバイス20との間でデータ転送を行
うものである。特に、デバイス管理手段41は、デバイ
ス20から取得した構成情報のうち、ベンダIDやプロ
ダクトID等デバイス20特有の情報(以下「デバイス
情報」という)DIをアドレス管理手段46に送るよう
になっている。
The device control device 40 comprises a device management means 41, an address setting means 42, a virtual address setting means 43, an application monitoring means 44, an address management means 46 and the like. The device management unit 41 sends various device requests to the device 20 connected to the computer 1 and receives a response from the device 20. Also, the device management means 41
Are for transmitting and receiving data packets to and from the bus interface 30 and for transferring data to and from the device 20. In particular, the device management means 41 is adapted to send information unique to the device 20 such as a vendor ID and a product ID (hereinafter referred to as “device information”) DI to the address management means 46 among the configuration information acquired from the device 20. .

【0028】ここで、デバイス管理手段41からデバイ
ス20にControl転送される場合には、図4に示
すようなトークンパケット(Token Packe
t)が送られる。なお、デバイス管理手段41からデバ
イス20にデータ転送される場合であっても、データパ
ケットの前にトークンパケットが送られる。図4のトー
クンパケットには7bit(0〜127)のデータ列か
らなるデバイスアドレスADDRが含まれている。トー
クンパケットのデバイスアドレスADDRと同一のデバ
イス20がトークンパケットに反応してデータの送受信
が行われることになる。
Here, when the device management unit 41 transfers the control to the device 20, the token packet (Token Packet) as shown in FIG.
t) is sent. Even when data is transferred from the device management means 41 to the device 20, the token packet is sent before the data packet. The token packet in FIG. 4 includes a device address ADDR composed of a 7-bit (0 to 127) data string. The device 20 which is the same as the device address ADDR of the token packet responds to the token packet and data is transmitted and received.

【0029】アドレス設定手段42は、コンピュータ1
に接続されたデバイス20にデバイスアドレスADDR
を設定するものである。ここで、デバイスアドレスAD
DRを設定する際には、アドレス設定手段42は各デバ
イス20が競合しないようにデバイスアドレスADDR
を割り当てるようになっている。また、アドレス設定手
段42は設定したデバイスアドレスADDRをアドレス
管理手段46に送るようになっている。
The address setting means 42 is the computer 1
Device address ADDR to the device 20 connected to
Is to be set. Where device address AD
When setting the DR, the address setting means 42 uses the device address ADDR so that the devices 20 do not conflict with each other.
Are to be assigned. Further, the address setting means 42 sends the set device address ADDR to the address management means 46.

【0030】仮想アドレス設定手段43は、アプリケー
ション50がデバイス20を使用する際に、アプリケー
ション50がデバイス20を識別するための仮想デバイ
スアドレスHDAを割り当てる機能を有する。そして、
仮想アドレス設定手段43は、設定した仮想デバイスア
ドレスHDAをアドレス管理手段46に送るようになっ
ている。
The virtual address setting means 43 has a function of assigning a virtual device address HDA for the application 50 to identify the device 20 when the application 50 uses the device 20. And
The virtual address setting means 43 sends the set virtual device address HDA to the address management means 46.

【0031】ここで、従来のデバイス制御装置において
は、アプリケーション50は、アドレス設定手段42に
より割り当てられたデバイスアドレスADDRを用いて
デバイス20を使用する。一方、図3のデバイス制御装
置40においては、アプリケーション50は、仮想デバ
イスアドレスHDAを用いデバイス20を使用するよう
になっている。なお、仮想デバイスアドレスHDAは、
たとえばデバイスアドレスADDRと同一のデータ長
(7bit)を有する。
Here, in the conventional device control apparatus, the application 50 uses the device 20 by using the device address ADDR assigned by the address setting means 42. On the other hand, in the device control apparatus 40 of FIG. 3, the application 50 uses the virtual device address HDA to use the device 20. The virtual device address HDA is
For example, it has the same data length (7 bits) as the device address ADDR.

【0032】アプリケーション監視手段44は、アプリ
ケーション50の起動および終了を監視するものであ
る。特に、アプリケーション監視手段44は、アプリケ
ーション50に起動を認識すると、後述するアドレス管
理手段46に格納された仮想デバイスアドレスHDAを
アプリケーション50に送るようになっている。する
と、アプリケーション50は仮想デバイスアドレスHD
Aでデバイス20を指定するようになる。
The application monitoring means 44 monitors the activation and termination of the application 50. In particular, the application monitoring unit 44 sends the virtual device address HDA stored in the address management unit 46, which will be described later, to the application 50 when the application 50 recognizes the activation. Then, the application 50 determines that the virtual device address HD
The device 20 is designated by A.

【0033】アドレス変換手段45は、アプリケーショ
ン50からアプリケーション監視手段44を介して送ら
れたデータD1をアドレス変換処理して、デバイス管理
手段41に送る機能を有する。具体的には、アドレス変
換手段45は、データD1に含まれる仮想デバイスアド
レスHDAを、デバイスアドレスADDRに変換してデ
バイス管理手段41に送る。
The address conversion means 45 has a function of performing address conversion processing on the data D1 sent from the application 50 via the application monitoring means 44, and sending it to the device management means 41. Specifically, the address conversion unit 45 converts the virtual device address HDA included in the data D1 into a device address ADDR and sends the device address ADDR to the device management unit 41.

【0034】次に、図3を参照してアドレス管理手段4
6について説明する。アドレス管理手段46は、デバイ
ス管理手段41から送られるデバイス情報DIと、アド
レス設定手段42から送られるデバイスアドレスADD
Rと、仮想アドレス設定手段43から送られる仮想デバ
イスアドレスHDAとをリンクしたアドレステーブルA
Tを記憶する機能を有する。よって、アドレステーブル
ATは、図5に示すように、デバイスアドレスADD
R、デバイス情報DIおよび仮想デバイスアドレスHD
Aがリンクした状態で格納される。
Next, referring to FIG. 3, the address management means 4
6 will be described. The address management unit 46 receives the device information DI sent from the device management unit 41 and the device address ADD sent from the address setting unit 42.
An address table A that links R and the virtual device address HDA sent from the virtual address setting means 43.
It has a function of storing T. Therefore, as shown in FIG. 5, the address table AT shows the device address ADD.
R, device information DI and virtual device address HD
A is stored in a linked state.

【0035】なお、アドレステーブルATはコンピュー
タ1が起動する毎にデバイス管理手段41によって作成
されるものでもよいし、ハードディスク装置等のコンピ
ュータ1内の記憶装置に記録して、コンピュータ1が再
起動しても同一内容のアドレステーブルATを使用する
ようにしてもよい。
The address table AT may be created by the device management means 41 every time the computer 1 is started up, or may be recorded in a storage device in the computer 1 such as a hard disk device and the computer 1 is restarted. Alternatively, the address table AT having the same content may be used.

【0036】また、図3のアドレス管理手段46は、各
構成部位からの要求もしくはデータ転送により種々の動
作を行う。まず、アドレス管理手段46とデバイス管理
手段41の関係について説明する。アドレス管理手段4
6は、デバイス管理手段41からデバイス情報DIを取
得すると、アドレステーブルATの中から同一のデバイ
ス情報DIがあるか否かを検索する。すなわち、デバイ
ス管理手段41がデバイス情報DIをアドレス管理手段
46に送る場合、新しいデバイス20がコンピュータに
接続されるときに限られる。一方、一度コンピュータ1
に接続されたデバイス20に対しては、デバイス情報D
Iや仮想デバイスアドレスHDAをリンクしたアドレス
テーブルATが作成された状態にある。よって、アドレ
ス管理手段46は、デバイス情報DIを受け取ると、そ
のデバイス20が新規に接続されたものか、あるいは再
接続されたものか否かを判断するためアドレステーブル
AT内を検索するようにしている。
The address management means 46 shown in FIG. 3 performs various operations in response to requests or data transfers from each component. First, the relationship between the address management means 46 and the device management means 41 will be described. Address management means 4
When the device information DI is acquired from the device management means 41, the device 6 searches the address table AT for the same device information DI. That is, when the device management unit 41 sends the device information DI to the address management unit 46, it is limited to when the new device 20 is connected to the computer. On the other hand, once computer 1
Device information D for the device 20 connected to
The address table AT in which I or the virtual device address HDA is linked is created. Therefore, when the address management means 46 receives the device information DI, it searches the address table AT to determine whether the device 20 is newly connected or reconnected. There is.

【0037】検索の結果、同一のデバイス情報DIが存
在した場合、アドレス管理手段46は、そのデバイス情
報DIにリンクしたデバイスアドレスADDRを、アド
レス設定手段42で新たに割り当てられたデバイスアド
レスADDRに更新したアドレステーブルATを作成す
る。一方、同一のデバイス情報DIが存在しない場合
は、アドレス管理手段46は仮想アドレス設定手段43
に仮想デバイスアドレスHDAの割り当てを要求する。
そして、アドレス管理手段46は新規に接続されたデバ
イス20のデバイスアドレスADDR、仮想デバイスア
ドレスHDAおよびデバイス情報DIをリンクした新規
のアドレステーブルATを作成する。
When the same device information DI exists as a result of the search, the address management means 46 updates the device address ADDR linked to the device information DI to the device address ADDR newly assigned by the address setting means 42. The created address table AT is created. On the other hand, when the same device information DI does not exist, the address management means 46 causes the virtual address setting means 43.
To request the allocation of the virtual device address HDA.
Then, the address management means 46 creates a new address table AT in which the device address ADDR of the newly connected device 20, the virtual device address HDA and the device information DI are linked.

【0038】また、アドレス管理手段46は、アプリケ
ーション監視手段44からの要求により、仮想デバイス
アドレスHDAをアプリケーション監視手段44に送る
機能を有する。すると、アプリケーション監視手段44
はアプリケーション50仮想デバイスアドレスHDAを
通知して、アプリケーション50がデバイス20を仮想
デバイスアドレスHDAで指定するようになる。
The address management means 46 has a function of sending the virtual device address HDA to the application monitoring means 44 in response to a request from the application monitoring means 44. Then, the application monitoring means 44
Notifies the application 50 virtual device address HDA so that the application 50 can specify the device 20 by the virtual device address HDA.

【0039】さらにアドレス管理手段46はアドレス変
換手段45からの要求により、仮想デバイスアドレスH
DAに対応したデバイスアドレスADDRを検索してア
ドレス変換手段45に送る機能を有する。すると、アド
レス変換手段45は、データD1内の仮想デバイスアド
レスHDAをデバイスアドレスADDRに変換して、デ
バイス管理手段41に送るようになる。
Further, the address management means 46 responds to the request from the address conversion means 45 to generate the virtual device address
It has a function of searching the device address ADDR corresponding to DA and sending it to the address conversion means 45. Then, the address conversion unit 45 converts the virtual device address HDA in the data D1 into the device address ADDR and sends it to the device management unit 41.

【0040】なお、上述したように、アドレス管理手段
46は新規なデバイス20が検索されると、仮想デバイ
スアドレスHDAを割り当てるようにしているが、アプ
リケーション監視手段44の要求があったときに、仮想
アドレス設定手段43に仮想デバイスアドレスHDAの
要求を行うようにしてもよい。このとき、アプリケーシ
ョン監視手段44からの要求があるまでは、デバイスア
ドレスADDRとデバイス情報DIとのみがリンクした
状態のアドレステーブルATが作成されることになる。
As described above, the address management means 46 allocates the virtual device address HDA when the new device 20 is searched. However, when the application monitoring means 44 makes a request, the virtual device address HDA is allocated. The virtual device address HDA may be requested to the address setting means 43. At this time, until there is a request from the application monitoring means 44, the address table AT in which only the device address ADDR and the device information DI are linked is created.

【0041】図6から図8は本発明のデータ制御方法の
好ましい実施の形態を示すフローチャート図であり、図
1から図8を参照してデータ制御方法について説明す
る。なお、図6はデバイス認識過程、図7はデバイスへ
のデータ転送過程、図8はデバイス20の切断および再
接続の過程をそれぞれ示すフローチャート図である。
6 to 8 are flowcharts showing a preferred embodiment of the data control method of the present invention, and the data control method will be described with reference to FIGS. 1 to 8. 6 is a device recognition process, FIG. 7 is a data transfer process to the device, and FIG. 8 is a flowchart showing the process of disconnecting and reconnecting the device 20.

【0042】まず、図6を参照してデバイス20の認識
過程について説明する。デバイス20が接続されていな
い場合、デバイス制御装置40においてはデバイス20
は存在しないと認識される。一方、デバイス20が接続
されると、デバイス管理手段41において、デバイスの
接続がUSBポートの電流変化によって認識される(ス
テップST1)。
First, the recognition process of the device 20 will be described with reference to FIG. If the device 20 is not connected, the device
Is recognized as not existing. On the other hand, when the device 20 is connected, the device management unit 41 recognizes the device connection by the change in the current of the USB port (step ST1).

【0043】すると、デバイス管理手段41において、
エニュメレーションが実行される。具体的には、デバイ
ス管理手段41からデバイス20へControl転送
が行われる。そして、このControl転送によりデ
フォルトアドレスのデバイス20がデバイス管理手段4
1で認識される。その後、そのデバイス20に割り当て
るデバイスアドレスADDRの要求が、デバイス管理手
段41からアドレス設定手段42になされる。
Then, in the device management means 41,
Enumeration is executed. Specifically, Control transfer is performed from the device management means 41 to the device 20. By this Control transfer, the device 20 having the default address is transferred to the device management means 4
Recognized by 1. Thereafter, the device management unit 41 requests the address setting unit 42 to request the device address ADDR to be assigned to the device 20.

【0044】すると、アドレス設定手段42において、
接続されたデバイス20のデバイスアドレスADDRが
他のデバイス20と競合しないようにアドレステーブル
ATを参照しながら設定されて、デバイス管理手段41
に送られる。設定されたデバイスアドレスADDRは、
アドレス設定手段42からアドレス管理手段46に送ら
れる。その後、デバイスアドレスADDRは、トークン
パケットによりデバイス20側に送られて、デバイス2
0のバッファにデバイスアドレスADDRが格納される
(ステップST2)。
Then, in the address setting means 42,
The device address ADDR of the connected device 20 is set with reference to the address table AT so as not to conflict with other devices 20, and the device management means 41
Sent to. The set device address ADDR is
It is sent from the address setting means 42 to the address management means 46. After that, the device address ADDR is sent to the device 20 side by the token packet, and the device 2
The device address ADDR is stored in the 0 buffer (step ST2).

【0045】次に、デバイスディスクリプタ、コンフィ
グレーションディスクリプタ等の構成情報がデバイス管
理手段41によりデバイス20から取得される。これに
より、コンピュータ1上でデバイス20の機能を使用す
ることができるようになる。なお、構成情報の読み込み
において、デバイスディスクリプタに記述されたデバイ
ス情報DIが読み出される(ステップST3)。する
と、デバイス管理手段41はコンピュータ1内の「In
f」ファイルで構成されたドライバリストと比較する。
Infファイル内に同一のデバイス情報DIがある場
合、そのデバイスドライバがコンピュータ1内で読み込
まれる。これによりコンピュータ1上でデバイスが使用
可能な状態となる。一方、認識したデバイス20がコン
ピュータ1内のドライバリストにない場合、コンピュー
タ1上でデバイスドライバのインストール作業が行われ
る。
Next, the device management unit 41 acquires the configuration information such as the device descriptor and the configuration descriptor from the device 20. As a result, the functions of the device 20 can be used on the computer 1. In reading the configuration information, the device information DI described in the device descriptor is read (step ST3). Then, the device management means 41 causes the “In
f "file to compare with the driver list.
If the same device information DI exists in the Inf file, the device driver is read in the computer 1. This brings the device into a usable state on the computer 1. On the other hand, if the recognized device 20 is not in the driver list in the computer 1, the device driver is installed on the computer 1.

【0046】そして、読み取ったデバイス情報DIは、
デバイス管理手段41からアドレス管理手段46に送ら
れる。その後、仮想アドレス設定手段43において仮想
デバイスアドレスHDAが他のデバイス20と競合しな
いように割り当てられて、デバイス管理手段41に送ら
れる(ステップST4)。すると、デバイスアドレスA
DDR、仮想デバイスアドレスHDAおよびデバイス情
報DIをリンクしたアドレステーブルATがデバイス管
理手段41により作成される(ステップST5)。
Then, the read device information DI is
It is sent from the device management means 41 to the address management means 46. After that, the virtual device address HDA is assigned by the virtual address setting means 43 so as not to conflict with other devices 20, and is sent to the device management means 41 (step ST4). Then the device address A
An address table AT in which the DDR, the virtual device address HDA and the device information DI are linked is created by the device management means 41 (step ST5).

【0047】次に、図3と図7を参照して、アプリケー
ション50の起動およびアプリケーション50からデバ
イス20へのデータ転送過程について説明する。まず、
ユーザーの操作等により、アプリケーション50がコン
ピュータ1上で起動する(ステップST10)。アプリ
ケーション50が起動したとき、仮想デバイスアドレス
HDAの要求が、アプリケーション監視手段44からア
ドレス管理手段46にさなれる(ステップST11)。
すると、アドレス管理手段46において、アドレステー
ブルATの中から該当するデバイス20のデバイスアド
レスADDRが検索される。その後、アドレス管理手段
46において、デバイスアドレスADDRとリンクした
仮想デバイスアドレスHDAが取得され、アプリケーシ
ョン監視手段44を介してアプリケーション50に送ら
れる。すると、アプリケーション50は、デバイス20
の特定を仮想デバイスアドレスHDAによって行うよう
になる。
Next, with reference to FIGS. 3 and 7, the process of starting the application 50 and transferring data from the application 50 to the device 20 will be described. First,
The application 50 is activated on the computer 1 by a user operation or the like (step ST10). When the application 50 is activated, a request for the virtual device address HDA is sent from the application monitoring means 44 to the address management means 46 (step ST11).
Then, the address management means 46 searches the address table AT for the device address ADDR of the corresponding device 20. After that, the virtual device address HDA linked with the device address ADDR is acquired by the address management means 46 and sent to the application 50 via the application monitoring means 44. Then, the application 50 sends the device 20
Is specified by the virtual device address HDA.

【0048】次に、アプリケーション50からデバイス
20にデータD1が転送された場合、データD1はアプ
リケーション50からアプリケーション監視手段44を
介してアドレス変換手段45に転送される(ステップS
T12)。すると、アドレス変換手段45において、デ
ータD1に含まれる仮想デバイスアドレスHDAが認識
される(ステップST13)。そして、データD1に付
された仮想デバイスアドレスHDAに対応したデバイス
アドレスADDRの要求が、アドレス変換手段45から
アドレス管理手段46になされる。その後、アドレス変
換手段45によりデータD1の仮想デバイスアドレスH
DAがアドレス管理手段46から取得したデバイスアド
レスADDRに変換される。すると、変換データD10
が生成されて、アドレス変換手段45からデバイス管理
手段41へと送られる。
Next, when the data D1 is transferred from the application 50 to the device 20, the data D1 is transferred from the application 50 to the address conversion means 45 via the application monitoring means 44 (step S).
T12). Then, the address conversion means 45 recognizes the virtual device address HDA included in the data D1 (step ST13). Then, the request for the device address ADDR corresponding to the virtual device address HDA attached to the data D1 is sent from the address conversion means 45 to the address management means 46. After that, the address conversion means 45 causes the virtual device address H of the data D1.
DA is converted into the device address ADDR acquired from the address management means 46. Then, the converted data D10
Is generated and sent from the address conversion means 45 to the device management means 41.

【0049】そして、変換データD10がデバイス管理
手段41からデバイス20へとパケット送信されて、変
換データD10に付されたデバイスアドレスADDRを
割り当てられたデバイス20に変換データD10が転送
される(ステップST14)。これにより、アプリケー
ション50が仮想デバイスアドレスHDAを用いてデバ
イス20を指定した場合であっても、アプリケーション
50が指定したデバイス20とアクセスすることができ
る。
Then, the conversion data D10 is packet-transmitted from the device management means 41 to the device 20, and the conversion data D10 is transferred to the device 20 to which the device address ADDR attached to the conversion data D10 is assigned (step ST14). ). Accordingly, even when the application 50 specifies the device 20 using the virtual device address HDA, it is possible to access the device 20 specified by the application 50.

【0050】次に、図8を参照してデバイス20が切断
もしくは電源OFFされた後再接続された場合について
説明する。なお、図8においては、アプリケーション5
0が起動しているときに再接続があった場合について言
及する。
Next, a case where the device 20 is disconnected or turned off and then reconnected will be described with reference to FIG. In FIG. 8, the application 5
Note the case where there was a reconnection when 0 was up.

【0051】まず、アプリケーションが起動していると
き、デバイス20の接続状態が常にデバイス管理手段4
1によって監視されている(ステップST20、ST2
1)。また、デバイス20が切断等されたか否かもデバ
イス管理手段41によって監視されている(ステップS
T22)。ここで、デバイス20がコンピュータ1から
切断された場合、デバイス管理手段41によりデバイス
20の切断が認識される。この状態でアプリケーション
50からデバイス20に対して変換データD10が転送
された場合(ステップST23)、デバイス管理手段4
1からコンピュータ1のシステムに対してエラーを示す
情報が出力される(ステップST24)。
First, when the application is running, the connection state of the device 20 is always the device management means 4
1 is monitored (steps ST20, ST2)
1). The device management means 41 also monitors whether or not the device 20 has been disconnected (step S).
T22). Here, when the device 20 is disconnected from the computer 1, the device management unit 41 recognizes the disconnection of the device 20. When the conversion data D10 is transferred from the application 50 to the device 20 in this state (step ST23), the device management unit 4
1 outputs information indicating an error to the system of the computer 1 (step ST24).

【0052】一方、アプリケーション50からデバイス
20に対してデータ転送がない状態で切断等されたデバ
イス20が再接続された場合(ステップST26)、デ
バイス20の認識および新たなデバイスアドレスADD
Rnの割り当てが行われる(図6のステップST1〜ス
テップST3を参照)。そして、割り当てられたデバイ
スアドレスADDRnがデバイス管理手段41からアド
レス管理手段46に送られるとともに、デバイス情報D
Inがアドレス設定手段42からアドレス管理手段46
に送られる。
On the other hand, when the device 20 disconnected from the application 50 without data transfer to the device 20 is reconnected (step ST26), the device 20 is recognized and a new device address ADD is added.
Rn is assigned (see steps ST1 to ST3 in FIG. 6). Then, the assigned device address ADDRn is sent from the device management means 41 to the address management means 46, and the device information D
In is the address setting means 42 to the address management means 46.
Sent to.

【0053】すると、アドレス管理手段46において、
送られた新デバイス情報DInと同一のデバイス情報D
IがアドレステーブルAT内にあるか否かが検索される
(ステップST27)。新デバイス情報DInと同一の
デバイス情報DIがない場合、すなわち新規のデバイス
20が接続された場合、図6のステップST5と同様に
新規のアドレステーブルATがアドレス管理手段46に
より作成される(ステップST29)。
Then, in the address management means 46,
The same device information D as the sent new device information DIn
It is searched whether or not I is in the address table AT (step ST27). If the same device information DI as the new device information DIn does not exist, that is, if the new device 20 is connected, a new address table AT is created by the address management means 46 as in step ST5 of FIG. 6 (step ST29). ).

【0054】一方、新デバイス情報DInと同一のデバ
イス情報DIがある場合、そのアドレステーブルATの
うち、デバイスアドレスADDRのみ書き換えて、新し
いデバイスアドレスADDRn、仮想デバイスアドレス
HDAおよびデバイス情報DIを再リンクしたアドレス
テーブルATが更新記憶される(ステップST28)。
On the other hand, when there is the same device information DI as the new device information DIn, only the device address ADDR in the address table AT is rewritten, and the new device address ADDRn, the virtual device address HDA and the device information DI are relinked. The address table AT is updated and stored (step ST28).

【0055】すると、アプリケーション50がデバイス
20にデータ転送をする場合、データに含まれる仮想デ
バイスアドレスHDAが、新しく割り当てられたデバイ
スアドレスADDRnに変換されてデバイス20に送ら
れる。すると、アプリケーション50から送られたデー
タD1はデバイス20に転送されることになる。
Then, when the application 50 transfers data to the device 20, the virtual device address HDA included in the data is converted into the newly assigned device address ADDRn and sent to the device 20. Then, the data D1 sent from the application 50 is transferred to the device 20.

【0056】上記実施の形態によれば、デバイス20の
再接続によりデバイスアドレスADDRが変更した場合
であっても、デバイス20に対する仮想デバイスアドレ
スHDAは変わらない。このため、アプリケーション5
0が再接続したデバイス20にアクセスしたときに、デ
バイス20を検索する時間が不要となり、あるいはアク
セスエラーの発生によりアプリケーション50を再起動
する必要がなくなる。よって、ユーザーインターフェイ
スの向上を図ることができる。
According to the above embodiment, the virtual device address HDA for the device 20 does not change even if the device address ADDR changes due to the reconnection of the device 20. Therefore, application 5
When 0 accesses the reconnected device 20, the time for searching the device 20 becomes unnecessary, or it becomes unnecessary to restart the application 50 due to the occurrence of an access error. Therefore, the user interface can be improved.

【0057】なお、本発明の実施の形態は上記実施の形
態に限定されない。たとえば、上記実施の形態におい
て、アプリケーション50が複数インストールされてい
る場合、仮想デバイスアドレスHDAによりデバイス2
0を指定するか、もしくはデバイスアドレスADDRで
指定するかをアプリケーション50毎に選択可能にして
もよい。具体的には、アプリケーション監視手段44
は、仮想デバイスアドレスHDAを使用するアプリケー
ションリストを有しており、該当するアプリケーション
50が起動したときのみ、仮想デバイスアドレスHDA
を使用するようにしてもよい。
The embodiment of the present invention is not limited to the above embodiment. For example, in the above embodiment, when a plurality of applications 50 are installed, the device 2 is set by the virtual device address HDA.
Whether to specify 0 or the device address ADDR may be selectable for each application 50. Specifically, the application monitoring means 44
Has an application list that uses the virtual device address HDA, and only when the corresponding application 50 is activated, the virtual device address HDA
May be used.

【0058】また、アプリケーション50が起動してい
なくとも、コンピュータ1が起動している間は、デバイ
ス管理手段41が常にデバイス20の接続状態を監視す
るようにしてもよい。これにより、アプリケーション5
0が立ち上がっていないときにデバイス20の切断・再
接続がある場合であっても、アドレステーブルATの更
新を随時行うことができる。
Even if the application 50 is not activated, the device management means 41 may always monitor the connection state of the device 20 while the computer 1 is activated. This allows application 5
Even when the device 20 is disconnected / reconnected when 0 is not started, the address table AT can be updated at any time.

【0059】さらに、上記実施の形態において、活線挿
抜可能なインターフェイスとしてUSBインターフェイ
スの場合について例示しているが、たとえばIEEE1
394インターフェイス等のUSBインターフェイスと
同様活線挿抜可能なインターフェイスにも適用すること
ができる。
Further, in the above-mentioned embodiment, the case of the USB interface is illustrated as the hot-pluggable interface. For example, IEEE1
It can be applied to a hot-swap interface as well as a USB interface such as a 394 interface.

【0060】また、図3のデバイス制御装置40は、コ
ンピュータにデバイス制御プログラムを読み込ませて、
コンピュータとデバイス制御プログラムの協働した具体
的手段として提供されるようにしてもよい。このデバイ
ス制御プログラムは、活線挿抜可能なインターフェイス
を用いてコンピュータに接続されたデバイスを制御する
デバイス制御プログラムにおいて、前記デバイスが前記
コンピュータに接続されたことを認識して、該デバイス
からデバイス情報を取得するデバイス管理手段と、該デ
バイス管理手段により前記デバイスが認識された際に、
前記デバイスを識別するためのデバイスアドレスを該デ
バイスに割り当てるアドレス設定手段と、前記コンピュ
ータ上で稼働するアプリケーションが前記デバイスを使
用する際に前記アプリケーションが前記デバイスを識別
するための仮想デバイスアドレスを割り当てる仮想アド
レス設定手段と、該仮想アドレス設定手段により割り当
てられた前記仮想デバイスアドレスと、前記アドレス設
定手段により割り当てられた前記デバイスアドレスと、
前記デバイス管理手段で取得された前記デバイス情報と
をリンクさせたアドレステーブルを作成して記憶するア
ドレス管理手段と、前記アプリケーションが前記デバイ
スにアクセスした場合、前記アドレステーブルを用い
て、前記アプリケーションから送られるデータに含まれ
る前記仮想デバイスアドレスを、該仮想デバイスアドレ
スにリンクした前記デバイスアドレスに変換して前記デ
バイスに送るアドレス変換手段とを備え、前記アドレス
管理手段は、前記デバイスが前記コンピュータから切断
されて更に再接続された場合に、新たに前記デバイスか
ら取得される新デバイス情報を用いて、前記アドレステ
ーブルから新たに割り当てられた新デバイス情報と同一
の前記デバイス情報を検索して、前記アドレステーブル
内に前記新デバイスアドレスと同一のデバイス情報があ
る場合、該デバイス情報にリンクした前記デバイスアド
レスを前記新デバイスアドレスに更新するように、コン
ピュータを機能させるデバイス制御プログラムであって
もよい。
Further, the device control apparatus 40 of FIG. 3 causes the computer to read the device control program,
It may be provided as a specific means in which a computer and a device control program cooperate. This device control program is a device control program for controlling a device connected to a computer by using a hot-swap interface, recognizes that the device is connected to the computer, and outputs device information from the device. When the device management unit to acquire and the device is recognized by the device management unit,
Address setting means for allocating a device address for identifying the device to the device, and a virtual device address allocating virtual device address for identifying the device when the application running on the computer uses the device Address setting means, the virtual device address assigned by the virtual address setting means, the device address assigned by the address setting means,
An address management unit that creates and stores an address table linked with the device information acquired by the device management unit, and, when the application accesses the device, sends the address table from the application using the address table. Address conversion means for converting the virtual device address included in the data to the device address linked to the virtual device address and sending the device address to the device, wherein the address management means disconnects the device from the computer. When the device is reconnected again, the new device information newly acquired from the device is used to search the address table for the same device information as the newly allocated new device information, and the address table is searched. Within the new device If there is a dress same device information and, to update the device addresses linked to the device information to the new device address may be a device control program causing a computer to function.

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

【図1】コンピュータに活線挿抜可能なインターフェイ
スを用いてデバイスが接続された様子を示す図
FIG. 1 is a diagram showing a state in which devices are connected to a computer by using a hot-pluggable interface.

【図2】図1のコンピュータおよびデバイスの階層構造
を示すブロック図
FIG. 2 is a block diagram showing a hierarchical structure of the computer and the device of FIG.

【図3】本発明のデバイス制御装置の好ましい実施の形
態を示すブロック図
FIG. 3 is a block diagram showing a preferred embodiment of the device control apparatus of the present invention.

【図4】図3のデバイス管理手段からデバイスへ転送さ
れるトークンパケットのデータ構造を示す図
FIG. 4 is a diagram showing a data structure of a token packet transferred from the device management means of FIG. 3 to a device.

【図5】図3のアドレス管理手段で作成されるアドレス
テーブルのデータ構造を示す図
5 is a diagram showing a data structure of an address table created by the address management means of FIG.

【図6】本発明のデバイス制御方法の好ましい実施の形
態を示すフローチャート図。
FIG. 6 is a flowchart showing a preferred embodiment of the device control method of the present invention.

【図7】本発明のデバイス制御方法の好ましい実施の形
態を示すフローチャート図。
FIG. 7 is a flowchart showing a preferred embodiment of the device control method of the present invention.

【図8】本発明のデバイス制御方法の好ましい実施の形
態を示すフローチャート図。
FIG. 8 is a flowchart showing a preferred embodiment of the device control method of the present invention.

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

1 コンピュータ 10 ケーブル 20 デバイス 40 デバイス制御装置 41 デバイス管理手段 42 アドレス設定手段 43 仮想アドレス設定手段 44 アプリケーション監視手段 45 アドレス変換手段 46 アドレス管理手段 50 アプリケーション ADDR デバイスアドレス ADDRn 新デバイスアドレス AT アドレステーブル D1 データ D10 変換データ DI デバイス情報 DIn 新デバイス情報 DIn 新デバイス情報 HDA 仮想デバイスアドレス 1 computer 10 cables 20 devices 40 device controller 41 Device management means 42 Address setting means 43 Virtual address setting means 44 Application monitoring means 45 Address conversion means 46 Address management means 50 applications ADDR device address ADDRn new device address AT address table D1 data D10 conversion data DI device information DIn new device information DIn new device information HDA virtual device address

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 活線挿抜可能なインターフェイスを用い
てコンピュータに接続されたデバイスを制御するデバイ
ス制御方法において、 前記デバイスが前記コンピュータに接続された際に、該
デバイスからデバイス情報を取得するとともに、該デバ
イスを識別するためのデバイスアドレスを該デバイスに
割り当てるステップと、 前記コンピュータ上で稼働するアプリケーションが前記
デバイスを使用する際に該デバイスを識別するための仮
想デバイスアドレスを前記デバイスに割り当てるステッ
プと、 前記デバイスに割り当てられた前記仮想デバイスアドレ
スと前記デバイスアドレスと前記デバイス情報とをリン
クさせたアドレステーブルを作成するステップと、 前記アプリケーションが前記デバイスにアクセスした場
合、前記アドレステーブルを用いて、前記アプリケーシ
ョンから送られるデータに含まれる前記仮想デバイスア
ドレスを、該仮想デバイスアドレスにリンクした前記デ
バイスアドレスに変換して前記デバイスに送るステップ
とを備え、 前記デバイスが前記コンピュータから切断されて更に再
接続された場合に、新たに前記デバイスから取得される
新デバイス情報を用いて、前記アドレステーブルから同
一の前記デバイス情報を検索するステップと、前記アド
レステーブル内に前記新デバイスアドレスと同一の前記
デバイス情報がある場合、該デバイス情報にリンクした
前記デバイスアドレスを前記新デバイスアドレスに更新
するステップとを有することを特徴とするデバイス制御
方法。
1. A device control method for controlling a device connected to a computer by using a hot-swappable interface, wherein device information is acquired from the device when the device is connected to the computer, Assigning a device address for identifying the device to the device, assigning a virtual device address for identifying the device to the device when an application running on the computer uses the device, Creating an address table in which the virtual device address assigned to the device, the device address, and the device information are linked; and when the application accesses the device, the address table is created. And converting the virtual device address included in the data sent from the application into the device address linked to the virtual device address and sending the device address to the device, the device disconnecting from the computer. And reconnecting again, using the new device information newly acquired from the device, searching the same device information from the address table; and the new device address in the address table. If the same device information is present, updating the device address linked to the device information to the new device address, the device control method.
【請求項2】 活線挿抜可能なインターフェイスを用い
てコンピュータに接続されたデバイスを制御するデバイ
ス制御装置において、 前記デバイスが前記コンピュータに接続されたことを認
識して、該デバイスからデバイス情報を取得するデバイ
ス管理手段と、 該デバイス管理手段により前記デバイスが認識された際
に、前記デバイスを識別するためのデバイスアドレスを
該デバイスに割り当てるアドレス設定手段と、 前記コンピュータ上で稼働するアプリケーションが前記
デバイスを使用する際に前記アプリケーションが前記デ
バイスを識別するための仮想デバイスアドレスを割り当
てる仮想アドレス設定手段と、 該仮想アドレス設定手段により割り当てられた前記仮想
デバイスアドレスと、前記アドレス設定手段により割り
当てられた前記デバイスアドレスと、前記デバイス管理
手段で取得された前記デバイス情報とをリンクさせたア
ドレステーブルを作成して記憶するアドレス管理手段
と、 前記アプリケーションが前記デバイスにアクセスした場
合、前記アドレステーブルを用いて、前記アプリケーシ
ョンから送られるデータに含まれる前記仮想デバイスア
ドレスを、該仮想デバイスアドレスにリンクした前記デ
バイスアドレスに変換して前記デバイスに送るアドレス
変換手段とを備え、 前記アドレス管理手段が、前記デバイスが前記コンピュ
ータから切断されて更に再接続された場合に、新たに前
記デバイスから取得される新デバイス情報を用いて、前
記アドレステーブルから新たに割り当てられた新デバイ
ス情報と同一の前記デバイス情報を検索して、前記アド
レステーブル内に前記新デバイスアドレスと同一のデバ
イス情報がある場合、前記仮想デバイスアドレスは同じ
ままで該デバイス情報にリンクした前記デバイスアドレ
スを前記新デバイスアドレスに更新するものであること
を特徴とするデバイス制御装置。
2. A device control apparatus for controlling a device connected to a computer using a hot-swappable interface, recognizing that the device is connected to the computer, and acquiring device information from the device. Device management means for controlling the device, an address setting means for allocating a device address for identifying the device to the device when the device is recognized by the device management means, and an application running on the computer A virtual address setting means for assigning a virtual device address for the application to identify the device when used, the virtual device address assigned by the virtual address setting means, and the virtual device address assigned by the address setting means. Address management means for creating and storing an address table in which the device address and the device information acquired by the device management means are linked to each other; and when the application accesses the device, the address table is used. An address conversion unit that converts the virtual device address included in the data sent from the application into the device address linked to the virtual device address and sends the device address to the device, When the device is disconnected from the computer and reconnected, the new device information newly obtained from the device is used to search the address table for the same device information as the newly allocated new device information. The address If the device information that is the same as the new device address is present in the record, the virtual device address remains the same and the device address linked to the device information is updated to the new device address. Control device.
【請求項3】 前記アドレステーブルは、前記コンピュ
ータに接続された記憶装置に記憶されるものであること
を特徴とする請求項2に記載のデバイス制御装置。
3. The device control apparatus according to claim 2, wherein the address table is stored in a storage device connected to the computer.
JP2002086153A 2002-03-26 2002-03-26 Method and device for controlling device Withdrawn JP2003281072A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002086153A JP2003281072A (en) 2002-03-26 2002-03-26 Method and device for controlling device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002086153A JP2003281072A (en) 2002-03-26 2002-03-26 Method and device for controlling device

Publications (1)

Publication Number Publication Date
JP2003281072A true JP2003281072A (en) 2003-10-03

Family

ID=29232857

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002086153A Withdrawn JP2003281072A (en) 2002-03-26 2002-03-26 Method and device for controlling device

Country Status (1)

Country Link
JP (1) JP2003281072A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008027379A (en) * 2006-07-25 2008-02-07 Hitachi Omron Terminal Solutions Corp Host device
JP2009199623A (en) * 2004-06-10 2009-09-03 Analog Devices Inc System for measuring real electrical characteristic of device
JP2010267129A (en) * 2009-05-15 2010-11-25 Mitsubishi Electric Corp Device and method for identifying target equipment
JP2011008402A (en) * 2009-06-24 2011-01-13 Canon Inc Information processing apparatus, method for controlling the same, and program
JP2011186857A (en) * 2010-03-09 2011-09-22 Glory Ltd Host device and device control method
JP2011210231A (en) * 2010-03-30 2011-10-20 Sharp Corp Data processing apparatus, multifunctional peripheral device, data management method, program, and recording medium therefor

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009199623A (en) * 2004-06-10 2009-09-03 Analog Devices Inc System for measuring real electrical characteristic of device
JP2008027379A (en) * 2006-07-25 2008-02-07 Hitachi Omron Terminal Solutions Corp Host device
JP2010267129A (en) * 2009-05-15 2010-11-25 Mitsubishi Electric Corp Device and method for identifying target equipment
JP2011008402A (en) * 2009-06-24 2011-01-13 Canon Inc Information processing apparatus, method for controlling the same, and program
US9179014B2 (en) 2009-06-24 2015-11-03 Canon Kabushiki Kaisha Information processing apparatus, and method for controlling the same
JP2011186857A (en) * 2010-03-09 2011-09-22 Glory Ltd Host device and device control method
JP2011210231A (en) * 2010-03-30 2011-10-20 Sharp Corp Data processing apparatus, multifunctional peripheral device, data management method, program, and recording medium therefor

Similar Documents

Publication Publication Date Title
US7970974B2 (en) Method and system for adding or removing a logical unit of a USB mass storage device
KR100290945B1 (en) An apparatus and method for initializing a universal serial bus device
US7181553B2 (en) Method and apparatus for identifying multiple paths to discovered SCSI devices and specific to set of physical path information
KR101705596B1 (en) Server device connecting usb device and device sharing method
JP5352132B2 (en) Computer system and I / O configuration change method thereof
JP3629513B2 (en) Data processing system and method
US7568053B2 (en) USB composite device, USB communication system, and USB communication method
US20090089460A1 (en) Storage device and storage device access control method
KR100631620B1 (en) Apparatus and method for allowing to access to its equipped storage means
WO2015070640A1 (en) Remote accessing method for device, thin client, and virtual machine
JP5527512B2 (en) Bus protocol conversion device and bus protocol conversion method
JP2002541554A (en) Architecture for PC Flash Disk Based on Universal Serial Bus
JP2004070571A (en) Data transfer control system, electronic equipment, program and data transfer control method
JP2002149592A (en) Pci bridge on network
JP2007280261A (en) Portable type virtual memory apparatus which makes equipment on network sharable
US7165124B2 (en) Data transfer control system, electronic instrument, program, and data transfer control method
JP5581470B2 (en) Device sharing system, device sharing server, device sharing client, and device sharing method
JP2003281072A (en) Method and device for controlling device
US20090157896A1 (en) Tcp offload engine apparatus and method for system call processing for static file transmission
JP2000148651A (en) Shared disk device
US7827194B2 (en) Access to shared disk device on storage area network
EP1033658A2 (en) Communication apparatus with means for allocating alternate designation information to each function unit, and communication system with said two communication apparatus
US20040230734A1 (en) Data transfer control system, electronic instrument, and data transfer control method
CN112039941B (en) Data transmission method, device and medium
JP5135696B2 (en) Electronic device and object management method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20050607