JP4499862B2 - Status detection method for printer having USB interface and printing system using the method - Google Patents
Status detection method for printer having USB interface and printing system using the method Download PDFInfo
- Publication number
- JP4499862B2 JP4499862B2 JP2000011601A JP2000011601A JP4499862B2 JP 4499862 B2 JP4499862 B2 JP 4499862B2 JP 2000011601 A JP2000011601 A JP 2000011601A JP 2000011601 A JP2000011601 A JP 2000011601A JP 4499862 B2 JP4499862 B2 JP 4499862B2
- Authority
- JP
- Japan
- Prior art keywords
- printer
- host computer
- status
- usb interface
- detection method
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Lifetime
Links
Images
Landscapes
- Accessory Devices And Overall Control Thereof (AREA)
Description
【0001】
【発明の属する技術分野】
本発明は、プリンタとホストコンピュータとを接続したプリントシステムに関し、特にインタフェースとしてUSBインタフェースを用いたプリントシステムの状態検出方法とそれを用いたプリントシステムに関するものである。
【0002】
【従来の技術】
USBインタフェースがパーソナルコンピュータの分野で一般的に用いられるようになってきており、プリンタを接続するインタフェースとしても用いられることが多くなってきている。プリンタとコンピュータとの接続においては、印字データをプリンタに送信するだけではなく、双方向に通信することによって、プリンタの状態をコンピュータに取り込むことも行われ、USBインタフェースでも双方向性を有することから、ステータスを入力するために使われている。
【0003】
従来のプリントシステムでは、プリンタの状態をコンピュータが監視したい場合には、USBコマンドであるBulk INまたはControl INコマンドを周期的にプリンタに出力し、その応答を入力して状態を監視していた。
【0004】
【発明が解決しようとする課題】
しかし、従来のプリントシステムでは、プリンタの異常の有無にかかわらず周期的に上記INコマンドを出力していたために無駄な要求応答が発生していた。
【0005】
また周期的な要求のために異常をすぐに検出することはできなかった。早く異常を検出しようとするならば、上記INコマンドを出力する周期を短くしなければならないが、それは無駄な要求応答を増やすことになり、上記問題を生むことになっていた。
【0006】
本発明は、従来のUSB接続でのプリントシステムの有する上記課題を解決するためになされたものであり、その目的はインタフェースの負荷を増大させることなく、プリンタの異常状態等のステータスを早く検出することのできるプリンタの状態検出方法、およびこの方法を用いたプリントシステムを実現することである。
【0007】
【課題を解決するための手段】
上記課題を解決するために、本発明に係るUSBインタフェースを有するプリンタの状態検出方法は、USBインタフェースによってプリンタとホストコンピュータとを接続したプリントシステムにおいて、USB接続状態で、USBコマンドのうち前記ホストコンピュータが前記プリンタに対して前記プリンタのステータスを前記ホストコンピュータに送信するように要求するINコマンドを送信して前記プリンタの異常状態の検出を行う、USBインタフェースを有するプリンタの状態検出方法であって、前記ホストコンピュータがデータを前記プリンタに出力する第1ステップと、前記第1ステップにおいて前記データが出力された後に前記プリンタにおいて次のデータ受信の準備が出来ていないことを示すNAK応答が前記プリンタから前記ホストコンピュータに対して連続して出力される状態があらかじめ設定した時間以上に持続していることを前記ホストコンピュータが検出する第2ステップと、前記第2ステップの前記ホストコンピュータによる前記検出に基づいて、前記ホストコンピュータが前記プリンタに対して前記プリンタの前記ステータスを前記ホストコンピュータに送信するように要求する前記INコマンドを送信することにより、前記ホストコンピュータが前記プリンタの前記ステータスを受信する第3ステップと、前記第3ステップにおいて受信した前記プリンタの前記ステータスを前記ホストコンピュータが解析して前記プリンタの異常状態を検出する第4ステップと、を有することを特徴とするものである。
【0008】
また本発明に係るプリントシステムは、USBインタフェースによってプリンタとホストコンピュータとを接続したプリントシステムであって、前記ホストコンピュータにおいて前記状態検出方法を実行するように構成したことを特徴とするものである。
【0009】
【発明の実施の形態】
本発明によるプリンタの状態検出方法について図面に基づいて説明する。図1及び図2は本方法を実行するコンピュータ側プログラムのフローチャートである。
【0010】
プリンタとコンピュータとはUSB(ユニバーサルシリアルバス)によって接続され、プリントシステムを構成する。USBは、パーソナルコンピュータの分野で標準的に用いられるインタフェースである。このインタフェースは、基本的にはデータをシリアルに送受信するシリアルインタフェースであり、データまたはコマンドはビットシリアルに送受信される。
【0011】
データの送信及びステータスの入力等には、いくつかのコマンドが決められており、コンピュータはこれらのコマンドとデータを組み合わせてプリンタに送信し、プリンタからの応答がある場合にはそれを入力する。
【0012】
コンピュータ側プログラムの処理は、図1のフローチャートのように行われる。まず、ステップ1においてエラーを検出するためのタイムアウトカウンタを初期化する。このカウンタの働きについては後述する。次にステップ2において、次に出力するデータを準備し、ステップ3においてこのデータをプリンタに出力する。USBにおいてデータを出力するためにはOUTコマンドが用いられる。
【0013】
次にステップ4において、この出力に対するプリンタの応答を入力する。プリンタには、データを受信しこれを印字するために、データの加工からメカニズムの駆動まで、一定の処理時間が必要である。このためこの間は次のデータを処理することができないのでNAK応答を返して次のデータを送信しないように要求する。内部の処理が終わり次のデータ処理が可能になるとACK応答を返して次のデータ送信を要求する。ステップ4で入力した応答は、ステップ5においてまずACKであるかどうか判断される。ACKである場合には、プリンタは次のデータ受信準備ができているということなので、ステップ1に戻って次のデータの出力にかかる。
【0014】
ステップ5においてACKではないと判断された場合には、ステップ6においてNAKであるかどうか判断される。NAKではない場合には、この例では状態が定まらないのでステップ4に戻って新たなインタフェース応答を入力する。なお、具体的なプリンタの場合は、その他のコマンドも用意されているので、NAKではないと判断した場合には、その他のコマンドの解析を行うようになっている。
【0015】
ステップ6でNAKである場合には、ステップ7においてタイムアウトカウンタを更新する。ところで、前述のようにプリンタは内部処理に時間がかかることから、NAKとACKを処理に応じて出力してインタフェースの送受信制御を行っている。従って正常な状態に応じてもNAKが返されることはあるが、それが持続して出力される時間には上限があって、正常な状態においては、その上限以下の時間でACKが返されることになる。ところがたとえばプリント用紙切れのように異常な状態が長く続く場合には、NAKが返される時間が継続し、上限時間を超えることになる。ステップ8では、タイムアウトカウンタの内容を上記上限値と比較し、これを越えているかどうかを判断する。越えていなければ、まだ正常な範囲と判断しステップ4に戻って新たなインタフェース応答を入力する。
【0016】
ステップ8においてタイムオーバーと判断した場合には、図2のステップ9においてINコマンドをプリンタに送信する。USBにおいてINコマンドは、プリンタのステータスを送信するように要求するコマンドである。INコマンドを入力したプリンタは、現在のプリンタの状態を送信してくるので、ステップ10において、このステータスを受信する。続いて受信したステータスをステップ11において解析しプリンタの状態を識別する。
【0017】
なお、前記実施例においてタイムアウトを観測するために、ソフトウエアによってカウンタを構成し、これによってカウントするようにしたが、ハードウエアカウンタによってタイムアウト時間を計測するようにしてもよい。
【0018】
【発明の効果】
以上のようにプリントシステムを構成すれば、正常な状態ではINコマンドをプリンタに送信してステータスを受信するといった処理が不要になり、インタフェースの負荷を増大させることがない。またエラーが発生した場合も、それから短時間でステータスの解析が行えるようになるという効果もある。
【図面の簡単な説明】
【図1】本発明に係るプリンタの状態検出方法を実現するコンピュータプログラムのフローチャート(その1)である。
【図2】本発明に係るプリンタの状態検出方法を実現するコンピュータプログラムのフローチャート(その2)である。[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a print system in which a printer and a host computer are connected, and more particularly to a print system state detection method using a USB interface as an interface and a print system using the same.
[0002]
[Prior art]
The USB interface has been generally used in the field of personal computers, and is increasingly used as an interface for connecting a printer. In the connection between the printer and the computer, not only the print data is transmitted to the printer, but also the printer status is taken into the computer by bidirectional communication, and the USB interface is also bidirectional. , Used to enter status.
[0003]
In the conventional printing system, when the computer wants to monitor the status of the printer, a Bulk IN or Control IN command that is a USB command is periodically output to the printer, and a response is input to monitor the status.
[0004]
[Problems to be solved by the invention]
However, in the conventional print system, the above IN command is periodically output regardless of whether there is a malfunction of the printer.
[0005]
Also, abnormalities could not be detected immediately due to periodic requests. If an abnormality is to be detected early, the period of outputting the IN command must be shortened, but this increases the useless request response and causes the above problem.
[0006]
The present invention has been made in order to solve the above-described problems of the conventional print system with USB connection, and its purpose is to quickly detect the status such as an abnormal state of the printer without increasing the load on the interface. It is to realize a printer status detection method that can perform this and a printing system using this method.
[0007]
[Means for Solving the Problems]
In order to solve the above problems, the state detecting method for a printer having a USB interface according to the present invention is a printing system which connects a printer and a host computer by a USB interface, a USB connection state, the host computer of the USB command A status detection method for a printer having a USB interface, which detects an abnormal status of the printer by transmitting an IN command requesting the printer to transmit the status of the printer to the host computer , a first step of the host computer outputs the data to the printer, the purine NAK response indicating that no ready for the next data received at the printer after the data is output in the first step A second step of the host computer detects that the state is continuously output persists beyond a preset time to the host computer from the detection by the host computer of the second step based on, by sending the iN command the host computer requests to send the status of the printer to the host computer to the printer, first the host computer receives the status of said printer 3 and step, is characterized in that it has a, a fourth step of detecting an abnormal state of the printer the status by analyzing said host computer of said printer received in the third step.
[0008]
The printing system according to the present invention is a printing system which connects a printer and a host computer by a USB interface, is characterized in that have configured to perform said state detecting method in the host computer .
[0009]
DETAILED DESCRIPTION OF THE INVENTION
A printer status detection method according to the present invention will be described with reference to the drawings. 1 and 2 are flowcharts of a computer-side program for executing this method.
[0010]
The printer and the computer are connected by a USB (Universal Serial Bus) to constitute a printing system. USB is an interface used as a standard in the field of personal computers. This interface is basically a serial interface that transmits / receives data serially, and data / commands are transmitted / received bit-serially.
[0011]
Several commands are determined for data transmission, status input, and the like, and the computer transmits these commands and data in combination to the printer, and inputs any response from the printer.
[0012]
The processing of the computer side program is performed as shown in the flowchart of FIG. First, in
[0013]
In step 4, the printer response to this output is input. The printer needs a certain processing time from data processing to mechanism driving in order to receive data and print it. For this reason, the next data cannot be processed during this period, so a NAK response is returned to request not to transmit the next data. When internal processing is completed and next data processing becomes possible, an ACK response is returned to request the next data transmission. The response input in step 4 is first determined in step 5 as to whether it is an ACK. If it is ACK, it means that the printer is ready to receive the next data, so the process returns to
[0014]
If it is determined in step 5 that it is not ACK, it is determined in step 6 whether it is NAK. If it is not NAK, the state is not determined in this example, so the process returns to step 4 to input a new interface response. In the case of a specific printer, other commands are also prepared. Therefore, when it is determined that the printer is not a NAK, the other commands are analyzed.
[0015]
If it is NAK in step 6, the timeout counter is updated in step 7. By the way, as described above, since the printer takes time for internal processing, NAK and ACK are output according to the processing to perform interface transmission / reception control. Therefore, NAK may be returned even if it is in a normal state, but there is an upper limit in the time that it can be output continuously. In normal state, ACK is returned in a time less than the upper limit. become. However, when an abnormal state continues for a long time, for example, when the printing paper runs out, the time for returning the NAK continues and exceeds the upper limit time. In step 8, the contents of the time-out counter are compared with the upper limit value, and it is determined whether or not the time-out counter is exceeded. If not, it is determined that the range is still normal and the process returns to step 4 to input a new interface response.
[0016]
If it is determined in step 8 that the time is over, an IN command is transmitted to the printer in step 9 of FIG. In USB, an IN command is a command for requesting transmission of a printer status. Since the printer that has input the IN command transmits the current printer status, this status is received in
[0017]
In the above-described embodiment, in order to observe the timeout, the counter is configured by software and counted by this. However, the timeout time may be measured by a hardware counter.
[0018]
【The invention's effect】
If the print system is configured as described above, in a normal state, processing such as sending an IN command to the printer and receiving the status becomes unnecessary, and the load on the interface is not increased. In addition, when an error occurs, there is also an effect that the status can be analyzed in a short time.
[Brief description of the drawings]
FIG. 1 is a flowchart (No. 1) of a computer program for realizing a printer state detection method according to the present invention.
FIG. 2 is a flowchart (No. 2) of a computer program for realizing a printer state detection method according to the present invention.
Claims (2)
前記ホストコンピュータがデータを前記プリンタに出力する第1ステップと、
前記第1ステップにおいて前記データが出力された後に前記プリンタにおいて次のデータ受信の準備が出来ていないことを示すNAK応答が前記プリンタから前記ホストコンピュータに対して連続して出力される状態があらかじめ設定した時間以上に持続していることを前記ホストコンピュータが検出する第2ステップと、
前記第2ステップの前記ホストコンピュータによる前記検出に基づいて、前記ホストコンピュータが前記プリンタに対して前記プリンタの前記ステータスを前記ホストコンピュータに送信するように要求する前記INコマンドを送信することにより、前記ホストコンピュータが前記プリンタの前記ステータスを受信する第3ステップと、
前記第3ステップにおいて受信した前記プリンタの前記ステータスを前記ホストコンピュータが解析して前記プリンタの異常状態を検出する第4ステップと、
を有することを特徴とするUSBインタフェースを有するプリンタの状態検出方法。In a printing system in which a printer and a host computer are connected by a USB interface, an IN command that requests that the host computer sends the printer status to the host computer out of USB commands in a USB connection state And detecting the abnormal state of the printer by transmitting a printer status detection method for a printer having a USB interface ,
A first step of the host computer outputs the data to the printer,
A state in which a NAK response indicating that the printer is not ready to receive next data after the data is output in the first step is continuously output from the printer to the host computer is set in advance. a second step of the host computer detects that it is sustained over the time,
Based on the detection by the host computer of the second step, by said host computer sends the IN command requesting to transmit the status of the printer to the host computer to the printer, the A third step in which a host computer receives the status of the printer ;
A fourth step in which the host computer analyzes the status of the printer received in the third step and detects an abnormal state of the printer ;
A state detection method for a printer having a USB interface, characterized by comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2000011601A JP4499862B2 (en) | 2000-01-20 | 2000-01-20 | Status detection method for printer having USB interface and printing system using the method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2000011601A JP4499862B2 (en) | 2000-01-20 | 2000-01-20 | Status detection method for printer having USB interface and printing system using the method |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2001199132A JP2001199132A (en) | 2001-07-24 |
JP4499862B2 true JP4499862B2 (en) | 2010-07-07 |
Family
ID=18539445
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2000011601A Expired - Lifetime JP4499862B2 (en) | 2000-01-20 | 2000-01-20 | Status detection method for printer having USB interface and printing system using the method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP4499862B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4343524B2 (en) | 2002-12-13 | 2009-10-14 | キヤノン株式会社 | Control device and digital video device |
JP4227428B2 (en) * | 2003-01-31 | 2009-02-18 | キヤノン株式会社 | Information processing apparatus and method for controlling the apparatus |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0764743A (en) * | 1993-08-31 | 1995-03-10 | Canon Inc | Scanner/printer server system and its interrupt print control method |
JPH11296315A (en) * | 1998-04-15 | 1999-10-29 | Seiko Epson Corp | Information processor and data communication method |
-
2000
- 2000-01-20 JP JP2000011601A patent/JP4499862B2/en not_active Expired - Lifetime
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0764743A (en) * | 1993-08-31 | 1995-03-10 | Canon Inc | Scanner/printer server system and its interrupt print control method |
JPH11296315A (en) * | 1998-04-15 | 1999-10-29 | Seiko Epson Corp | Information processor and data communication method |
Also Published As
Publication number | Publication date |
---|---|
JP2001199132A (en) | 2001-07-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9137395B2 (en) | Image processing device and computer-readable storage medium for use in connection with USB data packets | |
US6311294B1 (en) | Device and method for efficient bulk data retrieval using a universal serial bus | |
JP2003316712A5 (en) | ||
US7155555B2 (en) | Communication system and method of controlling same | |
JP2002297336A (en) | Printer system | |
US20100220354A1 (en) | Information processing apparatus and method and program for controlling same | |
JP3684685B2 (en) | Bidirectional communication recognition method, bidirectional communication recognition device, and storage medium | |
US8527669B2 (en) | Communication apparatus and method for communicating with an external device through USB interface using a high-speed or low-speed communication mode | |
JP4499862B2 (en) | Status detection method for printer having USB interface and printing system using the method | |
JP4646859B2 (en) | USB device and USB connection system | |
US7856089B2 (en) | Method and apparatus for control lockout and transfer during service for systems controlled by multiple devices | |
US9525757B2 (en) | Information processing apparatus that controls connection of devices, method of controlling the apparatus, and device control system | |
US9794442B2 (en) | Communication apparatus, control method, and storage medium | |
JPH0511938A (en) | High-functional parallel port interface | |
JP3739581B2 (en) | Interface device | |
JPH1091567A (en) | Input/output interface extension device | |
JP2012213859A (en) | Printer, program, and printer system | |
EP2610733B1 (en) | Image forming apparatus connectable to multiple hosts and method of controlling image forming jobs of the image forming apparatus | |
JP4941212B2 (en) | Electronic device, data processing apparatus, and bus control method | |
JP2000347828A (en) | Information processor and job managing method of information processor | |
JPH0749817A (en) | Dma transfer controller | |
JP3477819B2 (en) | Image reading device and information processing system | |
JP2898025B2 (en) | I / O terminal | |
JP2005174147A (en) | Communication controller and communication control method | |
JPH10207649A (en) | Printer interface system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20040302 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20060904 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090825 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20091013 |
|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20091104 |
|
RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20091112 |
|
TRDD | Decision of grant or rejection written | ||
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20100413 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20100416 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130423 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4499862 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140423 Year of fee payment: 4 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
EXPY | Cancellation because of completion of term |