Output method and apparatus using the same

Abstract: According to an output method and an apparatus using the same, codes represented by respective control languages and representing instructions having higher frequencies of occurrence are stored, data represented by a control language for controlling an output is input, the input data is compared with the stored codes, and the control languages are switched.

Description: The present invention relates to an output method and an apparatus using the same, wherein received data is determined to allow switching between control languages. Related Background Art An output apparatus such as a printer apparatus (e.g., an ink-jet or laser beam printer) generally has a control instruction group (to be referred to as a control language thereinafter) for controlling the output apparatus. The output apparatus can draw characters and figures on the basis of the control language. Since different control languages have different instruction codes for recognizing instructions in accordance with different types of printer apparatuses, a correct output character or figure cannot be obtained unless a control language suitable for a currently used printer apparatus is transmitted. For this reason, control languages used in other printer apparatuses are installed as emulation languages in addition to the language assigned to each printer apparatus, so that a plurality of control languages can be interpreted. In a printer apparatus installed with a plurality of control languages, a desired control language is manually switched on an operation panel or the like equipped in this printer apparatus. When an output apparatus for interpreting a plurality of these control languages is assumed, the output apparatus cannot automatically determine the control language of received data. Even if the output apparatus can automatically determine the control language of the received data, its accuracy cannot be evaluated. By the way, in a recent apparatus of this type, a detachable program storage medium is prepared in addition to an installed first control program, and a second control program having a different operation from that of the first control program is stored in the detachable program storage medium. Therefore, the first control program (i.e., the installed program) and the second control program can be selectively used. Most of the second control programs are so-called emulation programs for determining data of a command system different from that of the first control program and executing the program. When such a second control program is used, all existing application programs on the host side which could not have used the recording apparatus can use this recording apparatus by the second control program without modifying the existing application programs. For example, a new high-performance type command system of the first control program and a conventional command system having poor performance can be used. In the above conventional example, when recording and printing are to be performed on the basis of data suitable for the second command system supported by the second control program, a host computer sends a control program switching command to a recording apparatus in advance and then sends data of the second command system thereto. Assume that a storage medium which stores a third control program for supporting a third command system is attached against the will of an operator since the storage medium which stores the second control program is detachable. In this case, the command system supported by the control program stored in the detachable storage medium is inconsistent with the command system of print data sent from the host computer. As a result, a desired print cannot be obtained, resulting in inconvenience. The disclosure of EP-A-0469974 forms part of the state of the art to the extent provided by Article 54(3) EPC and discloses a printer which analyses input data by statistical techniques to identify the appropriate control programme for interpreting the input data. The frequency of occurrence of control codes identified in the input data is determined by analysing a sampled portion of input data and a decision then taken as to which control programme should be used. Document WO-A-9204762 forms part of the state of the art to the extent provided by Article 54(3) EPC and discloses a method in which the frequency of occurrence of control codes of different control programmes is counted for a predetermined number of characters of input data and, following a decision as to the appropriate control programme, the input data is routed to one of a plurality of printers according to the control programme installed in that printer. It is known from Patent Abstracts of Japan, vol. 14, No. 113 (M-944), 2 March 1990 & JP-A-01314177 (Mita Ind Co Ltd), 19 December 1989 to select one of three emulation programmes in a printer according to the frequency of occurrence of control codes in the input data. If one such control code is capable of being interpreted by more than one control programme, a count value is allocated to each of the control programmes, printing being carried out on the basis of the control programme for which the maximum accumulated count value is measured. It is known from US-A-4968159 to provide a printer which selects a control programme on the basis of control codes identified in input data, candidate control programmes being progressively eliminated according to the number of control programmes in which each control code is capable of interpretation. It is known from EP-A-0332779 to provide a method of selecting a control programme by analysing control code identified in input data by a numerical method in which a judgment is made in respect of each item of control code as to the probability of the control code corresponding to each of a number of control programmes, the probabilities being expressed as numeral values which are accumulated. Selection is finally made on the basis of the maximum numerical value accumulated in respect of each control programme. According to the present invention there is disclosed an output apparatus comprising: storage means operable to store control codes of each one of a plurality of control programs; comparison means operable to compare a piece of input data with the control codes stored in the storage means; control means operable to select one of the control programs on the basis of the comparison by the comparison means; and output means operable to derive processed data by processing the input data with the selected control program and to output the processed data; characterised in that: each control code stored by the storage means can be interpreted by its respective control program and cannot be interpreted by the others of the control programs; and wherein the control means is operable to select the selected control program by comparing successive pieces of input data with each of the stored control codes until a first instance of coincidence occurs between a piece of the input data and an identical stored control code, the control means then being operable to select as the selected control program the control program corresponding to the identical stored control code. The present invention also provides a method of operating an output apparatus as defined in claim 6. Preferred embodiments of the present invention will now be described by way of example only and with reference to the accompanying drawings of which: Fig. 1 is a block diagram showing an output apparatus according to an embodiment of the present invention; Fig. 2 is a view showing instruction codes registered in advance to determine control languages; Fig. 3 is a flow chart for determining a control language by counting instruction codes appearing in received data; Fig. 4 is a view showing a printer engine; Fig. 5 is a flow chart for determining a control language by storing instruction codes respectively assigned to the control languages; Fig. 6 is a block diagram showing an example of output apparatus; Fig. 7 is a flow chart for explaining switching between control languages in accordance with an input instruction code; Fig. 8 is a block diagram of a laser beam printer; Fig. 9 is a view showing a data storage format in a program cartridge of the printer shown in Fig. 8; Fig. 10 is a view showing a command format of a cartridge shift command in the printer shown in Fig. 8; Fig. 11 is a view showing a command format of a main body shift command in the printer shown in Fig. 8; Fig. 12 is a view showing a data structure,of a main body shift command table in the printer shown in Fig. 8; Fig. 13 is a flow chart of a program stored in the main body of the apparatus; and Fig. 14 is a flow chart of a program stored in a program cartridge. Note that the present invention may be realized by a system comprising a plurality of equipments or a single equipment. In addition, the present invention is also realized by supplying programs to a system or apparatus. Fig. 4 is a sectional view showing an internal structure of a laser beam printer (to be referred to as an LBP hereinafter) as an arrangement of an output apparatus according to an embodiment of the present invention. Note that the output apparatus is not limited to the laser beam printer but can be replaced with an LED printer, an ink-jet printer, or the like. A character pattern and a format (form data) can be registered from a data source (not shown) to the LBP. Referring to Fig. 4, an LBP main body (1-10 in Fig. 1) 1000 receives character information (character codes), form information, or a microinstruction from a host computer (1-1 in Fig. 1) connected to an external device. The LBP main body 1000 generates a character pattern and a form pattern corresponding to these pieces of input information and forms an image on a recording sheet serving as a recording medium. An operation panel 1012 has operation switches and LED indicators. A printer control unit 1001 performs overall control of the LBP main body 1000 (1-10 in Fig. 1) and analyzes character information supplied from the host computer. The control unit 1001 mainly converts character information into a video signal representing a character pattern and outputs the video signal to a laser driver 1002. The laser driver 1002 is a circuit for driving a semiconductor laser 1003. The laser driver 1002 ON/OFF-controls a laser beam 1004 emitted from the semiconductor laser 1003 in accordance with the input video signal. The laser beam 1004 is swung by a rotary polygonal mirror 1005 to scan an electrostatic drum 1006, thereby forming an electrostatic latent image of a character pattern on the electrostatic drum 1006. This latent image is developed by a developing unit 1007 located around the electrostatic drum 1006 and is then transferred to the recording sheet. The recording sheet is a cut sheet. The cut sheets are stored in a sheet cassette 1008 attached to the LBP main body 1000. Each recording sheet is picked up and fed by a pickup roller 1009 and feed rollers 1010 and 1011 to the electrostatic drum 1006. Fig. 1 is a block diagram of a control unit for controlling the overall operation of the LBP. The control unit comprises a host computer 1-1 for performing data transfer, a reception buffer 1-2 for storing received data, a CPU 1-3 for controlling the LBP, a registration memory 1-4 for storing a plurality of instruction codes in units of control languages shown in Fig. 2, a page buffer 1-5 for storing received data in units of pages, a bit map memory 1-6 for storing a one-page output image, and a printer engine 1-7 for outputting data from the bit map memory 1-6 onto a sheet. The recorded sheet is illustrated as an output sheet 1-8. [Automatic Switching Between Control Languages] Fig. 2 shows instruction code systems of control languages registered in the registration memory 1-4. By designating each control language, a visible image such as a character or figure can be formed. A main code of each control language shown in Fig. 2 is compared with print data transmitted from the host computer 1-1 and stored in the reception buffer 1-2. The main code is an instruction code consisting of an instruction for initializing a printer apparatus, a sheet switching instruction, a font selection instruction, an image code (e.g., image drawing instruction) representing a possibility of the current capacity exceeding a buffering capacity. That is, instructions supposed to be received are represented by the respective control languages, and the control language of the received data is determined. Fig. 3 is a flow chart showing a program stored in a ROM 1-9 in Fig. 1. Fig. 3 shows processing for determining the control language of the received data. Prior to this processing, the received data is transferred from the host computer 1-1 to the reception buffer 1-2 and is buffered in the reception buffer 1-2. It is determined in step S3-1 whether the print data buffered in the buffer memory 1-2 is completed. If NO in step S3-1, data is loaded byte by byte in step S3-2 and is compared with the instruction codes of control languages 1 and 2 shown in Fig. 2. If any instruction code which is inconsistent with the input data is not extracted, the flow returns to step S3-1. However, if an instruction code is extracted in step S3-2, it is determined in step S3-3 whether this instruction code is received for the first time. A flag for determining this is assumed to be set by an initialization instruction or a sheet discharge instruction. If NO in step S3-3, the flow returns to step S3-1. If this instruction code is determined to be the instruction code received for the first time, i.e., any identical code is not previously received, and if it is determined in step S3-4 that an identical instruction code is registered in control language 1, counter 1 is incremented. Otherwise, if it is determined in step S3-6 that the instruction code is registered in control language 2 stored in the registration memory 1-4, counter 2 is incremented in step S3.-7. If this instruction code is not registered, the flow returns to step S3-1. The above operations are repeated. When it is determined in step S3-1 that all the buffered data are interpreted, the count of counter 1 is compared with that of counter 2 in step S3-8. The control language having a larger count is determined as the control language of the received data. Print processing is performed using control language 1 in step S3-9 or control language 2 in step S3-10. The print data is then printed in step S3-11. Note that all the data need not be interpreted, and that the above operations may be performed for a predetermined number of instructions. The instruction codes of the control languages shown in Fig. 2 need not be permanently assigned, but can be registered or modified. In addition, a means for deleting instruction codes which are rarely used on the basis of the received data and for replacing these instruction codes with frequently used instruction codes may be arranged. More specifically, soft counters are arranged in correspondence with the respective instruction codes to determine frequencies of occurrence of the respective instruction codes, so that a plurality of instruction codes having a high frequency of occurrence for each control language can be stored in the registration memory. Although this flow chart will be omitted, step S3-3 in Fig. 3 is omitted, and values from steps S3-4 to S3-7 are counted by the counters in units of instruction codes. Instructions to be stored in the registration memory 1-4 are selected in accordance with the count values of the soft counters. A specific control language is designated as the first control language as in the conventional arrangement. Thereafter, instruction codes having a higher frequency of occurrence can be stored in the registration memory. The control instructions need not be checked until all the buffered data are determined in step S3-1 to be completed. The flow may advance to step S3-8 when a given instruction code such as a sheet discharge code (HEX 0C) is detected. In this case, all the predetermined number of instruction codes need not be simply checked, but processing can be performed in units of instruction groups of the predetermined number of instruction codes. In this embodiment, an instruction code stored in a registration memory 1-4 is present in either control language. That is, if a registered instruction code is extracted, the corresponding control language is set. Otherwise, another control language is set. Fig. 5 is a flow chart for determining the control language of received data on the basis of instruction codes stored in the registration memory 1-4. Prior to this processing, the received data is transferred from a host computer 1-1 to a reception buffer 1-2 and is buffered in the reception buffer 1-2. It is determined in step S3-1 whether all the buffered print data are completed. If YES in step S3-1 and if the control language of the received data is not determined, the flow advances to step S3-4 to interpret and print the instruction code on the basis of control language 1. If NO in step S3-1, data is loaded byte by byte in step S3-2. The loaded data is compared with the instruction code of the registered control language 1 shown in Fig. 2. If no consistent instruction code is extracted, the flow returns to step S3-1. The flow then advances from step S3-1 to step S3-4. However, if an instruction code can be extracted in step S3-2, and if it is determined in step S3-3 that the instruction code is registered in control language 1, the instruction code is interpreted and subjected to print processing by control language 1 in step S3-4, thereby printing the data in step S3-6. However, if the instruction code is determined in step S3-3 to be included in any control language except for control language 1, i.e., control language 2, the instruction code is interpreted and subjected to print processing by control language 2 in step S3-5. The data is then printed in step S3-6. A default for printing processing may be designated even if the control language is not determined in step S3-1. The instruction code may be interpreted and subjected to print processing in accordance with the control language of the default even if a sheet discharge code (HEX OC) is received in addition to the determination in step S3-1. [Processing Starting with Control Language] Fig. 6 is a block diagram of a control unit for controlling an LBP for realizing this example. In this example, the registration memory is not arranged, but processing of data stored in a page buffer memory 1-5 is started on the basis of control language 1. Referring to Fig. 6, the control unit comprises a host computer 1-1 for performing data transfer, a reception buffer 1-2 for storing received data, a CPU 1-3 for controlling the LBP, the page buffer memory 1-5 for storing received data in units of pages, a bit map memory 1-6 for storing a one-page output image, and a printer engine 1-7 for outputting data stored in the bit map memory 1-6 to a sheet. The recorded sheet is illustrated as an output sheet 1-8. Fig. 7 is a flow chart of processing for interpreting data stored in the page buffer memory 1-5 to print it. Prior to this processing, data is assumed to be transferred from the host computer 1-1 to the reception buffer 1-2. It is determined in step S3-1 whether all buffered print data are completed. If NO in step S3-1, data is loaded byte by byte in step S3-2. The loaded data is compared with the instruction code of registered control language 1 shown in Fig. 2. If a consistent instruction code is present, i.e., if a proper instruction code for the registered control language 1 is present, the flow advances to step S3-4 to interpret the instruction code. The interpreted data is stored as image formation data in the bit map memory 1-6 and as buffered data in the page buffer 1-5. When this instruction processing is completed, the flow returns to step S3-1. However, if an improper instruction code which is not present in the currently interpreted control language is present in step S3-2, the instruction code stored in the page buffer 1-5, if any, is deleted in step S3-3, thereby restoring the print atmosphere set at the start of data interpretation. Thereafter, the interpreting control language is switched to start processing operations of steps S3-1 and S3-2 from the start of the received data stored in the reception buffer 1-2. As described above, the instruction is interpreted until the end of the data, and print processing is executed. When all the data are determined in step S3-1 to be interpreted, the data is read out from the page buffer 1-5, and a visible image is formed in the bit map memory 1-6. The visible image is transferred to the printer engine 1-7 and is printed thereat. At the start of processing, a default of a control language to be compared for the first time may be designated at an operation panel or the like. Alternatively, the first control language may be selected from the previous history. The control instructions need not be checked until all the buffered data are determined in step S3-1 to be completed. The flow may advance to step S3-5 when a sheet discharge code (HEX OC) is detected. In switching the control language in step S3-3, the input data may be compared with the instruction code tables of the respective control languages shown in Fig. 2. In this case, the control language is switched to the one having the consistent instruction code. The control language of the received data is automatically determined, and interpretation suitable for the selected control language is executed to obtain a desired character or graphic pattern. A printing means switching instruction and a control language switching instruction is issued at the time of printing and prior to control language switching, respectively. Therefore, the time and labor required to switch the control language can be eliminated, thereby simplifying switching between the control languages. [Signaling whether Output Is Possible] An operation for signaling whether an output is possible when the current command system is to be switched to another command system will be described in detail. This example will be described in detail with reference to accompanying drawings and exemplifies a laser beam printer as an image recording apparatus. Fig. 8 is a block diagram of a laser beam printer according to this example. A laser beam printer 1000 is connected to a host computer 1-1 serving as a recording data source. The laser beam printer 1000 mainly comprises a print mechanism 109 and a print control unit 101 for receiving recording data from the host computer 1-1 and controlling the print mechanism 109. The print mechanism 109 receives an image signal to perform a series of laser beam printer operations such as supply of a recording sheet (recording medium), ON/OFF-control of a laser beam, transfer of an image to the sheet, and fixing of the transferred image. The print mechanism 109 is illustrated in Fig. 4 in detail, and a detailed description thereof will be omitted. An arrangement of the print control unit 101 of the laser beam printer 1000 will be described below. The print control unit 101 includes a CPU 102, an input I/F 103, a ROM 104, a RAM 105, a display panel 106, an image signal generator 107, an output I/F 108, a cartridge I/F 110, and a cartridge connector 111. The CPU 102 controls the overall operation of the laser beam printer. The input I/F 103 receives data from the host computer 1000 through an input signal Iine S11 and signals data reception to the CPU 102. Various status data of the laser beam printer are output from the input I/F 103 through an output signal line S12. The ROM 104 stores a first program (i.e., a program (to be described later) shown in Fig. 13) for realizing recording processing of the first printer command system, and control information, character dot patterns, and the like used by the first program. The RAM 105 is used by the control program as a work area of the control program and an image memory area as a one-page bit map image data area. The display panel 106 is constituted by general 7-segment LEDs and is used to indicate various operating states under the control of the CPU 102. The image signal generator 107 converts the one-page bit map image data developed in the image memory area of the RAM 105 into an image signal. The image signal generator 107 outputs an image signal S22 to a print mechanism 109 in synchronism with a sync signal S21 from the print mechanism 109. The output I/F 108 performs input/output operations between the print control unit 101 and the print mechanism 109. The cartridge I/F 110 serves as an electrical interface between the program cartridge 112 and the control unit 100. The CPU 102 accesses the ROM in the program cartridge through the cartridge I/F 110 and senses the presence/absence of the program cartridge through the cartridge I/F 110. The program cartridge 112 is obtained by storing as a cartridge a ROM circuit board constituted by the ROM and its associated elements. The program cartridge 112 stores a second control program (i.e., a program for controlling the laser beam printer 1000 as in the first control program) having a printer command system (to be referred to as a second command system) different from that of the first control program stored in the ROM 104. A sequence of the second command system is shown as a flow chart in Fig. 14. This program cartridge 112 has a detachable structure through the cartridge connector 111 of the print control unit 101. The program cartridge 112 can be replaced with another program cartridge which stores a third control program. The first control program stored in the ROM 104 is referred to as program A, and the control program stored in the program cartridge 112 is referred to as program Bi (i = 1, 2,...). Fig. 9 is a view showing a ROM storage format 200 of program Bi stored in the program cartridge 112. Referring to Fig. 9, the storage format 200 consists of a program ID area 201 for storing a program ID No. as a unique number in accordance with a the of control program stored in a 4-byte ROM area (addresses 0 to 3) from address 0, and a program area 202 for storing an object code of program Bi so that the program is started from address 4 of the ROM. Any program Bi can be stored in the program cartridge 12, and one program is shown in Fig. 14 (i.e., a program of this flow chart is defined as program Bj). Fig. 10 shows a command format of one of the printer commands applied to program A stored in the ROM 104 to designate shift from program A to program Bi stored in the program cartridge 112. This command format is of a so-called escape sequence command system and consists of a control ECC (1B H where H represents the hexadecimal notation) 301 representing the start of the command, a program ID No. 302 of program Bi to be shifted, and a command terminator "P" (also serving as a command ID name representing a shift command) 303. When switching is to be performed from program A to program Bi stored in the program cartridge 112, the above command is transmitted from the host computer and is analyzed by program A, so that control transits to program Bi stored in the program cartridge 112. The components 301 to 303 constitute a cartridge shift command 300. Fig. 11 shows a command format of one of the printer commands applied to program Bj as an example of program Bi stored in the program cartridge 112. This command designates a shift of control from program Bj to program A stored in the ROM 104. Note that since a shift to program A stored in the ROM 104 of the main body is performed, this command is called a main body shift command. This shift has the same function as a function of shifting program A to program Bi in Fig. 10. The command formats correspond to command systems stored in the program cartridges 112, respectively. In this example, the command format is a text command format consisting of a character code train "@%" of an identifier for designating the start of the command and a command character string 402 following the character code train "GO TO NATIVE" for designating a shift to program A. When program Bj detects the main body shift command 400, its control transits to program A. Fig. 12 shows a data structure of a main body shift command table 500 prepared in the ROM 104. As described above, the plurality of program cartridges 112 are detachable from the laser beam printer. The main body shift command table 500 is used to cause the ROM 104 in the print control unit 100 to store the main body shift commands i of the command systems of programs Bi (i = 1, 2,...) stored in the respective program cartridges. This table consists of three elements, i.e., an ID No. area 501 for setting the program ID No. i of program Bi in each program cartridge, a command length area 502 for setting a length ℓi (the number of bytes) of the main body shift command, and a code area 503 for storing a code train of the main body shift command i . Sets each consisting of these three elements are prepared in number corresponding to the number of various program cartridges, thereby constituting the table 500. A set 504 consists of an ID No. area, a command length area, and a main body shift command of program Bj as one of programs Bi. Switching control operations of program A as the control program on the main body in the laser beam printer and program Bj as the control program on the program cartridge side will be described with reference to flow charts in Figs. 13 and 14, respectively. The operation of program A stored in the ROM 104 will be described first with reference to the flow chart in Fig. 13. When the power switch of the laser beam printer is turned on, initialization processing of the program is started in step S601, and the input I/F 103 is checked in step S602. The laser beam printer waits for input data from the host computer 1000. When data is received, the flow advances to step S603 to fetch input data from the input I/F, thereby executing data analysis. In this data analysis, the input data is determined whether to be a command or a character code. If the input data is consistent with the cartridge shift command 300 in Fig. 10, the flow is branched from step S604 and advances to step S608 to execute program switching processing. Otherwise, i.e., if the input data is determined to be a command or a character code, the flow advances to step S605 to select a corresponding character dot pattern from the ROM 104. The selected character dot pattern is developed in an image memory area in the RAM 105 to form an output page image. The flow then advances to step S606, and operations in steps S602 to S606 are repeated until one-page data analysis is completed. When one-page image formation is completed, the flow advances to step S607 to send information of the image memory area of the RAM 105 to the image signal generator 107. The image signal generator 107 causes the print mechanism 109 to print the information. The flow then returns to step S602, and processing of the next page is started. When the cartridge shift command 300 is detected in step S604, the flow advances to step S608 to determine whether a program cartridge is attached. If YES in step S608, it is checked in steps S609 whether the program ID No. 302 designated by the cartridge shift command 300 is consistent with the program ID No. set in the program ID area 201 in the program cartridge. If YES in step S609, since the designated program Bi (Bj in this case) is present, control jumps to the start of the program area 202 in the program cartridge, and control transits to program Bj (i.e., step S701 to be described later) (step S610). When the program cartridge is determined in step S608 not to be attached to the laser beam printer, or when the program ID Nos. are inconsistent with each other in step S609, this indicates that program Bi designated by the host computer is not present. Processing advances to step S611 and subsequent steps. An alarm mark as an error display is displayed on the display panel 106 in step S611 to indicate a message representing the absence of the designated program Bj (an error code may be displayed). In step S612, a dot pattern of each character constituting the error message is read out from the ROM 104, and the readout data is developed in the image memory area. The developed data is sent to the image signal generator 107, thereby printing a one-page error message. The host computer 1-1 sends a data group corresponding to program Bj after it sends the cartridge shift command. In step S613, a code train of the main shift command corresponding to the program ID No. 302 of the cartridge shift command 300 detected in step S602 is extracted from the code 503. In this example, the table element 504 corresponding to program Bj is selected, and a code train "@% GOTONATIVE" of the main body shift command is selected. The laser beam printer waits for data from the host computer 1-1 in step S614 as in step S602. The received data are neglected until the received data is determined in step S615 as the previously extracted main body shift command. When the code train of the corresponding main body shift command is detected, the host computer 1-1 sends data based on the command system corresponding to program A. Therefore, the alarm mark and the message on the display panel 106 are deleted in step S616, and the flow returns to step S602. The processing contents of program Bj in the program cartridge 112 will be described with reference to the flow chart in Fig. 14. This processing is started upon reception of the cartridge shift command 300 during execution of program A in the ROM 104, as described with reference to Fig. 13. Initialization processing as program Bj is executed in step S701. The current state of the print control unit 100 by program A is reset. In step S702, the laser beam printer waits for data from the host computer 1-1. When data is received, the received data is analyzed in step S703. A command is discriminated from a character code in data analysis according to the command system supported by program Bj. If the input data is consistent with the main body shift command 400, the flow is branched from step S704, and control transits to program A (i.e., step S601) in the ROM 104 (step S708). When a command or character code for program Bj is detected, the flow advances to step S705, and a, corresponding character pattern or the like is developed in the image memory area in the RAM 104. The operations in steps S702 to S706 are repeated until a one-page image is prepared in step S706. When the one-page image is completed, the flow advances to step S707, and the completed image information is sent to the image signal generator 107. The one-page image is printed. The flow then returns to step S702, and processing of the next page is continued. As described above, when the designated second control program is not present, an alarm mark or message can be displayed on the display panel because the absence of the designated second control program is signaled to the user. Since an error message representing the absence of the designated control program is output, the presence of a recording sheet on which the error message is printed indicates that nonprinted subsequent data are present. Therefore, if the laser beam printer has a timer backed up by a battery and current time is printed together with an error message, the user can know the subsequent nonprinted data set from the time when the error message is displayed, regardless of the length of time elapsed. As an alarming means given when the control program of the program ID No. designated by the cartridge shift command is absent, the alarm mark and the message are displayed on the display panel, and the error message is printed. For example, the presence/absence of the designated control program may be informed to the host computer through the output signal line S12. In this case, the host computer transmits the cartridge shift command and waits for a response signal from the printer. The host computer then transmits print data corresponding to the desired control program. If the designated control program is not present, transmission of the print data can be interrupted. Therefore, the printer need not neglect the received data, and wasteful data transmission can be prevented. The present invention is equally applicable to an ink-jet printer for causing a change in volume of an ink by heat energy and injecting an ink from an orifice. In the above example, only one program cartridge is attached to the cartridge connector 111. However, if a plurality of connectors are used, the present invention is applicable to a plurality of command systems. At this time, in order to allow to switch the command system from each program cartridge to the command system of another program cartridge, tables having the number corresponding to combinations of the command systems are prepared in addition to the command table for switching the program from each program Bi to program A. For example, in step S613 of Fig. 13, character trains of commands which allow shift from the designated program Bj are extracted. It is determined in step S615 whether the input data is consistent with one of the character trains. If any command which is consistent with the input data, the corresponding command system is set. As has been described in detail, when the output apparatus cannot be set in the designated control command system, the user can easily know this trouble. At this time, a message representing the absence of the designated control command system is printed and recorded. At the same time, if the output apparatus keeps neglecting all received data until a command representing that the designated command system can be set, unnecessary printing and recording need not be performed. At the same time, nonprinted data can be known.

