BACKGROUND OF THE INVENTION1. Field of the Invention[0001]
The present invention relates to a host-based printing system and printing control method thereof.[0002]
2. Description of the Related Art[0003]
Host-based printing systems have been proposed in recent years. Generally used printers receive printing data from a host computer and convert the same into image data for printing, such as bit-mapped data whereas the host-based printers receive the bit-mapped data or compressed bit-mapped data created at a host computer. Generally, the image data output from the host computer is compressed. The host-based printer expands the received compressed image data and relays the resultant data to a printer engine. Because the host-based printer needs only perform data expansion, burden on the host-based printer is greatly relieved. This allows employing a CPU of low processing capability and/or a memory of small storage capacity in the host-base printer. As such, the host-based printers can be manufactured at low cost.[0004]
There are such printers that cannot temporarily stop during printing. Laser printers are an example of such printers. Such a printer has a buffer memory in which one page worth of image data is stored so that the supply of the image data to the printer will not be interrupted during printing. Some of the printers have a reprinting capability. When a printing error, such as a paper jam, occurs during printing, the printer can automatically reprint the page which was not produced as a result of the printing error. This reprinting can be achieved by using the one page worth of image data stored in the buffer memory of the printer.[0005]
However, provision of a buffer memory with one page worth of print data storing capability increases the cost of the printer. To lower the cost and provide a low-price product, a memory of small storage capacity is mounted in recent host-based printers. Because one page worth of image data cannot be stored in the buffer memory in such printers, reprinting of a page cannot be performed automatically when a printing error occurs but the operator has to operate the printer again to perform printing of the page.[0006]
In the host-based printing systems, the image data output from the host computer is stored temporarily in a buffer memory within the printer. With a page printer, image data is stored in the buffer memory until the end of the page, providing the page of image data Is small enough to fit Into the buffer memory, and then the printing unit is activated to print the page. If a page of image data is larger than the capacity of the buffer memory, however, the printing unit is activated when the buffer memory becomes full. Hereinafter, this method of starting to print a page before the end of the page has been transferred will be referred to as “printing on the fly.”[0007]
When printing on the fly with a page printer, the buffer memory may become empty in the middle of a page if transferring of image data from the computer is slow, and the printer will be unable to print. This condition in which printing is impossible will hereinafter be referred to as “print overrun.”[0008]
When an error occurs due to a paper jam, for example, while printing on the fly with such a page printer, the host computer stops outputting image data in the middle of a page. Then, after the jammed paper is removed and the printer Is reset, the host computer will continue outputting the remaining image data in the page. However, data for the first part of the page was lost when the printer was reset. Thus, even if data for the latter part of the page is sent to the printer, the printer will be unable to process that data as specifications for data length, for example, will be missing, resulting in an illegal command error.[0009]
Sometimes an error recovery function is provided to resend image data from the host computer for a page in which an error occurred, but when print overrun occurs, the same error may recur due to relationships between the printer buffer capacity, the data size of one page, and the transfer speed from the host computer. For this reason, when an error recovery function is set in conventional host-based printing systems and a print overrun occurs, the same error occurs repeatedly, and the function is ineffective.[0010]
SUMMARY OF THE INVENTIONIn view of the foregoing, it is an object of the present invention to provide a host-based printing system and a printing control method thereof capable of automatically reprinting a page that could not be printed as a result of a printing error regardless of the storage capacity of a buffer memory of a printer.[0011]
It is another object of the present invention to provide a host-based printing system and a printing control method thereof that can smoothly recover from a printing error.[0012]
To achieve the above and other objects, there is provided a printing control method of a host-based printing system that includes a host computer and a printer connected to the host computer, the printing control method including the steps of:[0013]
(a) creating, in the host computer, image data for printing;[0014]
(b) outputting the image data created in the host computer to the printer;[0015]
(c) printing, in the printer, the image data on a page basis;[0016]
(d) when a printing error occurs in the printer during the step (c) before the printing the image data for one page the printing error occurred in was completely output from the host computer to the printer, recovering the printing error, and thereafter outputting remaining image data for the one page to the printer; and[0017]
(e) discarding, in the printer, the remaining image data for the one page output from the host computer.[0018]
The method may further include the following steps:[0019]
(f) determining whether the printing error is of a recurring type or a nonrecurring type;[0020]
(g) when the determination made in step (f) indicates that the printing error is of the nonrecurring type, recovering the printing error, and thereafter resending to the printer the image data for the one page that the printing error occurred in instead of executing the step (d); and[0021]
(h) printing the image data resent by the host computer instead of executing the step (e).[0022]
The steps (d) and (e) are executed when the determination made in step (f) indicates that the printing error is of the recurring type.[0023]
The method may further include the following steps:[0024]
(i) resetting the printer before outputting the remaining image data for the one page to the printer.[0025]
The method may further include the following steps:[0026]
(j) executing the step (i) when the determination made in step (f) indicates that the printing error is of the recurring type;[0027]
(k) after executing the step (t), outputting the image data for a subsequent one page to the printer instead of executing the step (d): and[0028]
(l) printing the image data for the subsequent one page.[0029]
According to another aspect of the invention, there is provided a printing control method of a host-based printing system that includes a host computer and a printer connected to the host computer so as to be capable of performing a bi-directional communication therebetween, the printing control method including the steps of:[0030]
(a) creating, in the host computer, image data for printing;[0031]
(b) outputting the image data created in the host computer to the printer;[0032]
(c) printing, in the printer, the image data on a page basis:[0033]
(d) when a printing error occurs in the printer during the step (a) before the printing the image data for one page the printing error occurred in was completely output from the host computer to the printer, transmitting a reprint command from the printer to the host computer requesting to resend the image data for the one page the printing error occurred in, a part of the print data for the one page being left unprinted in the printer as a result of the printing error;[0034]
(e) clearing the part of the print data; and[0035]
(f) in response to the reprint command received from the printer, resending the image data for the one page the printing error occurred in to the printer.[0036]
The host computer retains the image data that has been sent to the printer so as to be capable of resending the image data. The method may further include the following steps:[0037]
(g) sending information regarding a page that has been successfully printed in the printer to the host computer; and[0038]
(h) discarding the print data retained by the host computer for the page that has been successfully printed in the printer.[0039]
According to still another aspect of the invention, there is provided a host-based printing system that includes a host computer for creating image data for printing and transmitting the image data; a printer connected to the host computer for receiving and printing the image data on a page basis; output complete determination means for determining whether or not the image data for one page had been completely transmitted from the host computer when a printing error occurred; and discarding means for discarding a part of the image data for the one page which remains untransmitted from the host computer when the determination by the output complete determination means indicates that the image data for one page had not been completely transmitted. In this case, discharging the part of the image data is implemented after resetting the printer.[0040]
The discarding means is provided in the printer and discards the part of the image data after the part of the image data has been transmitted to the printer.[0041]
There may further be provided error recovery means for retransmitting the image data for the one page the printing error occurred in after the printer recovers from the printing error; printing error cause determination means for determining whether or not the printing error is of a type that will cause the same printing error to recur; and error recovery ignore means for disabling the error recovery means so that retransmitted image data is not printed by the printer when the determination by the printing error cause determination means indicates the printing error is of the type that will cause the same printing error to recur.[0042]
According to yet another aspect of the invention, there is provided a host-based printing system that includes: a host computer for creating image data for printing and transmitting the image data; a printer connected to the host computer for receiving and printing the image data on a page basis; printing error cause determination means for determining whether or not the printing error is of a type that will cause the same printing error to recur; and discarding means for discarding a part of the image data for the one page which remains untransmitted from the host computer when the determination by the printing error cause determination means indicates the printing error is of the type that will cause the same printing error to recur. Discharging the part of the image data is implemented after resetting the printer.[0043]
In this case also, the discarding means is provided in the printer and discards the part of the image data after the part of the image data has been transmitted to the printer.[0044]
According to further aspect of the present invention, there is provided a host-based printing system that includes: a host computer for creating image data for printing; a printer connected to the host computer for receiving and printing the image data on a page basis; output complete determination means for determining whether or not the image data for one page had been completely transmitted from the host computer when a printing error occurred; and retransmitting means for retransmitting the image data for the one page the printing error occurred in when the determination by the output complete determination means indicates that the image data for one page had not been completely transmitted, the image data being retransmitted after resetting the printer.[0045]
According to another aspect of the invention, there is provided a host-based printing system that includes: a host computer for creating image data for printing: a printer connected to the host computer for receiving and printing the image data on a page basis; printing error cause determination means for determining whether or not the printing error is of a type that will cause the same printing error to recur; and page skipping means for skipping the image data for the one page the printing error occurred in and transmitting the image data for a subsequent one page to the printer when the determination by the printing error cause determination means indicates the printing error is of the type that will cause the same printing error to recur. Transmitting the image data for the subsequent one page is implemented after resetting the printer.[0046]
According to still another aspect of the invention, there is provided a host-based printing system that includes: a host computer for creating image data and outputting the image data; a printer connected to the host computer for receiving and printing the image data on a page basis: and bi-directional communication lines for connecting the host computer to the printer so as to be capable of performing a bi-directional communication therebetween. The printer includes: print execution information output means for outputting print execution information to the host computer, the print execution information being representative of normally printed pages and print error pages; and data clear means for clearing, when a printing error occurred during printing the image data for one page, a part of the image data for the one page which remains unprinted as a result of the printing error. The host computer includes; image data retaining means for retaining the image data that has been output to the printer so as to repeatedly output to the printer; resending means for resending to the printer the image data for the one page that is indicated as a print error page in the print execution information; and discarding means for discarding the image data for a page that is retained in the image data retaining means and indicated as a normally printed page in the print execution information.[0047]
The printer may further include print results storing means for storing an accumulated number of printed pages and outputting the accumulated number of printed pages to the host computer. The host computer may further include printed pages specifying means for specifying a number of normally printed pages based on the accumulated number of printed pages output from the print results storing means before start of printing and an updated accumulated number of printed pages.[0048]
The host computer may further include output page managing means for managing a page whose image data has been output to the printer, and print error page specifying means for specifying print error pages based on the page managed by the output page managing means and the normally printed pages.[0049]
When the print error page specifying means specifies a print error page, the output page managing means indicates a page immediately preceding the print error page specified by the print error page specifying means.[0050]
According to yet further aspect of the invention, there is provided a host-based printing system that includes: a host computer for creating image data: a printer connected to the host computer for receiving and printing the image data on a page basis; image data retaining means for retaining the image data; start page managing means for managing a start page of the image data stored in the image data retaining means; end page managing means for managing an end page of the image data stored in the image data retaining means; output page managing means for managing an output page which has been sent to the printer; and output data specifying means for specifying the image data for a subsequent page to be sequentially output to the printer based on a relationship between the output page and the end page.[0051]
The start page managing means specifies the normally printed page based on information received from the printer and rewrites the start page based on the normally printed page specified by the start page managing means. The output page managing means specifies the print error page based on information received from the printer and rewrites the output page based on the print error page specified by the output page managing means.[0052]
BRIEF DESCRIPTION OF THE DRAWINGSThe particular features and advantages of the invention as well as other objects will become apparent from the following description taken in connection with the accompanying drawings, in which:[0053]
FIG. 1 shows the general configuration of a host-based printing system of the embodiments;[0054]
FIG. 2A shows the general configuration of a host-based printing system according to the first and second embodiments of the invention;[0055]
FIG. 2B shows the general configuration of a host-based printing system according to the third embodiment of the invention;[0056]
FIGS. 3A, 3B and[0057]3C are schematic diagrams showing the relationships of the write pointer and read pointer with the reception buffer in a host-based printing system;
FIG. 4 is a flowchart showing the control process in a printer of the first embodiment of the invention;[0058]
FIG. 5 is a flowchart showing the control process in a host computer of the second embodiment of the invention;[0059]
FIG. 6 is a flowchart showing the control process in a host computer of the third embodiment of the invention; and[0060]
FIG. 7 is a flowchart showing the control process in the printer of the third embodiment of the invention.[0061]
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTA host-based printing system according to a preferred embodiment of the present invention will be described while referring to the accompanying drawings wherein like parts and components are designated by the same reference numerals to avoid duplicating description.[0062]
As shown in FIG. 1, the host-based[0063]printing system10 of the present embodiment includes ahost computer20 and alaser printer30. Thehost computer20 andlaser printer30 are connected electrically via a parallel data transmission/reception cable. Dot image data is created with thehost computer20 and transferred to thelaser printer30 for printing. Thehost computer20 transfers compressed image data, which thelaser printer30 expands and prints. The parallel data transmission/reception cable conforms to the IEEE1284 standard and can transfer data from thelaser printer30 to thehost computer20.
The[0064]host computer20 includes a personal computer provided with a CPU, RAM, ROM, hard drive, I/0 interface, and the like; and such functional components as anapplication program21 and aprinter driver22 for creating output data. Theapplication program21 can be a word processor or CAD application program, for example, with printing functions. Theprinter driver22 develops and compresses image data corresponding to printing data for thelaser printer30. The resulting data is the output data.
The[0065]host computer20 also includes aspooler23 for accumulating output data in anoutput data list26 and transferring the output data in theoutput data list26 to thelaser printer30. Thisspooler23 can be considered as one of the functions of theprinter driver22 or as an independent function. Theoutput data list26, more specifically, is constructed with a storage device such as a hard drive.
The[0066]host computer20 also includes a startingpage counter27, an endingpage counter28, and a page outputcomplete counter29 for managing theoutput data list26. The startingpage counter27 and endingpage counter28 indicate the first and last pages, respectively, that are stored in theoutput data list26. However, the endingpage counter28 indicates the last complete page. The page outputcomplete counter29 indicates the last page output to thelaser printer30. Thecounters27,28, and29, more specifically, are constructed with RAM.
The[0067]host computer20 can be used to set an error recovery function to resend data for a page in which an error occurred in thelaser printer30. The user can preset this error recovery function to either ON or OFF. The setting information for the error recovery function is then sent along with a command to thelaser printer30.
The[0068]host computer20 manages data and output pages in theoutput data list26 according to the counters27-29 described above. More specifically, the page outputcomplete counter29 is incremented after one page of data has been output, indicating the next page that needs to be output. Hence, if an error occurs when the error recovery function described above is set to ON, the page outputcomplete counter29 is decremented one to return to the previous page, in order that the same page is output again.
The ending[0069]page counter28 is incremented every time one page of data is stored in theoutput data list26. Data is output only when this endingpage counter28 is of a larger value than the page outputcomplete counter29.
The starting[0070]page counter27 is set to the number of pages that have been printed plus one. The number of pages that have been printed is determined based on a value stored in anonvolatile memory53 of thelaser printer30, which will be described later. Thehost computer20 deletes all data from theoutput data list26 for pages previous to page specified by the startingpage counter27, in order to make efficient use of the storage space.
The[0071]laser printer30 has aprinter engine31 including various mechanisms, such as a printing mechanism for printing by a laser light method and a paper feed mechanism, and acontrol unit32 for controlling the various mechanisms of theprinter engine31. A more detailed description of theprinter engine31 will be omitted as it is well known in the art.
As shown in FIG. 2A, the[0072]control unit32 is provided with aCPU40; a crystal oscillator41 for supplying a clock pulse to theCPU40; aROM42 with a built-in printing control program; aRAM43 provided with various work memories; atimer44 used for time interruptions; a transmission/reception circuit45 for transmission and reception between thehost computer20; areception buffer46; anencoding circuit47 for encoding compressed image data received from thereception buffer46; aline buffer48 for temporarily storing image data encoded by theencoding circuit47 before outputting the data as serial image data; aDMA controller49 capable of directly accessing thereception buffer46 and theline buffer48; a printer drive I/O interface50; a printer drive circuit-51; and acontrol panel52. Thecontrol unit32 also includes thenonvolatile memory53 for storing the accumulated number of printed pages.
A[0073]bus54 is provided for connecting theROM42,RAM43, transmission/reception circuit45.DMA controller49,printer drive circuit51, andnonvolatile memory53 to theCPU40. Also, an interruptsignal line55 is provided for connecting thetimer44, transmission/reception circuit45, printer drive I/O interface50, and encodingcircuit47 to theCPU40.
The[0074]DMA controller49 is connected to thereception buffer46 and theline buffer48, and also to theencoding circuit47.
Parallel compressed image data received from the[0075]host computer20 via the transmission/reception circuit45 is written to thereception buffer46 by theDMA controller49. Then, the image data is read from thereception buffer46 and supplied to theencoding circuit47 by theDMA controller49, where it is encoded. Next, the encoded dot image data is supplied from theencoding circuit47 to theline buffer48. From theline buffer48, the data is supplied as serial image data to theprinter drive circuit51, and theprinter engine31 is driven by drive signals corresponding to the dot image data.
When the printing of one page has completed, the[0076]CPU40 increments the accumulated value stored in thenonvolatile memory53 by1. Theprinter engine31 also includesvarious sensors35, such as a paper jam sensor for detecting when paper has become jammed. TheCPU40 keeps track of what thesesensors35 detect.
The[0077]reception buffer46 is configured as a so-called ring buffer. TheDMA controller49 controls the reading and writing of data by using a read pointer RP and a write pointer WP in thereception buffer46. The read pointer RP indicating the data read address and the write pointer WP indicating the data write address will be explained using a schematic drawing.
As shown in FIGS. 3A through 3C, data is written into the[0078]reception buffer46 in the direction of the arrows, beginning from the bottom. When the writing position for the data reaches the top of the buffer, the writing begins again from the bottom of the buffer and continues in an upward direction. Reading of data is performed in the same manner, beginning from the bottom end, moving upward to the top end, and starting over from the bottom end. Hence the write pointer WP and read pointer RP also move in the direction indicated by the arrows. The relationship of the two pointers is such that the write pointer WP cannot overtake the read pointer RP. If the write pointer WP were to overtake the read pointer RP, new data would be written over data that had not yet been read. In the same way, the read pointer RP cannot overtake the write pointer WP, because the read pointer RP would attempt to read data from an area to which data had not yet been written.
FIGS. 3A through 3C show the different types of relationships that are possible between these two pointers. The areas with hatching in the drawings indicate memory areas storing unread data.[0079]
FIG. 3A corresponds to a case in which one page of data is smaller than the capacity of the[0080]reception buffer46. Here, the write pointer WP stopped just after a form feed command FF, signifying the end of data, was written. Then the read pointer RP begins to move, and data is read.
In the case of FIG. 3B, one page of data is larger than the capacity of the[0081]reception buffer46, and, hence, the entire page cannot be stored. Therefore, when thereception buffer46 becomes full, the reading of data is begun while moving the read pointer RP. After the reading is completed, the writing continues. This process is what was referred to above as printing on the fly. In this situation, reading is begun before a form feed command FF is written. Thus, both the read pointer RP and the write pointer WP are in a state of continual movement. When WP=RP −1, a busy signal is given to prevent more data from being written and, thus, prevent the write pointer WP from overtaking the read pointer RP.
In the cases of FIGS. 3A and 3B, printing can be performed normally, but printing cannot be performed normally in case of FIG. 3C. In other words, when printing on the fly, the read pointer RP catches up to the write pointer WP, and printing cannot be performed do to the moving speeds of the two pointers. This situation is called print overrun. In print overrun, if the page is reprinted, the same error will recur due to the relationships of the size of data on the page, the capacity of the buffer, and the speeds of the pointers RP and WP.[0082]
The following is clear from the position relationships of the read pointer RP and the write pointer WP as described above.[0083]
(1) Printing on the fly is the condition in which the write pointer WP is directly behind the read pointer RP when printing begins.[0084]
(2) Print overrun is the condition in which the read pointer RP is directly behind the write pointer WP during printing.[0085]
Thus, the above conditions can be detected by checking the positions of the two pointers at the beginning of printing and during printing, Further, the condition (1) can be detected by checking whether both pointers are moving or not during printing.[0086]
Next, an error surveillance control in the host-based[0087]printing system10 of the present embodiment will be described. In the present embodiment, this error surveillance control process is performed in thelaser printer30. A detailed structure of this process is given in FIG. 4. Hereinafter, the process of FIG. 4 will be called the first embodiment.
In the error surveillance routine of the first embodiment, moving state of the read pointer RP and the write pointer WP by the[0088]DMA controller49 is checked to determine whether condition (2), or print overrun, has occurred (S10). If the occurrence of a print overrun is determined (S10: yes), a BUSY signal is output to thehost computer20 for a sufficient length of time (about 10 seconds, for example), and a reset process is executed (S20). Data sent from thehost computer20 after the BUSY signal has stopped is read and discarded up to the form feed FF (S30).
At step S[0089]20, thehost computer20 stops transmitting data temporarily, but resumes the transmission of data when the BUSY signal stops. At this point, if the error recovery function is Set to OFF, data transmission will continue from where it left off in the page when the error occurred. As the data transmitted is incomplete, the data is read to the end of the page and discarded to prevent an illegal command error from occurring.
If the error recovery function is set to ON, the data for the page in which the print overrun occurred will be retransmitted when transmission resumes. In this case, the complete data for the page will be transmitted, but, as described above, print overrun is a recurring error. Thus, to prevent the print overrun from recurring, in step S[0090]30 data will be read and discarded until the first form feed FF is read.
If, on the other hand, a print overrun has not occurred (S[0091]10: No), the paper jam sensor of thesensors35 is checked to determine whether a paper jam has occurred (S40). If a paper jam has occurred (S40: Yes), the process is suspended until the cover on the printer has been opened and the jammed paper removed (S50).
After the paper jam has been cleared (S[0092]50: Yes), the process returns to S10 after reset (S70) if the error recovery function is set to ON (S60: Yes). The error recovery setting is determined from data sent together with a command from thehost computer20. If the error recovery function is set to OFF (S60: No), a printing on the fly condition is checked for from results of checking the positions of the pointers WP and RP at the start of printing (S80). If the printer is currently printing on the fly, the process shifts to step S20. Thus, when the error recovery function is set to OFF and the printer is printing on the fly, thehost computer20 will continue to transmit the remaining data for a page in which a paper jam occurred. The process shifts to step s20 to read and discard this remaining data.
On the other hand, if the printer is not printing on the fly the process returns to step S[0093]10 after performing a reset (S70). Because the printer is not printing on the fly, thehost computer20 will transmit data beginning from the top of the page following the page In which the paper jam occurred. This data need not be discarded.
Data is not read and discarded after a paper jam when the error recovery function is ON because a paper jam is not a data-caused error and, therefore, is not a recurring type of error. Thus, setting error recovery to ON will cause the page to be reprinted.[0094]
Therefore, in the present embodiment, print overrun and paper jam errors that occur when printing can be smoothly recovered from without causing an illegal command error to occur and without repeating the same error.[0095]
Next, the second embodiment of the present invention will be described.[0096]
In the second embodiment, error surveillance control is performed in the[0097]host computer20. As shown in FIG. 5, a printing control routine in thehost computer20 checks for status data from the laser printer30 (S110).
In the present embodiment, status data is sent from the[0098]laser printer30 to thehost computer20, and at least the messages “paper jam,” “print overrun,” and “print on the fly” can be distinguished in that status data. As in the first embodiment, thelaser printer30 detects conditions such as paper jam and print overrun by monitoring signals from the paper jam sensor of thesensors35 and by checking the positions of the write pointer WP and the read pointer RP.
If there is no status data from the laser printer[0099]30 (S110: No), the output data stored in theoutput data list26 is transmitted to the laser printer30 (S120). However, if there is status data from the laser printer30 (S110: Yes), the data must be checked for a paper jam message (Sl30).
If the data indicates a paper jam has occurred (S[0100]130; Yes), the data must be checked further for a printing on the fly message (S140). If the data indicates the printer is printing on the fly (S140: Yes), the setting of the error recovery function must be checked (S150). If the error recovery function is ON (S150: Yes), the input prime signal (IP) is set to low (S160) in order to send a reset command to thelaser printer30. Then, data is retransmitted from the top of the page in which the paper jam occurred (S170). On the other hand, if the error recovery function is not ON (S150: No), the IP is set to low (S180), and the data for the page currently being transmitted is deleted until the end of the page (S190).
If a paper jam occurred but the printer is not printing on the fly (S[0101]140: No), steps S160 and S170 are executed the same as when the printer is printing on the fly, providing the error recovery function is ON (S200: Yes). If the error recovery function is not ON (S200: No), however, only the IP is set to low (S210). Since the printer is not printing on the fly, the data for the page in which the paper jam occurred has been completely output, making it unnecessary to delete data until the end of the page.
When the status data does not indicate a paper jam (S[0102]130: no), the data is checked for a print overrun message (S220). If a print overrun has occurred (S220: Yes), the IP is set to low (S180), regardless of the error recovery function setting, and a process is executed to delete data until the end of the page (S190). The error recovery setting is ignored because print overrun is a recurring error.
When receiving a command to set IP to low, the[0103]laser printer30 executes a reset procedure, clearing thereception buffer46 and theline buffer48. When a paper jam occurs and the error recovery is set to ON, data for the page in which the paper jam occurred is received again and reprinted. When error recovery is set to OFF, data is received beginning from the top of the next page. If a print overrun occurs, however, the printer will skip that page and begin receiving data from the top of the next page, regardless of the error recovery setting.
Therefore, in the second embodiment, print overrun and paper jam errors that occur when printing can be smoothly recovered from without causing an illegal command error to occur and without repeating the same error.[0104]
A third embodiment of the present invention will next be described while referring to FIGS. 2B.[0105]6 and7. FIG. 2B shows thecontrol unit32 which is similar to that shown in FIG. 2B except for the provision of a sensor I/O interface65 forsensors60 provided to theprinter engine31. Thesensors60 include a paper jam sensor for detecting when paper has become jammed. TheCPU40 receives detection signals from thesensors60 during timer interruptions.
In the host-[0106]base printing system10 provided with thecontrol unit32 shown in FIG. 2B, the following processes are executed in thehost computer20.
As sown in FIG. 6, when a print process starts, the[0107]host computer20 requires theprinter30 to send an accumulated value Σ in thenonvolatile memory53. The accumulated value Σ received from theprinter30 is stored set torespective counters27 through29 as an initial value (S210). Next, the count value C27 of the startingpage counter27 is incremented by one (S220). Output data is created by theapplication program21 and theprinter driver22 and stored in theoutput data list26 through the spooler23 (S230). Next, whether or not one page worth output data has been stored in theoutput data list26 is determined (S240). When the determination made in S240 is affirmative (S240: Yes), the count value C28 of the endingpage counter28 is incremented by one (S250). Next, based on the status information sent from theprinter30, it is confirmed that theprinter30 is ready for printing (S260). This step is necessary to carry out printing. When theprinter30 is ready for printing, data stored in theoutput data list26 corresponding to (C29+1) page is output to the printer30 (S270), and then the count number of the page outputcomplete counter29 is incremented by one (S280).
On the other hand, when the determination made in S[0108]240 is negative, it Is determined that a relationship of C28>C29 is met (S290). This step is for determining whether or not more than one page worth of data has been stored in theoutput data list26. When the determination made in step290 is affirmative, the routine proceeds to S260 where data is output to theprinter30. In this manner, the output data is sequentially output on a page basis until sending of the last page data stored in theoutput data list26 is complete.
When the[0109]printer30 is busy or when C28≦C29, data is not output, and it Is checked whether or not there is a transfer information from the printer (S300). When there exists the transfer information from theprinter30, the accumulated value Σ is retrieved from thenonvolatile memory53 and determination is made as to whether or not a relation of Σ≧C27 is met (S310). It is to be noted that the accumulated value Σ represents the page that could successfully printed. Therefore, if Σ≧C27, it is no longer necessary to keep on holding the data up to the Σ page in the data currently stored in theoutput data list26. The output data up to the Σ page is erased (S320) and the count value C27 in thecounter27 Is set to Σ+1 (S330).
Next, it is checked if the print error has occurred in the printer[0110]30 (S340). If the print error has not occurred, the routine returns to S220 whereupon storage of the output data in theoutput data list26 is resumed. On the other hand, when the print error has occurred, a command is issued to theprinter30 to clear the reception data (S350). A printed page Σ is set to the count value C29 of thecounter29, whereupon the routine returns to S220 (S360). Whether or not the print error has occurred in theprinter30 is determined based on the contents of the transfer information transferred from theprinter30.
The third embodiment is configured so that after one page worth data is outputs it is confirmed that the transfer data is prepared in the printer[0111]30 (S230 to S300). Absent any information regarding print error or the like, the printed page Σ is set as the transfer information when the same has been updated. In such a situation, steps S310 et sea are also executed. In this case, however, since the print error has not occurred, the routine directly returns to S230 from S340.
Next, the control process of the[0112]printer30 will be described.
As shown in FIG. 7, the[0113]printer30 checks the current processing condition (S410), whereupon various processes including checking of the status (S420), resetting the engine (S430), feeding a paper (S440), cancellation of paper error (S500) and the like are executed. In the status check, the various kinds of sensors are checked. When the printer is incapable of receiving data from thehost computer20 by the detection of abnormality, such as full of thereception buffer46 or print error, a busy signal is output to thehost computer20 as a status signal. When a clear command for clearing the data received from thehost computer20 is output, the data in thereception buffer46 and theline buffer48 is cleared (S450).
With the arrangement as describe above, the host-based[0114]printing system10 according to the third embodiment will operate in a manner to be described below.
When, for some reason, a print error occurs in the[0115]printer30, theprinter30 sends the busy signal to thehost computer20 as the status signal. Also, theprinter30 will prepare transfer information to be conveyed to thehost computer20 through a bi-directional communication in order to indicate that the print error has occurred. This transfer information together with the printed page Σ are output to thehost computer20 in response to the interrogation from thehost computer20 in the process of S300. Upon receipt of these pieces of data from theprinter30, thehost computer20 Instructs theprinter30 to clear the reception data currently retained in theprinter30. Concurrently, thehost computer20 returns the output completion page to the printed page (S340 to S360). Accordingly, in theprinter30, the reception data is cleared (S450) to erase incomplete data. In thehost computer20, as a result of decrementing C29, the data on the page which results in print error is retransmitted in S260. In this case, it is required that the error on part of theprinter30 be resolved and the status of the printer return to a ready condition (S260: Yes). As such, in the third embodiment of the invention, the data for the print error page is retransmitted to allow the data to be printed. When performing reprinting, residual incomplete data does not remain in the printer so that printing trouble will not occur caused thereby.
When no printing error occurred, the leading data to be retained in the[0116]output data list26 is specified based on the accumulated value Σ in thenonvolatile memory53 each time one page worth data is output therefrom. The data corresponding to the pages preceding to the page in the current page is erased (s310 to S330). Thus, an extra amount of storage capacity needs not be provided in theoutput data list26 to perform reprinting.
Although the present invention has been described with respect to specific embodiments, it will be appreciated by one skilled in the art that a variety of changes and modifications may be made without departing from the scope of the invention. For example, although, in the third embodiment, the accumulated value Σ of the print page number is retrieved and the initial values of the[0117]counters27 through29 are set, the initial values of thecounters27 through29 may be zero and the number of pages counted from the start of print may be output from the printer.