Patent Description:
Conventionally, there has been proposed Line Printer Remote (LPR) printing in which a printer on which an Line Printer Daemon (LPD) is running is instructed to perform printing using an LPR command from a host PC. In LPR printing, the host PC is requested, by regulations of the Request For Comment (RFC) <NUM>, to notify the printer of the size information of print data prior to transmission of the print data. There is known a printing system that disconnects the communication connection between the host PC and the printer after having completed transmission of print data from the host PC to the printer, by setting a value indicating a larger size than that of the actual print data in the notification of such size information.

With regard to data communication between the host PC and the printer, <CIT> discloses a control method for setting, at the printer side, a shorter time-out time than a predetermined time-out time of the host PC to stop and resume printing. In addition, <CIT> discloses a control method for notifying from the printer to the host PC of a size of data receivable by a receiving buffer. <CIT> discloses a communication apparatus which determines whether to automatically stop a wireless communication function based on a device setting and a type of SSID used.

<CIT> discloses a printing apparatus which controls the time period for disconnecting a remote connection upon detection of a paper jam or maintenance event interrupting a print job.

In a printing system, generally, a data spool mechanism is introduced in order to smoothly receive print data in parallel with the printing operation. The data spool (spool area) includes a memory area of a predetermined size. Even when print data exceeding the size of the data spool is transmitted from the host.

PC to the printer, free area of the data spool will never be exhausted as long as the printing operation is smoothly performed in the printer. However, free area in the data spool may be exhausted when the printing operation is stopped due to occurrence of an error such as out-of-paper or paper jam.

When free area in the data spool is exhausted, the transmission of print data from the host PC to the printer may stop halfway through. In such a state, disconnection of the communication connection occurs between the host PC and the printer, when, for example, transition to sleep or rebooting occurs in the host PC, or when transition to sleep (error sleep) occurs in the printer without the error being resolved. As a result, it is no longer possible to normally perform a cancel operation of the print job in the printer, and printed material may be output with occurring an abnormality such as an incorrect character string printed thereon. In addition, when the size of the print data is smaller than the size of the data spool, the print job may disappear even though there is no cancel operation performed.

Accordingly, the present invention provides a technique that allows for normally resuming a printing process even when reception of print data from an external apparatus is stopped halfway through in a printing apparatus.

The present invention in its first aspect provides a printing apparatus as specified in claims <NUM> to <NUM>.

The present invention in its second aspect provides a method for controlling a printing apparatus as specified in claim <NUM>.

<FIG> illustrates an exemplary wireless network configuration according to the present reference example outside the scope of the claimed invention. A MultiFunction Peripheral (MFP) <NUM> is connected to a Local Area Network (LAN) <NUM>. Although the LAN <NUM> may be configured as a wired LAN, it may also be configured as a wireless LAN. The LAN <NUM> also has PCs <NUM> and <NUM> connected thereto. The MFP <NUM> can communicate with the PCs <NUM> and <NUM> via the LAN <NUM>. The PCs <NUM> and <NUM> can cause the MFP <NUM> to execute a print job by transmitting the print job to the MFP <NUM> via the LAN <NUM>. The PCs <NUM> and <NUM> may also be referred to as client PCs or host PCs.

<FIG> is a block diagram illustrating an exemplary hardware configuration of the MFP <NUM>. The MFP <NUM> includes a controller (control unit) <NUM> as well as an operation unit <NUM>, a printer (printer engine) <NUM>, and a scanner <NUM> connected to the controller. The controller <NUM> includes a CPU <NUM> and configured to control the operation of the MFP <NUM> as a whole. The controller <NUM> further includes the CPU <NUM>, a RAM <NUM>, a ROM <NUM>, a hard disk drive (HDD) <NUM>, an operation unit interface (I/F) <NUM>, a printer I/F <NUM>, a scanner I/F <NUM>, and a LAN I/F <NUM>.

The CPU <NUM> performs various control or processing such as communication control and image processing by loading to the RAM <NUM> a control program stored in the ROM <NUM> or the HDD <NUM>, and reading and executing the loaded control program. The RAM <NUM> is a volatile storage medium (storage apparatus) used as a main memory and a work area of the CPU <NUM>. The HDD <NUM> is a non-volatile storage medium (storage apparatus). The HDD <NUM>, having various data and programs stored therein, is also used for temporarily storing image data generated in a printing process or a copying process. As such, hardware components such as the CPU <NUM>, the ROM <NUM>, the RAM <NUM>, the HDD <NUM> or the like make up a so-called computer. Although it is assumed in the MFP <NUM> of the reference example that a single CPU <NUM> uses a control program loaded in a single memory (RAM <NUM>) to execute each process illustrated in the flowchart described below, other aspects are also conceivable. For example, each process illustrated in the flowchart described below can also be executed by coordinating a plurality of processors, memories, and storages.

