JPH06262809A - Printer control device - Google Patents

Printer control device

Info

Publication number
JPH06262809A
JPH06262809A JP5052227A JP5222793A JPH06262809A JP H06262809 A JPH06262809 A JP H06262809A JP 5052227 A JP5052227 A JP 5052227A JP 5222793 A JP5222793 A JP 5222793A JP H06262809 A JPH06262809 A JP H06262809A
Authority
JP
Japan
Prior art keywords
data
buffer
printer
control
save
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP5052227A
Other languages
Japanese (ja)
Inventor
Koji Fukunaga
耕司 福長
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 JP5052227A priority Critical patent/JPH06262809A/en
Publication of JPH06262809A publication Critical patent/JPH06262809A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To make a busy signal as short as possible by storing receiving data in a memory buffer from a receiving buffer by a receiving data holding means when it is detected that the receiving buffer is in a full state by a receiving data holding quantity detection means. CONSTITUTION:When no data is taken in (S 50), the number-of-residual bite obtaining processing of a receiving buffer is performed. The number of residual bites of the receiving buffer is obtained by reading the blank register of a parallel IF register and the read content becomes the number of residual bites of the receiving buffer. It is checked whether the read number of residual bites is 0 (S 51) and, when the residual bites are not 0, the previous processing is again performed and, when the residual bites are 0, it is checked whether a memory buffer is in a full state (S 53). This check is performed by comparing a memory buffer end address with a memory buffer pointer. Since storing can not be performed when the memory buffer is in the full state, the previous processing is again performed and, when the memory buffer is not in the full state, receiving data is read (S 54) and the memory buffer pointer is advanced.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、受信データを蓄える受
信バッファを持ち、受信バッファの状態をビジー信号と
してホストに知らしめることが出来るプリンタ及びプリ
ンタ制御方式に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a printer and a printer control system which have a reception buffer for storing reception data and can inform the host of the status of the reception buffer as a busy signal.

【0002】[0002]

【従来の技術】従来、ホストから送られる印字データを
蓄える受信バッファを持つようなプリンタは一般的に知
られている。その様なプリンタではホストから転送され
るデータを受信バッファに蓄え、蓄えられたデータを順
次処理することによって、印字データの展開や印字の制
御を行なうことができる。受信バッファへの受取処理と
印字動作とはおのおの独立して行なえるプリンタも一般
的である。近年ホストの高性能化に伴い、ホストからプ
リンタへのデータ転送スピードも高速化されている。ま
たプリンタも、多量の受信バッファを持ったり、受信バ
ッファの制御をハードウェア回路を用いる等、ホストか
らのデータ受取処理の高速化がおこなわれている。しか
し、ホストに比較してプリンタは実際の印字動作を伴う
ため、ホストほどの高速化は望めない。このため、ホス
トからのデータは受信バッファに多量に蓄えられる結果
となり、受信バッファは満杯状態となる時間が増えるこ
とになる。またホストにビジー信号としてプリンタの状
態を知らせることは一般的であり、プリンタの受信バッ
ファの満杯状態もビジー信号としてホストは知ることが
できる。プリンタがビジーの場合、プリンタの受信バッ
ファが満杯である場合もあり、ホストはプリンタへのデ
ータ転送が不可能であることを知ることが出来る。ビジ
ー信号は受信バッファのデータが処理され受信バッファ
に空きが発生すると、受信バッファ満杯によるプリンタ
のビジー信号は解除され、ホストは次のデータを転送す
ることができる。しかしながら、受信バッファの蓄えら
れたデータは、印字データの展開や印字の制御などが行
なわれることにより消費されるが、受信バッファのデー
タとは関係しない処理、即ち、独自に実行する処理、例
えば排紙、給紙などでは受信バッファのデータが消費さ
れないため、これらの処理が終了するまで受信データの
処理は中断されることになる。この間、受信バッファが
満杯となって、プリンタはビジー信号をホストに知らせ
る。また、ホストの高速化に伴い通常の場合でもプリン
タがビジーとなる時間が長くなる傾向がある。
2. Description of the Related Art Conventionally, a printer having a reception buffer for storing print data sent from a host is generally known. In such a printer, the data transferred from the host can be stored in the reception buffer, and the stored data can be sequentially processed to expand the print data and control the printing. In general, a printer is capable of independently performing the receiving process and the printing operation in the receiving buffer. In recent years, as the performance of the host has been improved, the data transfer speed from the host to the printer has been increased. The printer also has a large amount of receive buffers, and hardware circuits are used to control the receive buffers to speed up the process of receiving data from the host. However, since the printer involves an actual printing operation as compared with the host, it cannot be expected to achieve the higher speed than the host. As a result, a large amount of data from the host is stored in the reception buffer, and the reception buffer becomes full for a longer time. Further, it is general to inform the host of the printer status as a busy signal, and the host can also know the full status of the reception buffer of the printer as a busy signal. If the printer is busy, the printer's receive buffer may be full and the host will know that it cannot transfer data to the printer. As for the busy signal, when the data in the receiving buffer is processed and the receiving buffer becomes vacant, the busy signal of the printer due to the receiving buffer being full is canceled and the host can transfer the next data. However, the data stored in the receive buffer is consumed by the expansion of print data and the control of printing, but the process that is not related to the data in the receive buffer, that is, the process that is executed independently, such as Since the data in the reception buffer is not consumed for paper, paper feeding, etc., the processing of the reception data is interrupted until these processings are completed. During this time, the receive buffer is full and the printer signals a busy signal to the host. In addition, as the host speed increases, the printer tends to be busy for a longer period of time even in normal cases.

【0003】[0003]

【発明が解決しようとしている課題】しかしながら、上
記従来例では、ビジー信号が受信バッファ満杯状態の時
にセットされるだけではないため、ホストはプリンタが
ビジーとなっている時間が長くなることにより、プリン
タに何らかのエラーが発生したと判断したり、あるいは
エラーとは断定せずにプリンタが正しくデータを受け取
ったとして、以降の処理を継続するようなことが発生す
る。エラーと判定されれば印字が最後まで終了していな
いのに、ホストがデータの転送を終了したり、プリンタ
はデータを正しく受け取っていないのにホストからは次
のデータが送られることが起こり、途中のデータが失わ
れたような状態となる。結果として正しい印字結果が得
られなかったり、誤った印字結果となる様なことが発生
する。
However, in the above-mentioned conventional example, since the busy signal is not only set when the receive buffer is full, the host increases the time during which the printer is busy. It is determined that some error has occurred, or if the printer correctly receives the data without concluding that it is an error, the subsequent processing is continued. If it is judged as an error, although the printing is not completed to the end, the host may finish the data transfer, or the printer may not correctly receive the data but the host may send the next data, The data on the way is lost. As a result, a correct print result may not be obtained, or an incorrect print result may occur.

【0004】[0004]

【課題を解決するための手段(及び作用)】本発明によ
れば、定期的に受信バッファの状態を監視することが出
来、受信バッファが満杯であれば、受信データを保存バ
ッファに保存することにより、受信バッファが満杯であ
ることによって発生していたビジー信号の時間を短くす
ることができる。またビジー信号を定期的に解除するこ
とが出来るため、今までビジーで送れなかったのに対し
てホストからプリンタへのデータ転送が可能となり、ビ
ジー信号が長く続くことにより発生していた印字の中断
や印字データの消失をなくすことができ、正しい印字結
果を得ることができる。
According to the present invention, the state of the receiving buffer can be regularly monitored, and if the receiving buffer is full, the received data is saved in the saving buffer. As a result, it is possible to shorten the time of the busy signal generated due to the reception buffer being full. Also, because the busy signal can be canceled periodically, data can be transferred from the host to the printer, which could not be sent until now, and printing has been interrupted due to a long busy signal. It is possible to eliminate the loss of print data and print data and obtain correct print results.

【0005】[0005]

【実施例】【Example】

(実施例1)以下、添付図面を参照して本発明の好適な
実施例を詳細に説明する。尚、本発明でいう国指定は、
言語別、地域別等、文書処理に係るある条件で特定され
る複数のグループの中から所望のグループを指定するこ
とをいう。尚、グループはイギリスという指定でイギリ
ス、米国等の複数を含める場合もあれば、日本という国
を指定して、その国1つを指定する場合もあるが、ほぼ
使用言語に対応しているものである。
(Embodiment 1) Hereinafter, a preferred embodiment of the present invention will be described in detail with reference to the accompanying drawings. The country designation in the present invention is
Designating a desired group from a plurality of groups specified by certain conditions related to document processing, such as language and region. In addition, the group may include a plurality of countries such as the United Kingdom and the United States by designating the United Kingdom, or may specify the country of Japan and one of the countries, but it corresponds to almost all the languages used. Is.

