JP2000231457A - Data transfer system - Google Patents

Data transfer system

Info

Publication number
JP2000231457A
JP2000231457A JP11032092A JP3209299A JP2000231457A JP 2000231457 A JP2000231457 A JP 2000231457A JP 11032092 A JP11032092 A JP 11032092A JP 3209299 A JP3209299 A JP 3209299A JP 2000231457 A JP2000231457 A JP 2000231457A
Authority
JP
Japan
Prior art keywords
data
transfer
speed
printer
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP11032092A
Other languages
Japanese (ja)
Other versions
JP3394717B2 (en
Inventor
Yoshihiro Matsuda
好弘 松田
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.)
Oki Electric Industry Co Ltd
Original Assignee
Oki Data 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 Oki Data Corp filed Critical Oki Data Corp
Priority to JP03209299A priority Critical patent/JP3394717B2/en
Publication of JP2000231457A publication Critical patent/JP2000231457A/en
Application granted granted Critical
Publication of JP3394717B2 publication Critical patent/JP3394717B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Accessory Devices And Overall Control Thereof (AREA)

Abstract

PROBLEM TO BE SOLVED: To optimize the transfer speed of data from a host device to an external device by selecting a standby time matching the external device according to the relation between apparent transfer speeds and standby times. SOLUTION: A host computer 1 is equipped with a high-speed processor and the data transfer speed of a printer driver 6 is very fast, so a printer 3 possibly causes an underline or data absent phenomenon in this state. For the purpose, a port driver 7 adjusts the transfer rate of the printer driver 6. Namely, when data transfer from the host computer 1 is carried out at a data transfer speed much faster than the reception speed that the printer requires, the port driver 7 when transferring data passed from the printer driver 6 to the printer 3, byte by byte, provides a certain standby time each time one byte is transferred. Thus, the transfer of the data is delayed to make the apparent transfer speed slow on the whole.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、ホスト装置から外
部装置へデータを転送する場合の転送速度の最適化を図
ったデータ転送システムに関する。
[0001] 1. Field of the Invention [0002] The present invention relates to a data transfer system which optimizes a transfer speed when data is transferred from a host device to an external device.

【0002】[0002]

【従来の技術】例えば、パーソナルコンピュータからプ
リンタへ印刷データを転送する場合には、パーソナルコ
ンピュータとプリンタとの間を所定のインタフェースケ
ーブルにより接続する。パーソナルコンピュータにはプ
リンタドライバがインストールされており、これが所定
の速度で印刷データをプリンタに転送する。プリンタ
は、プリンタバッファへ印刷データを一時格納し、これ
がいっぱいになるとプリンタドライバに対し転送の一時
停止を要求する。
2. Description of the Related Art For example, when transferring print data from a personal computer to a printer, the personal computer and the printer are connected by a predetermined interface cable. A printer driver is installed in the personal computer, and transfers print data to the printer at a predetermined speed. The printer temporarily stores the print data in the printer buffer, and when the print data becomes full, requests the printer driver to temporarily stop the transfer.

【0003】印刷が進み、プリンタバッファに空きが生
じると、再びプリンタドライバからデータの転送を行
う。プリンタの印刷制御のみならず、ホスト装置から様
々な外部装置にデータを転送する場合には、一般にこう
した手順の制御が行われている。
When printing progresses and a printer buffer becomes empty, data is transferred again from the printer driver. When data is transferred from the host device to various external devices as well as the printing control of the printer, such a procedure is generally controlled.

【0004】[0004]

【発明が解決しようとする課題】ところで、上記のよう
な従来の技術には次のような解決すべき課題があった。
例えば、パーソナルコンピュータがホスト装置であっ
て、プリンタに印刷データを転送する場合を考える。近
年のパーソナルコンピュータにおける、CPU(中央処
理装置)の演算処理速度向上は著しい。従って、CPU
の性能差によって、データ転送速度が著しく相違するケ
ースが増えてきている。プリンタは既存のCPUの処理
速度を考慮して設計されており、新たな高い演算処理速
度のCPUが出現すると、動作速度差が許容範囲を超え
る場合が生じる。
However, the above-mentioned prior art has the following problems to be solved.
For example, consider a case in which a personal computer is a host device and print data is transferred to a printer. 2. Description of the Related Art In recent personal computers, the processing speed of a CPU (central processing unit) has been remarkably improved. Therefore, CPU
In many cases, the data transfer rate is significantly different due to the performance difference. The printer is designed in consideration of the processing speed of the existing CPU, and when a new CPU with a high processing speed appears, the operation speed difference may exceed an allowable range.

【0005】プリンタは、プリンタエンジンの印字速度
や印字品位を考慮すると、所定速度以上の速度でデータ
を受信する必要はない。むしろ、プリンタに対して高速
でデータ転送が行われると、データ送受信のためにプリ
ンタのプロセッサに負荷がかかり、後で説明するように
データ抜けやアンダーラン等の障害が発生する恐れがあ
る。プロセッサの演算処理速度が速くなると、プリンタ
ドライバによるデータ転送速度も速くなる。従って、こ
うした高性能化したパーソナルコンピュータによって、
従来のプリンタを正常に制御する方法の開発が要求され
ている。これらの課題は、ホスト装置から様々な外部装
置にデータを転送する場合にも同様に発生している。
In consideration of the printing speed and printing quality of the printer engine, the printer need not receive data at a speed higher than a predetermined speed. Rather, when data is transferred to the printer at a high speed, a load is applied to the processor of the printer for data transmission and reception, and there is a possibility that a failure such as data loss or underrun may occur as described later. As the arithmetic processing speed of the processor increases, the data transfer speed of the printer driver also increases. Therefore, with such advanced personal computers,
There is a need to develop a method for normally controlling a conventional printer. These problems also occur when transferring data from the host device to various external devices.

【0006】[0006]

【課題を解決するための手段】本発明は以上の点を解決
するため次の構成を採用する。 〈構成1〉ホスト装置と、このホスト装置からデータを
受信する外部装置とから成り、上記ホスト装置は、上記
データの転送速度を調整する転送速度調整部と、この転
送速度調整部が単位量のデータを転送するたびに所定の
待機時間だけ転送待ちをするように制御をするウェイト
処理部とを備え、上記転送速度調整部は、上記データの
転送前に、所定量のダミーデータを任意の待機時間で転
送したときの、見かけ上の転送速度を実測し、この見か
け上の転送速度と待機時間との関係から、上記外部装置
に適する上記待機時間を選択することを特徴とするデー
タ転送システム。
The present invention employs the following structure to solve the above problems. <Structure 1> Consisting of a host device and an external device that receives data from the host device, the host device includes a transfer speed adjustment unit that adjusts the transfer speed of the data, and the transfer speed adjustment unit that has a unit amount. A wait processing unit for performing control so as to wait for transfer for a predetermined standby time every time data is transferred, wherein the transfer speed adjusting unit is configured to arbitrarily wait a predetermined amount of dummy data before transferring the data. A data transfer system which measures an apparent transfer speed when transferring data by time, and selects the standby time suitable for the external device from the relationship between the apparent transfer speed and the standby time.

【0007】〈構成2〉構成1に記載のデータ転送シス
テムにおいて、上記転送速度調整部は、所定量のダミー
データをそれぞれ異なる待機時間で転送したときの、見
かけ上の転送速度を実測し、この見かけ上の転送速度の
変化を求めて、上記外部装置に適する上記待機時間を選
択することを特徴とするデータ転送システム。
<Structure 2> In the data transfer system described in Structure 1, the transfer speed adjusting section measures an apparent transfer speed when a predetermined amount of dummy data is transferred at different standby times. A data transfer system, wherein a change in an apparent transfer speed is obtained, and the standby time suitable for the external device is selected.

【0008】〈構成3〉構成1または2に記載のデータ
転送システムにおいて、上記転送速度調整部は、所定量
のダミーデータを、選択した待機時間で転送したとき
の、見かけ上の転送速度を実測し、目標とするデータ転
送速度との誤差を検出して、上記待機時間を補正するこ
とを特徴とするデータ転送システム。
<Structure 3> In the data transfer system according to Structure 1 or 2, the transfer rate adjusting section measures an apparent transfer rate when a predetermined amount of dummy data is transferred during a selected standby time. A data transfer system that detects an error from a target data transfer speed and corrects the standby time.

【0009】〈構成4〉構成1に記載のデータ転送シス
テムにおいて、上記転送速度調整部は、見かけ上の転送
速度を、外部装置側に設けたタイマを利用して実測する
ことを特徴とするデータ転送システム。
<Structure 4> In the data transfer system according to Structure 1, the transfer rate adjusting unit measures an apparent transfer rate by using a timer provided on an external device side. Transfer system.

【0010】〈構成5〉構成1に記載のデータ転送シス
テムにおいて、上記転送速度調整部は、所定量のダミー
データを、選択した待機時間で転送したときの、データ
抜け発生の有無を検査し、データ抜けが発生する場合に
は、上記待機時間を部分的に調整することを特徴とする
データ転送システム。
<Structure 5> In the data transfer system according to Structure 1, the transfer rate adjusting unit checks whether or not data loss has occurred when a predetermined amount of dummy data has been transferred for a selected standby time. A data transfer system characterized by partially adjusting the standby time when data loss occurs.

【0011】〈構成6〉ホスト装置と、このホスト装置
からデータを受信する外部装置とから成り、上記外部装
置には、上記データの受信速度を測定する受信速度測定
部と、測定した上記データの受信速度と最適受信速度と
を比較して、データの受信速度を最適受信速度に近付け
るように、所定量のデータ受信毎にホスト装置によるデ
ータ送信を抑制するためのビジー信号を有効にする時間
を調整する受信速度調整部とを備えたことを特徴とする
データ転送システム。
<Structure 6> Consisting of a host device and an external device for receiving data from the host device, the external device includes a reception speed measuring unit for measuring the reception speed of the data, The reception speed is compared with the optimum reception speed, and the time for enabling the busy signal for suppressing the data transmission by the host device every time a predetermined amount of data is received is set so that the data reception speed approaches the optimum reception speed. A data transfer system, comprising: a reception speed adjustment unit for adjusting.

【0012】〈構成7〉構成1または5に記載のデータ
転送システムにおいて、外部装置には、ホスト装置から
データを自動受信するダイレクトメモリアクセスコント
ローラが設けられ、上記外部装置の受信速度調整部は、
上記ダイレクトメモリアクセスコントローラが一括して
受信可能な量のデータ受信毎に、待機時間を挿入するこ
とを特徴とするデータ転送システム。
<Structure 7> In the data transfer system according to structure 1 or 5, the external device is provided with a direct memory access controller for automatically receiving data from the host device, and the reception speed adjusting unit of the external device is
A data transfer system, wherein a waiting time is inserted every time the direct memory access controller receives an amount of data that can be received collectively.

【0013】〈構成8〉構成1に記載のデータ転送シス
テムにおいて、ホスト装置から複数の外部装置にデータ
が転送されるとき、上記転送速度調整部は、複数の外部
装置に同時にデータを送信して、見かけ上の転送速度を
実測し、その転送速度が目標とする転送速度に近付くよ
うに上記待機時間を短縮することを特徴とするデータ転
送システム。
<Structure 8> In the data transfer system according to Structure 1, when data is transferred from the host device to a plurality of external devices, the transfer speed adjusting unit transmits the data to the plurality of external devices simultaneously. A data transfer system which measures an apparent transfer speed and reduces the standby time so that the transfer speed approaches a target transfer speed.

【0014】〈構成9〉構成8に記載のデータ転送シス
テムにおいて、ホスト装置に接続されて同時にデータを
転送する外部装置が増減した場合に、各外部装置に対す
る見かけ上のデータ転送速度を監視し、見かけ上のデー
タ転送速度が変化したとき、その転送速度が目標とする
転送速度に近付くように上記待機時間を短縮することを
特徴とするデータ転送システム。
<Configuration 9> In the data transfer system according to Configuration 8, when the number of external devices connected to the host device and simultaneously transferring data increases or decreases, an apparent data transfer rate to each external device is monitored. A data transfer system, wherein when the apparent data transfer rate changes, the standby time is reduced so that the transfer rate approaches a target transfer rate.

【0015】[0015]

【発明の実施の形態】以下、本発明の実施の形態を具体
例を用いて説明する。 〈具体例〉図1は、具体例1のシステムを示すブロック
図である。本発明は、ホスト装置から様々な外部装置に
データを転送する場合に適用できるが、ここでは、ホス
トコンピュータ1からプリンタ3に対しデータを転送す
る場合を例にとって説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Embodiments of the present invention will be described below using specific examples. <Specific Example> FIG. 1 is a block diagram showing a system of a specific example 1. The present invention can be applied to a case where data is transferred from a host device to various external devices. Here, a case where data is transferred from the host computer 1 to the printer 3 will be described as an example.

【0016】図1において、ホストコンピュータ1に
は、双方向インタフェース2を介してプリンタ3が接続
されている。このインタフェースは、IEEE1284
(Institute of Electrical and Electronic Engineer
s)等で規格化されたパラレルインタフェースである。
ホストコンピュータ1には、印刷用のデータを生成する
アプリケーション(AP)4と、オペレーティングシス
テム(OS)5、プリンタドライバ6、ポートドライバ
7及びIEEE1284出力部8が設けられている。
In FIG. 1, a printer 3 is connected to a host computer 1 via a bidirectional interface 2. This interface is IEEE1284
(Institute of Electrical and Electronic Engineer
This is a parallel interface standardized in s).
The host computer 1 is provided with an application (AP) 4 for generating data for printing, an operating system (OS) 5, a printer driver 6, a port driver 7, and an IEEE1284 output unit 8.

【0017】プリンタ3は、電子写真式プリンタ、イン
クジェットプリンタ等、各種の従来よく知られた印刷装
置である。ポートドライバ7は、この図に示すように、
I/F処理部11、データ転送部12、転送速度調整部
13、タイマ14、カウンタ発生部15、ダミーデータ
16、ループカウンタ17、ウェイト処理部18により
構成されている。
The printer 3 is a conventionally well-known printing device such as an electrophotographic printer or an ink jet printer. The port driver 7, as shown in this figure,
It comprises an I / F processing unit 11, a data transfer unit 12, a transfer speed adjustment unit 13, a timer 14, a counter generation unit 15, dummy data 16, a loop counter 17, and a wait processing unit 18.

【0018】このシステムでは、ホストコンピュータ1
は高速プロセッサを備え、プリンタドライバ6のデータ
転送速度が著しく速い。そのため、そのままではプリン
タ3がアンダーランあるいはデータ抜け等を発生する恐
れがある。そこで、この具体例の発明では、ポートドラ
イバ7がプリンタドライバ6の転送速度を調整する機能
を持つ。プリンタドライバ6の出力は、I/F処理部1
1とデータ転送部12とを経てIEEE1284出力部
8に送られる。図に示す転送速度調整部13は、I/F
処理部11からホストコンピュータ1のデータ転送速度
を示すパラメータを受け取り、調整した転送速度をデー
タ転送部12に設定する機能を持つ部分である。データ
転送部12は、I/F処理部11から入力する印刷デー
タをIEEE1284出力部8を経由してプリンタ3に
転送する役割を持つ。
In this system, the host computer 1
Has a high-speed processor, and the data transfer speed of the printer driver 6 is extremely high. Therefore, there is a possibility that the printer 3 may cause an underrun, missing data, or the like. Thus, in the invention of this specific example, the port driver 7 has a function of adjusting the transfer speed of the printer driver 6. The output of the printer driver 6 is sent to the I / F processing unit 1
1 and the data transfer unit 12 and are sent to the IEEE1284 output unit 8. The transfer rate adjusting unit 13 shown in FIG.
This section has a function of receiving a parameter indicating the data transfer rate of the host computer 1 from the processing section 11 and setting the adjusted transfer rate in the data transfer section 12. The data transfer unit 12 has a role of transferring print data input from the I / F processing unit 11 to the printer 3 via the IEEE1284 output unit 8.

【0019】このポートドライバ7の詳細な説明をする
前に、まず転送速度の差によるプリンタ3に発生する障
害について具体的に説明する。図2には、PC(パーソ
ナルコンピュータ)の性能による転送速度の差説明図を
示す。図の(a)には、例えばデータ転送速度が毎秒6
00キロバイトのホストコンピュータ1からプリンタ3
(ここではレーザプリンタ)に対しデータを転送するケ
ースを示す。この場合のプロセッサの動作クロックは毎
秒100MHzである。(b)には、データ転送速度が
毎秒1メガバイトのホストコンピュータ1からプリンタ
3に対しデータを転送するケースを示す。プロセッサの
動作クロックは毎秒100MHzである。なお、(a)
は32ビット処理でPCIバスを使用し、(b)は16
ビット処理でVLバスを使用するプロセッサである点が
相違する。
Before describing the port driver 7 in detail, a failure that occurs in the printer 3 due to a difference in transfer speed will first be specifically described. FIG. 2 is a diagram illustrating a difference in transfer speed depending on the performance of a PC (personal computer). FIG. 5A shows that, for example, the data transfer rate is 6 per second.
00 KB host computer 1 to printer 3
(Here, a case where data is transferred to a laser printer) is shown. The operating clock of the processor in this case is 100 MHz per second. FIG. 3B shows a case where data is transferred from the host computer 1 having a data transfer speed of 1 megabyte per second to the printer 3. The operating clock of the processor is 100 MHz per second. (A)
Uses a PCI bus with 32-bit processing, and (b)
The difference is that the processor uses a VL bus for bit processing.

【0020】(c)は、同じく16ビット処理のプロセ
ッサで、データ転送速度が毎秒300キロバイトの例を
示す。この場合、プロセッサの動作クロックは66MH
zである。また、(d)は、16ビット処理のプロセッ
サで、データ転送速度が毎秒400キロバイトの場合の
例を示す。このプロセッサは、動作クロックが66MH
zである。バスはいずれもVLバスを使用する。
FIG. 2C shows an example of a 16-bit processor having a data transfer rate of 300 kilobytes per second. In this case, the operating clock of the processor is 66 MHz.
z. Also, (d) shows an example in which a 16-bit processor has a data transfer rate of 400 kilobytes per second. This processor has an operation clock of 66 MHz.
z. Each bus uses a VL bus.

