[go: up one dir, main page]

JP4346761B2 - Data transfer apparatus and method - Google Patents

Data transfer apparatus and method Download PDF

Info

Publication number
JP4346761B2
JP4346761B2 JP35037199A JP35037199A JP4346761B2 JP 4346761 B2 JP4346761 B2 JP 4346761B2 JP 35037199 A JP35037199 A JP 35037199A JP 35037199 A JP35037199 A JP 35037199A JP 4346761 B2 JP4346761 B2 JP 4346761B2
Authority
JP
Japan
Prior art keywords
data
print
complementary
printer
data block
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP35037199A
Other languages
Japanese (ja)
Other versions
JP2001166892A (en
Inventor
宣雄 大沼
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP35037199A priority Critical patent/JP4346761B2/en
Publication of JP2001166892A publication Critical patent/JP2001166892A/en
Application granted granted Critical
Publication of JP4346761B2 publication Critical patent/JP4346761B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Accessory Devices And Overall Control Thereof (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、プリンタへのデータの送信を制御するデータ転送装置および方法に関する。
【0002】
【従来の技術】
従来、一般的には、プリンタとコンピュータを接続するセントロニクスインタフェースには、リセット信号線が用意されており、このリセット信号線上のリセット信号をアサートすることによりプリンタをリセットすることができるようになっていた。
【0003】
プリンタによるプリントの途中であっても、このリセット信号線上のリセット信号をアサートして強制的にプリンタをリセットしてしまえば、排紙が行なわれ、それまでにセットされていた設定値が全てプリンタの初期値に戻されるようになっており、一旦リセットしてしまえば、次のプリントを正常に開始することができるようになっていた。
【0004】
これに対して、ネットワークでプリンタが共有されることを前提として設計されたような環境では、リセット信号線上のリセット信号を利用できないようにした環境があるが、これは、むやみにプリンタにリセット処理を施すようにすると、第三者のプリントまでも中止してしまうといった危険を回避するためである。
【0005】
【発明が解決しようとする課題】
しかしながら、リセット信号線上のリセット信号を使用しない環境で印刷中止を実現するために、単純に印刷データの転送を停止するだけでは、リセット処理として充分ではない。つまり、この時、プリンタは未完結のコマンドの続きを受信待ちしていることがあり、次の印刷データの先頭部をその続きと勘違いして不要なゴミ印刷をしてしまったり、仮にコマンドが完結していたとしても、フォームフィードコードを受信していないので、排紙をせずに紙の途中から次の印刷を開始してしまうといった問題があった。
【0006】
また、リセット処理が不充分であるため、それまでにセットされていた設定値が初期化されず、次の印刷に引き継がれてしまうといった問題もあった。
【0007】
本発明の目的は、上記のような問題点を解決し、ジョブごとに印刷を正常に開始させることができるデータ転送装置および方法を提供することにある。
【0008】
【課題を解決するための手段】
請求項1の発明は、プリンタへデータを送信する送信手段を有するデータ転送装置において、データ転送要求に応答して印刷データブロックが完結しているか否かを判定する判定手段と、該判定手段により否定判定された場合は、印刷終了要求に応答して、印刷データブロックのパラメータレングスを完結させるための印刷されるデータと給紙中の用紙を排紙させるフォームフィードコードを含む補完データを生成する補完データ生成手段と、該補完データ生成手段により補完データが生成された場合は、生成された補完データを印刷データブロックの後に前記送信手段に転送する転送手段とを有することを特徴とする。
【0009】
請求項1において、判定手段は、コマンドの区切りを検出する検出手段を有し、該検出手段により検出されたコマンドの区切りに基づき当該印刷データブロックが完結しているか否かを判定することができる。また、補完データ生成手段は、フォームフィードコードを含む補完データを生成することができる。
【0010】
請求項1において、補完データ生成手段は、補完に必要なバイト数を計算する計算手段を有し、該計算手段による計算により得られたバイト数分の補完を行なうことができる。
【0012】
請求項において、補完データ生成手段は、プリンタリセットコマンドを含む補完データを生成することができる。
【0014】
請求項の発明は、データ転送要求に応答して印刷データブロックが完結しているか否かを判定する判定ステップと、否定判定した場合は、印刷終了要求に応答して、印刷データブロックのパラメータレングスを完結させるための印刷されるデータと給紙中の用紙を排紙させるフォームフィードコードを含む補完データを生成する補完データ生成ステップと、補完データが生成された場合は、生成された補完データを印刷データブロックの後に、プリンタへデータを送信する送信手段に転送する転送ステップとを有することを特徴とする。
【0015】
請求項において、判定ステップは、コマンドの区切りを検出する検出ステップを有し、該検出ステップで検出されたコマンドの区切りに基づき当該印刷データブロックが完結しているか否かを判定することができる。
【0016】
請求項において、補完データ生成ステップは、補完に必要なバイト数を計算する計算ステップを有し、該計算ステップで得られたバイト数分の補完を行なうことができる。
【0018】
請求項において、補完データ生成ステップは、プリンタリセットコマンドを含む補完データを生成することができる。
【0020】
コンピュータ読み取り可能な記憶媒体に記憶したプログラムは、データ転送要求に応答して印刷データブロックが完結しているか否かを判定する判定手順と、該判定手順により否定判定された場合に、印刷終了要求に応答して、印刷データブロックのパラメータレングスを完結させるための印刷されるデータと給紙中の用紙を排紙させるフォームフィードコードを含む補完データを生成する補完データ生成手順と、該補完データ生成手順により補完データが生成された場合に、生成された補完データを印刷データブロックの後に、プリンタへデータを送信する送信手段に転送する転送手順とをコンピュータに実行させる。
【0021】
コンピュータ読み取り可能な記憶媒体に記憶したプログラムは、判定手順が、コマンドの区切りを検出する検出手順を有し、該検出手順により検出されたコマンドの区切りに基づき当該印刷データブロックが完結しているか否かを判定する。
【0022】
コンピュータ読み取り可能な記憶媒体に記憶したプログラムは、補完データ生成手順が、補完に必要なバイト数を計算する計算手順を有し、該計算手順による計算により得られたバイト数分の補完を行なう。
【0024】
コンピュータ読み取り可能な記憶媒体に記憶したプログラムは、補完データ生成手順が、プリンタリセットコマンドを含む補完データを生成することができる。
【0026】
【発明の実施の形態】
以下、本発明の実施の形態を図面を参照して詳細に説明する。
【0027】
図1は本発明の一実施の形態を示す。これは、コンピュータ1とプリンタ2とを接続したシステムの例である。外部インタフェースとしてセントロニクスパラレルインタフェースを用いたが、SCSIインタフェース等の他のインタフェースでも良い。
【0028】
コンピュータ1は、入力インタフェース11と、CPU12と、ROM13と、RAM14と、外部記憶装置15と、出力インタフェース16と、表示部17と、マウス18とを有する。
【0029】
ROM13は初期設定プログラムがストアしてある。外部記憶装置15は、図2に示すように、アプリケーションプログラムと、OS(データスプールプログラムと、データ送信処理プログラムと、インタフェース制御プログラム等)と、プリンタドライバ(印刷データ生成プログラムと、データ送信制御プログラム等)とがストアしてある。
【0030】
アプリケーションプログラムは作画環境と印刷環境を提供し印刷開始を命令するためのプログラムである。データスプールプログラムは生成された印刷データを受け取り、任意のサイズの印刷データブロックに分割して繰り返しデータ転送要求を発行するためのプログラムである。データ送信処理プログラムはパースを終えた印刷データブロックの送信を司るためのプログラムである。インタフェース制御プログラムはセントロニクス・パラレルインタフェースを通じてデータ書き込み、読み込みを実際に行い、プリンタ2の受信バッファがフルになった等のデータ受信が即座に実行できない状況においてビジー信号を発行する役割を担うプログラムである。印刷データ生成プログラムはアプリケーションプログラムに従って作画された図柄情報をプリンタコマンドに変換するためのプログラムである。データ送信制御プログラムはデータ転送要求を受け付け、入力された印刷データブロックをパースしてプリンタコマンドの区切りを検出するためのプログラムである。
【0031】
RAM14は図柄情報記憶部14aと、印刷データ記憶部14bと、プログラムロード領域14cとを有し、外部記憶装置15にストアされている各プログラムがストアされる。CPU12はRAM14にストアされる制御プログラムに従って各部を制御するものである。
【0032】
図3は図1のプリンタ2の構成を示す。プリンタ2はインタフェース部201と、RAM202と、ROM203と、CPU204と、エンジン205とを有する。インタフェース部201はコンピュータ1の出力インタフェース16に接続してある。ROM203は制御プログラム等がストアしてある。CPU204はROM203にストアしてある制御プログラムに従ってプリンタ2の各部を制御するものである。RAM202はCPU204の主メモリとワークメモリとして用いら、受信したデータを一旦保存するための受信バッファを有する。エンジン205はRAM202に保存されたデータに基づきプリントを行なうものである。
【0033】
図4は図1のRAM14にストアされるデータ送信制御プログラムを示すフローチャートである。ステップS1にて、データスプールプログラムからの今回の要求が「印刷開始要求」であるかどうかを判断し、「印刷開始要求」と判断した場合は、ステップS2にて、印刷に備えた初期化を行う。ここでは、初期化作業として、未完結フラグに0をセットする。他方、「印刷開始要求」でないと判断した場合には、ステップS3にて、今回の要求が「データ転送要求」であるかどうかを判断する。
【0034】
データ転送要求と判断した場合は、ステップS4にて、印刷データブロックをパースする。ここで、例えば、コマンド
ESC( x n p1 p2 p3 …
において、
ESC :コマンドの先頭を示す符号(1バイト)
( :次に続くコマンドIDの前符号(1バイト)
x :例ではa、b、c、等で代表しているコマンドID(1バイト)
n :p1、p2で構成されるパラメータのレングス(1バイト)
p1 :パラメータ1(1バイト)
p2 :パラメータ2(1バイト)
p3 :パラメータ3(1バイト)

を表す。
【0035】
ステップS4にてパースをした結果、例えば、図5に示すように、印刷データブロックに含まれる最後のコマンドのパラメータレングスが01であって、かつ、最後にパラメータが1バイト付いている場合は、ステップS5にて、この印刷データブロックはちょうどコマンドの区切りで終了して完結していると判断し、ステップS6にて、未完結フラグに0をセットする。
【0036】
例えば、図6に示すように、印刷データブロックに含まれる最後のコマンドのパラメータレングスが02であって、かつ、最後にパラメータが1バイトしか付いていない場合は、テップS5にて、この印刷データブロックはちょうどコマンドの区切りで終了しておらず未完結と判断し、ステップS7にて、未完結フラグに1をセットする。そして、ステップS8にて、パースを終えた印刷データブロックを、プリンタへ送信するため、データ転送処理プログラムへ転送する。その後、この処理を終了する。
【0037】
他方、ステップS3にて、今回の要求が「データ転送要求」でないと判断した場合は、ステップS9にて、今回の要求が「印刷終了要求」であるかどうかを判断する。そして、「印刷終了要求」でないと判断した場合は、「印刷開始要求」か、「データ転送要求」か、「印刷終了要求」のいずれの要求でもなかったと判断し、その後、この処理を終了する。
【0038】
他方、「印刷終了要求」と判断した場合は、ステップS10にて、未完結フラグが1であるかどうか、すなわち、印刷を終了する前に補完データを送る必要があるかどうかを判断する。
【0039】
「印刷終了要求」の場合、印刷データ送信制御プログラムにとっては、この「印刷終了要求」が正常に印刷を終了する過程で最後に要求されたものか、それとも印刷中止命令に従って途中で要求されたものなのかは解らなくても良く、ステップS2、ステップS6もしくはS7でセットした「未完結フラグ」の状態に従って補完データを生成、送信することが結果として印刷を正常終了させることになる。
【0040】
未完結フラグが1でない場合は、この処理を終了し、他方、未完結フラグが1である場合は、ステップS11にて、補完データを生成し、ステップS12にて、補完データをデータ送信処理プログラムへ転送する。
【0041】
次に、補完データの生成方法をより詳細に説明する。例えば、図6に示す印刷データブロックの場合は、まず、この印刷データブロックに含まれる最後のコマンドのパラメータレングス、すなわち、02に注目し、あと何バイト補完すればコマンドが完結するかを計算する。計算結果から、コマンドを完結させるには、あと1バイト補完する必要があることが分かるので、任意の1バイト、ここではプリンタに送信すると印刷されるデータであるFFを付加する。ただし、補完されるものはFFに限定されるものではなく、印刷されるデータであれば他のコードであっても良い。図6の例では、このFFを付加する他に、給紙中の用紙を排紙する目的で0C(フォームフィードコード)1バイトも付加した。
【0042】
また、例えば、図7に示す例は、印刷データブロックの最後のコマンドのコマンドIDやパラメータレングス部が印刷データブロックに含まれていない例である。この例でのコマンドの完結は、この印刷データブロックがプリンタに送信されても、印刷に影響がなく、虞らくは、プリンタがサポートしていないコマンドと判断されて読み飛ばしてくれるような、コマンドID(図7(b)のZ)とパラメータレングス(図7(b)の00)を付加して行なう。これらを付加した他に、図6の例と同様に、排紙の目的で0C(フォームフイードコード)を付加し、さらに、プリンタの初期化を目的としてRESETで示されるようなプリンタリセットコマンドを付加してコマンドを完結させた。
【0043】
以上のようにして補完データを生成した後、ステップS12にて、生成した補完データをデータ送信処理プログラムへ転送する。
【0044】
以上のように、上述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体を、システムあるいは装置に供給し、そのシステムあるいは装置のコンピュータ(または、CPUやMPU(microprocessor unit))が記憶媒体に格納されたプログラムコードを読み出し実行することによっても、本発明の目的が達成されることは言うまでもない。
【0045】
この場合、記憶媒体から読み出されたプログラムコード自体が本発明の新規な機能を実現することになり、そのプログラムコードを記憶した記憶媒体は本発明を構成することになる。
【0046】
プログラムコードを供給するための記憶媒体としては、例えば、フロッピーディスク、ハードディスク、光ディスク、光磁気ディスク、CD−ROM(compact disk ROM)、CD−R(compact disk recordable)、磁気テープ、不揮発性のメモリカード、ROM(read only memory)、等々を用いることができる。
【0047】
また、コンピュータが読み出したプログラムコードを実行することにより、上述した実施形態の機能が実現されるだけでなく、そのプログラムコードの指示に基づき、コンピュータ上で稼働しているOS(operating system)などが実際の処理の一部または全部を行い、その処理によって上述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0048】
さらに、記憶媒体から読み出されたプログラムコードが、コンピュータに挿入された機能拡張ボードやコンピュータに接続された機能拡張ユニットに備わるメモリに書き込まれた後、そのプログラムコードの指示に基づき、その機能拡張ボードや機能拡張ユニットに備わるCPUなどが実際の処理の一部または全部を行い、その処理によって上述した実施形態の機能が実現される場合も含まれることは言うまでもない。
【0049】
【発明の効果】
以上説明したように、本発明によれば、未完結のコマンドを完結させるために補完データを送信するようにしたので、続く印刷の先頭で不要なゴミ印刷を防ぐことができる。
【0050】
また、本発明によれば、補完データにフォームフィードコードを含めるようにしたので、印刷途中の用紙を排紙して次の印刷を用紙途中から開始してしまうといった不都合を防ぐことができる。
【0051】
さらに、本発明よれば、補完データにリセットコマンドを含めるようにしたので、今までにセットされてきた設定値を初期化でき、前回の設定値が次の印刷に引き継がれてしまうといった不都合を防ぐことができる。
【図面の簡単な説明】
【図1】本発明の一実施の形態を示すブロック図である。
【図2】図1の外部記憶装置15にストアされるプログラムの例を示す図である。
【図3】図1のプリンタ2の構成を示すブロック図である。
【図4】図1のRAM14にストアされるデータ送信制御プログラムの一例を示すフローチャートである。
【図5】印刷データブロックの一例を示す図である。
【図6】印刷中止時の印刷データブロックの例とコマンドを完結するために付加されるものの例を示す図である。
【図7】印刷中止時の印刷データブロックの例とコマンドを完結するために付加されるものの例を示す図である。
【符号の説明】
1 コンピュータ
2 プリンタ
11 入力インタフェース
12 CPU
13 ROM
14 RAM
15 外部記憶装置
16 出力インタフェース
17 表示部
18 マウス
[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a data transfer apparatus and method for controlling transmission of data to a printer.
[0002]
[Prior art]
Conventionally, in general, a reset signal line is prepared for a Centronics interface that connects a printer and a computer, and the printer can be reset by asserting a reset signal on the reset signal line. It was.
[0003]
Even during printing by the printer, if the printer is forcibly reset by asserting the reset signal on this reset signal line, the paper is ejected and all the settings that have been set up to that point are Thus, once reset, the next printing can be started normally.
[0004]
On the other hand, in an environment designed on the assumption that the printer is shared on the network, there is an environment in which the reset signal on the reset signal line cannot be used. This is to avoid the danger that even a third party's printing is canceled.
[0005]
[Problems to be solved by the invention]
However, simply stopping the transfer of print data is not sufficient as a reset process in order to realize print cancellation in an environment where the reset signal on the reset signal line is not used. In other words, at this time, the printer may be waiting to receive a continuation of an unfinished command, and the head of the next print data will be misunderstood as the continuation. Even if the printing is completed, the form feed code is not received, so that there is a problem that the next printing is started from the middle of the paper without discharging the paper.
[0006]
Further, since the reset process is insufficient, there is a problem in that the setting value set up to that point is not initialized and is transferred to the next printing.
[0007]
An object of the present invention is to provide a data transfer apparatus and method capable of solving the above problems and starting printing normally for each job.
[0008]
[Means for Solving the Problems]
According to a first aspect of the present invention, there is provided a data transfer apparatus having a transmission unit for transmitting data to a printer, a determination unit for determining whether or not a print data block is completed in response to a data transfer request, and the determination unit If a negative determination is made, in response to the print end request, complementary data including data to be printed for completing the parameter length of the print data block and form feed code for discharging the paper being fed is generated. Complementary data generating means, and a transfer means for transferring the generated complementary data to the transmitting means after the print data block when the complementary data is generated by the complementary data generating means.
[0009]
The determination unit includes a detection unit that detects a command break, and can determine whether the print data block is completed based on the command break detected by the detection unit. . Further, the complementary data generation means can generate complementary data including a form feed code.
[0010]
According to a first aspect of the present invention, the complementary data generation means has a calculation means for calculating the number of bytes necessary for the complement, and can perform the complement for the number of bytes obtained by the calculation by the calculation means.
[0012]
In the first aspect , the complementary data generation means can generate complementary data including a printer reset command.
[0014]
The invention according to claim 5 is a determination step for determining whether or not the print data block is completed in response to the data transfer request, and in the case of negative determination, in response to the print end request, the parameter of the print data block A complementary data generation step for generating complementary data including data to be printed for completing the length and a form feed code for discharging the paper being fed, and if the complementary data is generated, the generated complementary data And a transfer step of transferring the data to a transmission means for transmitting data to the printer after the print data block.
[0015]
6. The determination step according to claim 5 , further comprising a detection step of detecting a command delimiter, and determining whether or not the print data block is complete based on the command delimiter detected in the detection step. .
[0016]
According to a fifth aspect of the present invention, the complementary data generation step includes a calculation step for calculating the number of bytes necessary for the complementation, and the number of bytes obtained in the calculation step can be complemented.
[0018]
In the fifth aspect , the complementary data generation step can generate complementary data including a printer reset command.
[0020]
A program stored in a computer-readable storage medium includes a determination procedure for determining whether or not a print data block is completed in response to a data transfer request, and a print end request when a negative determination is made by the determination procedure. And a complementary data generation procedure for generating complementary data including print data for completing the parameter length of the print data block and form feed code for discharging the paper being fed , and the complementary data generation When complementary data is generated according to the procedure, the computer is caused to execute a transfer procedure for transferring the generated complementary data to a transmission unit that transmits data to the printer after the print data block.
[0021]
The program stored in the computer-readable storage medium has a detection procedure in which the determination procedure detects a command break, and whether or not the print data block is completed based on the command break detected by the detection procedure. Determine whether.
[0022]
The program stored in the computer-readable storage medium has a calculation procedure in which the complementary data generation procedure calculates the number of bytes necessary for the complementation, and complements the number of bytes obtained by the calculation by the calculation procedure.
[0024]
Program stored in a computer-readable storage medium, complement data generation procedure, Ru can generate supplemental data comprising a printer reset command.
[0026]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings.
[0027]
FIG. 1 shows an embodiment of the present invention. This is an example of a system in which a computer 1 and a printer 2 are connected. Although the Centronics parallel interface is used as the external interface, other interfaces such as a SCSI interface may be used.
[0028]
The computer 1 includes an input interface 11, a CPU 12, a ROM 13, a RAM 14, an external storage device 15, an output interface 16, a display unit 17, and a mouse 18.
[0029]
The ROM 13 stores an initial setting program. As shown in FIG. 2, the external storage device 15 includes an application program, an OS (a data spool program, a data transmission processing program, an interface control program, etc.), a printer driver (a print data generation program, and a data transmission control program). Etc.) are stored.
[0030]
The application program is a program for providing a drawing environment and a printing environment and instructing the start of printing. The data spool program is a program for receiving the generated print data, dividing it into print data blocks of an arbitrary size, and issuing repeated data transfer requests. The data transmission processing program is a program for managing transmission of the print data block that has been parsed. The interface control program is a program that plays a role of issuing a busy signal in a situation where data cannot be received immediately such as when the data is actually written and read through the Centronics parallel interface and the reception buffer of the printer 2 is full. . The print data generation program is a program for converting the symbol information drawn according to the application program into a printer command. The data transmission control program is a program for receiving a data transfer request and parsing an input print data block to detect a printer command delimiter.
[0031]
The RAM 14 has a symbol information storage unit 14a, a print data storage unit 14b, and a program load area 14c, and stores each program stored in the external storage device 15. The CPU 12 controls each unit in accordance with a control program stored in the RAM 14.
[0032]
FIG. 3 shows the configuration of the printer 2 of FIG. The printer 2 includes an interface unit 201, a RAM 202, a ROM 203, a CPU 204, and an engine 205. The interface unit 201 is connected to the output interface 16 of the computer 1. The ROM 203 stores a control program and the like. The CPU 204 controls each part of the printer 2 according to a control program stored in the ROM 203. The RAM 202 is used as a main memory and work memory of the CPU 204, and has a reception buffer for temporarily storing received data. The engine 205 performs printing based on data stored in the RAM 202.
[0033]
FIG. 4 is a flowchart showing a data transmission control program stored in the RAM 14 of FIG. In step S1, it is determined whether or not the current request from the data spool program is a “print start request”. If it is determined that the request is a “print start request”, initialization in preparation for printing is performed in step S2. Do. Here, 0 is set to the incomplete flag as initialization work. On the other hand, if it is determined that the request is not a “print start request”, it is determined in step S3 whether the current request is a “data transfer request”.
[0034]
If it is determined that the request is a data transfer request, the print data block is parsed in step S4. Here, for example, the command ESC (x n p1 p2 p3...
In
ESC: Code indicating the start of the command (1 byte)
(: Preceding code of the next command ID (1 byte)
x: Command ID (1 byte) represented by a, b, c, etc. in the example
n: Length of parameter composed of p1 and p2 (1 byte)
p1: Parameter 1 (1 byte)
p2: Parameter 2 (1 byte)
p3: Parameter 3 (1 byte)
...
Represents.
[0035]
As a result of the parsing in step S4, for example, as shown in FIG. 5, when the parameter length of the last command included in the print data block is 01 and the parameter is 1 byte at the end, In step S5, it is determined that the print data block has been completed at the end of the command, and is completed. In step S6, 0 is set in the incomplete flag.
[0036]
For example, as shown in FIG. 6, when the parameter length of the last command included in the print data block is 02 and the parameter has only 1 byte at the end, this print data is displayed at step S5. It is determined that the block is not completed at the command segment and is not completed, and 1 is set to the incomplete flag in step S7. In step S8, the parsed print data block is transferred to the data transfer processing program for transmission to the printer. Thereafter, this process is terminated.
[0037]
On the other hand, if it is determined in step S3 that the current request is not a “data transfer request”, it is determined in step S9 whether or not the current request is a “print end request”. If it is determined that the request is not a “print end request”, it is determined that the request is not a “print start request”, a “data transfer request”, or a “print end request”, and then the process ends. .
[0038]
On the other hand, if it is determined that the request is “printing end”, it is determined in step S10 whether or not the incomplete flag is 1, that is, whether or not it is necessary to send complementary data before ending printing.
[0039]
In the case of “print end request”, for the print data transmission control program, this “print end request” was requested last in the process of normally ending printing, or was requested in the middle according to the print stop command It does not have to be understood, and generating and transmitting complementary data according to the state of the “incomplete flag” set in step S2, step S6 or S7 results in the normal termination of printing.
[0040]
If the incomplete flag is not 1, this process is terminated. On the other hand, if the incomplete flag is 1, complementary data is generated in step S11, and the complementary data is transmitted to the data transmission processing program in step S12. Forward to.
[0041]
Next, a method for generating complementary data will be described in more detail. For example, in the case of the print data block shown in FIG. 6, first, pay attention to the parameter length of the last command included in this print data block, that is, 02, and calculate how many more bytes are to be complemented to complete the command. . From the calculation result, it can be seen that one more byte needs to be complemented to complete the command. Therefore, an arbitrary one byte, here, FF which is data to be printed when transmitted to the printer is added. However, what is complemented is not limited to FF, and other codes may be used as long as they are data to be printed. In the example of FIG. 6, in addition to this FF, 1 byte of 0C (form feed code) is also added for the purpose of discharging the paper being fed.
[0042]
Further, for example, the example shown in FIG. 7 is an example in which the command ID or parameter length portion of the last command in the print data block is not included in the print data block. The completion of the command in this example means that even if this print data block is sent to the printer, there is no effect on printing, and possibly a command that is judged as a command that the printer does not support and skips. This is performed by adding an ID (Z in FIG. 7B) and a parameter length (00 in FIG. 7B). In addition to the addition of these, 0C (form feed code) is added for the purpose of paper discharge, and a printer reset command as indicated by RESET for the purpose of initialization of the printer is issued as in the example of FIG. Added command to complete.
[0043]
After generating complementary data as described above, the generated complementary data is transferred to the data transmission processing program in step S12.
[0044]
As described above, the storage medium storing the program code of the software that implements the functions of the above-described embodiments is supplied to the system or apparatus, and the computer of the system or apparatus (or CPU or MPU (microprocessor unit)) It goes without saying that the object of the present invention can also be achieved by reading and executing the program code stored in the storage medium.
[0045]
In this case, the program code itself read from the storage medium realizes the novel function of the present invention, and the storage medium storing the program code constitutes the present invention.
[0046]
Examples of the storage medium for supplying the program code include a floppy disk, a hard disk, an optical disk, a magneto-optical disk, a CD-ROM (compact disk ROM), a CD-R (compact disk recordable), a magnetic tape, and a nonvolatile memory. Cards, ROM (read only memory), etc. can be used.
[0047]
Further, by executing the program code read by the computer, not only the functions of the above-described embodiments are realized, but also an OS (operating system) running on the computer based on the instruction of the program code. It goes without saying that a case where the function of the above-described embodiment is realized by performing part or all of the actual processing and the processing is included.
[0048]
Further, after the program code read from the storage medium is written to a memory provided in a function expansion board inserted into the computer or a function expansion unit connected to the computer, the function expansion is performed based on the instruction of the program code. It goes without saying that the CPU or the like provided in the board or the function expansion unit performs part or all of the actual processing and the functions of the above-described embodiments are realized by the processing.
[0049]
【The invention's effect】
As described above, according to the present invention, since complementary data is transmitted to complete an incomplete command, unnecessary dust printing can be prevented at the head of subsequent printing.
[0050]
In addition, according to the present invention, since the form feed code is included in the complementary data, it is possible to prevent the inconvenience of discharging the paper in the middle of printing and starting the next printing in the middle of the paper.
[0051]
Further, according to the present invention, since the reset command is included in the complementary data, it is possible to initialize the setting value that has been set so far, and prevent the inconvenience that the previous setting value is carried over to the next printing. be able to.
[Brief description of the drawings]
FIG. 1 is a block diagram showing an embodiment of the present invention.
FIG. 2 is a diagram showing an example of a program stored in the external storage device 15 of FIG.
FIG. 3 is a block diagram illustrating a configuration of the printer 2 in FIG. 1;
4 is a flowchart showing an example of a data transmission control program stored in a RAM 14 of FIG.
FIG. 5 is a diagram illustrating an example of a print data block.
FIG. 6 is a diagram illustrating an example of a print data block when printing is stopped and an example of what is added to complete a command.
FIG. 7 is a diagram illustrating an example of a print data block when printing is stopped and an example of what is added to complete a command.
[Explanation of symbols]
1 Computer 2 Printer 11 Input Interface 12 CPU
13 ROM
14 RAM
15 External storage device 16 Output interface 17 Display unit 18 Mouse

Claims (12)

プリンタへデータを送信する送信手段を有するデータ転送装置において、
データ転送要求に応答して印刷データブロックが完結しているか否かを判定する判定手段と、
該判定手段により否定判定された場合は、印刷終了要求に応答して、印刷データブロックのパラメータレングスを完結させるための印刷されるデータと給紙中の用紙を排紙させるフォームフィードコードを含む補完データを生成する補完データ生成手段と、
該補完データ生成手段により補完データが生成された場合は、生成された補完データを印刷データブロックの後に前記送信手段に転送する転送手段と
を有することを特徴とするデータ転送装置。
In a data transfer apparatus having a transmission means for transmitting data to a printer,
Determination means for determining whether or not the print data block is completed in response to the data transfer request;
If the determination means makes a negative determination, in response to the print end request, the supplement including the data to be printed for completing the parameter length of the print data block and the form feed code for discharging the paper being fed Complementary data generation means for generating data;
And a transfer unit that transfers the generated complementary data to the transmission unit after the print data block when the complementary data is generated by the complementary data generation unit.
請求項1において、前記判定手段は、コマンドの区切りを検出する検出手段を有し、該検出手段により検出されたコマンドの区切りに基づき当該印刷データブロックが完結しているか否かを判定することを特徴とするデータ転送装置。  The determination unit according to claim 1, further comprising a detection unit that detects a command break, and determines whether or not the print data block is complete based on the command break detected by the detection unit. A data transfer device. 請求項1において、前記補完データ生成手段は、補完に必要なバイト数を計算する計算手段を有し、該計算手段による計算により得られたバイト数分の補完を行なうことを特徴とするデータ転送装置。  2. The data transfer according to claim 1, wherein the complementary data generation means includes a calculation means for calculating the number of bytes necessary for the completion, and performs the complement for the number of bytes obtained by the calculation by the calculation means. apparatus. 請求項において、前記補完データ生成手段は、該判定手段により否定判定された場合は、印刷終了要求に応答して、印刷データブロックのパラメータレングスが含まれていない場合、0のパラメータレングスと給紙中の用紙を排紙させるフォームフィードコードとプリンタの初期化を行なうためのプリンタリセットコマンドとを含む補完データを生成することを特徴とするデータ転送装置。2. The supplementary data generation means according to claim 1 , wherein, if the determination means makes a negative determination, in response to a print end request, if the parameter length of the print data block is not included, a parameter length of 0 is supplied. A data transfer device that generates complementary data including a form feed code for discharging a sheet of paper and a printer reset command for initializing the printer . データ転送要求に応答して印刷データブロックが完結しているか否かを判定する判定ステップと、A determination step of determining whether the print data block is completed in response to the data transfer request;
否定判定した場合は、印刷終了要求に応答して、印刷データブロックのパラメータレングスを完結させるための印刷されるデータと給紙中の用紙を排紙させるフォームフィードコードを含む補完データを生成する補完データ生成ステップと、  If a negative determination is made, in response to the print end request, a complement that generates supplement data including print data for completing the parameter length of the print data block and a form feed code for discharging the paper being fed A data generation step;
補完データが生成された場合は、生成された補完データを印刷データブロックの後に、プリンタへデータを送信する送信手段に転送する転送ステップと  A transfer step of transferring the generated complementary data to a transmission means for transmitting the data to the printer after the print data block when the complementary data is generated;
を有することを特徴とするデータ転送方法。  A data transfer method characterized by comprising:
請求項において、前記判定ステップは、コマンドの区切りを検出する検出ステップを有し、該検出ステップで検出されたコマンドの区切りに基づき当該印刷データブロックが完結しているか否かを判定することを特徴とするデータ転送方法。 6. The method according to claim 5 , wherein the determination step includes a detection step of detecting a command break, and it is determined whether or not the print data block is completed based on the command break detected in the detection step. A featured data transfer method. 請求項5において、前記補完データ生成ステップは、補完に必要なバイト数を計算する計算ステップを有し、該計算ステップで得られたバイト数分の補完を行なうことを特徴とするデータ転送方法。6. The data transfer method according to claim 5, wherein the complementary data generation step includes a calculation step of calculating the number of bytes necessary for the complement, and performs the complement for the number of bytes obtained in the calculation step. 請求項において、前記補完データ生成ステップは、該判定ステップにより否定判定された場合は、印刷終了要求に応答して、印刷データブロックのパラメータレングスが含まれていない場合、0のパラメータレングスと給紙中の用紙を排紙させるフォームフィードコードとプリンタの初期化を行なうためのプリンタリセットコマンドとを含む補完データを生成することを特徴とするデータ転送方法。6. The complementary data generation step according to claim 5 , wherein when the determination step makes a negative determination, in response to a print end request, when the parameter length of the print data block is not included, a parameter length of 0 is supplied. A data transfer method comprising generating complementary data including a form feed code for discharging a sheet of paper and a printer reset command for initializing the printer . データ転送要求に応答して印刷データブロックが完結しているか否かを判定する判定手順と、A determination procedure for determining whether the print data block is completed in response to the data transfer request;
該判定手順により否定判定された場合に、印刷終了要求に応答して、印刷データブロックのパラメータレングスを完結させるための印刷されるデータと給紙中の用紙を排紙させるフォームフィードコードを含む補完データを生成する補完データ生成手順と、  Complement including a print data block for completing the parameter length of the print data block and a form feed code for discharging the paper being fed in response to a print end request when a negative determination is made by the determination procedure Complementary data generation procedure for generating data,
該補完データ生成手順により補完データが生成された場合に、生成された補完データを印刷データブロックの後に、プリンタへデータを送信する送信手段に転送する転送手順と  A transfer procedure for transferring the generated complementary data to a transmission means for transmitting data to the printer after the print data block when the complementary data is generated by the complementary data generation procedure;
をコンピュータに実行させるためのプログラムを記憶したコンピュータ読み取り可能な記憶媒体。  A computer-readable storage medium storing a program for causing a computer to execute.
請求項9において、前記判定手順が、コマンドの区切りを検出する検出手順を有し、該検出手順により検出されたコマンドの区切りに基づき当該印刷データブロックが完結しているか否かを判定するプログラムを記憶したコンピュータ読み取り可能な記憶媒体。 The program according to claim 9, wherein the determination procedure includes a detection procedure for detecting a command delimiter, and determines whether or not the print data block is complete based on the command delimiter detected by the detection procedure. A stored computer-readable storage medium. 請求項において、前記補完データ生成手順が、補完に必要なバイト数を計算する計算手順を有し、該計算手順による計算により得られたバイト数分の補完を行なうプログラムを記憶したコンピュータ読み取り可能な記憶媒体。 10. The computer-readable computer according to claim 9 , wherein the complementary data generation procedure includes a calculation procedure for calculating the number of bytes necessary for complementation, and stores a program for performing complementation for the number of bytes obtained by the calculation by the calculation procedure Storage medium. 請求項において、前記補完データ生成手順が、該判定手順により否定判定された場合は、印刷終了要求に応答して、印刷データブロックのパラメータレングスが含まれていない場合、0のパラメータレングスと給紙中の用紙を排紙させるフォームフィードコードとプリンタの初期化を行なうためのプリンタリセットコマンドとを含む補完データを生成するプログラムを記憶したコンピュータ読み取り可能な記憶媒体。 According to claim 9, wherein the complementary data generation procedure, if a negative determination by said determining step, in response to a print end request, does not contain the parameter length of print data blocks, feeding the parameters length of 0 A computer-readable storage medium storing a program for generating complementary data including a form feed code for discharging a sheet of paper and a printer reset command for initializing the printer.
JP35037199A 1999-12-09 1999-12-09 Data transfer apparatus and method Expired - Lifetime JP4346761B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP35037199A JP4346761B2 (en) 1999-12-09 1999-12-09 Data transfer apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP35037199A JP4346761B2 (en) 1999-12-09 1999-12-09 Data transfer apparatus and method

Publications (2)

Publication Number Publication Date
JP2001166892A JP2001166892A (en) 2001-06-22
JP4346761B2 true JP4346761B2 (en) 2009-10-21

Family

ID=18410042

Family Applications (1)

Application Number Title Priority Date Filing Date
JP35037199A Expired - Lifetime JP4346761B2 (en) 1999-12-09 1999-12-09 Data transfer apparatus and method

Country Status (1)

Country Link
JP (1) JP4346761B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3762394B2 (en) 2002-08-29 2006-04-05 キヤノン株式会社 Information processing apparatus, print job processing method, program, and storage medium stored in computer-readable form

Also Published As

Publication number Publication date
JP2001166892A (en) 2001-06-22

Similar Documents

Publication Publication Date Title
US20020001104A1 (en) Printer for managing a plurality of print job data
US7200685B2 (en) Communication apparatus for communicating data between separate toplogies, and related method, storage medium, and program
JPH11327856A (en) Print control device, data processing method of print control device, and storage medium storing computer readable program
JP3733259B2 (en) Information processing apparatus, information processing method, and storage medium storing computer-readable program
US4958298A (en) Printing apparatus having means for clearing unwanted print data stored in an input buffer and abolishing ensuing residual print data
JPH01174453A (en) Printer controller
JP3452247B2 (en) Printer, printer control method, and recording medium recording program
JP4346761B2 (en) Data transfer apparatus and method
US8355144B2 (en) Apparatus and method of changing printer driver, and printing system and method using the same
US7586638B2 (en) Print control apparatus and printing system
US6388761B1 (en) Multi-function peripheral device
JP3478519B2 (en) Printer device
JP3985135B2 (en) Device initialization method in control system, control system, program for causing computer to execute device initialization method, and recording medium recording this program
JP3452701B2 (en) Printer device
JP2000108463A (en) Printing control apparatus, print system using the same, and recording medium having printing control program recorded therein
JP3129679B2 (en) Printer
JP3740350B2 (en) Image processing apparatus, image processing method, and storage medium
JP3168853B2 (en) Print data control method
JP2004062875A (en) Printing system, printing apparatus, and printing control method
JP3810238B2 (en) Print job management apparatus, print job management method, and recording medium recording program
JP2768307B2 (en) Printer device
JP2004216693A (en) Printing equipment
JPH0561617A (en) Printing control system
JPH08324039A (en) Printing device, printing control device, printing method, and printing control method
JP2001273099A (en) Printer, printer control method, and recording medium recording program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20061204

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20090416

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20090424

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090619

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20090710

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20090715

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 4346761

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120724

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20120724

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20130724

Year of fee payment: 4

EXPY Cancellation because of completion of term