The printer I/F <NUM> is an interface configured to connect the printer <NUM> and the controller <NUM>. The printer <NUM> performs a printing process for printing (forming) an image on a sheet fed from a sheet feed unit (not illustrated) such as a sheet feed cassette, based on the image data input from the controller <NUM> via the printer I/F <NUM>. The printer <NUM> performs image forming by an electrophotographic type or an ink-jet type, for example.

The scanner I/F <NUM> is an interface configured to connect the scanner <NUM> and the controller <NUM>. The scanner <NUM> reads an image of an original document placed on a document base to generate image data. The image data generated by the scanner <NUM> is input to the controller <NUM> via the scanner I/F <NUM>, and may be used for printing by the printer <NUM>, stored in the HDD <NUM>, or transmitted to an external apparatus via the LAN I/F <NUM>.

The operation unit I/F <NUM> is an interface configured to connect the operation unit <NUM> and the controller <NUM>. The operation unit <NUM> accepts a user operation (e.g., operations for various settings of the MFP <NUM>). The operation unit <NUM> includes a display device (display unit) configured to display a screen, and can display a state of the MFP <NUM>, for example.

The LAN I/F <NUM> is a communication I/F connected to the LAN <NUM> and can communicate with an external apparatus via the LAN <NUM>. The CPU <NUM> can, for example, transmit the image data generated by the scanner <NUM> to an external apparatus via the LAN I/F <NUM>, or receive, from an external apparatus, print data including image data for printing by the printer <NUM>. Here, the MFP <NUM> may further include a wireless LAN I/F that can connect to the wireless LAN.

<FIG> is a block diagram illustrating an exemplary software configuration (functional configuration) of the MFP <NUM>. The function of each block (software) illustrated in <FIG> is implemented in the MFP <NUM> by the CPU <NUM> that reads out to the RAM <NUM> and executes a program stored in the ROM <NUM> or the HDD <NUM>.

An operation control unit <NUM> displays a user-oriented screen (operation screen) on the operation unit <NUM>, and accepts a user operation via the operation unit <NUM>. The operation control unit <NUM> performs a process relating to a display object, such as a button on the display screen, in accordance with the accepted user operation. In the present reference example, for example, the operation control unit <NUM> displays on the operation unit <NUM> a setting screen <NUM> illustrated in <FIG> and described below. The operation control unit <NUM> can further accept a setting of whether or not to disconnect, from the MFP <NUM> side, the connection with the external apparatus in a case where a predetermined time has elapsed in a state where reception of print data from the external apparatus (host PC) remains stopped.

Based on a request from each functional unit (control unit), a data storage unit <NUM> stores data such as setting values in the ROM <NUM> or the HDD <NUM>, and reads the stored data. For example, when the user desires to change the setting of a certain device, the operation control unit <NUM> accepts the user's input via the operation unit <NUM> and requests the data storage unit <NUM> to store the setting value corresponding to the input contents. The data storage unit <NUM> stores the setting value in the ROM <NUM> or the HDD <NUM> in accordance with the request from the operation control unit <NUM>. In addition, the data storage unit <NUM> secures, in a storage area of a volatile memory such as the RAM <NUM> or a non-volatile memory such as the HDD <NUM>, a spool area (data spool) that temporarily stores print data received from the external apparatus (host PC).

An environment setting unit <NUM> performs environment setting of the MFP <NUM>, when activating the system or upon detecting change of the setting, in accordance with the setting value stored in the data storage unit <NUM>. Specifically, the environment setting unit <NUM> performs various network settings including setting of IP address, and various parameter settings for the print function and copy function included in the MFP <NUM>.

NW apps <NUM> to <NUM> are application modules that operate on the MFP <NUM> to execute network functions. Although there will be described a configuration in which these three NW apps operate on the MFP <NUM> in the present reference example, any number of applications may operate on the MFP <NUM> as long as they are applications that realize the functions of the MFP <NUM> using the network function.

The NW app <NUM> is a Line Printer Daemon (LPD) module corresponding to an LPD protocol. The LPD module is an application that performs a reception process for receiving print data from an external apparatus such as the PC <NUM> using a Line Printer Remote (LPR) command. Here, the specification of LPD is standardized by RFC <NUM>. The NW app <NUM> is a RAW module. The RAW module is an application that performs a reception process for receiving print data from an external apparatus such as the PC <NUM> using a port <NUM> of the TCP/IP. The NW app <NUM> is an application for managing device information of the MFP <NUM>.

The NW app <NUM> collects information of device configurations and consumables of the MFP <NUM> in response to a request from an external apparatus such as the PC <NUM>, and outputs a response including the collected information. In the present reference example, the NW app <NUM> is configured as a Simple Network Management Protocol (SNMP) agent that outputs the device information in the form of a management information base (MIB object) in accordance with SNMP defined in the RFC <NUM>.