【0021】最近では、更に、プロセッサの動作クロッ
クが200MHzから400MHzのものも登場してい
る。例えば、ユーザが同一のプリンタ3にこの図に示す
ような様々な性能のパーソナルコンピュータを接続した
り、あるいはネットワークを通じて様々なパーソナルコ
ンピュータから印刷要求があった場合を考える。このよ
うに、プロセッサの動作クロックの周波数が著しく高い
場合、プリンタドライバも高速で動作し、プリンタ3に
次のような負荷がかかる。
Recently, processors having an operation clock of 200 MHz to 400 MHz have appeared. For example, it is assumed that a user connects personal computers having various performances to the same printer 3 as shown in this figure, or a print request is made from various personal computers through a network. As described above, when the frequency of the operation clock of the processor is extremely high, the printer driver operates at high speed, and the following load is applied to the printer 3.

【0022】図3は、転送速度が適切な場合のプリンタ
動作タイムチャートを示す。プリンタは、通常、印刷デ
ータを受信し、その解析処理を行い、プリンタエンジン
を制御しながら印刷を行う。従って、この図に示すよう
に、受信、解析、印刷といった処理が交互に規則的に繰
り返されることが好ましい。
FIG. 3 shows a printer operation time chart when the transfer speed is appropriate. A printer normally receives print data, performs an analysis process on the print data, and performs printing while controlling a printer engine. Therefore, as shown in this figure, it is preferable that processes such as reception, analysis, and printing are alternately and regularly repeated.

【0023】図4には、データ転送速度が不適切な場合
のプリンタ動作タイムチャートを示す。通常、プリンタ
においては、受信処理が解析処理に優先される。即ち、
データを解析中にデータの受信があれば受信処理を優先
する。また、解析処理よりも印刷処理が優先される。印
字ヘッドの駆動、印刷用紙のスペーシング等は一定の速
度で遅滞無く制御しなければならないからである。
FIG. 4 is a time chart showing the operation of the printer when the data transfer speed is inappropriate. Usually, in a printer, reception processing has priority over analysis processing. That is,
If data is received during data analysis, the receiving process is given priority. In addition, the print processing is given priority over the analysis processing. This is because the driving of the print head, the spacing of the printing paper, and the like must be controlled at a constant speed without delay.

【0024】ところが、例えば、この図の矢印Aの部分
に示すように、印刷データを受信し解析処理を開始する
前に、ホスト側から次のデータの受信があると、割り込
みによって受信処理が優先されてしまう。従って、解析
処理が受信処理の後回しになり、印刷のタイミングが時
間Dだけ遅れる。このような受信による割り込みが繰り
返されると、印刷処理が次第に図のように遅延する。こ
こでその遅延が時間3Dに達すると、オーバーランが発
生する。
However, if the host receives the next data before the print data is received and the analysis process is started, for example, as shown by the arrow A in FIG. Will be done. Therefore, the analysis processing is postponed to the reception processing, and the printing timing is delayed by the time D. When the interruption due to such reception is repeated, the printing process is gradually delayed as shown in the figure. Here, when the delay reaches time 3D, an overrun occurs.

【0025】即ち、印刷速度は一定であって、これに間
に合うようにデータが解析され、プリンタエンジンに供
給されなければならない。ところが、解析処理に遅延が
あると、プリンタエンジンへのデータ供給が間に合わな
くなる。従って、印刷データの供給の無いまま途中から
白紙の印刷が行われる。プリンタの必要とする受信速度
をはるかに上回るデータ転送速度で、ホストコンピュー
タからのデータ転送があった場合、こうした問題が発生
する。そこで、この具体例では、図1に示したポートド
ライバ7がプリンタドライバ6から渡されたデータを、
1バイトずつプリンタ3に転送する際に、1バイト転送
する度に一定の時間待機時間を挟むようにする。こうし
てデータの転送待ちを行うことによって、全体としての
見かけ上の転送速度を遅くする。このようにして、デー
タ転送速度の最適化を図る。別の具体例では、プリンタ
側でデータ転送を抑制するビジー信号を出力して、見か
け上の転送速度を遅くする。
That is, the printing speed is constant, and the data must be analyzed and supplied to the printer engine in time. However, if there is a delay in the analysis processing, data cannot be supplied to the printer engine in time. Therefore, printing of a blank sheet is performed halfway without supply of print data. Such a problem occurs when data is transferred from the host computer at a data transfer speed much higher than the reception speed required by the printer. Therefore, in this specific example, the port driver 7 shown in FIG.
When transferring one byte at a time to the printer 3, a fixed waiting time is inserted every time one byte is transferred. By waiting for data transfer in this way, the apparent transfer speed as a whole is reduced. In this way, the data transfer speed is optimized. In another specific example, the printer transfers a busy signal for suppressing data transfer to reduce the apparent transfer speed.

【0026】データの転送速度は、ホストコンピュータ
1のプロセッサの演算処理速度のみで一意的に計算する
ことはできない。ホストコンピュータの内部回路の性
能、インタフェースの性能、プリンタ3の受信速度等、
様々なファクターにより変化する。そこで、この具体例
では、図1に示したポートドライバ7に、転送速度調整
部13を設け、印刷データ転送開始前に、ダミーデータ
16を実際にプリンタ3に転送し、所定の待機時間を設
定したときの転送速度を実測する。この結果によって、
見かけ上の転送速度を最適化するための待機時間を算出
する。待機時間は図1に示すループカウンタ17にセッ
トする。ウェイト処理部18は、1バイト転送する毎に
セットされた待機時間だけデータの転送待ちをするよう
にデータ転送部12を制御する。以下、フローチャート
を用いて具体例1のシステムの動作を順に説明する。
The data transfer speed cannot be uniquely calculated only by the arithmetic processing speed of the processor of the host computer 1. The performance of the internal circuit of the host computer, the performance of the interface, the reception speed of the printer 3, etc.
Varies by various factors. Therefore, in this specific example, the transfer speed adjusting unit 13 is provided in the port driver 7 shown in FIG. 1, and the dummy data 16 is actually transferred to the printer 3 before the start of the print data transfer, and a predetermined standby time is set. Measure the transfer speed when you do. According to this result,
A standby time for optimizing an apparent transfer speed is calculated. The standby time is set in the loop counter 17 shown in FIG. The wait processing unit 18 controls the data transfer unit 12 to wait for data transfer for a set standby time every time one byte is transferred. Hereinafter, the operation of the system of the specific example 1 will be sequentially described with reference to a flowchart.

【0027】図1に示すホストコンピュータ1のアプリ
ケーション4は、所定の印刷データを生成する。オペレ
ーティングシステム5は、アプリケーション4から印刷
データを受け取り、これをプリンタドライバ6に渡す。
プリンタドライバ6は、この印刷データをプリンタ3が
認識できるコマンドに変換し、ポートドライバ7に渡
す。ポートドライバ7は、プリンタドライバ6から受け
取ったデータをインタフェースの仕様に合わせてIEE
E1284出力部8に転送する。この過程で、ポートド
ライバ7がその転送速度を調整する。
The application 4 of the host computer 1 shown in FIG. 1 generates predetermined print data. The operating system 5 receives the print data from the application 4 and passes it to the printer driver 6.
The printer driver 6 converts the print data into a command that can be recognized by the printer 3 and passes the command to the port driver 7. The port driver 7 converts the data received from the printer driver 6 according to the specifications of the interface according to the IEEE standard.
E1284 Transfers to the output unit 8. In this process, the port driver 7 adjusts the transfer speed.

【0028】図5には、具体例1のシステム動作フロー
チャートを示す。このフローチャートは、上記ポートド
ライバ7の動作を示す。まず、図のステップS1におい
て、ポートドライバ7の転送速度調整部13は、I/F
処理部11を経由して、プリンタドライバ6から受け取
った転送速度の設定値をSetSpeedにセットする。このSe
tSpeedは、プリンタの要求する最適データ転送速度を示
す。なお、以下に示すSetSpeed、DummySize、Count1、
TransSpeed、Count2、TransSpeed2は、いずれも、演
算処理を実行する場合にデータをセットしておく変数を
示す名称である。ステップS2において、ダミーデータ
16を読み出し、そのサイズをDummySizeにセットす
る。次のステップS3では、ウェイトカウンタがCount
1のときの転送速度TransSpeed1を求める。このウェイ
トカウンタは、転送速度を実測するときに使用するカウ
ンタで、1バイト転送する度に転送待ちをする待ち時間
を保持する。
FIG. 5 shows a system operation flowchart of the first embodiment. This flowchart shows the operation of the port driver 7. First, in step S1 of the figure, the transfer speed adjustment unit 13 of the port driver 7
The setting value of the transfer speed received from the printer driver 6 via the processing unit 11 is set in SetSpeed. This Se
tSpeed indicates the optimum data transfer speed required by the printer. Note that SetSpeed, DummySize, Count1,
TransSpeed, Count2, and TransSpeed2 are names indicating variables in which data is set when executing the arithmetic processing. In step S2, the dummy data 16 is read, and its size is set to DummySize. In the next step S3, the wait counter is set to Count
The transfer speed TransSpeed1 at 1 is obtained. This wait counter is used when actually measuring the transfer speed, and holds a waiting time for waiting for transfer every time one byte is transferred.

【0029】ステップS3で求めるTransSpeed1は、待
ち時間がCount1のときの見かけ上の転送速度である。
ステップS4では、待ち時間がCount2のときの見かけ
上の転送速度TransSpeed2を求める。ウェイトカウンタ
の値Count1、Count2は、図1に示したポートドライバ
7のカウンタ発生部15が予め保持している。これを転
送速度調整部13が読み出して使用する。
TransSpeed1 obtained in step S3 is an apparent transfer speed when the waiting time is Count1.
In step S4, an apparent transfer speed TransSpeed2 when the waiting time is Count2 is obtained. The counts Count1 and Count2 of the weight counter are held in advance by the counter generator 15 of the port driver 7 shown in FIG. This is read and used by the transfer rate adjusting unit 13.

【0030】図6には、上記ステップS3、ステップS
4における見かけ上の転送速度を求めるためのフローチ
ャートを示す。(a)は、転送速度TransSpeed1の計算
動作フローチャートである。(b)は、転送速度TransS
peed2の計算動作フローチャートである。まず、(a)
のステップS1において、カウンタ発生部15から受け
取った値Count1をウェイトカウンタにセットする。次
に、ステップS2において、タイマ14をスタートさせ
る。タイマ14は、ディジタルカウンタ等から構成され
る。データ転送部12に対しダミーデータ16とダミー
データサイズDummySize、ウェイトカウンタの値Count1
を渡してデータ転送命令を出す。
FIG. 6 shows the above steps S3 and S3.
4 shows a flowchart for obtaining an apparent transfer speed in FIG. (A) is a flowchart for calculating the transfer speed TransSpeed1. (B) Transfer rate TransS
It is a calculation operation flowchart of peed2. First, (a)
In step S1, the value Count1 received from the counter generator 15 is set in the weight counter. Next, in step S2, the timer 14 is started. The timer 14 includes a digital counter and the like. For the data transfer unit 12, the dummy data 16 and the dummy data size DummySize, the value of the wait counter Count1
To issue a data transfer instruction.

【0031】データ転送部12は、転送速度調整部13
から受け取ったこれらの値を使用して、1バイトダミー
データを転送する毎にウェイトカウンタに設定された値
Count1だけ転送待ちを行い、全てのダミーデータを転
送する。ダミーデータサイズDummySize分のダミーデー
タ16の転送が終了すると、ステップS5で、タイマ1
4をストップし、そのときのタイマ値をTime1にセット
する。ステップS6では、ダミーデータサイズDummySiz
eとタイマ値Time1から、そのときの転送速度を計算す
る。(b)は(a)と全く同様の処理で、ウェイトカウ
ンタの値をCount2に変えて見かけ上の転送速度TransSp
eed2を計算する。演算式は次の通りである。 TransSpeed1(ウェイトカウンタの値Count1のとき) =Time1/DummySize …(1) TransSpeed2(ウェイトカウンタの値Count2のとき) =Time2/DummySize …(2)
The data transfer unit 12 includes a transfer speed adjustment unit 13
Each time 1 byte dummy data is transferred using these values received from
The transfer waits for Count1 and transfers all the dummy data. When the transfer of the dummy data 16 for the dummy data size "DummySize" is completed, in step S5, the timer 1
4 is stopped, and the timer value at that time is set to Time1. In step S6, the dummy data size DummySiz
The transfer rate at that time is calculated from e and the timer value Time1. (B) is the same processing as (a) except that the value of the wait counter is changed to Count2 and the apparent transfer speed TransSp
Calculate eed2. The arithmetic expression is as follows. TransSpeed1 (when the value of the weight counter is Count1) = Time1 / DummySize (1) TransSpeed2 (when the value of the weight counter is Count2) = Time2 / DummySize (2)

【0032】次に、図5のステップS5に進み、求めら
れた2種類の見かけ上の転送速度TransSpeed1、TransS
peed2とそれぞれその転送速度測定時のカウンタの値Co
unt1、Count2からカウンタを“1”増加させたときの
転送速度の減少率Decを計算する。
Next, the process proceeds to step S5 in FIG. 5, in which the obtained two apparent transfer speeds TransSpeed1 and TransS1 are determined.
peed2 and the counter value Co at the time of each transfer rate measurement
The transfer rate reduction rate Dec when the counter is increased by "1" is calculated from unt1 and Count2.

【0033】図7には、この転送速度の減少率計算の説
明図を示す。この図に示す横軸はウェイトカウンタの
値、縦軸は実測された見かけ上の転送速度を示す。図に
示すように、ウェイトカウンタの値Count1を設定して
見かけ上の転送速度を測定した場合の点Pと、ウェイト
カウンタの値Count2を設定して見かけ上の転送速度を
測定した場合の点Qとを直線で結ぶことによって、転送
速度の減少率が計算される。即ち、この直線の傾きは、
ウェイトカウンタの値を“1”ずつ減少させた場合の転
送速度の変化率に相当する。この計算式は、下の(1)
式に示す通りとなる。 Dec=|TransSpeed1−TransSpeed2|/|Count1−Count2| =|転送速度1−転送速度2|/ |ウェイトカウンタ1−ウェイトカウンタ2| …(3)
FIG. 7 is a diagram for explaining the calculation of the transfer rate reduction rate. The horizontal axis shown in this figure represents the value of the weight counter, and the vertical axis represents the actually measured apparent transfer rate. As shown in the figure, a point P when the apparent transfer rate is measured by setting the value Count1 of the weight counter, and a point Q when the apparent transfer rate is measured by setting the value Count2 of the weight counter. Is connected by a straight line, the reduction rate of the transfer rate is calculated. That is, the slope of this straight line is
This corresponds to the rate of change of the transfer speed when the value of the wait counter is decreased by “1”. This calculation formula is shown in (1) below.
It is as shown in the equation. Dec = | TransSpeed1-TransSpeed2 | / | Count1-Count2 | = | Transfer speed 1-Transfer speed 2 | / | Weight counter 1-Wait counter 2 | (3)

【0034】これによって、ウェイトカウンタの値をい
くつにすると、見かけ上の転送速度がどのような値に変
化するかを計算により求めることができる。これによっ
て、最適転送速度にするためのウェイトカウンタの値を
割り出す。これを図1に示すループカウンタ17にセッ
トする。ループカウンタ17は、実際にデータ転送をす
るときに待機時間を格納しておくレジスタである。例え
ば、プリンタの性能が印刷速度600dpi(ドット/
インチ)、印刷スピード4ppm(ページ/分)、受信
バッファサイズ128キロバイトであるとする。このよ
うなプリンタでレターサイズの用紙に印刷を行う場合、
印刷データの転送速度は次のようになる。
With this, it is possible to calculate the value of the weight counter to determine what value the apparent transfer speed changes. Thus, the value of the wait counter for obtaining the optimum transfer speed is determined. This is set in the loop counter 17 shown in FIG. The loop counter 17 is a register that stores a standby time when data is actually transferred. For example, if the performance of the printer is 600 dpi (dot / dot)
Inches), the printing speed is 4 ppm (pages / minute), and the receiving buffer size is 128 kilobytes. When printing on letter size paper with such a printer,
The transfer speed of the print data is as follows.

【0035】まず、レターサイズの用紙は、縦11イン
チ、横8.5インチである。この用紙に印刷をするため
のデータサイズの最大値は、11×600×8.5×6
00=33660000(ビット)になる。即ちデータサイズは
約4メガバイトである。このデータを上記のようなスピ
ードで印刷した場合に、1秒間に転送しなければならな
いデータ量は次の通りとなる。 4メガバイト×4ppm/60秒=280キロバイト/
First, letter size paper is 11 inches long and 8.5 inches wide. The maximum value of the data size for printing on this paper is 11 × 600 × 8.5 × 6.
00 = 33660000 (bits). That is, the data size is about 4 megabytes. When this data is printed at the speed described above, the amount of data that must be transferred per second is as follows. 4 megabytes x 4 ppm / 60 seconds = 280 kilobytes /
Second

【0036】なお、この転送速度はプリンタが連続的に
一定速度でデータを受信し続ける場合の速度である。し
かしながら、1ページ分のデータを記憶するために十分
な容量の受信バッファを持たないホストベースプリンタ
では、データ転送速度をこの値よりも速くして、断続的
にデータを受信する。ホストコンピュータのデータ転送
速度の設定値は、既に説明したようにSetSpeedにセット
されている。このとき、上記ウェイトカウンタCount1
とその見かけ上の転送速度TransSpeed1及び上記減少率
Decとを使用すると、最適待ち時間即ちループカウン
タの値を求める式は次のように表される。 ループカウンタ=(TransSpeed1−SetSpeed)/Dec+Count1 …(4)
The transfer speed is a speed at which the printer continuously receives data at a constant speed. However, in a host-based printer that does not have a reception buffer having a sufficient capacity to store one page of data, the data transfer speed is set higher than this value, and data is intermittently received. The set value of the data transfer speed of the host computer is set in SetSpeed as described above. At this time, the weight counter Count1
Using the apparent transfer speed TransSpeed1 and the decrease rate Dec, the formula for obtaining the optimum waiting time, that is, the value of the loop counter, is expressed as follows. Loop counter = (TransSpeed1-SetSpeed) / Dec + Count1 (4)