【0006】図1は本発明の実施例としての情報処理装
置としてのパーソナルコンピュータ(以下パソコンと略
す)を示す斜視図である。パソコン1は、装置本体10
1、キーボード102、表示部103を備える上カバー
104、及びプリンタ2等の各部によって構成される。
上カバー104は、装置本体101に対して、その後縁
の両端に設けられたヒンジ104aを介して回動可能に
取り付けられている。これにより本装置の使用時には、
上カバー104は、その回動によって表示部103が視
易くなる位置まで開けられ、また、不使用時は閉じられ
てカバーとして機能することができる。表示部103の
表示素子としては、表示部を薄く構成できることから液
晶表示素子が用いられる。
FIG. 1 is a perspective view showing a personal computer (hereinafter abbreviated as a personal computer) as an information processing apparatus as an embodiment of the present invention. PC 1 is the device body 10
1, a keyboard 102, an upper cover 104 including a display unit 103, a printer 2, and the like.
The upper cover 104 is rotatably attached to the apparatus main body 101 via hinges 104a provided at both ends of its rear edge. As a result, when using this device,
The upper cover 104 can be opened to a position where the display 103 can be easily seen by the rotation thereof, and can be closed when not in use to function as a cover. As the display element of the display section 103, a liquid crystal display element is used because the display section can be made thin.

【0007】[Host−Printerの概略ブロッ
ク図]図2に、ホストコンピュータとプリンタの概略ブ
ロック図を示す。
[Schematic Block Diagram of Host-Printer] FIG. 2 shows a schematic block diagram of a host computer and a printer.

【0008】まずホストコンピュータにおいては、主制
御をつかさどっているのが中央処理装置(CPU)であ
り、その基本的な制御を指示するのがBIOS ROM
(Basic Input Output Syste
m ROM)である。フロッピーディスク(FDD)や
ハードディスク(HDD)からフロッピーディスクコン
トローラ(FDC)やハードディスクコントローラ(H
DC)を経由してアプリケーション プログラムを読み
出し、システムメモリ(RAM)を利用してプログラム
の実行を行なう。この時、画面の表示方法としてはLC
Dコントローラ(LCDC)を使って液晶(LCD)に
キャラクタ等の表示を行ない、キーボード(KB)から
のキー入力はキーボードコントローラ(KBC)を経由
して行なわれる。ここで、数値演算プロセッサ(FP
U)はCPUに対して演算処理のサポートを行なうもの
である。また、リアルタイムクロック(RTC)は現時
点の経過時間を示すものでシステム全体の電源が切られ
た状態においても、専用バッテリーにより動作は行なわ
れる。DMAコントローラ(DMAC)は、メモリ〜メ
モリ間、メモリ〜I/O間、I/O〜I/O間において
高速にデータの転送を行なう為に、CPUの介在なしで
データ転送を行なう。割り込みコントローラ(IRQ
C)は各I/Oからの割り込みを受け付け、優先順位に
従って処理を行なう。タイマ(TIMER)は、数チャ
ンネルのフリーランニングタイマを持ち、種々の時間管
理を行なう。その他に外部につながる、シリアルインタ
フェース(SIO)、拡張ポート(PORT)や、ユー
ザに動作状況を伝えるLEDがある。
First, in the host computer, it is the central processing unit (CPU) that controls the main control, and it is the BIOS ROM that directs the basic control.
(Basic Input Output System
m ROM). From floppy disk (FDD) or hard disk (HDD) to floppy disk controller (FDC) or hard disk controller (H
The application program is read via the DC) and the program is executed using the system memory (RAM). At this time, the screen display method is LC
Characters and the like are displayed on the liquid crystal (LCD) using the D controller (LCDC), and key input from the keyboard (KB) is performed via the keyboard controller (KBC). Here, the numerical processor (FP
U) supports arithmetic processing for the CPU. The real-time clock (RTC) indicates the elapsed time at the present time, and the operation is performed by the dedicated battery even when the power of the entire system is turned off. The DMA controller (DMAC) transfers data at high speed between the memories, between the memories, between the memories and I / O, and between the I / O and I / O, so that the data is transferred without intervention of the CPU. Interrupt controller (IRQ
C) accepts an interrupt from each I / O and performs processing according to the priority order. The timer (TIMER) has a free-running timer of several channels and manages various times. In addition, there are a serial interface (SIO), an expansion port (PORT), and an LED that communicates the operating status to the user, which are connected to the outside.

【0009】一般のパソコンが持つ上記の各制御に加え
て、ノートブック型パーソナルコンピュータ(パソコ
ン)に於ては、ACアダプター/電池の少なくとも2電
源に対応する必要があり、特に電池使用時の省電力が必
要となり、以下の構成を有する。ELのインバータ回路
のon−off/FDDへの電源供給/HDDへの電源
供給/printer−off/RAM及びVRAM以
外のディバイスへの電源供給の各時間制御や、CPU等
のCLOCK制御、サスペンド/レジューム時の電源制
御手順等を制御するホストパワーマネージメント部(ホ
ストPM部)と、ホストPM部の指示信号によりRAM
及びVRAMをサスペンド時とcpu−clock動作
時とで切り替えてrefreshするためのリフレッシ
ュコントローラと、2次電池をチャージしながらホスト
側も駆動可能なチャージコントローラよりなる。
In addition to the above-mentioned controls of a general personal computer, it is necessary for a notebook personal computer (personal computer) to support at least two power sources of an AC adapter / battery. It requires electric power and has the following configuration. On-off of EL inverter circuit / power supply to FDD / power supply to HDD / printer-off / time control of power supply to devices other than RAM and VRAM, CLOCK control of CPU, suspend / resume. A host power management unit (host PM unit) that controls the power supply control procedure at the time, and a RAM by an instruction signal from the host PM unit
And a refresh controller for switching and refreshing the VRAM between suspend and cpu-clock operations, and a charge controller capable of driving the host side while charging the secondary battery.

【0010】プリンタは、ホストコンピュータに対して
汎用のパラレルインタフェースでつながる形になり、I
/Oポートのレジスタレベルでデータ送受信を行ない、
接続のイメージとしては外部プリンタとやり取りした時
と同等となる。
The printer is connected to the host computer by a general-purpose parallel interface.
Data is sent and received at the register level of the / O port,
The image of connection is the same as when communicating with an external printer.

【0011】●[Printerのブロック図]図3は
プリンタ部の制御系の構成を示すブロック図で主な構成
は以下の通りである。
[Block Diagram of Printer] FIG. 3 is a block diagram showing the configuration of the control system of the printer section, and the main configuration is as follows.