A network control unit <NUM> is formed of protocol stacks and is configured as part of an OS that collectively controls the controller <NUM>. Generally, a protocol stack is equivalent to a program group having software functions stacked in a hierarchical manner, the group including a plurality of programs respectively corresponding to protocols for implementing the network functions. The protocol stack may be formed of a session layer, a transport layer, a network layer, and a data link layer, conforming to the OSI reference model. The session layer performs connection control or the like. The transport layer manages data transfer. The network layer controls address management and path selection. The data link layer performs identification and transfer of data frames. The network control unit <NUM> (protocol stack) of the present reference example further includes a device driver <NUM> for controlling the LAN I/F <NUM>.

A network control API <NUM>, being an API library for invoking a protocol stack included in the network control unit <NUM>, is provided in the OS as a general socket function (socket API). The environment setting unit <NUM> and the NW apps <NUM> to <NUM> perform data communication conforming to respective communication protocols by setting parameters in the network control API <NUM> and invoking the network control API.

A job control unit <NUM> controls execution of respective jobs of a plurality of functions (such as copy function, print function, and file transmission function) included in the MFP <NUM>. When executing a print job, the job control unit <NUM> uses the NW app <NUM> to establish a connection with an external apparatus (host PC) in accordance with an LPD protocol. The job control unit <NUM> receives print data transmitted from the external apparatus via the established connection, and temporarily stores the received print data in the spool area.

A printing process unit <NUM> performs a printing process based on the print data received from an external apparatus and stored in the spool area, in accordance with an instruction from the job control unit <NUM>. Specifically, the printing process unit <NUM> interprets the print data to generate image data, transmits the generated image data to the printer <NUM> via the printer I/F <NUM>, and causes the printer <NUM> to print the image data.

A scanning process unit <NUM> causes, via the scanner I/F <NUM>, the scanner <NUM> to read an image of an original document to generate image data, and store the image data in the HDD <NUM> as scanned image data, in accordance with an instruction from the job control unit <NUM>.

Note that the printing process unit <NUM> can also read out the scanned image data stored by the scanning process unit <NUM>, and perform a printing process based on the image data. For example, when executing a copy function, the operation control unit <NUM> instructs the job control unit <NUM> to execute the copy function, upon accepting an execution instruction of the copy function from the user via the operation unit <NUM>. The job control unit <NUM> instructs the scanning process unit <NUM> to read the original document, and acquires the scanned image data from the scanning process unit <NUM>. By instructing the printing process unit <NUM> to perform a printing process based on the acquired scanned image data, the job control unit <NUM> further outputs a sheet having the image of the original document printed thereon as a copy result of the original document.

<FIG> illustrates a part of the RFC <NUM> specification defining a Line Printer Daemon (LPD) protocol, and illustrates a specification of the LPR command which is a control command relating to the received data file. As illustrated in this figure, this LPR command has stored therein size information (number of bytes) of a data file next to a command code "<NUM>", and further a name of the data file next to a one-character space. The LPR command has been transmitted from the host PC to the printing apparatus (MFP <NUM>) on which the LPD is running, before transmission of a main body of the print data is performed.

<FIG> illustrates an exemplary setting screen (setting screen <NUM>) for setting a print port at the host PC side that instructs the MFP <NUM> to execute printing using an LPR command. In the setting screen <NUM>, "RAW", "IPP" and "LPR" can be selected as a printing protocol (communication protocol) to be used. In the example of <FIG>, "LPR" is selected as the printing protocol, as indicated by a reference numeral <NUM>. The setting screen <NUM> also allows for setting whether or not to enable an LPR byte count, as an LPR setting. In the example of <FIG>, a setting that turns the LPR byte count "OFF" is selected as the LPR setting, as indicated by a reference numeral <NUM>. In other words, a setting that does not enable the LPR byte count is selected.

<FIG> illustrates an example of reception packets including a LPR command in a case where the LPR byte count is enabled (LPR byte count = ON). In the packet illustrated in <FIG>, a predetermined range starting from the position of the command code "<NUM>" indicated by reference numeral <NUM> corresponds to the LPR command indicating the received data file. As has been described referring to <FIG>, the size information <NUM> has appropriately set therein size information indicating the size of the print data to be transmitted from the host PC to the printing apparatus (MFP <NUM>), in a case where the LPR byte count is enabled at the host PC side. In the present example, a size of "<NUM>" bytes has been set as the size information <NUM>.

<FIG> illustrates an example of reception packets including the LPR command in a case where the LPR byte count is not enabled (LPR byte count = OFF). In the packet illustrated in <FIG>, a predetermined range starting from position of the command code "<NUM>" indicated by reference numeral <NUM> corresponds to the LPR command indicating the received data file. The size information <NUM> has not appropriately set therein the size information indicating the size of the print data to be transmitted from the host PC to the printing apparatus (MFP <NUM>). In the present example, a size of "<NUM>" bytes (≈ <NUM> [TB]) is set as the size information <NUM>, in other words, size information indicating a large imaginary file size is set.