【0037】例えば、図2に示したものよりも更に動作
クロックの遅い386SX/25MHzのプロセッサを
組み込んだホストコンピュータから、転送速度設定値Se
tSpeedが400キロバイトでデータを転送したい場合、
上記ループカウンタの値は次のようにして求められる。
ダミーデータのサイズを64キロバイトとする。ウェイ
トカウンタCount1を“1”としたときの転送時間Time
1は130msとなり、このときの転送速度TransSpeed
1は、上記(1)式により480キロバイト/秒になっ
た。
For example, from a host computer incorporating a 386SX / 25 MHz processor whose operation clock is slower than that shown in FIG.
If you want to transfer data with tSpeed of 400 kilobytes,
The value of the loop counter is obtained as follows.
The size of the dummy data is 64 kilobytes. Transfer time Time when wait counter Count1 is set to "1"
1 is 130 ms, and the transfer speed at this time TransSpeed
1 was 480 kilobytes / sec according to the above equation (1).

【0038】また、ウェイトカウンタCount2を“1
0”としたときの転送時間Time2は320msとなり、
転送速度TransSpeed2は上記(2)式により200キロ
バイト/秒になった。これを上記(3)式に当てはめる
と、減少率Decは次の式で計算される。 (480−200)/(10−1)≒27キロバイト/
回 以上の結果から、ループカウンタの値は、上記(4)式
より次のように計算される。 (480−400)/27+1=3.96≒4 従って、この例では、ループカウンタの値を“4”にす
ればSetSpeed即ちプリンタの要求する最適転送速度でデ
ータを転送できることがわかる。実際にこのループカウ
ンタを使用したデータ転送動作例を次に説明する。
The wait counter Count2 is set to "1".
The transfer time Time2 when it is set to 0 "is 320 ms,
The transfer speed TransSpeed2 is 200 kilobytes / second according to the above equation (2). When this is applied to the above equation (3), the reduction rate Dec is calculated by the following equation. (480-200) / (10-1) @ 27 kilobytes /
From the above results, the value of the loop counter is calculated from the above equation (4) as follows. (480−400) /27+1=3.96≒4 Therefore, in this example, it can be seen that if the value of the loop counter is set to “4”, data can be transferred at SetSpeed, that is, the optimum transfer speed required by the printer. Next, an example of a data transfer operation using this loop counter will be described.

【0039】図8は、図1に示したポートドライバ7の
データ転送動作フローチャートを示す。このデータ転送
動作は、見かけ上の転送速度測定のためにダミーデータ
を転送する場合も、実際にプリンタで印刷を行うデータ
を転送する場合も同様である。まずステップS1におい
て、データ転送部12は、I/F処理部11から受け取
ったプリンタ3に転送すべきデータサイズをSubSizeに
セットする。なお、ダミーデータを転送する場合には、
ダミーデータを転送速度調整部13から受け取る。そこ
で、その旨を図中に示した。
FIG. 8 is a flowchart showing the data transfer operation of the port driver 7 shown in FIG. This data transfer operation is the same whether the dummy data is transferred to measure the apparent transfer speed or the data to be actually printed by the printer. First, in step S1, the data transfer unit 12 sets the data size to be transferred to the printer 3 received from the I / F processing unit 11 to SubSize. When transferring dummy data,
Dummy data is received from the transfer speed adjusting unit 13. Therefore, this is shown in the figure.

【0040】次に、ステップS2では、図1に示すウェ
イト処理部18が、ループカウンタ17から受け取った
ウェイトカウンタの値をSubCountにセットする。次に、
ステップS3において、データ転送部12は、転送すべ
きデータの1バイト分を読み出して出力する。ステップ
S4において、ウェイト処理部18はSubCountのデクリ
メントを行い、ステップS5で、この値が“0”になっ
たかどうかを判断する。即ち、ここで、ウェイトカウン
タ分だけ転送待ちを行う。ウェイトカウンタ分即ち待機
時間だけ転送待ちが終了すると、ステップS6に進み、
データ転送部12は、転送データのサイズをデクリメン
トする。そして、ステップS7において、転送データが
全て転送されたかどうかの判断を行う。そして、データ
全てが転送終了するまで、ステップS2からステップS
7の処理を繰り返す。
Next, in step S2, the weight processing unit 18 shown in FIG. 1 sets the value of the weight counter received from the loop counter 17 to SubCount. next,
In step S3, the data transfer unit 12 reads and outputs one byte of data to be transferred. In step S4, the weight processing unit 18 decrements the SubCount, and determines in step S5 whether or not this value has become "0". That is, here, the transfer is waited for the wait counter. When the transfer wait is completed for the wait counter, that is, the wait time, the process proceeds to step S6,
The data transfer unit 12 decrements the size of the transfer data. Then, in step S7, it is determined whether or not all the transfer data has been transferred. Steps S2 to S2 are performed until all the data has been transferred.
Step 7 is repeated.

【0041】なお、上記の例において、転送速度の減少
率を、異なる待機時間で転送したときの見かけ上の転送
速度の差に基づいて計算したが、見かけ上の転送速度の
比等により求めても差し支えない。
In the above example, the transfer rate reduction rate is calculated based on the difference between the apparent transfer speeds when the transfer is performed at different standby times. No problem.

【0042】〈具体例1の効果〉以上のように、データ
転送前に、所定量のダミーデータを任意の待機時間で転
送したときの、見かけ上の転送速度を実測し、この見か
け上の転送速度と待機時間との関係から、待機時間を選
択すれば、ホストコンピュータ1とプリンタ3との組み
合わせに応じた最適の転送速度で、ホストコンピュータ
1からプリンタ3へのデータ転送を行うことができる。
<Effects of Specific Example 1> As described above, before the data transfer, the apparent transfer speed when a predetermined amount of dummy data is transferred for an arbitrary standby time is measured, and the apparent transfer speed is measured. If the standby time is selected from the relationship between the speed and the standby time, data transfer from the host computer 1 to the printer 3 can be performed at an optimal transfer speed according to the combination of the host computer 1 and the printer 3.

【0043】なお、このデータ転送処理は、プリンタへ
のデータ転送のみならず様々な外部装置へのデータ転送
に同様に適用できる。また、データ転送速度を実際にダ
ミーデータを転送することにより実測するため、ホスト
コンピュータのプロセッサの動作クロックやインタフェ
ースの構成、プリンタのバッファサイズ等、様々な要因
に基づく見かけ上のデータ転送速度を正確に測定し、転
送速度の最適化を図ることができる。
The data transfer process can be applied not only to data transfer to a printer but also to data transfer to various external devices. In addition, since the data transfer rate is actually measured by actually transferring dummy data, the apparent data transfer rate based on various factors such as the operating clock of the host computer processor, the configuration of the interface, and the buffer size of the printer can be accurately determined. And the transfer speed can be optimized.

【0044】〈具体例2〉この具体例は、上記の例より
もホストコンピュータのプロセッサが更に動作クロック
の速いものである場合に適用する。上記のようにして、
見かけ上の転送速度を実測して最適な待機時間を演算し
たとしても、実際と誤差が生じることがある。この例で
は、演算処理をした結果から、選択された待機時間を使
用して見かけ上の転送時間を実測し、目標とするデータ
転送速度との誤差を検出して、更に待機時間を補正す
る。システムの構成は、図1に示したものと同様である
ため、そのブロック図の図示は省略する。
<Specific Example 2> This specific example is applied to a case where the processor of the host computer has an operation clock faster than that of the above example. As above,
Even if the optimum standby time is calculated by actually measuring the apparent transfer speed, an error may occur from the actual one. In this example, the apparent transfer time is actually measured using the selected standby time from the result of the arithmetic processing, an error from the target data transfer rate is detected, and the standby time is further corrected. Since the configuration of the system is the same as that shown in FIG. 1, illustration of the block diagram is omitted.

【0045】図9に、具体例2のシステム動作フローチ
ャートを示す。これは、図5に示した具体例1のシステ
ム動作のステップS5以降を改良したものである。従っ
て、図5に示すステップS1〜ステップS4までの処理
は、具体例1と同様であり、図示を省略した。図9のス
テップS1では、具体例1と同様にして、カウンタを
“1”増加したときの転送速度の減少率Decを計算す
る。
FIG. 9 shows a system operation flowchart of the second embodiment. This is an improvement from step S5 of the system operation of the specific example 1 shown in FIG. Therefore, the processes from step S1 to step S4 shown in FIG. 5 are the same as those in the specific example 1, and are not shown. In step S1 in FIG. 9, the transfer rate reduction rate Dec when the counter is incremented by "1" is calculated in the same manner as in the first embodiment.

【0046】そして、ステップS2において、プリンタ
の要求する転送速度設定値SetSpeedに近付けるためのル
ープカウンタの値を計算する。ここで、ホスト側のプロ
セッサが図2に示した486DX以上の高速プロセッサ
によるシステムクロックで動作する場合には、転送速度
とウェイトカウンタとの関係が直線で表せなくなる。
In step S2, the value of a loop counter for approaching the transfer speed setting value SetSpeed requested by the printer is calculated. Here, when the host processor operates on the system clock of the high-speed processor of 486DX or more shown in FIG. 2, the relationship between the transfer speed and the wait counter cannot be represented by a straight line.

【0047】図10には、ウェイトカウンタの誤差説明
図を示す。図7と同様に、グラフの縦軸は転送速度、横
軸はウェイトカウンタの値を示す。具体例1では、転送
速度とウェイトカウンタの関係を図の破線のような直線
で近似した。しかしながら、計算によって求めたループ
カウンタをウェイトカウンタとして、ダミーデータを実
際に転送してその結果をプロットすると、転送速度とウ
ェイトカウンタの関係は、図の実線に示すように、やや
カーブしてくる。
FIG. 10 is a diagram for explaining an error of the weight counter. As in FIG. 7, the vertical axis of the graph indicates the transfer speed, and the horizontal axis indicates the value of the weight counter. In the specific example 1, the relationship between the transfer speed and the weight counter was approximated by a straight line as indicated by a broken line in the figure. However, when dummy data is actually transferred using the loop counter obtained by calculation as a weight counter and the result is plotted, the relationship between the transfer speed and the weight counter slightly curves as shown by the solid line in the figure.

【0048】従って、具体例1のように、破線に示す直
線により転送速度がSetSpeedのときのウェイトカウンタ
の値C1を用いてデータ転送をすると、実際の転送速度
はSS1となってしまう。そこで、図9のステップS4
に示すように、実測した転送速度SS1と目的とする転
送速度SetSpeedとの差を考慮して、ループカウンタの値
の補正を行う。この補正後のループカウンタ値を用い
て、既に説明したデータ転送を行う(図9ステップS
5)。
Therefore, when data transfer is performed using the value C1 of the wait counter when the transfer speed is SetSpeed using the straight line shown by the broken line as in the first embodiment, the actual transfer speed becomes SS1. Therefore, step S4 in FIG.
As shown in (1), the value of the loop counter is corrected in consideration of the difference between the actually measured transfer speed SS1 and the target transfer speed SetSpeed. The data transfer described above is performed using the corrected loop counter value (step S in FIG. 9).
5).

【0049】図11には、この誤差補正動作のフローチ
ャートを示した。まず、ステップS1において、図1に
示すダミーデータ16を読み出し、そのサイズをDummyS
izeにセットする。次に、ステップS2において、ルー
プカウンタの値をウェイトカウンタCount3にセットす
る。これは、図10のC1に相当する値である。そし
て、ステップS3で、タイマをスタートさせる。次のス
テップS4で、データ転送部12に対し、ダミーデー
タ、ダミーデータサイズ、ウェイトカウンタ等のデータ
を渡して、データ転送命令を出す。データ転送部12
は、受け取った値を使用して、設定された待ち時間C1
だけ転送待ちを行いながらダミーデータを転送する。
FIG. 11 shows a flowchart of the error correction operation. First, in step S1, the dummy data 16 shown in FIG.
Set to ize. Next, in step S2, the value of the loop counter is set in the weight counter Count3. This is a value corresponding to C1 in FIG. Then, in step S3, the timer is started. In the next step S4, data such as dummy data, dummy data size, and a weight counter are passed to the data transfer unit 12 to issue a data transfer instruction. Data transfer unit 12
Uses the received value to set the waiting time C1
The dummy data is transferred while only waiting for transfer.

【0050】ダミーデータの転送が終了すると、ステッ
プS6で、タイマ14をストップし、そのときのタイマ
値をTime3にセットする。ステップS7では、ダミーデ
ータサイズとタイマ値から転送速度を計算する。ステッ
プS8で、こうして求められた転送速度が目的とするプ
リンタの最適転送速度SetSpeed以下かどうかを判断す
る。もし、実測した転送速度が目標よりも小さければス
テップS9に進み、カウンタをアップして補正する。目
標より大きければステップS10に進み、カウンタをダ
ウンして補正する。
When the transfer of the dummy data is completed, the timer 14 is stopped in step S6, and the timer value at that time is set in Time3. In step S7, the transfer rate is calculated from the dummy data size and the timer value. In step S8, it is determined whether or not the transfer speed thus obtained is equal to or less than the optimum transfer speed SetSpeed of the target printer. If the actually measured transfer speed is lower than the target, the process proceeds to step S9, and the counter is incremented and corrected. If it is larger than the target, the process proceeds to step S10, in which the counter is decreased to perform correction.

【0051】図12には、カウンタをダウンして補正す
る場合の動作フローチャートを示す。まず、ステップS
1で、誤差の生じているループカウンタの値をCtrCount
1にセットする。次に、ステップS2において、ダミー
データを読み出し、そのサイズをDummySizeにセットす
る。そして、ステップS3において、ループカウンタの
値を1つダウンさせてウェイトカウンタにセットする
(ステップS4)。ステップS5で、タイマをスタート
させる。
FIG. 12 is a flowchart showing the operation in the case where the correction is performed by decreasing the counter. First, step S
1, the value of the loop counter in which the error occurs is CtrCount.
Set to 1. Next, in step S2, the dummy data is read out and its size is set to DummySize. Then, in step S3, the value of the loop counter is decreased by one and set in the weight counter (step S4). In step S5, a timer is started.

【0052】その後、ステップS6では、これまで説明
したと同様の要領で、そのウェイトカウンタの値による
データ転送速度を実測する。得られたタイマ値Time4
を、ステップS7において使用して、実際のデータ転送
速度を計算する。ステップS8では、データ転送速度が
目標とする値を超えたかどうかを判断する。超えなけれ
ば、再びステップS3に戻り、更にウェイトカウンタの
値をダウンさせる。こうして、目標とする値を超えるま
で、ウェイトカウンタの値をダウンさせながら、ステッ
プS3〜ステップS8の処理を繰り返す。
Thereafter, in step S6, the data transfer speed is actually measured by the value of the wait counter in the same manner as described above. Obtained timer value Time4
Is used in step S7 to calculate the actual data transfer rate. In step S8, it is determined whether the data transfer rate has exceeded a target value. If not, the process returns to step S3, and the value of the wait counter is further reduced. Thus, the processing of steps S3 to S8 is repeated while the value of the weight counter is reduced until the value exceeds the target value.

【0053】目標とする値を超えた場合には、ステップ
S9に進み、ウェイトカウンタの値を1つ戻す。そし
て、ステップS10で、この値を最終値に決定し、ルー
プカウンタ17にセーブする。これで待機時間の補正が
終了する。
If the value exceeds the target value, the flow advances to step S9 to return the value of the weight counter by one. Then, in step S10, this value is determined as the final value and saved in the loop counter 17. This completes the correction of the waiting time.

【0054】図13は、カウンタをアップして補正する
場合の動作のフローチャートである。図12に示す処理
と比較すると、ステップS3で、ウェイトカウンタの値
を“1”ずつアップさせる点のみが異なる。ウェイトカ
ウンタの値が目標値に達した場合に、図12の場合と同
様、その値をループカウンタ17にセットする。こうし
て、いずれの場合においても、ループカウンタの値が目
標値に近付くまで実測を繰り返し、転送速度の最適化を
図る。
FIG. 13 is a flow chart of the operation when the counter is incremented for correction. The only difference from the processing shown in FIG. 12 is that the value of the weight counter is incremented by "1" at step S3. When the value of the weight counter reaches the target value, the value is set in the loop counter 17 as in the case of FIG. Thus, in any case, the actual measurement is repeated until the value of the loop counter approaches the target value to optimize the transfer speed.

【0055】なお、具体例1や具体例2に示した処理
は、印刷開始前に自動的に行うとよい。例えばホストコ
ンピュータとプリンタとを接続し、プリンタの電源を投
入したときに、自動的に制御プログラムが起動すること
が好ましい。また、任意のタイミングで、オペレータの
指示によって処理をスタートさせるようにしてもよい。
The processing described in the first and second embodiments may be automatically performed before the start of printing. For example, it is preferable that the control program be started automatically when the host computer is connected to the printer and the printer is turned on. Further, the processing may be started at an arbitrary timing according to an instruction from the operator.

【0056】〈具体例2の効果〉以上の処理により、高
速の動作クロックのホストコンピュータをプリンタに接
続した場合に、演算処理による転送速度の最適化に加え
て、実測による転送速度の補正を行うため、より転送速
度を最適値に近付けることが可能になる。
<Effect of Specific Example 2> With the above processing, when a host computer with a high-speed operation clock is connected to a printer, the transfer speed is corrected by actual measurement in addition to the optimization of the transfer speed by arithmetic processing. Therefore, it is possible to make the transfer speed closer to the optimum value.