【0012】ここでCPU−Pはプリンタ部の主制御を
なすマイクロプロセッサ形態のCPUで有り、プリンタ
ーコントロール&ステータスポート部のPST/IOレ
ジスタを介してホスト側からアクセス可能なPST/I
Oレジスタとの間でプリンターのステータス情報やエミ
ュレーション設定の情報授受を行ない、この状態設定に
基づきホスト側から後述のパラレルIFアダプタ部のP
IO/IOレジスタを介して得られるプリンタコマンド
やデータに従って所望の状態処理及び印字処理を後述の
ROM−Pにあらかじめマイクロコード化して格納され
たプログラムやデータに則りCPU−P上のディバイス
/レジスター/メモリーを用いて行なう。ROM−Pは
図14〜図21の処理を実行するCPU−Pが実行する
記録制御手順(例えば図14〜図21)及び印字制御手
順等に対応したプログラム、キャラクタージェネレータ
(CG)、その他のテーブル及びデフォルト値等の固定
データを格納するROM(リードオンリーメモリー)で
ある。TIMER1ーPは紙送りモータ(FM)/ヒー
タ等の駆動相時間及びその他の時間タイミングを得る為
のTIMERで、RTC−Pは回復動作の経過時間を知
るためのRTC(リアルタイムクロック)である。ま
た、複合制御UNITは、IF転送制御/省電力制御/
RAMアクセス制御/プリンタコントロール&ステータ
ス制御/プリンタポート制御等から構成され、この内R
AMアクセス制御/プリンタコントロール&ステータス
制御/省電力制御等はCPU−Pの制御によらずCPU
−Pのクロック停止及びフォルト中であっても独立した
制御が可能である。以上の構成がCPU−PのBUSに
接続されている。RAM−Pはレジスタとして用いるワ
ーク領域、1ライン分の印字データを格納する為のライ
ンバッファ、ドットに再展開されたドット展開バッフ
ァ、パラレルIFからのINPUTバッファ、エミュレ
ーション情報記録等の領域を有するRAM(ランダムア
クセスメモリー)で、複合制御UNITとの間をRAM
busによって接続され、複合制御UNITのRAM
制御部によりRAM−Pが後述するCPU−Pをはじめ
複数の制御部からのアクセスが可能となっている。複合
制御UNITからは各プリンタ駆動制御信号が出力さ
れ、FM駆動回路/CM駆動回路/ヘッドドライバー/
ヒータドライバではFM/CM/BJ−Head/ヒー
タ等の駆動レベルに変換し、プリンタのFM(フィード
モーター)/CM(キャリアモーター)/BJ−Hea
d各部が駆動される。省電力制御信号として複合制御U
NITからVcc1P−off/Vcc2P−off/
Vp−offの電源コントロール信号と、入力信号とし
てPrinter−off/プリンタセンサー類/操作
パネルSW、出力信号として操作パネルのLED駆動信
号等を持つ。このうちPrinter−off信号のア
クティブからインアクティブの変化のみによってVcc
1−Pの電源供給がなされて、複合制御UIT/CPU
−P/RAM−Pのみに電源供給が可能となる。また、
Vcc1P−offはprinter−off信号をプ
リンタの駆動状況に合わせて、変更したOFFタイミン
グでVcc1Pなる電源を切ることが可能となってい
る、即ちヘッドがキャップオープン状態で電源が切れて
しまい、致命的な障害を及ぼすことがないのである。
Here, the CPU-P is a microprocessor type CPU that performs the main control of the printer unit, and is accessible from the host side via the PST / IO register of the printer control & status port unit.
Printer status information and emulation setting information are exchanged with the O-register, and based on this status setting, the host side P
A device / register / on the CPU-P according to a program or data pre-microcoded and stored in a ROM-P, which will be described later, according to a printer command or data obtained via the IO / IO register. Use memory. The ROM-P is a program corresponding to the recording control procedure (for example, FIGS. 14 to 21) and the print control procedure executed by the CPU-P that executes the processing of FIGS. 14 to 21, a character generator (CG), and other tables. And a ROM (Read Only Memory) for storing fixed data such as default values. TIMER1-P is a TIMER for obtaining the drive phase time of the paper feed motor (FM) / heater and the like and other time timings, and RTC-P is an RTC (real time clock) for knowing the elapsed time of the recovery operation. In addition, the composite control unit includes IF transfer control / power saving control /
RAM access control / printer control & status control / printer port control etc.
The AM access control / printer control & status control / power saving control etc. do not depend on the control of the CPU-P.
-Independent control is possible even during P clock stop and fault. The above configuration is connected to the BUS of the CPU-P. RAM-P is a RAM having a work area used as a register, a line buffer for storing print data for one line, a dot expansion buffer re-developed into dots, an INPUT buffer from a parallel IF, and an emulation information recording area. (Random access memory), RAM between combined control unit and RAM
RAM of composite control unit connected by bus
The control unit allows the RAM-P to be accessed from a plurality of control units including the CPU-P described later. Each printer drive control signal is output from the composite control unit, and FM drive circuit / CM drive circuit / head driver /
The heater driver converts the drive level into FM / CM / BJ-Head / heater etc., and the printer FM (feed motor) / CM (carrier motor) / BJ-Hea
d Each part is driven. Combined control U as a power saving control signal
From NIT to Vcc1P-off / Vcc2P-off /
It has a power control signal of Vp-off, Printer-off / printer sensors / operation panel SW as an input signal, and an LED drive signal of the operation panel as an output signal. Of these, Vcc is generated only by the change of the Printer-off signal from active to inactive.
1-P power is supplied, UIT / CPU combined control
Power can be supplied only to -P / RAM-P. Also,
Vcc1P-off can turn off the power of Vcc1P at the changed OFF timing according to the printer-off signal according to the printer driving status, that is, the head is cap open and the power is turned off, which is fatal. It does not cause any obstacles.

【0013】図4に複合制御UNITの構成図を示す。FIG. 4 shows a block diagram of the composite control unit.

【0014】機能ブロックとしては、主としてホスト側
からのIFアダプタとして機能するパラレルIFアダプ
タ、パラレルIFアダプタを介してRAM−Pのinp
ut−buffer上にパラレルデータの格納を行なう
IFデータ取込み制御部、主としてホスト側から直接プ
リンタの状態を確認コントロールする為のプリンタコン
トロール&ステータスポート部、RAM−Pのリフレッ
シュタイミングを発生するリフレッシュ制御部、RAM
−P上の1ラインドット展開データを読みだしてBJヘ
ッドを駆動印字しつつ合わせてキャリアの相励磁も制御
するBJ−ヘッド/CM制御部と、FM/ヒータ/LE
D等を駆動するプリンタポート制御部と、IFデータ取
り込み制御部とリフレッシュ制御部とBJ−ヘッド/C
M制御部とCPU−Pの4つのアクセス要求に対して優
先度別にアクセス権を持つRAMアクセス制御部と、省
電力制御を行なうプリンタPM部で構成される。省電力
制御については後述するがCPU−Pをフォルト状態で
供給クロックを停止させる低消費電力モードからの通常
処理状態への復帰は、PM制御部で集中して管理される
各種割り込みによってもたらされ、CPU−Pを復帰さ
せる条件がととのったのちINTとして出力されCPU
−Pは再開して処理を行なう。
As a functional block, a parallel IF adapter mainly functioning as an IF adapter from the host side, and an inp of the RAM-P via the parallel IF adapter are used.
IF data fetching control unit for storing parallel data on ut-buffer, printer control & status port unit mainly for confirming and controlling the printer state directly from the host side, refresh control unit for generating RAM-P refresh timing , RAM
-BJ-head / CM control unit that reads out the 1-line dot development data on P and drives and prints the BJ head while also controlling the phase excitation of the carrier, and FM / heater / LE
Printer port control unit for driving D, etc., IF data acquisition control unit, refresh control unit, BJ-head / C
An M control unit and a RAM access control unit that has access rights according to priority for four access requests of the CPU-P, and a printer PM unit that performs power saving control. Although power saving control will be described later, the return from the low power consumption mode in which the supply clock is stopped in the CPU-P fault state to the normal processing state is brought about by various interrupts centrally managed by the PM control unit. , CPU-P return condition is output and then output as INT
-P resumes processing.

【0015】図5は、パラレルIFアダプタ(PIO/
IO)の構成を示していて、IFdata,IFsta
tus,IFcontrol,IBblankの各レジ
スタから成り、このレジスタはホストコンピュータ側お
よびプリンタロジックの双方向から読み書きできるI/
Oレジスタ領域になっている。
FIG. 5 shows a parallel IF adapter (PIO /
IO), showing the configuration of IFdata, IFsta
It consists of tus, IFcontrol, and IBblank registers, which can be read / written from the host computer side and printer logic bidirectionally.
It is an O register area.

【0016】IFdataは、ホスト側がプリンタに対
して印字制御コマンドや印字ドットデータを送出するた
めのデータレジスタであり、8ビット(1バイト)単位
でデータのやり取りが行なわれる。
IFdata is a data register for the host side to send a print control command and print dot data to the printer, and data is exchanged in units of 8 bits (1 byte).

【0017】IFstatusは、プリンタ側からホス
トに対してIFdataの受信受付状態を示すステータ
スレジスタで、1バイト単位のハンドシェイクを行なう
時のBusy/Ack信号と、プリンタエラーを示すE
rror信号を持つ。
IFstatus is a status register indicating a reception acceptance state of IFdata from the printer side to the host, and is a Busy / Ack signal when performing a handshake in 1-byte units, and E indicating a printer error.
It has a rror signal.

【0018】IFcontrolは、ホスト側からプリ
ンタに対してIFdataを送信する為のコントロール
レジスタで、1バイト単位のハンドシェイクを行なう時
のData Strobe信号を持つ。
IFcontrol is a control register for transmitting IFdata from the host side to the printer and has a Data Strobe signal for handshake in 1-byte units.

【0019】IBblankは、受信データバッファ領
域に於て空エリアのバイト数を示すレジスタである。
IBblank is a register indicating the number of bytes in the empty area in the reception data buffer area.

【0020】図6は、IFデータ取り込み制御部におけ
るプリンタ側から見えるIOレジスタ(PIF/IO)
の構成を示していて、IBstart IBend I
Bpoint1の各レジスタから成る。
FIG. 6 shows an IO register (PIF / IO) seen from the printer side in the IF data fetch control section.
IBstart IBend I
It consists of each register of Bpoint1.

【0021】図7は、IBデータ読み出し制御部におけ
るプリンタ側から見えるIOレジスタ(PIB/IO)
の構成を示していて、IBpoint2 IBstat
usIBdataの各レジスタから成る。
FIG. 7 shows an IO register (PIB / IO) seen from the printer side in the IB data read control unit.
IBpoint2 IBstat
It consists of each register of usIBdata.

【0022】図8は、プリンタ制御部においてプリンタ
側から見えるIOレジスタ(PBJ/IO)の構成を示
す。
FIG. 8 shows the configuration of the IO register (PBJ / IO) seen from the printer side in the printer control section.

【0023】PBstart,PBend,PBpoi
nt,PBstatus,PB制御情報、CM相励磁信
号、FM相励磁信号、ヒータ駆動信号、LED制御信号
の各レジスタで構成される。
PBstart, PBend, PBpoi
nt, PBstatus, PB control information, CM phase excitation signal, FM phase excitation signal, heater drive signal, LED control signal register.

【0024】図9は、図4のRAM−P上でプリンタ制
御部が管理する印字バッファ(PB)と、IFデータ取
り込み制御部およびIBデータ読み出し制御部が管理す
る受信バッファ(IB)のアドレス領域の配置を示して
いる。
FIG. 9 is an address area of the print buffer (PB) managed by the printer controller and the receive buffer (IB) managed by the IF data fetch controller and IB data read controller on the RAM-P of FIG. Shows the arrangement.