<FIG> illustrates an example of a setting screen (setting screen <NUM>) displayed on the operation unit <NUM> of the MFP <NUM> according to the present reference example. The setting screen <NUM> is used for performing setting related to printing by the LPD. The setting screen <NUM> includes setting items <NUM> to <NUM> as those for the network settings (LPD settings). The setting item <NUM> indicates whether or not to use the LPD printing function. The setting can be made using the ON and the OFF button. The operation control unit <NUM> performs display control of the operation unit <NUM> so that either the ON or OFF button is selected according to the user operation with respect to the setting item <NUM>. In order to use the LPD printing function on the MFP <NUM>, the user needs to select the ON button with respect to the setting item <NUM>.

The setting item <NUM> indicates whether or not to print a banner page for each print job in LPD printing. The setting can be made using the ON and the OFF button. The operation control unit <NUM> performs display control of the operation unit <NUM> so that either the ON or OFF button is selected according to the user operation with respect to the setting item <NUM>. When a setting is made to print a banner page (not illustrated), information such as a user name of the user who has instructed execution of the print job, and the file name used to execute the print job are printed as a partition page of the print job.

The setting item <NUM> indicates a setting of the operation (behavior) of the MFP <NUM> after the printing operation is stopped due to, for example, out-of-paper or paper jam, and a predetermined time has elapsed therefrom. The setting can be made using a drop-down list <NUM>. Specifically, a setting is made either to keep waiting while maintaining the TCP/IP connection with the host PC ("standby with connection"), or to disconnect the TCP/IP connection ("disconnect connection"). The setting of the setting item <NUM> is reflected in the setting value of a reset response flag stored in the ROM <NUM> or the HDD <NUM>.

The reset response flag indicates whether or not to disconnect the connection (TCP/IP connection) with the external apparatus from the printing apparatus side (the MFP <NUM> side), in a case where a predetermined time has elapsed while reception of print data from the external apparatus (host PC) remains stopped. When "standby with connection" is selected as a setting of the setting item <NUM>, the reset response flag is set to OFF. In other words, a setting is made not to disconnect the connection with the external apparatus from the printing apparatus side (MFP <NUM> side), in a case where a predetermined time has elapsed while reception of print data from the external apparatus (host PC) remains stopped. In a case where, on the other hand, "disconnect connection" is selected as a setting of the setting item <NUM>, the reset response flag is set to ON. In other words, a setting is made to disconnect the connection with the external apparatus from the printing apparatus side (the MFP <NUM> side), in a case where a predetermined time has elapsed while reception of print data from the external apparatus (host PC) remains stopped. Disconnection of the connection is performed by transmitting an RST packet (RST command) to the external apparatus (host PC) as a disconnection request for requesting to disconnect the connection.

Pressing (touching) a setting reflection button <NUM> on the setting screen <NUM> causes the setting contents on the setting screen <NUM> to be enabled by being stored by the data storage unit <NUM>. The NW app <NUM> (LPD module) refers to and uses the stored setting contents. Subsequent to pressing of the setting reflection button <NUM>, the operation control unit <NUM> causes the display screen of the operation unit <NUM> to transition from the setting screen <NUM> to a setting screen (not illustrated) relating to higher-level setting items. In a case where, on the other hand, the cancel button <NUM> is pressed, similar transition of the display screen is performed without the setting contents being reflected.

<FIG> is a flowchart illustrating a procedure of a print data reception process to be performed by the CPU <NUM> in the MFP <NUM> according to the present reference example. The processing at each step of <FIG> can be realized in the MFP <NUM> by the CPU <NUM> by reading out a program stored in the ROM <NUM> or the HDD <NUM> to the RAM <NUM> and executing the program thereon.

Upon the MFP <NUM> being powered ON, the CPU <NUM> performs various initialization processes (not illustrated). Thus, upon the MFP <NUM> being available as a printer connected to the network, the CPU <NUM> starts execution of the process according to the procedure illustrated in <FIG>.

First, at step S701, the CPU <NUM> enters a standby state to wait for establishment of a connection based on TCP/IP. Upon receiving a request packet for communication establishment from the host PC (external apparatus) such as the PC <NUM> or <NUM> via the LAN I/F <NUM>, the CPU <NUM> establishes connection with the host PC according to the request packet.

After having established the connection, the CPU <NUM> determines at step S702 whether or not the request from the host PC in the established connection is a printing request (LPR printing request) by an LPR command. Upon determining that the request from the host PC is not an LPR printing request, the CPU <NUM> advances the process to step S703, or advances the process to S704 upon determining that the request is an LPR printing request.

At step S703, the CPU <NUM> receives print data from the host PC by a different type of reception process other than the reception process based on the LPR printing request, and terminates the process. Here, the different type of reception process may be based on, for example, a printing request according to the RAW Protocol (TCP port <NUM>), or a printing request according to the IPP (Internet Printing Protocol). Subsequently, the CPU <NUM> starts execution of the process according to the procedure illustrated in <FIG>, and enters the standby state to wait for establishment of connection at step S701.