【0057】〈具体例3〉具体例3は、要求されるデー
タ転送速度の精度が毎秒数十キロバイト以下の誤差に収
まるように速度調整を行う例を説明する。上記の例で
は、ホストコンピュータ1のポートドライバ7に設けら
れたタイマ14を用いて、見かけ上の転送速度を測定し
た。ところが、プリンタ3の側には、ホストコンピュー
タ側より更に精度の高いタイマが設けられている場合が
ある。このような場合、ホストコンピュータ側でなくプ
リンタ側で、見かけ上の転送速度を測定することによっ
て、高い精度で転送速度の最適化を図ることができる。
<Third Embodiment> In the third embodiment, an example will be described in which the speed is adjusted so that the required accuracy of the data transfer rate falls within an error of several tens of kilobytes per second or less. In the above example, the apparent transfer rate was measured using the timer 14 provided in the port driver 7 of the host computer 1. However, a timer with higher accuracy than the host computer may be provided on the printer 3 side. In such a case, the transfer rate can be optimized with high accuracy by measuring the apparent transfer rate on the printer side, not on the host computer side.

【0058】図14には、具体例3のシステム構成を示
すブロック図を示す。図のホストコンピュータ1は、具
体例1の場合と同様の構成をしている。両者の同一部分
には同一の符号を付した。なお、ポートドライバ7は、
具体例1で用いたタイマ14が不要である。プリンタ側
のタイマを用いて見かけ上のデータ転送速度を測定する
ためである。図のプリンタ3には、データ受信部20、
データ解析部23及び印刷部24が設けられている。こ
のデータ受信部20には、ホストコンピュータから転送
されたデータを受信する受信部21と、具体例1におい
て、データ転送速度を測定したものと同様の役割を持つ
タイマ22が設けられている。
FIG. 14 is a block diagram showing the system configuration of the third embodiment. The illustrated host computer 1 has the same configuration as that of the specific example 1. The same reference numerals are given to the same parts of both. Note that the port driver 7
The timer 14 used in the specific example 1 is unnecessary. This is to measure the apparent data transfer rate using the timer on the printer side. The printer 3 shown includes a data receiving unit 20,
A data analysis unit 23 and a printing unit 24 are provided. The data receiving section 20 is provided with a receiving section 21 for receiving data transferred from the host computer, and a timer 22 having the same role as that for measuring the data transfer rate in the first embodiment.

【0059】図15には、具体例3のシステム動作説明
図を示す。具体例3の場合にも、図5と同様の見かけ上
のデータ転送速度測定処理を行う。即ち、図5のステッ
プS3やステップS5において、ウェイトカウンタを変
更しながら見かけ上の転送速度を求める動作を行う。図
15のステップS1〜ステップS7は、図6(a)ある
いは(b)の処理に相当する。
FIG. 15 is an explanatory diagram of the system operation of the third embodiment. Also in the case of the specific example 3, an apparent data transfer rate measurement process similar to that of FIG. 5 is performed. That is, in steps S3 and S5 in FIG. 5, an operation of obtaining the apparent transfer speed while changing the weight counter is performed. Steps S1 to S7 in FIG. 15 correspond to the processing in FIG. 6A or 6B.

【0060】まず、図15のステップS1において、カ
ウンタ発生部15から受け取った値をウェイトカウンタ
Count6にセットする。次に、ステップS2において、
プリンタ3に対し転送時間測定開始コマンドを転送す
る。これによって、プリンタ3のタイマ22(図14)
が起動する(図15ステップS8)。
First, in step S1 of FIG. 15, the value received from the counter
Set to Count6. Next, in step S2,
The transfer time measurement start command is transferred to the printer 3. Thus, the timer 22 of the printer 3 (FIG. 14)
Is activated (step S8 in FIG. 15).

【0061】次に、図15のステップS3において、デ
ータ転送部12に対しダミーデータ、ダミーデータサイ
ズ、ウェイトカウンタ等を渡して、データ転送命令を出
す。ステップS4では、データ転送部12が受け取った
値を使用して、ウェイトカウンタに設定した待ち時間を
使用しながらダミーデータを転送する。このダミーデー
タは、図15ステップS9に示すように、プリンタ側に
受信される。
Next, in step S3 of FIG. 15, a dummy data, a dummy data size, a weight counter, and the like are passed to the data transfer unit 12 to issue a data transfer instruction. In step S4, using the value received by the data transfer unit 12, the dummy data is transferred while using the waiting time set in the wait counter. This dummy data is received by the printer as shown in step S9 in FIG.

【0062】次に、そのダミーデータの転送が終了する
と、ステップS5において、ホストコンピュータ1から
プリンタ3に対し、データ転送終了コマンドを転送す
る。プリンタ側では、ステップS10において、データ
転送コマンドを受け取った時点でタイマ22をストップ
し、そのタイマ値をホストコンピュータ1に返す。ステ
ップS6では、ホストコンピュータ1がプリンタ3から
そのタイマ値を受け取り、タイマ値Time6にセットす
る。その後、ダミーデータサイズとタイマ値から見かけ
上の転送速度を計算する(ステップS6、ステップS
7)。
Next, when the transfer of the dummy data is completed, a data transfer end command is transferred from the host computer 1 to the printer 3 in step S5. On the printer side, in step S10, upon receiving the data transfer command, the timer 22 is stopped, and the timer value is returned to the host computer 1. In step S6, the host computer 1 receives the timer value from the printer 3 and sets the timer value to Time6. After that, the apparent transfer rate is calculated from the dummy data size and the timer value (step S6, step S6).
7).

【0063】具体例1では、2種類のウェイトカウンタ
を設定し、ウェイトカウンタが“1”増加した場合の転
送速度の減少率を計算した。具体例3においても、図1
5に示す処理をそれぞれ異なるウェイトカウンタの値を
設定して実行する。こうして、具体例1と同様にして、
転送速度の最適化を図る。
In the first embodiment, two types of weight counters are set, and the rate of decrease in transfer speed when the weight counter increases by "1" is calculated. In the specific example 3, FIG.
The processing shown in FIG. 5 is executed by setting different values of the weight counters. Thus, in the same manner as in Example 1,
Optimize the transfer speed.

【0064】通常、ホストコンピュータ1のタイマは精
度が数十ミリ秒ほどのものが多く、ループカウンタ17
に設定する待機時間は数十ミリ程度の誤差を含むものに
なる。このため、要求される転送速度の精度が高い場
合、その精度を満たすことが困難になる。一方、プリン
タ3のタイマ22(図14)の精度が数マイクロ秒程度
であれば、これによって十分正確な見かけ上の転送時間
を測定できる。
Usually, many timers of the host computer 1 have an accuracy of about several tens of milliseconds.
The standby time set in includes an error of about several tens of millimeters. Therefore, if the required accuracy of the transfer rate is high, it is difficult to satisfy the accuracy. On the other hand, if the accuracy of the timer 22 (FIG. 14) of the printer 3 is on the order of a few microseconds, the apparent transfer time can be measured sufficiently accurately.

【0065】〈具体例3の効果〉データ転送速度に高い
精度が要求される場合に、プリンタ側のタイマを用いる
ことによって、転送速度のより精密な最適化が可能にな
る。その他の効果は具体例1等と同様である。
<Effect of Specific Example 3> When a high accuracy is required for the data transfer speed, the use of the timer on the printer side enables more precise optimization of the transfer speed. Other effects are the same as those of the first embodiment.

【0066】〈具体例4〉上記のように、転送速度の最
適化をはかったとしても、インタフェースの影響により
正常なデータ転送ができないことがある。例えば、イン
タフェースケーブルのインピーダンスによって、信号線
を流れるパルスの波形が崩れるために、同期が取れなく
なる場合等である。このような現象を、ここではなまり
によるデータ抜けと称する。なまりによるデータ抜けが
生じる場合には、データ転送速度を更に遅くすればよ
い。そこで、このなまりによるデータ抜けの発生を検出
し、どの程度データ転送速度を遅くするか決定する方法
をこの具体例で説明する。
<Example 4> As described above, even if the transfer speed is optimized, normal data transfer may not be performed due to the influence of the interface. For example, there is a case where the waveform of a pulse flowing through the signal line is broken due to the impedance of the interface cable, so that synchronization cannot be achieved. Such a phenomenon is herein referred to as data loss due to rounding. If data loss occurs due to dullness, the data transfer speed may be further reduced. Therefore, a method of detecting occurrence of data loss due to rounding and determining how much the data transfer speed is reduced will be described in this specific example.

【0067】図16は、具体例4のシステム構成を示す
ブロック図である。図のホストコンピュータ1は、具体
例1の場合と同様の構成をしている。両者の同一部分に
は同一の符号を付した。なお、ポートドライバ7には、
ハイカウンタ26とローカウンタ27とを設けた。これ
らに2種の待機時間をセットしておき、それぞれの場合
の見かけ上のデータ転送速度を測定するためである。プ
リンタ3には、受信したデータのバイト数をカウントし
て集計するサムチェック部28を新たに設ける。
FIG. 16 is a block diagram showing a system configuration of the fourth embodiment. The illustrated host computer 1 has the same configuration as that of the specific example 1. The same reference numerals are given to the same parts of both. The port driver 7 includes
A high counter 26 and a low counter 27 are provided. This is for setting two types of standby times and measuring the apparent data transfer speed in each case. The printer 3 is newly provided with a sum check unit 28 for counting and counting the number of bytes of the received data.

【0068】ホストコンピュータ1とプリンタ3との間
を接続するインタフェースケーブルは、信号線を8本使
用している。これらの信号線に伝送されるデータの内容
を全て変化させるために、ダミーデータとして、0〜6
5535の間の64キロバイトのデータを使用する。1
バイト転送するたびに信号線を流れるデータの内容を変
化させて、なまりによるデータ抜けを監視するためであ
る。
The interface cable connecting the host computer 1 and the printer 3 uses eight signal lines. In order to change all the contents of the data transmitted to these signal lines, 0-6
Use 64 kilobytes of data between 5535. 1
This is because the content of data flowing through the signal line is changed every time byte transfer is performed, and data loss due to rounding is monitored.

【0069】図17には、信号線のなまりによるデータ
抜けと防止策説明図を示す。図の(a)は、8ビットの
データがシリアルに順に転送される状態を示す。信号線
のうちのいずれか1本の信号レベルが、この図に示すよ
うなタイミングで変化するものとする。(b)は、プリ
ンタ側でデータを受信するためのタイミングを知らせる
ストローブである。このストローブもデータとともにイ
ンタフェースケーブルを通じてプリンタに転送される。
FIG. 17 is a diagram for explaining data loss due to rounding of signal lines and a preventive measure. FIG. 7A shows a state in which 8-bit data is sequentially transferred in serial. It is assumed that the signal level of any one of the signal lines changes at the timing shown in FIG. (B) is a strobe for notifying the timing for receiving data on the printer side. This strobe is also transferred to the printer together with the data through the interface cable.

【0070】プリンタでは、このストローブのレベルが
ローレベルからハイレベルに上がったタイミングと、ハ
イレベルからローレベルに下がったタイミングで、各デ
ータを受信バッファに取り込む。図の例では、時刻t1
で最初のデータを取り込み、時刻t2で次のデータを取
り込み、時刻t3で最後のデータを取り込んでいる。こ
のストローブ信号になまりが生じると次のような状態に
なる。
In the printer, each data is fetched into the reception buffer at the timing when the level of the strobe rises from the low level to the high level and at the timing when the level of the strobe falls from the high level to the low level. In the example of FIG.
, The first data is fetched, the next data is fetched at time t2, and the last data is fetched at time t3. When the strobe signal becomes dull, the following state occurs.

【0071】(c)は、(a)と同じデータである。
(d)は、ストローブである。このストローブが、図に
示す時刻t1からt2に移るタイミングでなまりを生じ
ている。このnストローブがローレベルになった時刻t
1で、最初のデータを取り込み、次にnストローブがハ
イレベルになった時点で、次のデータを取り込む。とこ
ろが、信号になまりがあるため、ハイレベルに達した時
刻t2にデータを取り込もうとすると、既に次のデータ
が入力し、1回分のデータ抜けが生じてしまう。
(C) is the same data as (a).
(D) is a strobe. This strobe is rounded at the timing from time t1 to t2 shown in the figure. Time t when this n strobe goes low
In step 1, the first data is fetched, and when the n strobe goes high, the next data is fetched. However, since the signal is rounded, if data is to be taken in at time t2 when the signal has reached the high level, the next data has already been input, and one data drop will occur.

【0072】この発明では、こうした問題を防止するた
めに、データのなまりが発生し易い部分で部分的にデー
タの転送速度を調整する。(e)には、図の時刻t2の
部分でデータの転送を時間Tだけ遅らせたときのデータ
の内容を示す。(f)に示すストローブは、この間に所
定のレベルまで立ち上がり、2番目のデータの取り込み
を可能にする。即ち、ストローブがロウレベルからハイ
レベルに立ち上がるタイミングで、T時間だけウェイト
カウンタによる待機時間を挿入して、データ抜け発生を
防止している。以下、その具体的な動作をフローチャー
トを用いて説明する。
In the present invention, in order to prevent such a problem, the data transfer speed is partially adjusted in a portion where data rounding is likely to occur. (E) shows the data content when the data transfer is delayed by the time T at the time t2 in the figure. The strobe shown in (f) rises to a predetermined level during this time, and enables the capture of the second data. That is, at the timing when the strobe rises from the low level to the high level, a waiting time by the wait counter is inserted for the time T to prevent data loss. Hereinafter, the specific operation will be described using a flowchart.

【0073】図18、図19、図20は、具体例4の動
作を説明するためのフローチャートである。まず、図1
8のステップS1では、これまでの具体例で説明したと
おりに転送速度の減少率Decを計算する。そして、ス
テップS2において、転送速度を転送速度設定値SetSpe
edに近付けるために必要なループカウンタを計算し、そ
の計算結果をハイカウンタ26とローカウンタ27に格
納する。ハイカウンタ26は、図17に示したストロー
ブがハイレベルになった状態での待機時間を設定するカ
ウンタである。ローカウンタ27は、図17に示したス
トローブがロウレベルになった状態での待機時間を設定
するカウンタである。従って、ストローブの状態に応じ
て2種の待機時間を使い分けることになる。ステップS
3において、ダミーデータ16を読み出して、そのサイ
ズをDummySizeにセットする。
FIGS. 18, 19 and 20 are flowcharts for explaining the operation of the fourth embodiment. First, FIG.
In step S1 of FIG. 8, the transfer rate reduction rate Dec is calculated as described in the above specific examples. Then, in step S2, the transfer speed is set to the transfer speed set value SetSpe.
The loop counter required to approach ed is calculated, and the calculation result is stored in the high counter 26 and the low counter 27. The high counter 26 is a counter for setting a standby time when the strobe shown in FIG. 17 is at a high level. The low counter 27 is a counter for setting a standby time when the strobe shown in FIG. 17 is at a low level. Therefore, two types of standby time are used depending on the state of the strobe. Step S
At 3, the dummy data 16 is read out and its size is set to DummySize.

【0074】次に、プリンタ3になまり確認用コマンド
を転送する。即ち、これからダミーデータを転送しなが
ら、なまりの発生確認を行う旨をプリンタに通知する。
ステップS6では、転送速度調整部13がデータ転送部
12に対してダミーデータ16のサイズやダミーデータ
を渡してデータ転送命令を出す。ステップS7で、デー
タ転送部12は、受け取った値を使用してローカウンタ
27に設定された値で転送待ちを行いながらダミーデー
タを転送する。転送が終了すると、ステップS8におい
て、プリンタ3側にデータ転送終了コマンドを転送す
る。
Next, a rounding confirmation command is transferred to the printer 3. That is, while the dummy data is being transferred, the printer is notified that the occurrence of rounding is to be confirmed.
In step S6, the transfer speed adjustment unit 13 issues a data transfer instruction by passing the size of the dummy data 16 and the dummy data to the data transfer unit 12. In step S7, the data transfer unit 12 uses the received value to transfer the dummy data while waiting for transfer with the value set in the row counter 27. When the transfer is completed, a data transfer end command is transferred to the printer 3 in step S8.

【0075】ステップS9では、プリンタ3から受信デ
ータ数とサムチェックデータを受け取る。受信データ数
は、たとえば単位バイトで表示する。サムチェックデー
タは、受信したデータ数を示す。なお、データ数をその
まま数えて表示すると数値が大きくなるので、たとえば
その下位ビットのみをサムチェックデータとする。プリ
ンタ3のサムチェック処理部20は、このサムチェック
を行い、その結果をポートドライバ7に通知する機能を
持つ。ステップS10では、プリンタ3から受け取った
受信データ数とダミーデータサイズとを比較する。ま
た、プリンタ3から受け取ったサムチェックデータとホ
ストコンピュータ側で計算したダミーデータのサムチェ
ック結果とをそれぞれ比較する。そして、もしそのいず
れかが異なっていた場合には、信号線のなまり調整を行
う。なまり調整は、待機時間を延長してデータ転送速度
を遅くすることにより行われる。このなまり調整のため
の処理を次の図19を用いて説明する。
At step S 9, the number of received data and the sum check data are received from the printer 3. The number of received data is displayed in, for example, a unit byte. The sum check data indicates the number of received data. It should be noted that if the number of data is counted and displayed as it is, the numerical value increases. For example, only the lower bits thereof are used as the sum check data. The sum check processing unit 20 of the printer 3 has a function of performing this sum check and notifying the result to the port driver 7. In step S10, the number of received data received from the printer 3 is compared with the dummy data size. Further, the sum check data received from the printer 3 is compared with the sum check result of the dummy data calculated by the host computer. If any of them is different, the rounding of the signal line is adjusted. The rounding adjustment is performed by extending the standby time and decreasing the data transfer speed. This rounding adjustment process will be described with reference to FIG.

【0076】図19と図20は、信号線のなまり調整処
理を示すフローチャートである。上記転送速度の調整の
際、ダミーデータ転送終了時点でプリンタに対しデータ
転送終了コマンドを転送した。転送速度調整部13は、
プリンタ3から受信データのバイト数DataCountとサム
チェックデータAとを受け取る。転送速度調整部13
は、ダミーデータサイズDummySizeと、受信データ数Dat
aCountと、転送速度調整部13自身が計算したダミーデ
ータ16のサムチェックデータBと、サムチェックデー
タAとを比較する。これらのデータが同じ場合には信号
線になまりが生じていないと判断する。どれか1つでも
データが異なっていた場合には、信号線になまりがある
と判断する。
FIGS. 19 and 20 are flowcharts showing the rounding adjustment processing of the signal lines. At the time of adjusting the transfer speed, a data transfer end command was transferred to the printer at the end of the dummy data transfer. The transfer speed adjustment unit 13
The byte count DataCount of the received data and the sum check data A are received from the printer 3. Transfer speed adjustment unit 13
Is the dummy data size DummySize and the number of received data Dat
aCount is compared with the sum check data A and the sum check data B of the dummy data 16 calculated by the transfer speed adjusting unit 13 itself. When these data are the same, it is determined that the signal line is not rounded. If any one of the data is different, it is determined that the signal line is dull.