【0025】印字バッファ領域は印字に必要なデータ領
域を設定するもので、図8に示したPBJ/IOレジス
タを使って設定することができ、開始アドレス(PBs
tart)と終了アドレス(PBend)を設定するこ
とにより、その範囲内でプリンタ制御部によって開始ア
ドレスから順番に印字データを読み出し、終了アドレス
に至るまでRAM−Pから印字データを読み出し、ヘッ
ドドライバに制御信号を送出し印字を行ない、この時の
印字データアドレスポインタ(PBpoint)は現在
データ送出中のデータアドレスを示している。
The print buffer area sets a data area necessary for printing, and can be set by using the PBJ / IO register shown in FIG. 8, and the start address (PBs
By setting (start) and end address (PBend), the print data is sequentially read from the start address by the printer control unit within that range, and the print data is read from the RAM-P until the end address and controlled by the head driver. A signal is transmitted to perform printing, and the print data address pointer (PBpoint) at this time indicates the data address of the data currently being transmitted.

【0026】受信バッファ領域も同様に、受信に必要な
データ領域を設定するもので、図6に示したPIF/I
Oレジスタを使って設定することができ、開始アドレス
(IBstart)と終了アドレス(IBend)を設
定することで、IFデータ取り込み制御部によって開始
アドレスから終了アドレスに至るまでの範囲を順番に、
ホスト側から送られてくるデータ(IFdata)をR
AM−P上に書き込み、終了アドレスを過ぎると再度開
始アドレスに戻って同様に書き込み動作を行なうと共
に、この時のIBpoint1は現在データ受信済にな
っていて最後に書き込まれているデータアドレスを示し
ている。
Similarly, the reception buffer area is used to set a data area necessary for reception, and the PIF / I shown in FIG. 6 is used.
It can be set using the O register. By setting the start address (IBstart) and the end address (IBend), the range from the start address to the end address is sequentially set by the IF data fetch control unit.
The data (IFdata) sent from the host side is R
Writing on the AM-P, and when the end address is passed, it returns to the start address again and the same write operation is performed. At this time, IBpoint1 indicates the data address which has been already received and is the last written data address. There is.

【0027】同時にプリンタ側のCPU−Pは、図7に
示したPIB/IOの情報に基づきIBdataレジス
タを読み出す事により、IBデータ読み出し制御部によ
って受信バッファに取り込まれている受信データが開始
アドレスから終了アドレスまで順番に読み出され、終了
アドレスを過ぎると再度開始アドレスに戻って同様に読
み出し操作が行われ、CPU−Pは読み出した受信デー
タを印字データに変換して印字バッファ領域に書き込む
操作を行なう。
At the same time, the CPU-P on the printer side reads the IBdata register based on the PIB / IO information shown in FIG. 7, so that the received data fetched by the IB data read control unit from the start address can be read. The end address is read in sequence, and when the end address is passed, the read address is returned to the start address and the same read operation is performed. The CPU-P converts the read received data into print data and writes it in the print buffer area. To do.

【0028】この時のIBpoint2はIBデータ読
み出し制御部により既に読み出されている受信データの
アドレスを示していて、IBpoint1の値を越える
まで読み出し操作は行なわれる。
IBpoint2 at this time indicates the address of the received data already read by the IB data read control unit, and the read operation is performed until the value of IBpoint1 is exceeded.

【0029】読み出したデータが有効であるかを示すの
がステータスレジスタ(IBstatus)のData
Validフラグで、このフラグが”1”だった時はI
Bdataが無効であり既に残っている受信データはな
いことを示し、IBstatusをワードアクセスでI
Bdataと同時に読み出すことにより、データの読み
出しと同時にValidフラグを確認することができ
る。
Data of the status register (IBstatus) indicates whether the read data is valid.
It is a Valid flag, and when this flag is "1", I
It indicates that Bdata is invalid and there is no remaining received data, and IBstatus is word-accessed to I.
By reading the data at the same time as Bdata, the Valid flag can be confirmed at the same time as the data reading.

【0030】IBblankは、図5に示したPIO/
IOレジスタの一つで、IBstartとIBendに
よって設定された受信バッファ領域において、受信デー
タの取り込まれていない空バイト数を示しているレジス
タである。
IBblank is PIO / shown in FIG.
It is one of the IO registers, and is a register indicating the number of empty bytes in which the received data is not taken in the receiving buffer area set by IBstart and IBend.

【0031】すなわち、IBpointlからIBpo
int2の領域に受信データが格納されているので、設
定された受信バッファ領域から受信データが格納されて
いる領域を引いたものが、IBblankの値となる。
That is, IBpointl to IBpo
Since the received data is stored in the area of int2, the value of IBblank is obtained by subtracting the area where the received data is stored from the set receiving buffer area.

【0032】図10は、IBアクセスアドレスを生成す
るブロックとIBブランクレジスタの値を算出するブロ
ックを示す構造図であり、IBに受信データを書き込む
ためのIBWRアドレスを生成するIBWRカウンタ、
IB内に書き込まれているデータを読み出すためのIB
RDアドレスを生成するIBRDカウンタ、IBWRア
ドレスとIBRDアドレスを比較し受信データがまだ残
っているかを判別するコンパレータ、及び受信データが
取り込まれていない領域を算出するIBBNKカウンタ
で構成される。
FIG. 10 is a structural diagram showing a block for generating an IB access address and a block for calculating a value of an IB blank register. An IBWR counter for generating an IBWR address for writing received data in the IB,
IB for reading the data written in the IB
It is composed of an IBRD counter for generating an RD address, a comparator for comparing the IBWR address and the IBRD address to determine whether or not the received data still remains, and an IBBNK counter for calculating an area in which the received data is not captured.

【0033】IBWRアドレスはIFcontrolレ
ジスタのDataStrobe信号によりUPカウント
され、IBRDアドレスはIBdataの読み出しアク
セスによりUPカウントされ、IBWRアドレスとIB
RDアドレスは、RAMアクセス制御部によって優先度
別にRAM−Pにアクセスされる。
The IBWR address is UP-counted by the DataStrobe signal of the IFcontrol register, the IBRD address is UP-counted by the read access of IBdata, and the IBWR address and the IBWR address are read.
The RD address is accessed by the RAM access control unit in the RAM-P by priority.

【0034】コンパレータによる出力は、IBstat
usレジスタにおけるDataValedフラグにな
り、IBpoint2の値がIBpointlの値を越
えた時に初めて”1”になり、IBdataの読み出し
を禁止して読み出したデータが無効であることをCPU
−Pに知らせる。
The output from the comparator is IBstat.
The DataValed flag in the us register becomes "1" only when the value of IBpoint2 exceeds the value of IBpointl. It is prohibited to read the IBdata and the read data is invalid.
-Inform P.

【0035】IBBNKは、DataStrobe信号
によりUPカウントすると共に、IBdataRD信号
によりDOWNカウントし、双方のアドレスが等しい時
にIBendからIBstartのアドレスを引いた値
になるように設定することで、IB領域の残りの空バイ
ト数を加減算カウントするカウンタである。
The IBBNK counts up by the DataStrobe signal, performs DOWN count by the IBdataRD signal, and sets the value obtained by subtracting the address of IBstart from the value of IBend when both addresses are equal, thereby setting the remaining IB area. It is a counter that counts the number of empty bytes by addition and subtraction.

【0036】IBBNKの値はIBblankレジスタ
にそのまま出力されるので、ホスト側がデータ転送を行
なう時にIBblankの値を見てデータ転送量を決定
し、印字データをブロック単位で一気に転送することが
できる。
Since the value of IBBNK is output to the IBblank register as it is, the host side can determine the data transfer amount by looking at the value of IBblank and transfer the print data at once in block units.

【0037】図11は、インクジェット記録方式を用い
たプリンタユニット(図2)の内部構成を説明するため
の斜視図である。図11において、5001はインクタ
ンクであり、5012はそれに結合された記録ヘッドで
ある。5001のインクタンクと5012の記録ヘッド
で一体型の交換可能なカートリッジを形成するものであ
る。5014は、そのカートリッジをプリンター本体に
取り付けるためのキャリッジであり、5003はそのキ
ャリッジを副走査方向に走査するためのガイドである。
FIG. 11 is a perspective view for explaining the internal structure of the printer unit (FIG. 2) using the ink jet recording system. In FIG. 11, reference numeral 5001 is an ink tank, and 5012 is a recording head coupled thereto. The ink tank 5001 and the recording head 5012 form an integral replaceable cartridge. Reference numeral 5014 is a carriage for attaching the cartridge to the printer main body, and reference numeral 5003 is a guide for scanning the carriage in the sub-scanning direction.

【0038】5000は、記録紙3を主走査方向に走査
させるためのプラテンローラである。5024は、プラ
テンローラを回転させるための紙送りモータである。な
お、キャリッジ5014には、記録ヘッド5012に対
して駆動のための信号パルス電流やヘッド温調用電流を
流すためのフレキシブルケーブル(図示せず)が、プリ
ンターをコントロールするための電気回路を具備したプ
リント板(図示せず)に接続されている。
Reference numeral 5000 denotes a platen roller for scanning the recording paper 3 in the main scanning direction. Reference numeral 5024 is a paper feed motor for rotating the platen roller. The carriage 5014 is provided with a flexible cable (not shown) for supplying a signal pulse current for driving and a current for head temperature control to the recording head 5012, and a print circuit provided with an electric circuit for controlling the printer. It is connected to a plate (not shown).

【0039】さらに、上記構成のプリンタユニット2を
詳細に説明する。駆動モータ5013の正逆回転に連動
して駆動力伝達ギア5011、5009を介して回転す
るリードスクリュー5005の螺旋溝5004に対して
係合するキャリッジ5014はピン(不図示)を有し、
矢印a、b方向に往復移動される。5002は紙押え板
であり、キャリッジ移動方向にわたって紙をプラテン5
000に対して押圧する。5007、5008はフォト
カプラでキャリッジ5014のレバー5006のこの域
での存在を確認してモータ5013の回転方向切換等を
行なうためのホームポジション検知手段である。501
6は記録ヘッドの前面をキャップするキャップ部材50
22を支持する部材で、5015はこのキャップ内を吸
引する吸引手段であり、キャップ内開口5023を介し
て記録ヘッド5012の吸引回復を行なう。
Further, the printer unit 2 having the above structure will be described in detail. The carriage 5014 that engages with the spiral groove 5004 of the lead screw 5005 that rotates via the driving force transmission gears 5011 and 5009 in conjunction with the forward / reverse rotation of the drive motor 5013 has a pin (not shown),
It is reciprocated in the directions of arrows a and b. Reference numeral 5002 denotes a paper pressing plate which holds the paper in the platen 5 in the carriage movement direction.
Press against 000. Reference numerals 5007 and 5008 denote home position detecting means for confirming the existence of the lever 5006 of the carriage 5014 in this area by a photocoupler and switching the rotation direction of the motor 5013. 501
6 is a cap member 50 for capping the front surface of the recording head.
Reference numeral 5015 is a member for supporting the inside of the cap, and 5015 is a suction means for sucking the inside of the cap.

【0040】5017は、クリーニングブレードで、5
019はこのブレード5017を前後方向に移動可能に
する部材であり、本体支持板5018にこれらは支持さ
れている。ブレードは、この形態でなく周知のクリーニ
ングブレードが本例に適用できることはいうまでもな
い。また、5021は、吸引回復の吸引を開始するため
のレバーで、キャリッジ5014と係合するカム502
0の移動に伴って移動し、駆動モータからの駆動力がク
ラッチ切換等の公知の伝達手段で移動制御される。
5017 is a cleaning blade.
Reference numeral 019 denotes a member that allows the blade 5017 to move in the front-rear direction, and these members are supported by the main body support plate 5018. Needless to say, a well-known cleaning blade can be applied to this example instead of this form. Reference numeral 5021 is a lever for starting suction for suction recovery, and a cam 502 that engages with the carriage 5014.
It moves along with the movement of 0, and the driving force from the driving motor is movement-controlled by a known transmission means such as clutch switching.

【0041】即ち、駆動モータ5013をキャリッジ5
014のホームポジションから逆回転することにより、
動力伝達ギア5011を5010に切り替え(不図
示)、駆動モータ5013からの駆動力がカム5020
を介してレバー5021に伝わり、記録ヘッド5012
のキャッピング及びクリーニング、吸引回復が行なえる
ように構成されている。
That is, the drive motor 5013 is connected to the carriage 5
By rotating backward from the home position of 014,
The power transmission gear 5011 is switched to 5010 (not shown), and the driving force from the driving motor 5013 is applied to the cam 5020.
Is transmitted to the lever 5021 via the recording head 5012.
Capping, cleaning, and suction recovery can be performed.

【0042】図12は図3に示したRAM−Pで表わさ
れ、バッファ、フラグ等を含むリード/ライトメモリの
詳細を示した図である。図中、受信バッファは本体から
プリンタへ転送された印字コマンド、印字データを受信
するためのバッファで、プリンタの入力ポートに入力し
たデータが保持される。これは図9において説明した。
印字データエリアは、印字に必要なフラグ、レジスタを
含んだデータエリアで、印字はこのエリアに保持された
値、例えばマージン情報等を用いて行なわれる。
FIG. 12 is a diagram showing details of the read / write memory represented by the RAM-P shown in FIG. 3 and including a buffer, a flag and the like. In the figure, a reception buffer is a buffer for receiving print commands and print data transferred from the main body to the printer, and holds data input to the input port of the printer. This is explained in FIG.
The print data area is a data area including flags and registers necessary for printing, and printing is performed using the value held in this area, for example, margin information.

【0043】図13に図12に示した印字データエリア
内の詳細な内容を示す。データの取り込み中を示すデー
タ取り込み中フラグ、受信バッファ満杯状態以外でのビ
ジー設定状況を示すビジーフラグ、ページの終了を示す
ページフラグを含む。また、紙のフィード量を保持する
フィード量、保存バッファの先頭アドレスを指す保存バ
ッファスタートアドレス、保存バッファの最終アドレス
を指す保存バッファエンドアドレス、保存バッファの現
在アドレスを指す保存バッファポインタなどのレジスタ
を含む。
FIG. 13 shows the detailed contents in the print data area shown in FIG. It includes a data fetching flag indicating that data is being fetched, a busy flag indicating a busy setting status other than the reception buffer full state, and a page flag indicating the end of a page. Also, registers such as the feed amount that holds the paper feed amount, the save buffer start address that points to the start address of the save buffer, the save buffer end address that points to the end address of the save buffer, and the save buffer pointer that points to the current address of the save buffer. Including.

【0044】以下、フローチャートにしたがって本実施
例を詳細に説明する。
The present embodiment will be described in detail below with reference to the flow chart.

【0045】図14は、印字処理の詳細を示したフロー
チャートで、印字処理について説明する。まず、ステッ
プS1で初期化を行なう。初期化は印字に必要なデータ
エリアの初期化などを行ない、その一つとして図20に
示す保存ポインタの初期化も行なう。次に、ステップS
2へ進み、受信データが有るかどうかをチェックする。
受信データが有るかどうかのチェックは、図7で示した
PIB/IOレジスタのIBスティタスのData V
alidのビットで判定することができ、このビットが
オンであれば受信データがないことを表し、オフであれ
ば受信データがあることを表す。後で説明するが受信バ
ッファが満杯の場合、受信データは最も古いデータから
保存バッファへ保存される。保存バッファにデータが保
存されるような場合には、必ず受信バッファにデータが
存在し、受信データ有りの判定は有りとなる。受信デー
タ有りの場合にはステップS3へ進み、コマンド解析処
理を行なう。コマンド解析処理は、受信データを解析し
コントロールコードか文字コードかの判定を行ないそれ
ぞれの処理にしたがって、印字データの作成、印字等を
行なう。詳細については図15で説明する。次にステッ
プS4へ進む。また、受信データが無い場合にはステッ
プS4へ進み、コマンド解析処理はスキップされる。ス
テップS4は、スティタス制御処理で各種スティタスの
設定、解除を行なう。スティタスとしては、例えばプリ
ンタエラー状態やプリンタのスイッチなどの遷移によっ
て発生するものが有り、図5に示したIFstatus
などを、これらの状態変化に合わせるような処理を行な
う。また、プリンタの状態を示すI/Oポートの制御や
LED、パネル表示などの制御も行なう。次にステップ
S5へ進みフィード処理を行なう。フィード処理は紙の
フィードや排紙などを行なう。詳細は図16で説明す
る。次に、ステップS2へ戻り、同様の処理を繰り返し
行なう。これら一連の処理によりホストからデータを受
けコマンドを処理したり、文字を展開して印字動作を行
なうことが出来る。
FIG. 14 is a flow chart showing details of the printing process, and the printing process will be described. First, initialization is performed in step S1. For initialization, the data area required for printing is initialized, and as one of them, the save pointer shown in FIG. 20 is also initialized. Next, step S
Proceed to step 2 and check if there is received data.
Whether or not there is received data is checked by Data V of IB status of PIB / IO register shown in FIG.
It can be determined by the bit of "alid". When this bit is on, it means that there is no received data, and when it is off, it means that there is received data. As will be described later, when the reception buffer is full, the reception data is stored in the storage buffer from the oldest data. When the data is stored in the storage buffer, the data always exists in the reception buffer, and it is determined that the reception data exists. If there is received data, the process proceeds to step S3 and command analysis processing is performed. In the command analysis process, the received data is analyzed to determine whether it is a control code or a character code, and print data is created and printed according to each process. Details will be described with reference to FIG. Then, the process proceeds to step S4. If there is no received data, the process proceeds to step S4 and the command analysis process is skipped. A step S4 sets or cancels various statuses in status control processing. The status includes, for example, a status generated by a printer error state or a transition of a printer switch, and the IF status shown in FIG.
And so on according to these state changes. It also controls the I / O port indicating the status of the printer, LED, panel display, and the like. Next, the process proceeds to step S5 and feed processing is performed. The feed processing includes feeding and discharging paper. Details will be described with reference to FIG. Next, returning to step S2, the same processing is repeated. By this series of processing, it is possible to receive data from the host, process commands, and expand characters to perform printing operation.

【0046】図15は図14のステップS3を詳細に説
明するフローチャートで、コマンド解析処理を表してい
る。まず、ステップS10でデータ取得処理を行なう。
データ取得処理は、受信バッファに蓄えられたデータ、
あるいは保存バッファに蓄えられたデータを取り出す処
理を行なう。データは1バイト単位で取り出される。取
り出すデータはデータ取得処理により自動的に判断さ
れ、コマンド解析処理ではデータの所在場所については
感知する必要はない。データ取得処理については、図1
7で詳細に説明する。次に、ステップS11へ進み、ス
テップS10で取り出されたデータがコントロールコー
ドであるかどうかのチェックを行なう。コントロールコ
ードはプリンタを制御するためのコードで、一般的に知
られるキャリッジリターンやラインフィードなどと拡張
子(ESC)などを含んだ拡張コマンドなどを意味して
いる。コントロールコードであれば、ステップS12へ
進み各種コントロールコードに対応した処理を行ない、
戻りとなる。コントロールコードでなければ、ステップ
S13へ進みステップS10で取り出されたデータが文
字コードであるかどうかのチェックを行なう。文字コー
ドは文字を表すコードで、英数文字や漢字文字に対応す
る。文字コードであれば、ステップS14へ進み文字コ
ードの処理を行ない、戻りとなる。文字コードの処理は
各文字に対応した文字のデータを印字出来るデータに展
開する処理を行なう。
FIG. 15 is a flow chart for explaining step S3 in FIG. 14 in detail, and shows a command analysis process. First, a data acquisition process is performed in step S10.
Data acquisition processing is performed by the data stored in the reception buffer,
Alternatively, a process of extracting the data stored in the storage buffer is performed. The data is fetched in 1-byte units. The data to be extracted is automatically determined by the data acquisition process, and the command analysis process does not need to detect the location of the data. Figure 1 shows the data acquisition process.
This will be described in detail in Section 7. Next, in step S11, it is checked whether or not the data taken out in step S10 is a control code. The control code is a code for controlling the printer, and means a generally known extended command including a carriage return or line feed and an extension (ESC). If it is a control code, the process proceeds to step S12, processing corresponding to various control codes is performed,
Will be the return. If it is not a control code, the process proceeds to step S13, and it is checked whether the data taken out in step S10 is a character code. The character code is a code that represents a character and corresponds to alphanumeric characters and kanji characters. If it is a character code, the process proceeds to step S14, the character code is processed, and the process returns. In the character code processing, character data corresponding to each character is expanded into printable data.

【0047】これら一連の処理によりホストからのデー
タをコマンドあるいは、文字データに展開して印字動作
を行なうためのコマンド解析処理が行なえる。
By a series of these processes, a command analysis process for expanding the data from the host into a command or character data and performing a printing operation can be performed.

【0048】図16は、紙フィード処理の詳細を示した
図で、図14のステップS5に対応する。まずステップ
S20で、フィード量がセットされているかどうかを判
定する。セットされていなければ、戻りとなる。フィー
ド量がセットされている場合、ステップS21へ進み、
フィード量の合計がページ全体のフィード量を超えるか
どうかの判定を行なう。フィード量はフィードが行なわ
れる毎に、合計量として加算される。フィード量の合計
がページ全体のフィード量を超える場合、ステップS2
2へ進み、ページフラグをセットする。次に、ステップ
S23へ進み、排紙処理を行ない戻りとなる。ステップ
S21で、フィード量の合計がページ全体のフィード量
を超えない場合、ステップS24へ進み、紙のフィード
を行ない戻りとなる。
FIG. 16 is a diagram showing details of the paper feed process, which corresponds to step S5 of FIG. First, in step S20, it is determined whether the feed amount is set. If not set, it returns. If the feed amount is set, the process proceeds to step S21,
It is determined whether the total feed amount exceeds the feed amount of the entire page. The feed amount is added as a total amount each time the feed is performed. If the total feed amount exceeds the feed amount of the entire page, step S2
Go to 2 and set the page flag. Next, the process proceeds to step S23, the paper discharge process is performed, and the process returns. If the total feed amount does not exceed the feed amount of the entire page in step S21, the process proceeds to step S24 to feed the paper and return.

【0049】以上の処理により紙フィード処理とページ
フラグのセットが実行出来る。
By the above processing, the paper feed processing and the page flag setting can be executed.

【0050】図17は、データ取得処理の詳細を示した
フローチャートで、図15のステップS10に対応す
る。まずステップS30で、保存データが有るかどうか
を判定する。保存データは図12の保存バッファに蓄え
られた受信データで、図18で説明するタイマ割り込み
処理の受信バッファ制御処理により保存される。保存に
ついては図18以降で詳しく説明する。保存データは図
13に示した保存バッファポインタにより管理され次に
保存されるデータが保存バッファポインタにより示され
る保存バッファの位置にセットされる。保存バッファへ
の保存は、図13に示した保存バッファスタートアドレ
スから行なわれ、保存バッファエンドアドレスまで可能
となる。すなわち保存バッファスタートアドレスから保
存バッファポインタまで受信データが保存されており、
保存バッファスタートアドレスが指す先のデータが最も
古いデータとなる。保存データが有るかどうかを判定
は、この保存バッファスタートアドレスと保存バッファ
ポインタとの比較で行なわれ、保存バッファポインタが
保存バッファスタートアドレスと同じである場合、保存
データがないことになる。初期化処理として、保存バッ
ファポインタは保存バッファスタートアドレスと同じに
されており、初期状態としては保存データなしとなる。
ステップS30で、保存データがなければ、ステップS
31へ進み、受信データの読み込みを行なう。これが、
従来からの処理で、受信バッファからのデータ読み込み
となる。受信データの読み込みは図7で示したPIB/
IOのIBDataを読み込むことにより行なう。つぎ
に戻りとなる。ステップS30で、保存データが有れ
ば、ステップS32へ進み、データ取り込み中フラグを
セットする。データ取り込み中フラグはデータ取得処理
実行中に保存データがセットされるのを禁止するための
フラグで、このフラグがセットされている間受信データ
の保存バッファへの保存は行なわれない。これは図19
で説明する。次に、ステップS33へ進み、保存データ
の取り出しを行なう。保存データは最も古いデータから
順に取り出すため、保存バッファの保存バッファスター
トアドレスで示される位置のデータが取り出される。次
に、ステップS34へ進み、保存ポインタの更新を行な
う。保存バッファからデータが一つ取り出されたため、
保存バッファスタートアドレス+1から保存バッファポ
インタまでのデータを、保存バッファスタートアドレス
へ移動し、保存バッファポインタを一つ前に戻す。次
に、ステップS35へ進み、ステップS32でセットし
たデータ取り込み中フラグをリセットする。次に、戻り
となる。
FIG. 17 is a flow chart showing details of the data acquisition process, which corresponds to step S10 of FIG. First, in step S30, it is determined whether there is stored data. The save data is the receive data stored in the save buffer of FIG. 12, and is saved by the receive buffer control process of the timer interrupt process described in FIG. The storage will be described in detail with reference to FIG. Saved data is managed by the save buffer pointer shown in FIG. 13, and the data to be saved next is set at the position of the save buffer indicated by the save buffer pointer. Saving in the save buffer starts from the save buffer start address shown in FIG. 13 and can be done up to the save buffer end address. That is, the received data is saved from the save buffer start address to the save buffer pointer,
The data pointed to by the save buffer start address is the oldest data. The determination as to whether or not there is save data is performed by comparing the save buffer start address with the save buffer pointer. If the save buffer pointer is the same as the save buffer start address, there is no save data. As the initialization processing, the save buffer pointer is made the same as the save buffer start address, and there is no save data in the initial state.
If there is no saved data in step S30, step S30
In step 31, the received data is read. This is,
With the conventional processing, data is read from the reception buffer. The reception data can be read by the PIB / shown in FIG.
This is done by reading IBData of IO. Then return. If there is stored data in step S30, the process proceeds to step S32, and the data acquisition flag is set. The data fetching flag is a flag for prohibiting the setting of the saved data during the execution of the data acquisition process. While the flag is set, the received data is not saved in the save buffer. This is
Described in. Next, in step S33, the stored data is extracted. Since the stored data is retrieved in order from the oldest data, the data at the position indicated by the storage buffer start address of the storage buffer is retrieved. Next, in step S34, the save pointer is updated. Since one data has been retrieved from the save buffer,
The data from the save buffer start address + 1 to the save buffer pointer is moved to the save buffer start address and the save buffer pointer is moved back by one. Next, the process proceeds to step S35, and the data acquisition flag set in step S32 is reset. Then come back.

【0051】以上の処理によりデータ取得処理が実行さ
れ受信バッファからのデータ読み込みか保存バッファか
らのデータ取り出しかのいずれかが自動的におこなわ
れ、印字に必要なホストからのデータを取得することが
出来る。
By the above processing, the data acquisition processing is executed and either the data reading from the reception buffer or the data extraction from the storage buffer is automatically performed, and the data from the host necessary for printing can be acquired. I can.

【0052】図18はタイマ割り込み処理を示したフロ
ーチャートで、図4のTimer3−Pから一定の時間
間隔でCPU−Pへ知らされ、割り込み処理としてCP
U−Pで実行に移される。まず、ステップS40で受信
バッファ制御処理を行ない戻りとなる。受信バッファ制
御処理は図19で詳細に説明する。
FIG. 18 is a flow chart showing the timer interrupt process. The Timer3-P of FIG. 4 notifies the CPU-P at a constant time interval, and the CP is used as the interrupt process.
It is executed in UP. First, in step S40, the reception buffer control process is performed and the process returns. The reception buffer control process will be described in detail with reference to FIG.

【0053】図19は受信バッファ制御処理を示したフ
ローチャートで、図17のステップS40に対応する。
まず、ステップS50でデータ取り込み中かどうかのチ
ェックを行なう。このチェックはデータ取り込み中フラ
グがセットされているかどうかで行なわれ、セットされ
ていれば戻りとなり、何も行なわない。受信バッファ制
御処理は図17で示したデータ取得処理中でも、実行さ
れる可能性があるためデータ取得処理中にはデータ保存
処理を行なわないようにするためである。タイマ割り込
み処理として実行されるため、データ取得中に保存処理
が行なわれると、保存ポインタの位置が狂うおそれがあ
るためである。データ取り込み中でなければ、ステップ
S51へ進み受信バッファ残りバイト数取得処理を行な
う。受信バッファ残りバイト数取得は図5のPIO/I
OのIBblankでしめされるレジスタを読み込むこ
とにより行なわれ、読み込んだ内容が受信バッファの残
りバイト数となる。次に、ステップS52へ進みステッ
プS51で読み込んだ残りバイト数が0であるかどうか
のチェックを行なう。残りバイト数が0であれば、受信
バッファが満杯であることをしめしている。残りバイト
数が0でなければ、保存バッファへの保存を行なう必要
がないので戻りとなる。残りバイト数が0であれば、ス
テップS53へ進み、保存バッファが満杯であるかどう
かのチェックを行なう。保存バッファが満杯かどうかを
判定は、保存バッファエンドアドレスと保存バッファポ
インタとの比較で行なわれ、保存バッファポインタが保
存バッファエンドアドレスと同じである場合、保存バッ
ファが満杯であることになる。保存バッファが満杯であ
れば、これ以上の保存は行なえないので戻りとなる。保
存バッファが満杯でなければ、ステップS54へ進み、
受信データの読み込みを行なう。これは図17のステッ
プS31と同様である。次に、ステップS55へ進み、
ステップS54で読み込んだデータを保存バッファへ保
存する。保存する位置は保存バッファポインタで示され
る場所に行なわれ、保存バッファ中では最新のデータと
なる。次に、ステップS56へ進み、保存バッファポイ
ンタを一つ先へ進め戻りとなる。
FIG. 19 is a flowchart showing the receiving buffer control processing, which corresponds to step S40 in FIG.
First, in step S50, it is checked whether or not data is being taken. This check is performed depending on whether or not the data fetching flag is set. If it is set, the process returns and nothing is done. This is because the reception buffer control process may be executed even during the data acquisition process shown in FIG. 17, so that the data storage process is not performed during the data acquisition process. This is because the timer interrupt process is executed, and therefore, if the save process is performed during data acquisition, the position of the save pointer may be misaligned. If the data is not being fetched, the process proceeds to step S51, and the reception buffer remaining byte number acquisition process is performed. To obtain the number of remaining bytes in the receive buffer, use PIO / I
This is performed by reading the register indicated by O IBblank, and the read content becomes the number of bytes remaining in the reception buffer. Next, in step S52, it is checked whether or not the number of remaining bytes read in step S51 is zero. If the number of remaining bytes is 0, it indicates that the receive buffer is full. If the number of remaining bytes is not 0, there is no need to save in the save buffer, and the process returns. If the number of remaining bytes is 0, the process proceeds to step S53 to check whether the save buffer is full. The determination as to whether the save buffer is full is made by comparing the save buffer end address with the save buffer pointer. If the save buffer pointer is the same as the save buffer end address, the save buffer is full. If the save buffer is full, no more saves can be done and the process returns. If the save buffer is not full, go to step S54,
Read the received data. This is similar to step S31 of FIG. Next, in step S55,
The data read in step S54 is saved in the save buffer. The save position is the position indicated by the save buffer pointer, and the latest data is in the save buffer. Then, the process proceeds to step S56, the save buffer pointer is advanced by one, and the process returns.

【0054】以上の処理により一定の時間毎に受信バッ
ファのデータ状態を確認し、受信バッファが満杯であれ
ば受信バッファのデータを保存バッファに保存すること
が出来る。
By the above processing, the data state of the receiving buffer can be confirmed at regular intervals, and if the receiving buffer is full, the data in the receiving buffer can be saved in the saving buffer.

【0055】図20は保存ポインタの初期化処理を示し
たフローチャートで、図14のステップS1の初期化の
中の一つに対応する。ステップS60で保存ポインタの
初期化を行なう。図13の保存バッファスタートアドレ
スは保存バッファの先頭、保存バッファエンドアドレス
は保存バッファの最終をそれぞれセットし、保存バッフ
ァポインタには保存バッファスタートアドレスと同じ保
存バッファの先頭をセットする。
FIG. 20 is a flow chart showing the initialization processing of the save pointer, which corresponds to one of the initializations in step S1 of FIG. In step S60, the save pointer is initialized. In FIG. 13, the save buffer start address is set to the start of the save buffer, the save buffer end address is set to the end of the save buffer, and the save buffer pointer is set to the same save buffer start address as the save buffer start address.

【0056】以上の処理により保存ポインタの初期化が
出来る。
By the above processing, the save pointer can be initialized.

【0057】図21はビジー制御処理を示したフローチ
ャートで、受信バッファの状態をホストに知らせるため
のビジー信号を扱う処理をしめしている。ビジー信号は
図5のPIO/IOのIFstatusのBusyで表
され、このビットがオンであればビジーではなく、オフ
であればビジーであることを示す。ビジーはプリンタが
エラーやオフラインなどの場合にもビジーとされる。ホ
ストはこのビジー信号を見ることによりプリンタがデー
タを受けられる状態かどうかを判定できる。ビジー制御
処理は受信バッファへの読み込み、書き込みのたびに呼
ばれビジーの制御を行なう。
FIG. 21 is a flow chart showing a busy control process, showing a process for handling a busy signal for notifying the host of the state of the reception buffer. The busy signal is represented by Busy of IFstatus of PIO / IO in FIG. 5, and if this bit is on, it is not busy, and if it is off, it is busy. Busy is also called busy if the printer is in error or offline. By seeing this busy signal, the host can determine whether the printer is ready to receive data. The busy control process is called every time a read or write operation is performed on the reception buffer to control busy.

【0058】まず、ステップS70で受信バッファが満
杯かどうかのチェックを行なう。この処理は図19のス
テップS51、52と同様に行なわれる。受信バッファ
が満杯であれば、ステップS71へ進み、ビジーをセッ
トする。ビジーのセットは図5のPIO/IOのIFs
tatusのBusyをオフにすることにより行なう。
受信バッファが満杯でなければ、ステップS72へ進
み、ビジーフラグがセットされているかどうかをチェッ
クする。ビジーフラグは受信バッファ満杯以外の条件の
場合にセットされる。ビジーフラグオンならば戻りとな
る。ビジーフラグオンでなければ、ステップS73へ進
み、ビジーをリセットする。ビジーのリセットは図5の
PIO/IOのIFstatusのBusyをオンにす
ることにより行なう。次に、戻りとなる。
First, in step S70, it is checked whether the reception buffer is full. This process is performed in the same manner as steps S51 and S52 in FIG. If the reception buffer is full, the flow advances to step S71 to set busy. The busy set is the PIO / IO IFs of FIG.
This is done by turning off the Busy of the status.
If the receive buffer is not full, the process proceeds to step S72, and it is checked whether the busy flag is set. The busy flag is set under conditions other than the receive buffer full condition. If the busy flag is on, it returns. If the busy flag is not on, the process proceeds to step S73 and the busy is reset. Busy is reset by turning on Busy of IFstatus of PIO / IO in FIG. Then come back.

【0059】以上の処理により受信バッファのデータ状
態によりビジー信号の制御を行なうことが出来る。
By the above processing, the busy signal can be controlled according to the data state of the reception buffer.

【0060】以上、説明したように定期的に受信バッフ
ァの満杯状態を監視し満杯であれば保存バッファに保存
することが可能となり、また受信バッファの状態により
ビジーの設定、解除をおこなうことが可能となる。ま
た、受信データの取り出しに際しても受信バッファ、保
存バッファのいずれかによりデータを取り出すことも可
能となる。
As described above, it is possible to periodically monitor the full state of the receiving buffer and store it in the save buffer if it is full. Also, it is possible to set or cancel busy depending on the state of the receiving buffer. Becomes Also, when the received data is taken out, it is possible to take out the data by either the receive buffer or the save buffer.

【0061】(実施例2)本実施例においては、図4中
IFデータ取り込み制御部で示した回路を用いてホスト
から受け取ってデータを受信バッファへセットするよう
に構成されているが、これら回路を省略してそれらの処
理をソフト処理とすることも可能である。また、図10
で示した残りバイトの算出回路もソフト処理とすること
も可能である。この場合、必要な回路を減らすことがで
きる。
(Embodiment 2) In this embodiment, the circuit shown by the IF data fetching control section in FIG. 4 is used to receive data from the host and set the data in the receiving buffer. It is also possible to omit those and make those processing soft processing. In addition, FIG.
The remaining byte calculation circuit indicated by can also be processed by software. In this case, the required circuits can be reduced.

【0062】(実施例3)本実施例においては、図21
で示したビジー制御処理はソフト処理として構成されて
いるが、回路を用いることも可能である。また、図1
8、19で示した受信バッファの制御処理もソフト処理
として構成されているが、回路を用いることも可能であ
る。この場合、ソフト処理に比べて高速な処理ができ
る。
(Embodiment 3) In this embodiment, FIG.
Although the busy control process shown by is configured as a soft process, it is also possible to use a circuit. Also, FIG.
Although the control processing of the reception buffer shown by 8 and 19 is also configured as a soft processing, it is also possible to use a circuit. In this case, it is possible to perform processing at a higher speed than software processing.

【0063】(実施例4)本実施例においては、図1
8、19で示した受信バッファ制御処理はタイマ割り込
み処理として構成されているが、図14の印字処理の繰
り返し処理内(ステップS2〜ステップS5)で行なう
ことも可能である。この場合、タイマ割り込み機能を省
略することができる。
Example 4 In this example, FIG.
Although the reception buffer control process shown in 8 and 19 is configured as the timer interrupt process, it may be performed within the repeating process of the print process of FIG. 14 (steps S2 to S5). In this case, the timer interrupt function can be omitted.

【0064】[0064]

【発明の効果】以上、説明したように、ホストからおく
られた印字データによりプリンタの受信バッファが満杯
となることにより、ホストに通知されていたビジー信号
を極力短くすることが可能となり、従来、プリンタビジ
ーが長いことにより発生していたホストのエラーやデー
タの欠落を防ぐ効果がある。
As described above, since the print buffer sent from the host fills the printer's receive buffer, the busy signal notified to the host can be shortened as much as possible. This is effective in preventing host errors and data loss caused by long printer busy.

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

【図1】本発明を実施したパソコンを示す斜視図FIG. 1 is a perspective view showing a personal computer embodying the present invention.

【図2】ホスト−プリンタ間概略ブロック図FIG. 2 is a schematic block diagram between a host and a printer.

【図3】プリンタ1F部のブロック図FIG. 3 is a block diagram of a printer 1F section.

【図4】複合制御UNITの内部のブロック図FIG. 4 is a block diagram of an inside of a combined control unit.

【図5】PIO/IOレジスタ構成図FIG. 5: PIO / IO register configuration diagram

【図6】PIF/IOレジスタ構成図FIG. 6 is a PIF / IO register configuration diagram.

【図7】PIB/IOレジスタ構成図FIG. 7 PIB / IO register configuration diagram

【図8】PBJ/IOレジスタ構成図FIG. 8 PBJ / IO register configuration diagram

【図9】プリンタ内のRAMの詳細を示した図FIG. 9 is a diagram showing details of RAM in the printer.

【図10】IBアクセスアドレス及びIBブランク算出
回路の構成図
FIG. 10 is a configuration diagram of an IB access address and IB blank calculation circuit.

【図11】プリンタ内部ユニットの斜視図FIG. 11 is a perspective view of a printer internal unit.

【図12】プリンタ内のRAMの詳細を示した図FIG. 12 is a diagram showing details of RAM in the printer.

【図13】印字データエリアの詳細を示した図FIG. 13 is a diagram showing details of a print data area.

【図14】印字処理の詳細を示すフローチャートFIG. 14 is a flowchart showing details of print processing.

【図15】コマンド解析処理の詳細を示すフローチャー
FIG. 15 is a flowchart showing details of command analysis processing.

【図16】紙フィード処理の詳細を示すフローチャートFIG. 16 is a flowchart showing details of paper feed processing.

【図17】データ取得処理の詳細を示すフローチャートFIG. 17 is a flowchart showing details of data acquisition processing.

【図18】タイマ割り込み処理の詳細を示すフローチャ
ート
FIG. 18 is a flowchart showing details of timer interrupt processing.

【図19】受信バッファ制御処理の詳細を示すフローチ
ャート
FIG. 19 is a flowchart showing details of a reception buffer control process.

【図20】保存ポインタ初期化処理の詳細を示すフロー
チャート
FIG. 20 is a flowchart showing details of save pointer initialization processing.

【図21】ビジー制御処理の詳細を示すフローチャートFIG. 21 is a flowchart showing details of busy control processing.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 受信バッファのデータ保持量を検出する
受信データ保持量検出手段と、 前記受信バッファからデータを取り出し保存バッファに
保存する受信データ保存手段と、 前記データ保持量検出手段により、受信バッファが満杯
であることを検知した場合、前記受信データ保存手段に
より受信バッファから受信データを保存バッファに保存
することを特徴とするプリンタ制御方式。
1. A received data holding amount detecting means for detecting a data holding amount of a receiving buffer, a received data storing means for taking out data from the receiving buffer and storing the data in a saving buffer, and a receiving buffer by the data holding amount detecting means. Is detected, the received data saving means saves the received data from the receive buffer in the save buffer.
【請求項2】 前記受信データ保存手段により、受信バ
ッファに保持されるデータ量を減らすことにより、ビジ
ー信号制御手段に従ってプリンタのビジー信号を制御す
ることを特徴とする請求項1記載のプリンタ制御方式。
2. The printer control method according to claim 1, wherein the received data storage means reduces the amount of data held in the reception buffer to control the busy signal of the printer according to the busy signal control means. .
JP5052227A 1993-03-12 1993-03-12 Printer control device Pending JPH06262809A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5052227A JPH06262809A (en) 1993-03-12 1993-03-12 Printer control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5052227A JPH06262809A (en) 1993-03-12 1993-03-12 Printer control device

Publications (1)

Publication Number Publication Date
JPH06262809A true JPH06262809A (en) 1994-09-20

Family

ID=12908861

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5052227A Pending JPH06262809A (en) 1993-03-12 1993-03-12 Printer control device

Country Status (1)

Country Link
JP (1) JPH06262809A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006154950A (en) * 2004-11-25 2006-06-15 Hitachi Omron Terminal Solutions Corp Automatic transaction apparatus
JP2011104861A (en) * 2009-11-17 2011-06-02 Seiko Epson Corp Recording control device, method of controlling recording device, and program
US8769170B2 (en) 2010-09-16 2014-07-01 Seiko Epson Corporation Electronic device, control method for an electronic device, and recording medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006154950A (en) * 2004-11-25 2006-06-15 Hitachi Omron Terminal Solutions Corp Automatic transaction apparatus
JP4542880B2 (en) * 2004-11-25 2010-09-15 日立オムロンターミナルソリューションズ株式会社 Automatic transaction equipment
JP2011104861A (en) * 2009-11-17 2011-06-02 Seiko Epson Corp Recording control device, method of controlling recording device, and program
US8769170B2 (en) 2010-09-16 2014-07-01 Seiko Epson Corporation Electronic device, control method for an electronic device, and recording medium

Similar Documents

Publication Publication Date Title
EP0526189B1 (en) Print controller with power saving control
US5845144A (en) Information processing apparatus with internal printer
US20030156129A1 (en) Information processing method and apparatus
JP3323527B2 (en) Printing apparatus and method
US5844813A (en) Information processing apparatus and method with setting of power off state and with recognition of printer operating state
JPH0781186A (en) Power-saving device for information-processing system
EP0526183B1 (en) Computer-printer data transfer method
JPH06262809A (en) Printer control device
JP3093342B2 (en) Power saving method and printing apparatus
JPH10105295A (en) Battery built-in electronic equipment and print control method
JP3227188B2 (en) Information processing method and apparatus
JPH05169736A (en) Printer and printer controlling method
JP3262355B2 (en) Information processing method and apparatus
JP3210046B2 (en) Information processing apparatus and method
JPH08310086A (en) Information processing device and its printing method
JPH11192728A (en) Ink jet recorder, information processor, print control method, and memory medium
JPH0532013A (en) Information processing and device therefor
JP3140875B2 (en) Recording device
JP3278174B2 (en) Printing apparatus and initialization method
JP3542443B2 (en) Host computer and data transfer method
JPH08278867A (en) Information processor and method for starting and controlling information processor
JPH0532012A (en) Information processing and device therefor
JPH06286271A (en) Control method of printer and device therefor
JPH09188038A (en) Output device
JP2000158764A (en) Print controller, initialization thereof and memory medium storing computer readable program