In the case of advancing the process from step S702 to step S704, the CPU <NUM> determines whether or not an inhibiting factor has occurred that inhibits reception of print data. An inhibiting factor includes, for example, out-of-paper, paper jam, shortage of consumables required for printing, or the like in the MFP <NUM>. Upon occurrence of such an inhibiting factor, reception of print data from the host PC is stopped halfway through (reception can no longer be smoothly performed). For example, in a case where the printing process is stopped and unprocessed print data continues to accumulate in the spool area, and thus free area of the spool area becomes to be in an exhausted state, reception of print data from the host PC (external apparatus) is obliged to be stopped. As such, reception of print data is inhibited.

Upon determining that there has not occurred any inhibiting factor that inhibits reception of the print data, the CPU <NUM> advances the process to step S705. At step S705, the CPU <NUM> receives print data from the host PC via the established connection. Here, the received print data is temporarily stored in the spool area and successively used in the printing process. Subsequently, at step S706, the CPU <NUM> determines whether or not reception of print data has been completed. The print data is transmitted from the host PC in a manner divided into a plurality of packets over the network. The CPU <NUM> therefore determines at step S706 whether or not reception has been completed for all of the plurality of packets in one sequence which have been divided from the print data. In a case where reception of print data is not completed (reception of packets continuing), the CPU <NUM> returns the process from step S706 to step S704 and repeats the process of steps S704 to S706.

Upon completion of receiving the print data, the CPU <NUM> transmits, to the host PC, a reception acknowledgement with respect to the last reception packet, and advances the process from step S706 to step S707. At step S707, the CPU <NUM> disconnects the connection with the host PC by receiving the FIN packet transmitted from the host PC in response to receiving the reception acknowledgement. In other words, transmission of the FIN packet causes disconnection of the connection with the printer (MFP <NUM>) from the host PC side. Upon completion of disconnection of the connection with the host PC in the aforementioned manner, the CPU <NUM> terminates the reception process of print data according to the procedure illustrated in <FIG>.

On the other hand, upon determining at S704 that there has occurred an inhibiting factor that inhibits reception of print data, the CPU <NUM> advances the process to step S708. At step S708, the CPU <NUM> determines whether or not a time-out event has occurred according to a predetermined timer. The predetermined timer, which is activated in accordance with occurrence of an inhibiting factor, is used to measure the elapsed time from occurrence of an inhibiting factor. The CPU <NUM> determines that a time-out event has occurred when the timer reaches a predetermined time (upper limit time). The time-out event is an event indicating that a predetermined time has elapsed (a time-out has occurred) in a state where reception of print data remains stopped without the inhibiting factor that inhibits reception of the print data being resolved. Upon determining that a time-out event has occurred, the CPU <NUM> advances the process to step S709, or returns the process to step S704 upon determining that there is no time-out event having occurred.

At step S709, the CPU <NUM> determines whether or not the reset response flag is set to ON. As described above, the setting value of the reset response flag is stored in the ROM <NUM> or the HDD <NUM>, in accordance with the setting made using the setting screen <NUM>. The CPU <NUM> determines whether or not the reset response flag is set to ON by referring to the stored setting value of the reset response flag.

In a case where the reset response flag is set to ON (i.e., in a case where the setting item <NUM> on the setting screen <NUM> is set to "disconnect connection"), the CPU <NUM> advances the process to step S710. As such, in a case where a setting is made to disconnect the connection with the host PC from the printer side, as an operation when reception of print data is stopped due to occurrence of an inhibiting factor, the CPU <NUM> advances the process to step S710. In a case where, on the other hand, the reset response flag is set to OFF (i.e., in a case where the setting item <NUM> on the setting screen <NUM> is set to "standby with connection"), the CPU <NUM> returns the process to step S704. As such, in a case where a setting is made to maintain the connection with the host PC and standby without transmitting the RST packet to the host PC, as an operation when reception of print data is stopped due to occurrence of an inhibiting factor, the CPU <NUM> returns the process to step S704.

At step S710, the CPU <NUM> transmits, via the LAN I/F <NUM>, the RST packet (RST command) to the host PC which is the transmission source of print data. The RST packet corresponds to a disconnection request of TCP/IP. Transmission of the RST packet causes disconnection of the connection with the host PC proactively from the printer (MFP <NUM>) side.

As such, the CPU <NUM> controls whether or not to disconnect the connection with the external apparatus (host PC) from the MFP <NUM> side, in accordance with the setting (reset response flag setting) preliminarily performed via a user operation. Specifically, the CPU <NUM> transmits the RST packet to the external apparatus in a case where a predetermined time has elapsed in a state where reception of print data from the external apparatus remains stopped, and a setting has been made to disconnect the connection with the external apparatus from the MFP <NUM> side. The RST packet corresponds to a disconnection request for requesting to disconnect the connection. On the other hand, the CPU <NUM> maintains the connection with the external apparatus in a case where a predetermined time has elapsed in a state where reception of print data from the external apparatus remains stopped, and a setting has not been made to disconnect the connection with the external apparatus from the MFP <NUM> side.