【0077】ここで、図19ステップS1において、ロ
ーカウンタの値を調整用カウンタCtrCount1にセットす
る。また、ハイカウンタの値を調整用カウンタCtrCount
2にセットする。次に、ステップS3において、プリン
タ3になまり確認用コマンドを転送する。更に、ステッ
プS4において、ダミーデータ16を読み、そのサイズ
をDummySizeにセットする。次に、ステップS5におい
て、ダミーデータを1バイトプリンタに対し出力する。
そして、ステップS6において、nStrobeをハイレベル
に(有効)にセットする。こうして、データを1バイト
転送したことをプリンタ3に通知する。
Here, in step S1 in FIG. 19, the value of the row counter is set in the adjustment counter CtrCount1. Also, adjust the value of the high counter CtrCount
Set to 2. Next, in step S3, a rounding confirmation command is transferred to the printer 3. Further, in step S4, the dummy data 16 is read, and its size is set to DummySize. Next, in step S5, the dummy data is output to the one-byte printer.
Then, in step S6, nStrobe is set to a high level (valid). Thus, the printer 3 is notified that the data has been transferred by one byte.

【0078】次に、ステップS7において、調整用カウ
ンタの値CtrCount1をウェイトカウンタCount8にセッ
トする。そして、ステップS8において、Count8をデ
クリメントする。ステップS9は、ストローブがハイレ
ベルのときウェイトカウンタ分だけ時間が経過したかど
うかを判断する処理である。こうして、Count8に相当
する待機時間だけ経過すると、ステップS10に進み、
ダミーデータのサイズをデクリメントする。1バイトず
つ転送するデータをカウントして、すべてのデータを転
送したかチェックするためである。そして、ステップS
11において、ダミーデータのサイズが“0”になった
かどうかを判断する。即ち、全てのダミーデータの転送
が終了したかどうかを判断する。
Next, in step S7, the value CtrCount1 of the adjustment counter is set in the weight counter Count8. Then, in step S8, Count8 is decremented. Step S9 is a process for determining whether or not the time corresponding to the wait counter has elapsed when the strobe is at the high level. In this way, when the standby time corresponding to Count8 has elapsed, the process proceeds to step S10,
Decrement the size of dummy data. This is for counting the data to be transferred one byte at a time and checking whether all data has been transferred. And step S
At 11, it is determined whether the size of the dummy data has become "0". That is, it is determined whether the transfer of all the dummy data has been completed.

【0079】全てのダミーデータを転送し終えてない場
合には、図20のステップS12に進む。そして、再び
ダミーデータを1バイト分読み出して出力する。更に、
ステップS13において、nStrobeをロウレベルにセッ
トする。こんどは、ストローブがロウレベルの状態にお
ける処理である。ステップS14において、調整用カウ
ンタCtrCount2の値をウェイトカウンタCount9にセッ
トする。そして、ステップS15において、Count9を
デクリメントする。ステップS16は、Count9にセッ
トした時間だけ時間が経過したことを判断する処理であ
る。
If all the dummy data has not been transferred, the process proceeds to step S12 in FIG. Then, one byte of dummy data is read out again and output. Furthermore,
In step S13, nStrobe is set to a low level. This is the process in the state where the strobe is at the low level. In step S14, the value of the adjustment counter CtrCount2 is set in the weight counter Count9. Then, in step S15, Count9 is decremented. Step S16 is a process for determining that the time set in Count9 has elapsed.

【0080】この待機時間が経過すると、ステップS1
7に進み、ダミーデータのサイズをデクリメントする。
そして、再びダミーデータサイズが“0”になったかど
うかを判断する。ダミーデータサイズが“0”でなけれ
ば、ステップS4に戻る。即ち、図19に示すステップ
S4〜ステップS11の処理と、図20に示すステップ
S12〜ステップS18の処理を交互に繰り返し、ダミ
ーデータサイズが“0”になるまでこれらの処理を実行
する。
After the elapse of the standby time, step S1
Proceeding to 7, the size of the dummy data is decremented.
Then, it is determined again whether the dummy data size has become “0”. If the dummy data size is not "0", the process returns to step S4. That is, the processes of steps S4 to S11 shown in FIG. 19 and the processes of steps S12 to S18 shown in FIG. 20 are alternately repeated, and these processes are executed until the dummy data size becomes “0”.

【0081】その後、ステップS19に進み、ダミーデ
ータ転送終了をプリンタ3に通知する。ステップS20
では、プリンタ3が受信したデータ数をカウントし、こ
れを転送速度調整部13に通知する。更に、サムチェッ
クデータCheck2を転送速度調整部13に通知する。次
のステップS21とステップS22で、ダミーデータの
サイズと、実際に送信されたデータ数及びプリンタ側で
受信されたデータ数とをそれぞれ比較し、一致している
かどうかを判断する。
Thereafter, the flow advances to step S19 to notify the printer 3 of the end of the dummy data transfer. Step S20
Then, the number of data received by the printer 3 is counted, and this is notified to the transfer speed adjusting unit 13. Furthermore, the transfer rate adjusting unit 13 is notified of the sum check data Check2. In the next steps S21 and S22, the size of the dummy data is compared with the number of data actually transmitted and the number of data received by the printer, and it is determined whether or not they match.

【0082】一致していなければステップS25に進
み、ここでウェイトカウンタの値を変更する。この例で
は、ストローブがロウレベルのときの待機時間を短縮
し、ストローブがハイレベルのときの待機時間を順次延
長していく。したがって、図17(f)に示すようにパ
ルス波形を変形させてデータ抜けを防止する。そして、
再びその待ち時間によって見かけ上のデータ転送速度を
実測する。このようにして、データ抜けの発生しない待
ち時間を選択し、ステップS23,ステップS24にお
いて、これらの値をローカウンタ、ハイカウンタに格納
する。この例の場合、ストローブがロウレベルのときの
待機時間とし、ストローブがハイレベルのときの待機時
間の和を変更しないので、この調整をしても、見かけ上
のデータ転送時間が変わらないという特徴がある。
If they do not match, the process proceeds to step S25, where the value of the weight counter is changed. In this example, the standby time when the strobe is at a low level is reduced, and the standby time when the strobe is at a high level is sequentially extended. Therefore, the pulse waveform is deformed as shown in FIG. And
Again, the apparent data transfer rate is actually measured by the waiting time. In this way, a waiting time during which no data loss occurs is selected, and these values are stored in the low counter and the high counter in steps S23 and S24. In this example, the standby time when the strobe is at the low level is used, and the sum of the standby times when the strobe is at the high level is not changed. Therefore, even if this adjustment is made, the apparent data transfer time does not change. is there.

【0083】図21は、上記のような処理の際のプリン
タ側のデータ受信部処理概要フローチャートである。ス
テップS1では、なまり確認用測定コマンドを受け取っ
た時点で、サムチェックデータをリセットする。そし
て、ステップS2で、1バイトデータを受信する度にサ
ムチェック処理を行う。そして、ステップS3で、デー
タ転送終了コマンドを受け取った時点で受信データ数と
サムチェックデータとをホストコンピュータ1に返す。
FIG. 21 is a flowchart showing the outline of the processing of the data receiving section on the printer side in the above-described processing. In step S1, the sum check data is reset when the rounding confirmation measurement command is received. In step S2, a sum check process is performed each time 1-byte data is received. Then, in step S3, when the data transfer end command is received, the number of received data and the sum check data are returned to the host computer 1.

【0084】以上の処理によって、ダミーデータの送受
信によりデータ抜け発生の有無を検査し、データ抜けが
発生する場合には、所定のタイミングで部分的に待機時
間を調整して、データ転送速度の最適化を図る。
With the above processing, the presence or absence of data loss due to dummy data transmission / reception is checked. If data loss occurs, the standby time is partially adjusted at a predetermined timing to optimize the data transfer speed. Plan.

【0085】〈具体例4の効果〉以上のように、見かけ
上のデータ転送速度を最適値に調整すると共に、信号線
やその他の環境条件によってデータ抜けが発生するよう
な場合に、所定のタイミングで部分的に待機時間を補正
するので、データ転送速度の最適化と信頼性の向上を図
ることができる。
<Effect of Specific Example 4> As described above, the apparent data transfer speed is adjusted to the optimum value, and when data loss occurs due to signal lines and other environmental conditions, the predetermined timing is set. , The standby time is partially corrected, so that the data transfer speed can be optimized and the reliability can be improved.

【0086】〈具体例5〉上記の具体例では、全てホス
トコンピュータ側にデータ転送速度を調整する機能を持
たせた。この具体例では、データを受信するプリンタ側
にデータ転送速度の調整機能を持たせる。具体的には、
プリンタがデータを受信する際に所定のタイミングでホ
ストコンピュータ側にビジー信号を出力し、その都度デ
ータ送信を抑制する。これによって、見かけ上のデータ
転送速度を最適化する。
<Embodiment 5> In the above embodiments, the host computer has the function of adjusting the data transfer rate. In this specific example, the data receiving printer is provided with a data transfer speed adjusting function. In particular,
When the printer receives data, it outputs a busy signal to the host computer at a predetermined timing, and suppresses data transmission each time. This optimizes the apparent data transfer rate.

【0087】図22は、これを実現するためのシステム
ブロック図である。図に示すように、ホストコンピュー
タ1は、アプリケーション4、オペレーティングシステ
ム5、プリンタドライバ6、ポートドライバ7、IEE
E1284出力部8等を備えている。これらの構成は、
これまでの具体例と同様である。また、プリンタ3のデ
ータ受信部30には、受信部31の他に、ウェイト処理
部32、受信速度測定部33、受信速度調整部34、ウ
ェイトカウンタ35、タイマ36が設けられている。デ
ータ受信部30には、最大受信速度値37が記憶されて
おり、この値がプリンタの最適受信速度に設定される。
FIG. 22 is a system block diagram for realizing this. As shown in the figure, a host computer 1 includes an application 4, an operating system 5, a printer driver 6, a port driver 7, an IEEE
An E1284 output unit 8 and the like are provided. These configurations are:
This is the same as the above specific example. The data receiving unit 30 of the printer 3 is provided with a weight processing unit 32, a receiving speed measuring unit 33, a receiving speed adjusting unit 34, a weight counter 35, and a timer 36 in addition to the receiving unit 31. The data receiving unit 30 stores a maximum receiving speed value 37, and this value is set as the optimum receiving speed of the printer.

【0088】受信速度測定部33は、受信部31がホス
トコンピュータ1から受信するデータの受信速度を、例
えば単位時間当たりに何バイトといった要領で測定する
部分である。受信速度調整部34は、最大受信速度値3
7を参照し、最適受信速度を設定し、これに実際の受信
速度を近付けるように制御を行う部分である。タイマ3
6は、実際のデータ受信速度等を測定するために使用さ
れる。ウェイトカウンタ35は、これまでの具体例で説
明したように、1バイトデータを転送する度にデータ転
送待ちを行う待ち時間を設定するカウンタである。この
例の場合には、データ転送待ちというよりも、データ転
送を抑制する時間という意味になる。
The receiving speed measuring unit 33 is a unit that measures the receiving speed of the data received by the receiving unit 31 from the host computer 1 in a manner such as a number of bytes per unit time. The reception speed adjustment unit 34 calculates the maximum reception speed value 3
7 is a section for setting an optimum receiving speed and controlling the actual receiving speed to approach the optimum receiving speed. Timer 3
Reference numeral 6 is used to measure an actual data reception speed and the like. The wait counter 35 is a counter for setting a waiting time for waiting for data transfer every time 1-byte data is transferred, as described in the specific examples so far. In the case of this example, it means the time for suppressing data transfer rather than waiting for data transfer.

【0089】この例では、ウェイト処理部32が受信部
31を通じてホストコンピュータ1側へビジー信号を出
力する。このビジー信号の出力時間が待ち時間になる。
ビジー信号が出力されている間は、ホストコンピュータ
1からのデータ転送が一旦停止する。これが丁度ホスト
コンピュータ側での転送待機時間と同様の機能を持つ。
In this example, the weight processing section 32 outputs a busy signal to the host computer 1 through the receiving section 31. The output time of this busy signal is a waiting time.
While the busy signal is being output, the data transfer from the host computer 1 is temporarily stopped. This has exactly the same function as the transfer standby time on the host computer side.

【0090】図23には、具体例5における転送速度最
適化動作の方法説明図を示す。図の(a)は、ホストコ
ンピュータの転送速度でデータを転送したタイミングを
示す。(b)は、そのデータをプリンタが取り込むため
のタイミングを制御するnStrobe信号(これまでの説明
と同様に単にストローブと呼ぶ)である。この場合、ス
トローブの立ち上がりのタイミングでデータの取り込み
が行われる。(c)は、プリンタがデータを取り込む際
に周期的にデータ送信を抑制するためのビジー(Busy)
信号である。通常は、このように、ストローブの立ち上
がり部分を挟むタイミングでビジー信号が有効になり、
ホストコンピュータとプリンタとのデータ転送が行われ
る。しかしながら、この転送速度がプリンタにとって速
すぎる場合に、この具体例ではビジー信号を有効にする
時間(ハイレベルになる時間)を延長する。このビジー
信号が有効になる時間が、これまで説明した待機時間を
決定する。
FIG. 23 is a diagram for explaining a method of the transfer speed optimizing operation in the specific example 5. FIG. 3A shows the timing at which data is transferred at the transfer speed of the host computer. (B) is an nStrobe signal (simply called a strobe as in the description so far) that controls the timing at which the data is taken in by the printer. In this case, data is fetched at the rising edge of the strobe. (C) is a busy state for suppressing data transmission periodically when the printer takes in data (Busy).
Signal. Normally, the busy signal becomes valid at the timing of the rising edge of the strobe,
Data transfer between the host computer and the printer is performed. However, if the transfer rate is too fast for the printer, this embodiment extends the time during which the busy signal is made valid (the time when it goes high). The time during which this busy signal becomes valid determines the waiting time described above.

【0091】(d)は、このようにビジー信号が有効に
なる時間を延長した場合のデータ転送タイミングを示し
ている。また、(e)は、ホストコンピュータからプリ
ンタに転送されるnStrobe信号である。(f)は、デー
タを取り込んだ後、見かけ上のデータ転送速度を制御す
るためのビジー信号を示す。このように、ビジー信号が
有効になる時間を図の(t1)から(t2)までT時間
延長することによって見かけ上のデータ転送速度が遅く
なるように制御できる。
(D) shows the data transfer timing when the time during which the busy signal becomes valid is extended. (E) is an nStrobe signal transferred from the host computer to the printer. (F) shows a busy signal for controlling an apparent data transfer rate after data is taken. As described above, by extending the time during which the busy signal becomes valid from the time (t1) to the time (t2) in the drawing, the apparent data transfer speed can be controlled to be reduced.

【0092】図24には、具体例5の受信速度調整処理
概要フローチャートを示す。まず、ステップS1におい
て、図22に示した受信部31は、ホストコンピュータ
1からデータが転送されてきた時点で、タイマ36をス
タートさせる。次に、ステップS2において、DataSize
にセットされた数のデータを受信した時点で、タイマ3
6をストップし、そのときの値をTimeにセットする。受
信部31は、受信データ数DataSizeとタイマ値Timeを受
信速度測定部33に渡す。この受信データ数DataSize
は、データ受信速度を計算するために予め定めたもの
で、任意の数でよい。
FIG. 24 is a flowchart showing the outline of the receiving speed adjusting process according to the fifth embodiment. First, in step S1, the receiving unit 31 shown in FIG. 22 starts the timer 36 when data is transferred from the host computer 1. Next, in step S2, DataSize
At the point when the number of data set in
6 is stopped, and the value at that time is set to Time. The receiving unit 31 passes the received data number DataSize and the timer value Time to the receiving speed measuring unit 33. DataSize of this received data
Is predetermined for calculating the data reception speed, and may be an arbitrary number.

【0093】受信速度測定部33は、ステップS4にお
いて、受け取った値から受信速度を計算し、その値をSp
eedにセットする。受信速度は、受信したデータをタイ
マ36で測定した時間により除算して求めることができ
る。次のステップS5では、最大受信速度値37に基づ
いて、最適受信速度を得て、受信速度測定部33の内部
に設けたレジスタOptimumSpeedにセットする。
In step S4, the reception speed measurement unit 33 calculates the reception speed from the received value, and
Set to eed. The reception speed can be obtained by dividing the received data by the time measured by the timer 36. In the next step S5, an optimum receiving speed is obtained based on the maximum receiving speed value 37, and is set in a register OptimumSpeed provided inside the receiving speed measuring unit 33.

【0094】そして、ステップS6において、計算によ
って求めた受信速度が最適受信速度より大きいかどうか
を判断する。大きくなければ調整が不要なため処理を終
了する。大きければ次のステップS7に進み、受信部3
1や受信速度調整部34を呼び出す。そして、ステップ
S8に進み、受信速度調整部34は、受信速度が最適値
以下になるようにビジー信号が有効になる時間を調整す
る。
Then, in step S6, it is determined whether the reception speed obtained by the calculation is higher than the optimum reception speed. If it is not larger, the adjustment is not necessary and the process is terminated. If it is larger, the process proceeds to the next step S7, where the receiving unit 3
1 and the reception speed adjustment unit 34 are called. Then, proceeding to step S8, the reception speed adjustment unit 34 adjusts the time during which the busy signal is valid so that the reception speed becomes equal to or less than the optimum value.