Claims: An output apparatus (1000;1-10) comprising: storage means (1-4) operable to store control codes of each one of a plurality of control programs; comparison means (1-3) operable to compare a piece of input data with the control codes stored in the storage means; control means (1-3) operable to select one of the control programs on the basis of the comparison by the comparison means; and output means (1-7) operable to derive processed data by processing the input data with the selected control program and to output the processed data; characterised in that: each control code stored by the storage means can be interpreted by its respective control program and cannot be interpreted by the others of the control programs; and wherein the control means is operable to select the selected control program by comparing successive pieces of input data with each of the stored control codes until a first instance of coincidence occurs between a piece of the input data and an identical stored control code, the control means then being operable to select as the selected control program the control program corresponding to the identical stored control code. An apparatus according to claim 1 wherein, if a comparison by said comparison means shows that a piece of the input data is not identical to the stored control code, said control means is operable to control said comparison means to compare subsequent pieces of the input data with the stored control code until a predetermined amount of the input data has been compared with the stored control code. An apparatus according to claim 1, wherein said output means comprises a printer (1000) operable to print the processed data on the basis of the input data. An apparatus as claimed in any preceding claim wherein the plurality of control programs are constituted by first and second control languages. An apparatus as claimed in claim 4 wherein the second control language is stored in a program storage medium which is detachable from said apparatus. A method of operating an output apparatus (1000;1-10) comprising the steps of: storing in a storage means (1-4) control codes of each one of a plurality of control programs; comparing a piece of input data with the control codes stored in the storage means; selecting one of the control programs on the basis of the comparison, the selecting step being carried out by control means (1-3); and deriving processed data by processing the input data with the selected control program and outputting the processed data; characterised in that: each control code stored by the storage means can be interpreted by its respective control program and cannot be interpreted by the others of the control programs; and wherein the control means selects the selected control program by comparing successive pieces of input data with each of the stored control codes until a first instance of coincidence occurs between a piece of the input data and an identical stored control code, the control means then selecting as the selected control program the control program corresponding to the identical stored control code. A method as claimed in claim 6 wherein, if a comparison by said comparison means shows that a piece of the input data is not identical to the stored control code, subsequent pieces of the input data are compared with the stored control code until a predetermined amount of the input data has been compared with the stored control code. A method as claimed in any of claims 6 and 7 wherein said output means comprises a printer (1000) which prints the processed data on the basis of the input data. A method as claimed in any of claims 6 to 8 wherein the plurality of control programs are constituted by first and second control languages. A method as claimed in claim 9 wherein the second control language is stored in a program storage medium which is detachable from said apparatus.

Inventors: OKADA KUNIO, SUGAYA AKIO, OKADA, KUNIO, SUGAYA, AKIO, OKADA, KUNIO, C/O CANON KABUSHIKI KAISHA, Sugaya, Akio, c/o Canon Kabushiki Kaisha
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1992
Main classification: G06F3
IPC codes: G06K15