Upon completion of disconnection of the connection with the host PC subsequent to transmission of the RST packet at step S710, the CPU <NUM> terminates the reception process of print data according to the procedure illustrated in <FIG>.

In the present reference example, the operation (operation mode) of the MFP <NUM> when reception of print data from the host PC is stopped due to occurrence of an inhibiting factor is switched based on the settings using the setting screen <NUM>. Such operation switching has the following effects.

Let us assume a case where the host PC (PC <NUM> or <NUM>) uses the LPR protocol of a standard TCP/IP port in a Microsoft Windows operating system (OS) for a printing process. In such a case, the standard TCP/IP port is provided with a threshold value for a standby time with connection (time-out time). The print job is canceled at the host PC side in a case where, when reception of print data remains stopped, the connection with the host PC is kept maintained and the printing process does not proceed after the time-out time (reception of print data not resumed) has expired.

The present reference example allows for avoiding the aforementioned problem by setting the setting item <NUM> on the setting screen <NUM> to "disconnect connection". Specifically, before the print job is canceled in the host PC, transmission of the RST packet (S710) causes disconnection of the TCP/IP connection proactively from the MFP <NUM> side. To this end, the predetermined time relating to the time-out event (S708) is defined to be a shorter time than the time-out time until the external apparatus (host PC) cancels the print job in a case where reception of print data by the MFP <NUM> is not resumed. As such, before the print job is canceled in the host PC, a retry operation of printing is performed between the host PC and the MFP <NUM> via the aforementioned standard TCP/IP port. As a result, it becomes possible to avoid cancellation of the print job and output the printed material. In other words, it becomes possible for the MFP <NUM> (printing apparatus) to normally resume the printing process, even when reception of print data from the host PC is stopped halfway through.

Here, the operation control unit <NUM> may be configured so that it can change the predetermined time related to the aforementioned time-out event (S708), in accordance with the user operation accepted via a setting screen (not illustrated) displayed on the operation unit <NUM>.

In addition, let us assume a case where the host PC (PC <NUM> or <NUM>) uses a Common Unix Printing System (CUPS) of a Linux OS in the printing process. In such a case, disconnecting the TCP/connection from the MFP <NUM> side may cause the following problem. When the TCP/connection is disconnected, the print job is stopped in the host PC according to the default setting of the CUPS. Unlike printing processes that use the Windows standard TCP/IP port, print job cancellation does not occur at the host PC. However, in order to resume a stopped print job, it is necessary to log in to the Linux system with an authority equivalent to that of the system administrator to perform a resume operation.

The present reference example allows for avoiding aforementioned problem by setting the setting item <NUM> on the setting screen <NUM> to "standby with connection". In the default setting of the CUPS, a threshold (time-out time) for a standby time with connection is not set in contrast to the Windows standard TCP/IP port. Therefore, keeping standby while maintaining the TCP/IP connection between the host PC and the MFP <NUM> prevents stoppage of the print job in the host PC as has been described above. In addition, the foregoing eliminates the necessity of logging in with an authority equivalent to that of the system administrator to resume the print job. As a result, it becomes possible to normally resume the printing process after the reception inhibiting factor of the print data in the MFP <NUM> has been resolved.

ln the present reference example, as has been described above, the CPU <NUM> establishes a connection with an external apparatus (host PC) in accordance with a predetermined communication protocol, receives print data transmitted from the external apparatus via the connection, and temporarily stores the print data in the spool area. The CPU <NUM> executes a printing process based on the print data stored in the spool area. In a case where reception of print data from the external apparatus is stopped halfway through and a predetermined time has elapsed in a state where the reception remains stopped, the CPU <NUM> further controls whether or not to disconnect the connection with the external apparatus from the MFP <NUM> side, in accordance with a setting preliminarily made by a user operation. Accordingly, it becomes possible to normally resume the printing process even when reception in the MFP <NUM> of print data from the external apparatus is stopped halfway through.

Next, there will be described a second embodiment of the present disclosure. In the following, description of parts similar to those of the first reference example will be omitted.

In the first reference example, in a case where reception of print data remains stopped, switching is performed between transmitting (S710) the RST packet from the printer side, and waiting for reception (S707) of the FIN packet from the host PC, in accordance with settings on the setting screen <NUM>. Settings on the setting screen <NUM> are made in a manner appropriate for the operating system (OS) of the host PC connected to the MFP <NUM>, or appropriate for the print data transmission application used in the host PC.

However, in a case where the MFP <NUM> is shared by a plurality of host PCs, for example, it is also conceivable that a plurality of host PCs each having different OSs (e.g., Windows OS and Linux OS) installed therein are connected to the MFP <NUM>. In such a case, it is desirable that the aforementioned switching of operations, in a case where reception of print data remains stopped, can be dynamically performed to match with the host PC being connected.

In addition, it is also conceivable that, in a case where the host PC is using Windows OS, an application on the Windows OS operates similarly to the CUPS of the Linux OS, instead of a printing process using the standard TCP/IP port of the Windows OS.