【0095】既に、図23(f)を用いて説明したよう
に、ビジー信号を有効(ハイレベル)にする時間を計算
して、ウェイトカウンタ35に格納する。この計算は、
上記のように求めた実際のデータ受信速度Speedから最
適受信速度OptimumSpeedを差し引き、その差を上記受信
データ数DataSizeで除算することにより求められる。こ
の除算結果が待ち時間である。この時間だけビジー信号
をロウレベルにセットする時間を遅らせて、ビジー信号
を有効(ハイレベル)にする時間を延長する。この結果
をウェイトカウンタにセットする。
As described with reference to FIG. 23 (f), the time for making the busy signal valid (high level) is calculated and stored in the wait counter 35. This calculation is
It is obtained by subtracting the optimal receiving speed OptimumSpeed from the actual data receiving speed Speed obtained as described above, and dividing the difference by the above-mentioned received data number DataSize. The result of this division is the waiting time. The time for setting the busy signal to low level is delayed by this time, and the time for making the busy signal valid (high level) is extended. This result is set in the wait counter.

【0096】ステップS9では、受信部31がデータを
1バイト受信する毎にウェイト処理部32を呼び出す。
ウェイト処理部32は、ステップS10において、ウェ
イトカウンタ35の値を元にビジー信号をローにセット
するタイミングを遅らせる。こうして、ステップS11
に進み、受信部31は、ウェイト処理部32から処理が
戻ってきた時点で、ビジー信号をローにセットするよう
に動作する。
In step S9, the receiving unit 31 calls the weight processing unit 32 every time one byte of data is received.
In step S10, the weight processing unit 32 delays the timing of setting the busy signal to low based on the value of the weight counter 35. Thus, step S11
The receiving unit 31 operates to set the busy signal to low when the processing returns from the weight processing unit 32.

【0097】〈具体例5の効果〉以上により、図23
(f)に示すようにしてビジー信号を有効にする時間を
調整して、受信速度の最適化を図ることができる。ま
た、この制御は、これまでの具体例と異なり、プリンタ
側のデータ受信部で行うことができる。また、プリンタ
側でホストコンピュータから転送されるデータの受信速
度を最適化できるので、ホストコンピュータのプリンタ
ドライバ等に転送速度最適化機能がない場合において
も、これまで説明した具体例のような効果を得ることが
できる。
<Effect of Specific Example 5> As described above, FIG.
The reception speed can be optimized by adjusting the time during which the busy signal is made effective as shown in FIG. Also, this control can be performed by the data receiving unit on the printer side, unlike the above specific examples. Further, since the receiving speed of the data transferred from the host computer can be optimized on the printer side, even if the transfer speed optimizing function is not provided in the printer driver or the like of the host computer, the effect as in the specific examples described above can be obtained. Obtainable.

【0098】〈具体例6〉この具体例では、外部装置側
にホスト装置からデータを自動受信するダイレクトメモ
リアクセスコントローラを利用する。ダイレクトメモリ
アクセスコントローラは、ホスト装置による高速データ
転送に耐えられる能力を持つものとする。しかしなが
ら、ダイレクトメモリアクセスコントローラは、受信バ
ッファに受信可能なデータ量だけ受信してしまうと、い
ったん動作を停止する。受信バッファ中のデータが外部
装置内部に取り込まれてから、再びダイレクトメモリア
クセスコントローラが受信動作を再開する。従って、そ
の前に更に次のデータがホスト装置から転送された場合
には、データの受信ができなくなる。例えばプリンタが
ホストコンピュータから受信したデータの処理速度が遅
い場合に、これまで説明したと同様のアンダーラン等の
障害が生じる。
<Embodiment 6> In this embodiment, a direct memory access controller that automatically receives data from a host device is used on the external device side. It is assumed that the direct memory access controller has the ability to withstand high-speed data transfer by the host device. However, the direct memory access controller stops operating once it has received the amount of data that can be received in the reception buffer. After the data in the reception buffer is taken into the external device, the direct memory access controller restarts the reception operation again. Therefore, if the next data is transferred from the host device before that, the data cannot be received. For example, when the processing speed of the data received from the host computer by the printer is slow, the same trouble as underrun described above occurs.

【0099】そこで、この具体例では、ダイレクトメモ
リアクセスコントローラによる一括受信可能なデータ受
信毎に、具体例5で説明したようなビジー信号を出力す
る制御を行う。システムの構成自体は、図22で説明し
たものと同様で良いため、その図示を省略する。
Therefore, in this specific example, the control for outputting the busy signal as described in the specific example 5 is performed every time data can be received collectively by the direct memory access controller. The configuration of the system itself may be the same as that described with reference to FIG.

【0100】図25は、具体例6における最適化方法の
タイミングチャートである。図の(a)、(b)、
(c)に示すタイミングは、何ら最適化処理を行わない
でホストコンピュータからプリンタに対しデータが転送
された場合の状態を示す。(a)はデータの転送タイミ
ング、(b)はその取込みのためのnStrobe信号、
(c)はプリンタ側からホストコンピュータに向けて送
信されるビジー信号である。各信号の内容は、具体例5
の場合と同様である。
FIG. 25 is a timing chart of the optimization method in the specific example 6. (A), (b),
The timing shown in (c) indicates a state in which data is transferred from the host computer to the printer without performing any optimization processing. (A) is a data transfer timing, (b) is an nStrobe signal for taking in the data,
(C) is a busy signal transmitted from the printer side to the host computer. The content of each signal is described in Example 5.
Is the same as

【0101】次の(d)、(e)、(f)は、この具体
例6の制御を具体例5と比較するために示したもので、
図23の(d)、(e)、(f)と同様のものである。
即ち、1バイトのデータ受信毎に時刻t1、時刻t4で
ロウレベルになるべきビジー信号をT時間ずつ延長し、
時刻t2、時刻t5のタイミングで受信されるべきデー
タの受信タイミングを3、時刻t7までシフトさせてい
る。ところが、ダイレクトメモリアクセスコントローラ
を使用する場合には、ホストコンピュータの転送速度に
合わせた高速受信が可能である。こうして受信されたデ
ータは、図示しないプリンタのバッファメモリに格納さ
れる。
The following (d), (e), and (f) show the control of the specific example 6 for comparison with the specific example 5.
This is similar to (d), (e), and (f) of FIG.
That is, every time one byte of data is received, the busy signal to be turned to low level at time t1 and time t4 is extended by T time,
The reception timing of the data to be received at the timings of time t2 and time t5 is shifted to 3 and time t7. However, when the direct memory access controller is used, high-speed reception according to the transfer speed of the host computer is possible. The data thus received is stored in a buffer memory of a printer (not shown).

【0102】バッファメモリがいっぱいになると、プリ
ンタはそのデータを最適速度で読み出して印刷を実行す
る。従って、バッファメモリに対するデータの転送タイ
ミングを整えれば、ダイレクトメモリアクセスコントロ
ーラによるデータ転送速度をプリンタの印刷のための最
適転送速度に近付けることができる。
When the buffer memory becomes full, the printer reads out the data at the optimum speed and executes printing. Therefore, if the transfer timing of data to the buffer memory is adjusted, the data transfer speed of the direct memory access controller can be made closer to the optimum transfer speed for printing by the printer.

【0103】(g)、(h)、(i)は、具体例6の制
御を示す。即ち、図の時刻t8まではダイレクトメモリ
アクセスコントローラによるデータ転送のため、ホスト
コンピュータ側の転送速度でデータが受信される。そし
て、このタイミングでビジー信号を、図に示すように時
刻t8から時刻t11まで3Tだけ延長して出力する。
従って、時刻t8〜t11までの間、ホストコンピュー
タによるデータ転送が抑制される。こうすれば、図の
(f)に示すように、時刻t2からt3の間のT時間
と、時刻t6からt7までのT時間と、時刻t9から時
刻t10の延長時間T時間をまとめて、時刻t8から時
刻t11までの時間に移したことになる。これにより、
(f)に示す場合と(i)に示す場合とは、十分に長い
期間での平均的データ転送速度が同等になる。
(G), (h), and (i) show the control of the specific example 6. That is, the data is received at the transfer speed of the host computer side for data transfer by the direct memory access controller until time t8 in the figure. Then, at this timing, the busy signal is extended by 3T from time t8 to time t11 and output as shown in the figure.
Therefore, data transfer by the host computer is suppressed from time t8 to t11. By doing so, as shown in (f) of the figure, the T time from time t2 to t3, the T time from time t6 to t7, and the extension time T time from time t9 to time t10 are combined, and This means that the time has moved from t8 to time t11. This allows
In the case shown in (f) and the case shown in (i), the average data transfer rate over a sufficiently long period is equal.

【0104】図26には、具体例6の動作フローチャー
トを示す。まず、ステップS1において、転送するデー
タのサイズをTotalSizeにセットする。次に、ステップ
S2において、DMAStatusFlagをオンにする。これは、
DMA(ダイレクトメモリアクセスコントローラ)処理
の準備が完了しているかどうかを判断するステップであ
る。デフォルトの状態では、このフラグはオフのためス
テップS3に進み、DMA仕様を問い合わせ、ダイレク
トメモリアクセスコントローラが一度に受信できるデー
タ数をDMASizeにセットする。ステップS4において、
ダイレクトメモリアクセスコントローラの状態フラグを
オンにする。
FIG. 26 is a flowchart showing the operation of the sixth embodiment. First, in step S1, the size of data to be transferred is set to TotalSize. Next, in step S2, the DMAStatusFlag is turned on. this is,
This is a step for determining whether or not preparation for DMA (Direct Memory Access Controller) processing has been completed. In the default state, since this flag is off, the process proceeds to step S3 to inquire the DMA specification, and set the number of data that can be received at one time by the direct memory access controller to DMASize. In step S4,
Turn on the status flag of the direct memory access controller.

【0105】次に、DMASizeの値を転送するデータサイ
ズとしてTransferSizeにセットする。次にステップS6
において、メモリから1バイトのデータを読み出して出
力する。なお、DMA仕様は、ホストコンピュータがプ
リンタに対して問い合わせ、そのDMA仕様をホストコ
ンピュータ側のバッファに格納しておく。DMAStatusFla
gは、1つのデバイス即ちホストコンピュータに接続さ
れている1つの外部装置毎に1つ設定する。重複して同
一の外部装置にDMAの情報を問い合わせることを防ぐ
ためである。このフラグは、外部装置がパワーオンされ
たときに問い合わせてセットされ、外部装置の電源がオ
フされた場合には、オフにリセットされる。
Next, the value of DMASize is set in TransferSize as the data size to be transferred. Next, step S6
, One-byte data is read from the memory and output. As for the DMA specifications, the host computer inquires the printer and the DMA specifications are stored in a buffer on the host computer side. DMAStatusFla
g is set one for each device, that is, one external device connected to the host computer. This is to prevent the same external device from inquiring about the DMA information repeatedly. This flag is set in response to an inquiry when the external device is powered on, and is reset to off when the external device is powered off.

【0106】次のステップS7では、転送するデータの
サイズTotalSizeをデクリメントする。1バイトデータ
を転送する際に残りのデータを表示するためである。ス
テップS8では、このTotalSizeが“0”かどうかを判
断する。“0”であれば全てのデータ転送が終了したか
ら処理を終了する。“0”でなければステップS9に進
み、DMAが一度に受信できる受信数のデクリメントを
行う。
In the next step S7, the size TotalSize of the data to be transferred is decremented. This is for displaying the remaining data when transferring 1-byte data. In step S8, it is determined whether this TotalSize is "0". If it is "0", the process ends because all data transfer has ended. If it is not "0", the process proceeds to step S9, and the number of receptions that the DMA can receive at one time is decremented.

【0107】ステップS10では、これが“0”になっ
たかどうかを判断する。“0”でなければ、ステップS
6に戻り、1バイトずつデータ転送を繰り返す。そし
て、DMAが一度に受信できるデータ数分データを転送
すると、ステップS10からステップS11に進む。具
体例6で求めたウェイトカウンタの値をDMASize倍し
て、これを新たなウェイトカウンタの値とする。即ち、
1バイトずつ転送をし、ビジー信号によりウェイトカウ
ンタ分の待機時間を設定するとすれば、ダイレクトメモ
リアクセスコントローラが一度に転送できるDMASizeバ
イト分をまとめて新たな時間にする。これを用いて、図
25の(i)に示したような制御を行えばよい。
In the step S10, it is determined whether or not this becomes "0". If not "0", step S
Returning to No. 6, data transfer is repeated one byte at a time. When the DMA transfers the data for the number of data that can be received at one time, the process proceeds from step S10 to step S11. The value of the weight counter obtained in the specific example 6 is multiplied by DMASize, and this is set as a new value of the weight counter. That is,
If the transfer is performed byte by byte and the wait time for the wait counter is set by a busy signal, the DMASize bytes that can be transferred at a time by the direct memory access controller are collectively set as a new time. Using this, the control shown in FIG. 25 (i) may be performed.

【0108】次のステップS12では、こうして設定し
たウェイトカウンタをデクリメントし、待機時間の計測
を行う。即ちステップS13で、このウェイトカウンタ
が“0”になったかどうかを判断し、待機時間分だけ時
間待ちを行う。そして、ウェイトカウンタ分の時間が経
過すると、ステップS5に戻り、再びステップS5〜ス
テップS13の処理を繰り返す。こうして全てのデータ
転送を終了すると、動作が終了する。
In the next step S12, the wait counter thus set is decremented, and the standby time is measured. That is, in step S13, it is determined whether or not this wait counter has become "0", and a wait is performed for the standby time. When the time corresponding to the wait counter has elapsed, the process returns to step S5, and the processes of steps S5 to S13 are repeated again. When all data transfer ends in this way, the operation ends.

【0109】なお、図26のフローチャートは、具体例
5で説明したプリンタ側におけるビジー信号で、データ
転送速度を調整した例を説明した。しかしながら、具体
例6の方法は、具体例1等で説明したように、ホストコ
ンピュータ側でループカウンタを用いて待機時間を制御
する場合にも同様に適用される。この場合には、図26
に示すウェイトカウンタの値がループカウンタの値に置
き換えられる。ループカウンタの値を求める制御自身
は、具体例1等で説明した通りでよい。
In the flowchart of FIG. 26, an example in which the data transfer speed is adjusted by the busy signal on the printer side described in the specific example 5 has been described. However, the method of the specific example 6 is similarly applied to the case where the standby time is controlled using the loop counter on the host computer side as described in the specific example 1 and the like. In this case, FIG.
Is replaced by the value of the loop counter. The control itself for obtaining the value of the loop counter may be as described in the first embodiment.

【0110】〈具体例6の効果〉プリンタに設けられた
ダイレクトメモリアクセスコントローラの性能に合わせ
てデータを転送し、データを高速転送できる一方で、ダ
イレクトメモリアクセスコントローラが一度に受信でき
るデータ数を考慮し、このデータ量の受信毎に一定の待
機時間を挿入するので、これまでの具体例と同様、転送
速度の最適化を図ることができる。また、1バイト転送
する度に転送速度を調整する具体例1や具体例5の場合
と異なり、時間待ちのための制御が簡単になるので、ホ
スト装置やプリンタ装置の負荷が軽減できる。
<Effect of Specific Example 6> Data can be transferred at high speed according to the performance of the direct memory access controller provided in the printer, while the number of data that can be received by the direct memory access controller at one time is taken into consideration. Since a fixed waiting time is inserted every time this data amount is received, the transfer speed can be optimized as in the above-described specific examples. Also, unlike the specific examples 1 and 5 in which the transfer speed is adjusted every time one byte is transferred, the control for waiting for time is simplified, so that the load on the host device and the printer device can be reduced.

【0111】〈具体例7〉図27に、具体例7のシステ
ムを示すブロック図を図示した。この具体例では、ホス
トコンピュータ1に複数の外部装置が接続されている場
合の例を示す。図28には、その具体的なデバイスの状
態説明図を示す。図に示すように、ホストコンピュータ
40には、例えばモデム41、ハブ42、プリンタ3等
が接続されている。ホストコンピュータ40は、これら
の装置との通信を同時に制御する。従って、プリンタ3
のみがホストコンピュータ40に接続されている場合に
比べてデータ転送速度の制御が異なってくる。
<Embodiment 7> FIG. 27 is a block diagram showing a system of Embodiment 7. In this specific example, an example in which a plurality of external devices are connected to the host computer 1 will be described. FIG. 28 shows an explanatory diagram of the state of the specific device. As shown in the figure, for example, a modem 41, a hub 42, a printer 3, and the like are connected to the host computer 40. The host computer 40 simultaneously controls communication with these devices. Therefore, printer 3
The control of the data transfer speed is different from that in the case where only one is connected to the host computer 40.

【0112】図27に示すホストコンピュータ40に
は、アプリケーション4A,4B,4Cと、オペレーテ
ィングシステム5、プリンタドライバ6、ポートドライ
バ7、IEEE1284出力部8、ネットワークドライ
バ43、シリアルドライバ44等が設けられている。ネ
ットワークドライバ43は、ハブ42等を制御するドラ
イバである。また、シリアルドライバ44は、モデム4
1等を制御するドライバである。
The host computer 40 shown in FIG. 27 is provided with applications 4A, 4B, 4C, an operating system 5, a printer driver 6, a port driver 7, an IEEE1284 output unit 8, a network driver 43, a serial driver 44, and the like. I have. The network driver 43 is a driver that controls the hub 42 and the like. In addition, the serial driver 44
This is a driver for controlling 1 and the like.

【0113】このシステムの外観構成を次の図に示す。
図28は、具体例7における接続されているデバイスの
状態説明図である。図のホストコンピュータ40には、
モデム41、ハブ42、レーザプリンタ3が接続されて
いる。
The external configuration of this system is shown in the following figure.
FIG. 28 is an explanatory diagram of the state of the connected device in the specific example 7. The host computer 40 shown in FIG.
The modem 41, the hub 42, and the laser printer 3 are connected.

【0114】IEEE1284出力部8に接続されたプ
リンタ3は、データ受信部45、データ解析部23、印
刷部24等を備えている。これらの全体的な構成はこれ
までの具体例とほぼ同様である。また、ホストコンピュ
ータ40のポートドライバ7は、I/F処理部11、デ
ータ転送部12、転送速度調整部13、カウンタ発生部
15、ダミーデータ16、ループカウンタ17、ウェイ
ト処理部18及びタイマ46を備えている。ポートドラ
イバ各部の基本的な機能は具体例1等で説明したものと
ほぼ同様である。具体例7固有の動作について、以下の
図を用いて説明する。
The printer 3 connected to the IEEE1284 output unit 8 includes a data receiving unit 45, a data analyzing unit 23, a printing unit 24, and the like. The overall configuration of these is almost the same as the above specific examples. The port driver 7 of the host computer 40 includes an I / F processing unit 11, a data transfer unit 12, a transfer speed adjustment unit 13, a counter generation unit 15, dummy data 16, a loop counter 17, a wait processing unit 18, and a timer 46. Have. The basic functions of each part of the port driver are almost the same as those described in the specific example 1 and the like. The operation unique to the specific example 7 will be described with reference to the following drawings.

【0115】図29は、1秒間にプリンタに転送される
データ量の説明図を示す。図の(a)は、プリンタのみ
がホストコンピュータ40に接続されて動作した場合の
例を示す。このグラフの横軸は時間である。縦軸は単位
時間に転送されるデータ量を示す。時刻t1から時刻t
2まで、所定の一定のデータ転送速度でデータを転送し
印刷を行う。(b)には、プリンタ以外に送受信を行う
デバイスがある場合の制御を示す。
FIG. 29 is an explanatory diagram of the amount of data transferred to the printer in one second. FIG. 7A shows an example in which only the printer is connected to the host computer 40 and operates. The horizontal axis of this graph is time. The vertical axis indicates the amount of data transferred per unit time. From time t1 to time t
Up to 2, data is transferred at a predetermined constant data transfer speed and printing is performed. (B) shows control when there is a device that performs transmission and reception other than the printer.

【0116】(a)の時刻t1から時刻t2までの時間
に転送されるデータ量は、(b)の時刻t1から時刻t
2までの時間に転送されるデータ量と一致する。(b)
のケースでは、プリンタの制御を時刻t1から時刻t2
までの間でのみ行う。時刻t2からt3までは、ファク
シミリの制御が行われ、時刻t3から時刻t4までは、
ネットワークの制御が行われる。ファクシミリの制御は
モデム41を通じて行われ、ネットワークの制御はハブ
42を通じて行われる。
The amount of data transferred during the period from time t1 to time t2 in (a) is equal to the time t1 to time t2 in (b).
It matches the amount of data transferred in the time up to 2. (B)
In the case of, the control of the printer is changed from time t1 to time t2.
Perform only between From time t2 to t3, facsimile control is performed, and from time t3 to time t4,
Network control is performed. Facsimile control is performed through a modem 41, and network control is performed through a hub 42.

【0117】こうした場合、(a)に示したと同様のデ
ータ量をプリンタに転送する場合には、時刻t1から時
刻t2までの間に、単位時間当たりより多くのデータを
プリンタに転送しなければならない。従って、図のデー
タ量D1とD2を等しくするために、(b)の場合、転
送速度が速くなる。これまでの具体例では、他の外部装
置の接続を考慮せずに転送速度を設定したので、複数の
外部装置が同時に制御されると、データ転送速度が予定
より遅くなる。この具体例では、その転送速度の最適化
を図る。
In such a case, when transferring the same amount of data to the printer as shown in (a), more data must be transferred to the printer per unit time from time t1 to time t2. . Therefore, in order to equalize the data amounts D1 and D2 in the figure, the transfer speed is increased in the case of (b). In the specific examples so far, since the transfer rate is set without considering the connection of other external devices, if a plurality of external devices are controlled simultaneously, the data transfer speed will be lower than expected. In this specific example, the transfer speed is optimized.

【0118】図30には、具体例7のパワーオン時の処
理フローチャートを示す。図27に示すホストコンピュ
ータ40の電源をオンしたとき、この処理が開始され
る。まず、ステップS1において、ホストコンピュータ
の転送速度を調べてこれをMaxSpeedにセットする。次
に、ステップS2において、転送速度調整部13は、転
送速度調査後、プリンタの最適受信速度を調べてReceiv
eSpeedにセットする。
FIG. 30 is a flowchart of the process when power is turned on in the seventh embodiment. This processing is started when the power of the host computer 40 shown in FIG. 27 is turned on. First, in step S1, the transfer speed of the host computer is checked and set to MaxSpeed. Next, in step S2, after checking the transfer speed, the transfer speed adjusting unit 13 checks the optimum receiving speed of the printer, and
Set to eSpeed.

【0119】次に、ステップS3において、ホストコン
ピュータの転送速度がプリンタの最適受信速度を上回っ
ているかどうかを判断する。上回っている場合にのみ、
この具体例が有効であるから、上回っていない場合には
処理を終了する。上回っている場合には、ステップS4
に進み、転送速度の最適化を行い、最適化したときの転
送速度をOptimumSpeedにセットする。この処理は、具体
例1と同様である。
Next, in step S3, it is determined whether or not the transfer speed of the host computer exceeds the optimum receiving speed of the printer. Only if it exceeds
Since this specific example is effective, the process ends if the value does not exceed the value. If it exceeds, step S4
To optimize the transfer speed, and set the optimized transfer speed to OptimumSpeed. This process is the same as in the first embodiment.

【0120】次に、ステップS5において、ホストコン
ピュータにプリンタ以外のデバイスが接続されているか
どうかを判断する。プリンタ以外のデバイスが接続され
ていなければ具体例1と同様の設定でよいから、ここで
処理を終了する。プリンタ以外のデバイスが接続されて
いる場合には、ステップS6に進み、接続されているデ
バイスが使用可能な状態にあるかどうかを判断する。使
用可能な状態でなければ、プリンタのみが接続されてい
る場合と同様であるから、処理を終了する。使用可能な
状態では、ステップS7に進み、ホストコンピュータの
転送速度の範囲内で最適化した転送速度を100キロバ
イト単位で増加させていき、その値を配列SetSpeed[20]
にセットする。
Next, in step S5, it is determined whether a device other than a printer is connected to the host computer. If a device other than a printer is not connected, the same settings as those in the first example may be used, and the process ends here. If a device other than a printer is connected, the process proceeds to step S6, and it is determined whether the connected device is in a usable state. If the printer is not usable, the process is the same as when only the printer is connected, and the process ends. In the usable state, the process proceeds to step S7, in which the optimized transfer speed within the range of the transfer speed of the host computer is increased in units of 100 kilobytes, and the value is set in the array SetSpeed [20].
Set to.

【0121】例えば、ホストコンピュータの転送速度が
毎秒1メガバイト、最適化を行ったプリンタの転送速度
が毎秒400キロバイトとする。この場合、最適化され
た速度を100キロバイトずつ増加させたものを、それ
ぞれ配列のSetSpeed[0]から順に設定する。その設定内
容を以下に示す。 SetSpeed[0] = OptimumSpeed + 100 = 500[KBytes/S] SetSpeed[1] = OptimumSpeed + 200 = 600[KBytes/S] SetSpeed[2] = OptimumSpeed + 300 = 700[KBytes/S] SetSpeed[3] = OptimumSpeed + 400 = 800[KBytes/S] SetSpeed[4] = OptimumSpeed + 500 = 900[KBytes/S] SetSpeed[5] = OptimumSpeed + 600 = 1000[KBytes/S] なお、SetSpeed[6]以下の式は、ホストコンピュータの
転送速度以上になるため無視する。
For example, assume that the transfer speed of the host computer is 1 megabyte per second, and the transfer speed of the optimized printer is 400 kilobytes per second. In this case, the optimized speed increased by 100 kilobytes is set in order from SetSpeed [0] in the array. The setting contents are shown below. SetSpeed [0] = OptimumSpeed + 100 = 500 [KBytes / S] SetSpeed [1] = OptimumSpeed + 200 = 600 [KBytes / S] SetSpeed [2] = OptimumSpeed + 300 = 700 [KBytes / S] SetSpeed [3] = OptimumSpeed + 400 = 800 [KBytes / S] SetSpeed [4] = OptimumSpeed + 500 = 900 [KBytes / S] SetSpeed [5] = OptimumSpeed + 600 = 1000 [KBytes / S] The equation below SetSpeed [6] is Ignore it because it will be faster than the transfer speed of the host computer.

【0122】図31には、具体例7の転送速度の再セッ
トフローチャートを示す。まず、ステップS1におい
て、図27に示したポートドライバ7のタイマ46をス
タートさせる。そして、ステップS2において、転送速
度を予め求めた最適速度にセットしてデータの転送を開
始する。ステップS3では、ある特定バイト数のデータ
を転送した時点でタイマ46を止める。そして、そのと
きの値をTimeにセットする。
FIG. 31 is a flowchart for resetting the transfer speed in the seventh embodiment. First, in step S1, the timer 46 of the port driver 7 shown in FIG. 27 is started. Then, in step S2, the data transfer is started with the transfer speed set to the previously determined optimum speed. In step S3, the timer 46 is stopped when data of a specific number of bytes has been transferred. Then, the value at that time is set in Time.

【0123】次に、ステップS4において、転送したデ
ータサイズとタイマ値から現在の転送速度を計算して、
RealSpeedにセットする。即ち、実際に転送を開始し、
その転送速度をタイマ46を用いて測定する。そして、
ステップS5において、実際の転送速度が最適転送速度
として設定したOptimumSpeedから100キロバイトを引
いた値よりも小さいかどうかを判断する。なお、ここで
は、実際には最適速度よりも実測した速度が遅くなって
いるかどうかを判断する。
Next, in step S4, the current transfer rate is calculated from the transferred data size and the timer value.
Set to RealSpeed. That is, actually start the transfer,
The transfer rate is measured using the timer 46. And
In step S5, it is determined whether or not the actual transfer speed is smaller than a value obtained by subtracting 100 kilobytes from OptimumSpeed set as the optimum transfer speed. Here, it is determined whether or not the actually measured speed is actually lower than the optimum speed.

【0124】単純に数値比較をすると、測定誤差が含ま
れることによって、ほぼ最適速度でデータ転送を行って
いるのに、その補正をしてしまうことになる。従って、
ここではタイマ46の精度を考慮し、最適速度から10
0キロバイトを差し引いた値と実際に測定をしたスピー
ドとを比較している。これ以上実際の速度が下回る場合
は誤差ではないから、データ転送速度の補正を行う。即
ち、ステップS6に進み、最適速度と実際の速度とを比
較し、最適速度の補正を行って、これを再びセットし直
す。
When a simple numerical comparison is made, the measurement error is included, so that the data transfer is performed at almost the optimum speed, but the data transfer is corrected. Therefore,
Here, considering the accuracy of the timer 46, 10
The value obtained by subtracting 0 kilobytes is compared with the speed actually measured. If the actual speed is lower than this, there is no error, so the data transfer speed is corrected. That is, the process proceeds to step S6, where the optimum speed is compared with the actual speed, the optimum speed is corrected, and the corrected speed is set again.

【0125】この場合に、どの設定を行えばよいかとい
う計算は次の式により行う。 配列番号=(OptimumSpeed/RealSpeed)/100−1 ここに示した配列番号の式を、上記SetSpeedの配列群か
ら選択し、この転送速度を最適速度として再セットす
る。即ち、その条件に沿った待機時間でデータ転送を行
う。
In this case, which setting should be performed is calculated by the following equation. Array number = (OptimumSpeed / RealSpeed) / 100-1 The equation of the array number shown here is selected from the SetSpeed array group, and the transfer speed is reset as the optimum speed. That is, data transfer is performed in a standby time according to the condition.

【0126】こうして、ステップS1〜ステップS6の
処理を必要なだけ繰り返し、最適転送速度と実際の転送
速度とがほぼ等しくなった場合に処理を終了する。次に
ステップS7に進み、残りのデータを転送する。即ち、
ステップS1〜ステップS6によって転送速度の補正を
行い、残りのデータを転送するといった手順になる。例
えば、上記のように測定した実際の転送速度を毎秒30
0キロバイトとすると、配列番号iは、次の式により求
められる。 i=(400−300)/100−1=0
Thus, the processing of steps S1 to S6 is repeated as necessary, and the processing is terminated when the optimum transfer speed and the actual transfer speed become substantially equal. Next, the process proceeds to step S7, where the remaining data is transferred. That is,
In steps S1 to S6, the transfer speed is corrected and the remaining data is transferred. For example, the actual transfer rate measured as described above is 30 per second.
Assuming 0 kilobytes, the array number i is obtained by the following equation. i = (400−300) / 100−1 = 0

【0127】従って、この例では、次に再セットする最
適速度はSetSpeed[0]=500[KBytes/s]となる。また、最
初、毎秒400キロバイトにセットした転送速度が他の
デバイスとの並行処理のため、300キロバイトまで転
送速度が落ちた。これを毎秒500キロバイトに短縮す
るように再セットすると、そのときの転送速度は500×3
00/400=約380KByte/sになる。即ち、結果として、プ
リンタの最適受信速度に近付けてデータ転送を行うこと
ができるようになる。
Therefore, in this example, the optimum speed for the next resetting is SetSpeed [0] = 500 [KBytes / s]. At first, the transfer speed set to 400 kilobytes per second was reduced to 300 kilobytes due to parallel processing with other devices. If this is reset to reduce it to 500 kilobytes per second, the transfer speed at that time is 500 × 3
00/400 = about 380 KByte / s. That is, as a result, data transfer can be performed at a speed close to the optimum receiving speed of the printer.

【0128】〈具体例7の効果〉以上のように、複数の
外部装置がホスト装置に接続されて、データ転送の対象
となる外部装置に対する見かけ上のデータ転送速度が低
下する場合に、各外部装置に同時にデータを送信して、
見かけ上の転送速度を実測し、その転送速度が目標とす
る転送速度に近付くように待機時間を短縮することによ
って、各外部装置に対するデータ転送速度の最適化を図
ることができる。
<Effects of Specific Example 7> As described above, when a plurality of external devices are connected to the host device and the apparent data transfer rate to the external device to which data is to be transferred is reduced, each external device is connected. Sending data to the device at the same time,
By measuring the apparent transfer rate and reducing the standby time so that the transfer rate approaches the target transfer rate, the data transfer rate for each external device can be optimized.

【0129】〈具体例8〉上記の具体例では、ホスト装
置に複数の外部装置が接続された状態でホスト装置がパ
ワーオンされ、その後、プリンタへのデータ転送中、接
続状態は変わらなかった。ところが、例えば、PCMC
IA接続といったインタフェースを使用することによっ
て、ホストコンピュータが動作中に外部装置を自由に接
続したり切り離したりすることができる。従って、プリ
ンタに印刷データを転送中に、新たに外部装置がそのホ
ストコンピュータに接続され、ホストコンピュータと双
方向通信を開始した場合には、プリンタに対する実質的
なデータ転送速度が変動する。
<Specific Example 8> In the specific example described above, the host device was powered on while a plurality of external devices were connected to the host device, and thereafter, the connection state did not change during data transfer to the printer. However, for example, PCMC
By using an interface such as an IA connection, an external device can be freely connected and disconnected while the host computer is operating. Therefore, when an external device is newly connected to the host computer and starts bidirectional communication with the host computer while the print data is being transferred to the printer, the substantial data transfer speed to the printer fluctuates.

【0130】図32には、具体例8でのパワーオン時の
処理フローチャートを示す。ホストコンピュータをパワ
ーオンした場合にはまず、この処理を開始する。図のス
テップS1〜ステップS3までは、図30を用いて説明
した具体例7のケースと同様である。ステップS4も同
様で、測定をして求めた最適転送速度をまず設定する。
そして、ステップS5において、PCMCIAをサポー
トしているかどうかを判断する。PCMCIAをサポー
トしているケース以外は具体例7と同様のため、処理を
終了する。
FIG. 32 is a flowchart showing a process at the time of power-on in the eighth embodiment. When the host computer is powered on, this process starts first. Steps S1 to S3 in the figure are the same as in the case of the specific example 7 described with reference to FIG. The same applies to step S4, in which the optimum transfer speed obtained by measurement is first set.
Then, in step S5, it is determined whether or not PCMCIA is supported. Except for the case where PCMCIA is supported, the processing is the same as that of the specific example 7, and thus the processing ends.

【0131】PCMCIAをサポートしている場合に
は、ステップS6に進み、ホストコンピュータの転送速
度の範囲内でセットした最適受信速度を100キロバイ
ト単位で増加させ、具体例7の場合と同様、配列SetSpe
ed[20]にセットする。その配列の内容は、具体例7の場
合と全く同一である。
If PCMCIA is supported, the flow advances to step S6 to increase the optimum receiving speed set within the range of the transfer speed of the host computer in units of 100 kilobytes, and the array SetSpe
Set to ed [20]. The contents of the sequence are exactly the same as in Example 7.

【0132】図33には、具体例8での転送速度再セッ
トフローチャートを示す。ここでは、プリンタにデータ
を転送中、データの転送速度を監視して、他の外部装置
の新たな接続によるデータ転送速度の低下を検出する。
まず、ステップS1において、図27に示したポートド
ライバ7のデータ転送部12は、転送データサイズを受
け取る。そして、ステップS2において、その転送速度
を最適転送速度としてループカウンタ17にセットす
る。次に、ステップS3で、タイマ46をスタートさせ
る。ステップS4で、1バイトデータを転送する。ステ
ップS5では、転送データサイズのデクリメントを行
う。そして、ステップS6において、転送データサイズ
が“0”になったかどうかを判断する。
FIG. 33 is a flowchart for resetting the transfer rate in the eighth embodiment. Here, while data is being transferred to the printer, the data transfer speed is monitored to detect a decrease in the data transfer speed due to a new connection of another external device.
First, in step S1, the data transfer unit 12 of the port driver 7 shown in FIG. 27 receives the transfer data size. Then, in step S2, the transfer rate is set in the loop counter 17 as the optimum transfer rate. Next, in step S3, the timer 46 is started. In step S4, one-byte data is transferred. In step S5, the transfer data size is decremented. Then, in step S6, it is determined whether or not the transfer data size has become "0".