In such a case, it is desirable to set the setting item <NUM> on the setting screen <NUM> to "standby with connection", instead of "disconnect connection" in accordance with the printing process using the standard TCP/IP port of the Windows OS.

The present embodiment therefore allows for dynamically performing the aforementioned switching of operations in a case where reception of print data remains stopped in the MFP <NUM>. Specifically, control is performed as to whether or not to disconnect the connection with the external apparatus from the MFP <NUM> side, based on a size of print data transmitted from the external apparatus (host PC) and a size of the spool area for temporarily storing the print data.

<FIG> is a flowchart illustrating a procedure of the print data reception process to be executed by the CPU <NUM> in the MFP <NUM>, according to the present embodiment. The processing at each step of <FIG> can be realized in the MFP <NUM> by the CPU <NUM> that reads out a program stored in the ROM <NUM> or the HDD <NUM> to the RAM <NUM> and executes the program thereon.

The processing of steps S701 to S703 are similar to those in the first reference example. In the present embodiment, the CPU <NUM> advances the process to step S801 upon determining at step S702 that the request from the host PC is an LPR printing request.

At step S801, the CPU <NUM> extracts size information of the print data from the reception packets transmitted from the host PC prior to transmission of the print data for LPR printing. Specifically, size information described in the LPR command is extracted from reception packets including the control command (LPR command) described above referring to <FIG>, <FIG>. As such, the CPU <NUM> acquires a size of the print data from the control command (LPR command) transmitted from the host PC prior to transmission of the print data. Subsequently, at step S802, the CPU <NUM> determines whether or not a size of the print data indicated by the extracted size information exceeds a size of the spool area reserved for spooling the print data.

The CPU <NUM> advances the process to step S803 in a case where a size of the print data exceeds a size of the spool area. At step S803, the CPU <NUM> sets a size exceeded flag to ON (e.g., to a value <NUM>) and advances the process to step S704. On the other hand, in a case where the size of the print data does not exceed the size of the spool area, the CPU <NUM> advances the process to step S804. At step S804, the CPU <NUM> sets the size exceeded flag to OFF (e.g., value <NUM>) and advances the process to step S704. As such, the size exceeded flag being ON indicates that the size of the print data exceeds (surpasses) the size of the spool area. Here, the setting value of the size exceeded flag is stored in the ROM <NUM> or the HDD <NUM>.

The processing of steps S704 to S708 are similar to those of the first reference example. In the present embodiment, upon determining at step S708 that a time-out event has occurred according to a predetermined timer, the CPU <NUM> advances the process to step S805, or returns the process to step S704 upon determining that there has not occurred any time-out event.

At step S805, the CPU <NUM> refers to the setting value of the stored size exceeded flag to determine whether or not the size exceeded flag is set to ON. In a case where the size exceeded flag is set to OFF (i.e., the size of the print data is equal to or smaller than the size of the spool area), the CPU <NUM> returns the process to step S704. And then, the CPU <NUM> waits until the reception inhibiting factor is resolved and reception of print data is resumed. On the other hand, in a case where the size exceeded flag is set to ON (i.e., the size of the print data exceeds the size of the spool area), the CPU <NUM> advances the process to step S710.

At step S710, the CPU <NUM> transmits, via the LAN I/F <NUM>, the RST packet (RST command) to the host PC which is the transmission source of print data, similarly to the first reference example. In other words, transmission of the RST packet causes disconnection of the connection with the host PC proactively from the printer (MFP <NUM>) side.

As such, the CPU <NUM> controls whether or not to disconnect the connection with the external apparatus from the MFP <NUM> side, based on the size of the print data transmitted from the external apparatus (host PC) and the size of the spool area. Specifically, the CPU <NUM> transmits the RST packet to the external apparatus in a case where a predetermined time has elapsed in a state where reception of print data from the external apparatus remains stopped, and the size of the print data transmitted from the external apparatus exceeds the size of the spool area. The RST packet corresponds to a disconnection request for requesting to disconnect the connection. On the other hand, the CPU <NUM> maintains the connection with the external apparatus in a case where the predetermined time has elapsed in a state where reception of print data from the external apparatus remains stopped, and the size of the print data transmitted from the external apparatus does not exceed the size of the spool area. In such a case, the entire received print data can be stored in the spool area even when the printing process remains stopped, and therefore reception of print data is continued while maintaining the connection.

In the present embodiment, as has been described above, the CPU <NUM> establishes a connection with an external apparatus (host PC) in accordance with a predetermined communication protocol, receives print data transmitted from the external apparatus via the connection, and temporarily stores the print data in the spool area. The CPU <NUM> performs a printing process based on print data stored in the spool area. In a case where reception of print data from the external apparatus is stopped halfway through and a predetermined time has elapsed in a state where the reception remains stopped, the CPU <NUM> further controls whether or not to disconnect the connection with the external apparatus from the MFP <NUM> side, based on a size of the print data transmitted from the external apparatus and a size of the spool area.