【0133】まだ、転送すべきデータがある場合には、
ステップS7に進み、プリンタがビジーかどうかを判断
する。プリンタがビジーであれば、タイマ46を一時停
止させる。タイマで調査している時間が、ホストコンピ
ュータのデータ転送時間になるため、プリンタがビジー
状態で転送できないような時間を除外するためである。
ステップS9で、プリンタがビジーかどうかを判断し、
プリンタがビジーでなくなれば、ステップS10に進
み、タイマを再スタートさせる。
If there is still data to be transferred,
Proceeding to step S7, it is determined whether the printer is busy. If the printer is busy, the timer 46 is temporarily stopped. This is to exclude a time during which the printer cannot transfer data while the printer is busy because the time being checked by the timer is the data transfer time of the host computer.
In step S9, it is determined whether the printer is busy,
If the printer is no longer busy, proceed to step S10 to restart the timer.

【0134】ステップS11では、特定のバイト数のデ
ータを転送したかどうかを判断する。そして、ステップ
S12において、タイマ46を止めて、そのときの値を
Timeにセットする。ステップS13では、転送データサ
イズとタイマ値とから現在の転送速度を計算して、Real
Speedにセットする。このステップS12、ステップS
13等の処理は、具体例7のステップS4の処理と同様
である。
In step S11, it is determined whether data of a specific number of bytes has been transferred. Then, in step S12, the timer 46 is stopped, and the value at that time is
Set to Time. In step S13, the current transfer rate is calculated from the transfer data size and the timer value,
Set to Speed. This step S12, step S
The processing of 13 and the like is the same as the processing of step S4 of the specific example 7.

【0135】このように実際の転送速度を計算により求
め、ステップS14において、実際の計算速度とセット
された最適速度とを比較する。実際の計算速度の計算方
法及びセットされた速度との比較方法は具体例7と同様
である。従って、もし実際に測定された速度が設定した
速度を下回る場合には、ステップS15に進み、設定速
度の再セットを行う。その再セット方法は、具体例7と
同様である。
As described above, the actual transfer speed is obtained by calculation, and in step S14, the actual calculation speed is compared with the set optimum speed. The method of calculating the actual calculation speed and the method of comparison with the set speed are the same as in the seventh embodiment. Therefore, if the actually measured speed is lower than the set speed, the process proceeds to step S15, and the set speed is reset. The resetting method is the same as in the seventh embodiment.

【0136】〈具体例8の効果〉以上のように、ホスト
コンピュータの電源がオンされた状態で、転送速度の低
下を監視し、そのホストコンピュータに新たに接続され
た外部装置を認識し、各外部装置が並列動作を行った場
合、転送速度の再設定を行う。こうして、プリンタがオ
ーバーランやデータ抜けの発生しないよう、転送速度の
最適化を図ることができる。
<Effect of Specific Example 8> As described above, while the power supply of the host computer is turned on, the lowering of the transfer rate is monitored, and the external device newly connected to the host computer is recognized. When the external device performs the parallel operation, the transfer speed is reset. In this way, the transfer speed can be optimized so that the printer does not overrun or lose data.

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

【図1】具体例1のシステムを示すブロック図である。FIG. 1 is a block diagram showing a system of a specific example 1.

【図2】PC(パーソナルコンピュータ)の性能による
転送速度の差説明図である。
FIG. 2 is a diagram illustrating a difference in transfer speed depending on the performance of a PC (personal computer).

【図3】データ転送速度が適切な場合のプリンタ動作タ
イムチャートである。
FIG. 3 is a printer operation time chart when the data transfer speed is appropriate.

【図4】データ転送速度が不適切な場合のプリンタ動作
タイムチャートである。
FIG. 4 is a printer operation time chart when the data transfer speed is inappropriate.

【図5】具体例1のシステム動作フローチャートであ
る。
FIG. 5 is a system operation flowchart of the first embodiment.

【図6】図5のステップS3、ステップS4における見
かけ上の転送速度を求めるためのフローチャートで、
(a)は、転送速度TransSpeed1の計算動作フローチャ
ート、(b)は、転送速度TransSpeed2の計算動作フロ
ーチャートである。
6 is a flowchart for obtaining an apparent transfer speed in steps S3 and S4 in FIG. 5,
(A) is a flowchart of a calculation operation of the transfer speed TransSpeed1, and (b) is a flowchart of a calculation operation of the transfer speed TransSpeed2.

【図7】転送速度の減少率計算の説明図である。FIG. 7 is an explanatory diagram of calculation of a transfer rate reduction rate.

【図8】図1に示したポートドライバ7のデータ転送動
作フローチャートである。
FIG. 8 is a flowchart of a data transfer operation of the port driver 7 shown in FIG.

【図9】具体例2のシステム動作フローチャートであ
る。
FIG. 9 is a system operation flowchart of a specific example 2;

【図10】ウェイトカウンタの誤差説明図である。FIG. 10 is an explanatory diagram of an error of a weight counter.

【図11】誤差補正動作のフローチャートである。FIG. 11 is a flowchart of an error correction operation.

【図12】カウンタをダウンして補正する場合の動作フ
ローチャートである。
FIG. 12 is an operation flowchart in the case of performing correction by lowering a counter.

【図13】カウンタをアップして補正する場合の動作の
フローチャートである。
FIG. 13 is a flowchart of an operation in a case where correction is performed by increasing a counter.

【図14】具体例3のシステム構成を示すブロック図で
ある。
FIG. 14 is a block diagram illustrating a system configuration of a specific example 3.

【図15】具体例3のシステム動作説明図である。FIG. 15 is an explanatory diagram of a system operation of a specific example 3.

【図16】具体例4のシステムを示すブロック図であ
る。
FIG. 16 is a block diagram showing a system of a specific example 4.

【図17】信号線のなまりによるデータ抜けと防止策説
明図である。
FIG. 17 is an explanatory diagram of data loss due to rounding of a signal line and a preventive measure.

【図18】転送速度調整処理の動作フローチャートであ
る。
FIG. 18 is an operation flowchart of a transfer speed adjustment process.

【図19】信号線のなまり調整処理フローチャート(そ
の1)である。
FIG. 19 is a flowchart (part 1) of a signal line rounding adjustment process;

【図20】信号線のなまり調整処理フローチャート(そ
の2)である。
FIG. 20 is a flowchart (part 2) of a signal line rounding adjustment process.

【図21】データ受信部処理概要フローチャートであ
る。
FIG. 21 is a flowchart of a data receiving unit processing outline.

【図22】具体例5のシステムを示すブロック図であ
る。
FIG. 22 is a block diagram showing a system of a specific example 5;

【図23】具体例5における最適化の方法説明図であ
る。
FIG. 23 is an explanatory diagram of an optimization method in the specific example 5.

【図24】具体例5の受信速度調整処理概要フローチャ
ートである。
FIG. 24 is a schematic flowchart of a reception speed adjustment process of Example 5;

【図25】具体例6における最適化の方法タイミングチ
ャートである。
FIG. 25 is a timing chart of an optimization method in the specific example 6.

【図26】具体例6の動作フローチャートである。FIG. 26 is an operation flowchart of a specific example 6.

【図27】具体例7のシステムを示すブロック図であ
る。
FIG. 27 is a block diagram showing a system according to Example 7;

【図28】具体例7における接続されているデバイスの
状態説明図である。
FIG. 28 is an explanatory diagram of a state of connected devices in the specific example 7.

【図29】1秒間にプリンタに転送されるデータ量の説
明図である。
FIG. 29 is an explanatory diagram of the amount of data transferred to the printer in one second.

【図30】具体例7のパワーオン時の処理フローチャー
トである。
FIG. 30 is a processing flowchart when power is turned on in Example 7;

【図31】具体例7の転送速度の再セットフローチャー
トである。
FIG. 31 is a flowchart of resetting the transfer speed in Example 7;

【図32】具体例8でのパワーオン時の処理フローチャ
ートである。
FIG. 32 is a processing flowchart when power is turned on in a specific example 8.

【図33】具体例8での転送速度再セットフローチャー
トである。
FIG. 33 is a flowchart for resetting the transfer speed in specific example 8;

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

1 ホストコンピュータ 3 プリンタ 4 アプリケーション 5 オペレーティングシステム 6 プリンタドライバ 7 ポートドライバ 23 データ解析部 24 印刷部 30 データ受信部 DESCRIPTION OF SYMBOLS 1 Host computer 3 Printer 4 Application 5 Operating system 6 Printer driver 7 Port driver 23 Data analysis part 24 Printing part 30 Data reception part

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】 ホスト装置と、このホスト装置からデー
タを受信する外部装置とから成り、 前記ホスト装置は、 前記データの転送速度を調整する転送速度調整部と、こ
の転送速度調整部が単位量のデータを転送するたびに所
定の待機時間だけ転送待ちをするように制御をするウェ
イト処理部とを備え、 前記転送速度調整部は、 前記データの転送前に、所定量のダミーデータを任意の
待機時間で転送したときの、見かけ上の転送速度を実測
し、この見かけ上の転送速度と待機時間との関係から、
前記外部装置に適する前記待機時間を選択することを特
徴とするデータ転送システム。
1. A host device comprising: a host device; and an external device for receiving data from the host device. The host device includes: a transfer speed adjusting unit for adjusting a transfer speed of the data; A wait processing unit that controls so as to wait for transfer for a predetermined standby time every time data is transferred, wherein the transfer speed adjustment unit transmits a predetermined amount of dummy data to a given amount before transferring the data. Measure the apparent transfer speed when transferring in the standby time, and from the relationship between the apparent transfer speed and the standby time,
A data transfer system, wherein the standby time suitable for the external device is selected.
【請求項2】 請求項1に記載のデータ転送システムに
おいて、 前記転送速度調整部は、 所定量のダミーデータをそれぞれ異なる待機時間で転送
したときの、見かけ上の転送速度を実測し、この見かけ
上の転送速度の変化を求めて、前記外部装置に適する前
記待機時間を選択することを特徴とするデータ転送シス
テム。
2. The data transfer system according to claim 1, wherein the transfer speed adjustment unit measures an apparent transfer speed when a predetermined amount of dummy data is transferred with different standby times, and the apparent transfer speed is measured. A data transfer system for determining a change in the transfer speed and selecting the standby time suitable for the external device.
【請求項3】 請求項1または2に記載のデータ転送シ
ステムにおいて、 前記転送速度調整部は、 所定量のダミーデータを、選択した待機時間で転送した
ときの、見かけ上の転送速度を実測し、目標とするデー
タ転送速度との誤差を検出して、前記待機時間を補正す
ることを特徴とするデータ転送システム。
3. The data transfer system according to claim 1, wherein the transfer speed adjustment unit measures an apparent transfer speed when a predetermined amount of dummy data is transferred for a selected standby time. A data transfer system that detects an error from a target data transfer speed and corrects the standby time.
【請求項4】 請求項1に記載のデータ転送システムに
おいて、 前記転送速度調整部は、 見かけ上の転送速度を、外部装置側に設けたタイマを利
用して実測することを特徴とするデータ転送システム。
4. The data transfer system according to claim 1, wherein said transfer rate adjusting section measures an apparent transfer rate by using a timer provided on an external device side. system.
【請求項5】 請求項1に記載のデータ転送システムに
おいて、 前記転送速度調整部は、 所定量のダミーデータを、選択した待機時間で転送した
ときの、データ抜け発生の有無を検査し、データ抜けが
発生する場合には、前記待機時間を部分的に調整するこ
とを特徴とするデータ転送システム。
5. The data transfer system according to claim 1, wherein the transfer speed adjustment unit checks whether or not data loss has occurred when a predetermined amount of dummy data has been transferred for a selected standby time. A data transfer system, wherein when the disconnection occurs, the standby time is partially adjusted.
【請求項6】 ホスト装置と、このホスト装置からデー
タを受信する外部装置とから成り、 前記外部装置には、 前記データの受信速度を測定する受信速度測定部と、 測定した前記データの受信速度と最適受信速度とを比較
して、データの受信速度を最適受信速度に近付けるよう
に、所定量のデータ受信毎にホスト装置によるデータ送
信を抑制するためのビジー信号を有効にする時間を調整
する受信速度調整部とを備えたことを特徴とするデータ
転送システム。
6. A host device and an external device for receiving data from the host device, wherein the external device includes: a reception speed measuring unit for measuring the data reception speed; and a measured reception speed for the data. And adjusting the time for enabling the busy signal for suppressing data transmission by the host device every time a predetermined amount of data is received so that the data reception speed approaches the optimum reception speed. A data transfer system comprising a reception speed adjustment unit.
【請求項7】 請求項1または5に記載のデータ転送シ
ステムにおいて、 外部装置には、ホスト装置からデータを自動受信するダ
イレクトメモリアクセスコントローラが設けられ、 前記外部装置の受信速度調整部は、前記ダイレクトメモ
リアクセスコントローラが一括して受信可能な量のデー
タ受信毎に、待機時間を挿入することを特徴とするデー
タ転送システム。
7. The data transfer system according to claim 1, wherein the external device is provided with a direct memory access controller for automatically receiving data from a host device; A data transfer system, wherein a waiting time is inserted every time an amount of data that can be received collectively by a direct memory access controller is received.
【請求項8】 請求項1に記載のデータ転送システムに
おいて、 ホスト装置から複数の外部装置にデータが転送されると
き、 前記転送速度調整部は、 複数の外部装置に同時にデータを送信して、見かけ上の
転送速度を実測し、その転送速度が目標とする転送速度
に近付くように前記待機時間を短縮することを特徴とす
るデータ転送システム。
8. The data transfer system according to claim 1, wherein when data is transferred from the host device to a plurality of external devices, the transfer speed adjustment unit transmits the data to the plurality of external devices simultaneously, A data transfer system comprising: actually measuring an apparent transfer speed; and reducing the standby time so that the transfer speed approaches a target transfer speed.
【請求項9】 請求項8に記載のデータ転送システムに
おいて、 ホスト装置に接続されて同時にデータを転送する外部装
置が増減した場合に、各外部装置に対する見かけ上のデ
ータ転送速度を監視し、見かけ上のデータ転送速度が変
化したとき、その転送速度が目標とする転送速度に近付
くように前記待機時間を短縮することを特徴とするデー
タ転送システム。
9. The data transfer system according to claim 8, wherein when the number of external devices connected to the host device and simultaneously transferring data increases or decreases, an apparent data transfer speed for each external device is monitored, and the apparent data transfer speed is monitored. When the data transfer rate changes, the standby time is reduced so that the transfer rate approaches a target transfer rate.
JP03209299A 1999-02-10 1999-02-10 Data transfer system Expired - Fee Related JP3394717B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP03209299A JP3394717B2 (en) 1999-02-10 1999-02-10 Data transfer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP03209299A JP3394717B2 (en) 1999-02-10 1999-02-10 Data transfer system

Publications (2)

Publication Number Publication Date
JP2000231457A true JP2000231457A (en) 2000-08-22
JP3394717B2 JP3394717B2 (en) 2003-04-07

Family

ID=12349252

Family Applications (1)

Application Number Title Priority Date Filing Date
JP03209299A Expired - Fee Related JP3394717B2 (en) 1999-02-10 1999-02-10 Data transfer system

Country Status (1)

Country Link
JP (1) JP3394717B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6993605B2 (en) 2001-02-28 2006-01-31 Sharp Laboratories Of America, Inc. Adaptive run-time data transfer optimization
JP2008015609A (en) * 2006-07-03 2008-01-24 Fuji Xerox Co Ltd Continuous sheet-printing device and system
JP2008090414A (en) * 2006-09-29 2008-04-17 Nec Personal Products Co Ltd Writing control method for disk device, and disk writing device
JP2008516803A (en) * 2004-10-15 2008-05-22 フジフイルム ディマティックス インコーポレイテッド Print system architecture

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6993605B2 (en) 2001-02-28 2006-01-31 Sharp Laboratories Of America, Inc. Adaptive run-time data transfer optimization
JP2008516803A (en) * 2004-10-15 2008-05-22 フジフイルム ディマティックス インコーポレイテッド Print system architecture
JP2008015609A (en) * 2006-07-03 2008-01-24 Fuji Xerox Co Ltd Continuous sheet-printing device and system
JP4650357B2 (en) * 2006-07-03 2011-03-16 富士ゼロックス株式会社 Continuous paper printing apparatus and continuous paper printing system
JP2008090414A (en) * 2006-09-29 2008-04-17 Nec Personal Products Co Ltd Writing control method for disk device, and disk writing device

Also Published As

Publication number Publication date
JP3394717B2 (en) 2003-04-07

Similar Documents

Publication Publication Date Title
US6304911B1 (en) Information packet reception indicator for reducing the utilization of a host system processor unit
US9025194B2 (en) Data transmission apparatus for transferring data to an output device for outputting data, printer, information processing apparatus, and control method thereof
CN109484046B (en) Printing control method, control system and printing equipment
US5680596A (en) Data transfer apparatus with automatic transmission rate adjustment
US20020178310A1 (en) USB transmission control circuit
US8576734B2 (en) Information processing apparatus, control method thereof and program
JP2000231457A (en) Data transfer system
US6952276B2 (en) Printer detecting data precisely in response to change in data transmission speed
US20100106869A1 (en) USB Storage Device and Interface Circuit Thereof
EP2728514A2 (en) Method of controlling speed of ethernet connection in power save mode and image forming apparatus performing the same
JP3970728B2 (en) Data communication device
JP2000267826A (en) Device and method for controlling image output
JP3658151B2 (en) Printing device and printing method
JP2006195607A (en) Method and circuit for determining bulk-out transfer end
US6570666B1 (en) Printer detecting data precisely in response to change in data transmission speed
JP2001166891A (en) Printer
JP3286079B2 (en) Computer system with data transfer delay control function
JPH07210365A (en) Image forming device
JP2001331440A (en) Data reception processor
JP3787869B2 (en) Terminal device
JPH06290144A (en) Receiving buffer controller
JP4474990B2 (en) Printing system
JP2001256020A (en) Printer controller and its method
JP2004355041A (en) Dma transfer relay device, dma transfer method and dma transfer system
JPH08263234A (en) Data receiver, control method for the same and printer using the same

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090131

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100131

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20100131

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110131

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20110131

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20120131

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20130131

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20140131

Year of fee payment: 11

LAPS Cancellation because of no payment of annual fees