As such, it is possible to dynamically perform switching of the operation, in a case where reception of print data remains stopped, to match with the host PC being connected. Accordingly, it becomes possible to normally resume the printing process even when reception in the MFP <NUM> of print data from the external apparatus is stopped halfway through.

Next, there will be described a third embodiment of the present disclosure. In the following, description of parts similar to those of the first and the second embodiments will be omitted.

The second embodiment allows for dynamically switching between disconnecting (S710) the connection from the printer side, and waiting for reception (S707) of the FIN packet from the host PC side, in accordance with whether or not a size of the print data exceeds a size of the spool area. However, as has been described above, a state where reception of print data from the host PC remains stopped halfway through continues, unless the inhibiting factor that inhibits reception of print data is resolved. In such a state, disconnection of the connection occurs between the host PC and the printer when, for example, transition to sleep or rebooting occurs in the host PC, or when transition to sleep (error sleep) occurs in the MFP <NUM> without the error being resolved. As a result, there is a possibility that the cancel operation of the print job may fail in the MFP <NUM>, thereby printed material with an abnormality occurring thereon being output.

The MFP <NUM> according to the present embodiment therefore performs the following operations in order to avoid outputting printed material with an abnormality occurring thereon. The MFP <NUM> controls whether or not to disconnect the connection with the external apparatus from the MFP <NUM> side, based on whether or not the spool area is formed of a volatile memory, in a case where a predetermined time has elapsed in a state where reception of print data from the external apparatus remains stopped, and a size of the print data transmitted from the external apparatus does not exceed a size of the spool area.

<FIG> is a flowchart illustrating a processing procedure of the print data reception process to be executed by the CPU <NUM> in the MFP <NUM> according to the present embodiment. The processing at each step of <FIG> can be realized in the MFP <NUM> by the CPU <NUM> that reads out a program stored in the ROM <NUM> or the HDD <NUM> to the RAM <NUM> and executes it thereon.

The processing of steps S701 to S703, S801 to S804, S704 to S708, and S805 are similar to those of the second embodiments. In the present embodiment, the CPU <NUM> advances the process to step S901 in a case where the size exceeded flag is set to OFF at step S808 (i.e., a size of the print data is equal to or smaller than a size of the spool area).

At step S901, the CPU <NUM> determines whether or not the spool area is formed of a volatile memory. In a case where the spool area is formed of a non-volatile memory (HDD, SD memory, USB memory, etc.), the CPU <NUM> returns the process to step S704, or advances the process to step S710 in a case where the spool area is formed of a volatile memory.

At step S710, the CPU <NUM> transmits, via the LAN I/F <NUM>, the RST packet (RST command) to the host PC which is the transmission source of print data, similarly to the first and second embodiments. In other words, transmission of the RST packet causes disconnection of the connection with the host PC proactively from the printer (MFP <NUM>) side. Upon completion of disconnection of the connection with the host PC in the aforementioned manner, the CPU <NUM> terminates the reception process of print data according to the procedure illustrated in <FIG>.

As has been described above, the MFP <NUM> according to the present embodiment operates in the following manner, in a case where a predetermined time has elapsed in a state where reception of print data from the external apparatus remains stopped, and the size of the print data transmitted from the external apparatus does not exceed the size of the spool area. Specifically, the MFP <NUM> transmits, to the external apparatus, a disconnection request for requesting to disconnect the connection in a case where the spool area is formed of a volatile memory. On the other hand, the MFP <NUM> maintains the connection with the external apparatus, in a case where the spool area is formed of a non-volatile memory. As such, the MFP <NUM> maintains the connection with the external apparatus only when the spool area is formed of a non-volatile memory, in a case where the size of the print data transmitted from the external apparatus does not exceed the size of the spool area. According to the aforementioned process, it becomes possible to normally resume the printing process while avoiding outputting printed material with an abnormality occurring thereon, even when reception of print data from the external apparatus is stopped halfway through in the MFP <NUM>.

Claim 1:
A printing apparatus (<NUM>) capable of communicating with an external apparatus (<NUM>, <NUM>), the printing apparatus comprising:
an establishing means (<NUM>) for establishing a connection with an external apparatus in accordance with a predetermined communication protocol;
a receiving means (<NUM>) for receiving, and temporarily storing in a spool area, print data transmitted from the external apparatus via the connection; and
a printing means (<NUM>) for performing a printing process based on print data stored in the spool area;
characterized by:
a determining means (<NUM>) for determining whether a reception inhibiting factor being a cause of reception of print data from the external apparatus stopping halfway through has occurred in the printing apparatus and whether the reception inhibiting factor is resolved; and
a control means (<NUM>) for controlling whether or not to disconnect the connection with the external apparatus from the printing apparatus side, in accordance with whether or not a size of the print data transmitted from the external apparatus exceeds a size of the spool area, in a case where it is determined that the reception inhibiting factor has occurred and a predetermined time has elapsed in a state where the reception inhibiting factor is not resolved.