Printer having dumping function

Abstract: An information generating apparatus is disclosed. The apparatus includes a receiver which receives a group of code information, a selector which selects a desired piece of code information included in the code information group, and a detector which detects consumption amounts of coloring materials used when reproducing the code information gorup. The apparatus further includes a controller which controls operations so as to generate the selected code information by a color different from the color of the other code information when reproducing the code information group.

Description: BACKGROUND OF THE INVENTION Field of the Invention The invention relates to a printer having a dumping function to generate control codes which are sent from a host computer. Related Background Art Hitherto, when a control program for a print control is developed, there is a dumping function to print a control instruction which is sent from a host computer as a function which is used on the printer side in order to support the control program. By using the above function, not only the debugging when developing the print control program becomes easy but also an error of a communication system when data is transferred from the host computer to the printer side can be easily detected. An evaluation of the control program can be also easily obtained from a third party. By performing the evaluation, the reliability of a printer system is improved, and an unnecessary decrease in processing speed by the non-efficient print control process is avoided, thereby intending to establish the efficient print processing system. In the recent printers, however, the number of kinds of control commands exceeds 100 kinds in association with an increase in functions. The contents of the control commands are also fairly complicated. Therefore, the program itself to control the printer is very complicated. Although the dumping function is a convenient function, a great amount of labors are required for the work itself to analyze an enormous dump lists generated. For instance, when examining at which position of data a print position designating instruction is sent, it is difficult to search such a position unless there is no mark. When a great number of dump lists are generated, large quantities of print materials such as inks, toners, or the like are consumed, so that there is also a case where a trouble occurs when printing data to be inherently generated. JP-A-63 272 144 discloses a dump output device comprising an analyzing means to analyze the classification of dump output data output from a dump output means 6, and a dump data output means to change the output mode of the receiving data based on the classification of the receiving data analyzed by the analyzing means, and output identifiably the changed output mode. JP-A-3 025 611 discloses a received data output circuit for a printer, in which a received data output circuit translates received data separately for the part of the control code for controlling the operational state of the printer, the part of a character code for really printing the data and image data for which a data quantity is comparatively long, and converts the data to new codes. Accordingly, when the dump of the received data is outputted, the control code in received data can be distinguished from the print data. JP-A-63 288 562 discloses an image processor in which a main control part, when a color coding selecting signal is outputted, discriminates the character data and the form data in sentence information stored into a page memory. The main control part converts a dot image corresponding to the form data, stores it into a first color bit map memory, converts the dot image corresponding to the character data and stores it into a second color bit map memory. These are read and the character data and ruled line data inputted by a single color can be printed with a different color. When the color coding selecting signal is not outputted, the main control part stores both data into the first or second color bit map memories, reads them and executes the processing of input data so as to print both data with the same color. SUMMARY OF THE INVENTION According to the invention, by providing a method as claimed in claim 1 and an apparatus as claimed in claim 8, there is an effect such that a great amount of control instruction groups which are sent from a host computer can be easily analyzed. Furthermore, in the case of using the dumping function such that it is not an object to print in an inherent beautiful style but it is sufficient to immediately know the content of the output result, by generating the code information by the color whose consumption quantity is small, a more economical dumping process such that no trouble occurs in the inherent print can be realized. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a first block diagram showing a construction of an information output apparatus of an embodiment; Fig. 2 is a first flowchart showing processes in the embodiment; Fig. 3 is a second flowchart showing processes in the embodiment; Fig. 4 is a third flowchart showing processes in the embodiment; Fig. 5 is a diagram showing the first example of an instruction format when a color is designated for a command; Fig. 6 is a diagram showing examples of structures of the instructions in Fig. 5; Fig. 7 is a diagram showing combination examples of the structures in Fig. 6; Fig. 8 is a fourth flowchart showing processes in the embodiment; and Fig. 9 is a fifth flowchart showing processes in the embodiment. DESCRIPTION OF THE PREFERRED EMBODIMENTS Fig. 1 is a block diagram showing a construction of a printer of the embodiment. In Fig. 1, an external host computer 2 is connected through a connector (not shown) to a main body 1 of the printer shown by a block surrounded by a broken line in Fig. 1. The printer main body 1 receives a print instruction, an environment setting instruction to set an environment upon printing, output data, and the like from the host computer 2 side, thereby executing a print output. The following components 3, 4, 5, 7, 8, and 9 are respectively connected through a system bus to a CPU 6 for arithmetic operation control to control the whole main body 1: namely, a reception buffer 3 to receive a print instruction, print data, and the like which are sent from the host computer 2; a non-volatile RAM 4 in which various kinds of setting information such as print mode, interface setting, and the like are permanently stored; an output section 5 to actually print; an ROM (read only memory) 7 in which programs to execute a series of control flows, which will be explained hereinlater, environment information, and the like are recorded; an RAM (random access memory) 8 serving as a work area to execute the program; and an operating panel 9 to operate the main body 1. A power source (not shown) and various kinds of control signal lines such as a clock and the like are connected as necessary to those component elements. Further, print environment information 4a which is used in the dumping mode is permanently recorded in the non-volatile RAM 4. A command search table 7a to search a control instruction is stored in the ROM 7. An environment information area 8a to temporarily store the present print environment is held in the RAM 8. Generally, when the power source of the main body 1 is turned on, the operation to process a print control instruction is started. Such an operation is called an ordinary operating mode. The ordinary print and control instruction are executed in this operating mode. A process to allocate the color to each of the print control instructions is also executed in the above operating mode. On the other hand, there is a dumping mode. In the dumping mode, the actual control process is not performed. The instructions themselves are printed without interpreting all of the instructions. The operating mode is switched by depressing a switch (not shown) on the operating panel 9. The switched set mode information is stored into the environment information area 8a. <Outline of processes of the invention> Two processes will be explained with respect to the schematic operation of the printer with the construction described by using a block diagram of Fig. 1 in accordance with flowcharts shown in Figs. 2 and 3. One is a color allocating process to allocate the color to each of the print control instructions which the main body 1 has and this process is shown in the flowchart of Fig. 2. Another one is a dumping process to dump codes which are sent from the host computer 2 and the dumping process is shown in the flowchart of Fig. 3. In general, when the power source of the main body 1 is turned on, the operation to process the print control instruction is started. The color allocating process is executed in the above operating mode. To set the dumping mode, an interruption signal is generated by depressing a switch (not shown) on the operating panel 9 and the dumping process is executed from the color allocating process. On the contrary, the shift from the dumping process to the color allocating process is also performed by generating an interruption signal by depressing a switch (not shown) on the operating panel 9. Each of the above processes will now be described in accordance with the flowcharts. Fig. 2 will now be described. Fig. 2 is a flowchart for explaining the color allocating process to allocate the color to each of the print control instructions which the main body 1 has. A method whereby the print control instructions themselves are processed will now be generally described and the execution of a command color setting instruction will be subsequently described. In general, when the power source of the main body 1 is turned on, the initialization of each apparatus is executed in step S11. The environment information area 8a in the RAM 8 is initialized on the basis of the print environment information 4a which has been recorded in the non-volatile RAM 4 and in which information such as new paragraph width value, kind of character set, default color, and the like are included. In the next step S12, all of the colors which are allocated to the print control instructions are set to the same color. The above process is realized by writing the same color into the command color table in the environment information area 8a. For instance, assuming that black is allocated, all of the print control instruction groups which are generated in the dumping mode are printed in black in the initial state in which the power source is turned on. To change the print color, a command color setting instruction to allocate the color to each of the print control instructions is used. In the next step S13, the main body 1 is set into a data reception standby mode and waits for the data from the host computer 2. When the data is sent from the host computer 2, it is temporarily stored into the reception buffer 3 and, after that, it is sent to the next process. In step S14, a check is made to see if the received data is the print data or the print control instruction. When it is the print data, step S15 follows. When it is the print control instruction, step S16 follows. In step S15, simple data, for instance, character such as "ABC" or the like are printed. After that, the main body 1 is returned to a data reception standby mode in step S13. In step S16, a pointer P to indicate the command search table is initialized. In step S17, the received print control instruction is compared with the command search table. When they coincide, step S18 follows. When they differ, step S20 follows. In step S18, the designated parameter is examined. When it is correct, step S19 follows. When it is wrong, the processing routine is returned to step S13. In step S19, a function corresponding to each print control instruction is called. In step S20, the pointer P is increased. In step S21, a check is made to see if the examination has been completed or not. When the examination is not finished yet, the processing routine is returned to step S17. When the examination is completed, the processing routine is returned to step S13. The execution of the command color setting instruction will now be described. The command color setting instruction is executed along the flow of the above processes in a manner similar to an ordinary instruction. The function corresponding to the above instruction relates to a process to rewrite a command color table in the environment information area 8a on the basis of a parameter associated with the instruction. The above instruction doesn't have any meaning in the modes other than the dumping mode. Fig. 3 will now be described. Fig. 3 is the flowchart showing the dumping process of the main body 1 in the dumping mode. When the dumping mode is started by the operating panel 9, the environment information area 8a is initialized in step S31 on the basis of the print environment information 4a in the non-volatile RAM 4. However, only the command color table in the area 8a is not rewritten. At this time point, the print environment before the main body 1 enters the dumping mode is deleted and a constant environment is certainly held in the dumping mode. In the next step S32, the main body 1 is set into the data reception standby mode and waits for the data from the host computer 2. When the data is sent from the host computer 2, it is temporarily stored into the reception buffer 3 and, after that, it is sent to the next process. A check is made in step S33 to see if the received data is the print data or the print control instruction. When it is the print data, step S34 follows. When it is the print control instruction, step S36 follows. In step S34, a print color variable C is set into a color to print the data. In step S36, the pointer P to indicate the command search table is initialized. In step S37, the received print control instruction is compared with the command search table designated by the pointer P. When they coincide, step S38 follows. When they differ, step S40 follows. In step S38, a check is made to see if the parameter is correct or not. When it is correct, step S39 follows. When it is wrong, step S35 follows. In step S39, the color number corresponding to the command is extracted from the command color table and is set into the print color variable C. After that, step S35 follows. In step S42, the print color when an error exists is taken out from the environment information area 8a and is set into the print color variable C. Then, step S35 follows. In step S40, the pointer P increases and a check is made in step S41 to see if the search has been finished or not. When the search is not yet finished, the processing routine is returned to step S37 and the searching operation is continued. After completion of the search, in the case where the corresponding print control instruction doesn't exist, an error occurs. In step S42, the print color when the error exists is taken out from the environment information area 8a and is set into the print color variable C. Step S35 then follows. The value of each variable is returned to the original value in step S35 and the actual dump list is printed. After the printing of the dump list was finished, the processing routine is returned to step S32 and the above processes are repeated. <Color designating process to command> Processes to designate so as to add the color to a desired one of many kinds of commands to be printed in the dumping mode in the foregoing processes will now be described in detail. The flow of schematic processes is shown in the flowchart of Fig. 4. Since those processes are similar to those shown in the flowchart of Fig. 2, they are designated by the same step numbers shown in the flowchart of Fig. 2 and their descriptions are omitted here. The command color setting instruction will now be described. The command color setting instruction is executed in accordance with the processing routine in Fig. 4 in a manner similar to the general instruction. As shown in Fig. 5, a format of the command color setting instruction is stored in the environment information area 8a as {setting start instruction for command color} (instruction, .., instruction, setting color) .. (instruction, .., instruction, setting color) {setting end instruction of command color}. Between the setting start instruction of command color and the setting end instruction of command color, each setting color can be designated for each of a plurality of combinations of arbitrary instructions. So long as the color corresponding to a combination of special instructions is previously set by the above instructions, the data is printed in the designated setting color when printing in the dumping mode. For instance, in the case where the commands such as {setting start instruction of command color}, (print position designation instruction, new paragraph instruction, red) {setting end instruction of command color} are sent to the printer, when the codes in which the print position designation instruction and the new paragraph instruction continue in the printing in the dumping mode are sent from the host computer, the print color is changed from black as an ordinary print color to red and the data is printed in red. Fig. 6 shows combinations of instructions which are stored in the RAM 8 and constructions of structures A and B which are used to record the information of the colors corresponding to the above instruction combination. The structure A is constructed by three elements m 1 , m 2 , and m 3 . m 1 denotes an area to record the setting color. m 2 and m 3 denote areas to store point addresses. The structure B is constructed by two elements m 4 and m 5 . m 4 denotes an area to record the kind of command. m 5 indicates an area to store a point address. The structures shown in Fig. 6 are coupled like an example shown in Fig. 7. A combination of the instructions and the information of the colors corresponding thereto are recorded in the structures. In Fig. 7, R denotes a pointer variable to designate the structure A; n 1 , n 2 , and n 3 indicate the structure A; and g 1 , g 2 , g 3 , g 4 , g 5 , and g 6 represent the structure B. In the above example, there are three kinds of combinations of the instructions: D 1 and D 2 ; only D 3 ; and D 4 , D 5 , and D 6 . The colors corresponding to those combinations are set to C 1 for the combination of the instructions of D 1 and D 2 , C 2 for the instruction of D 3 , and C 3 for the combination of the instructions of D 4 , D 5 , and D 6 . The coupling starts from the pointer variable R. R points out the first structure n 1 . The element m 1 of n 1 records the setting color C 1 , the element m 2 points out n 2 , and the element m 3 points out g 1 . The element m 4 of g 1 records the command D 1 and the element m 5 points out g 2 . The element m 4 of g 2 records the command D 2 and the element m 5 points out nothing. This means that the the combination of the instructions which are dump printed by the setting color C 1 is set to D 1 and D 2 . The element m 1 of n 2 records the setting color C 2 , the element m 2 points out n 3 and the element m 3 points out g 3 . The element m 4 of g 3 records the command D 3 and the element m 5 points out nothing. This means that the instruction which is dump printed by the setting color C 2 indicates D 3 . The element m 1 of n 3 records the setting color C 3 , the element m 2 points out nothing, and the element m 3 points out g 4 . The element m 4 of g 4 records the command D 4 and the element m 5 points out g 5 . The element m 4 of g 5 records the command D 5 and the element m 5 points out g 6 . The element m 4 of g 6 records the command D 6 and the element m 5 points out nothing. This means that the combination of the instructions which are printed by the setting color C 3 is set to D 4 , D 5 , and D 6 . When the command color setting instruction is sent to the printer, it is processed in accordance with a processing routine in Fig. 4 mentioned above and reaches step S19. The processes which are executed by the function which is called in step S19 at that time will now be described in detail with reference to a flowchart of Fig. 8. When the function to process the command color setting instruction is called, the variables and the like are first initialized in step S31, all of the pointer variables are substituted by NULL, the numeral variable is cleared, and the Boolean variable is substituted by FALSE. In the next step S32, a token is extracted from the reception buffer 3. In step S33, a check is made to see if the extracted token denotes the end of process or not. If YES, step S34 follows. If NO, step S35 follows. In step S35, a check is made to see if the extracted token denotes a command format or a character train indicative of the setting color. When it is the command format, step S41 follows. When it is the character train indicative of the setting color, step S37 follows. A grammatical check is executed in step S41 and subsequent steps in order to register the combinations of the instructions. The correct instructions are linked like a chain. In the first step S41, a pointer variable CST indicating the head of the command search table 7a is substituted to a pointer variable V for comparison. In step S42, the command which is pointed out by the pointer variable V is compared with the extracted token, thereby checking a syntax. When they coincide, step S43 follows. When they differ, step S51 follows. In step S51, the pointer variable V is increased only one step in order to refer to the next instruction. In step S52, a check is made to see if the pointer variable V exceeds a limit or not. When it exceeds the limit, the processing routine is returned to step S32. If NO, the processing routine is returned to step S42. The command which coincides with the token extracted in step S32 is searched by a processing loop of step S42 → step S51 → step S52 → step S42 .... When the coincident command is found out, it is registered in the processes in step S43 and subsequent steps. When there is no coincident command, the token is abandoned and the processing routine is returned to step S32 in order to extract the next token. Processes to couple the pointer in order to register the commands are executed in step S43 and subsequent steps. First, when the value of a Boolean variable t b is TRUE in step S43, step S39 follows. In the other cases, step S44 follows. Step S44 and subsequent steps relate to processes to link the commands in the vertical direction when registering an instruction group of a new combination. The link in the vertical direction denotes a link which progresses, for instance, R → n 1 → n 2 → n 3 in the case of an example shown in Fig. 5 mentioned above. On the other hand, the commands are linked in the lateral direction in the processing step S39 and subsequent steps. In the example of Fig. 5, such a processing routine corresponds to g 1 → g 2 . In step S44, only one area in the structure A is assured and the head address is substituted to a pointer variable W. In step S45, when the value of the pointer variable R is NULL, step S50 follows. In the other cases, step S46 follows. In step S50, the value of the pointer variable W is substituted to the pointer variable R and step S47 follows. The pointer variable R denotes a pointer which is first referred to refer to the subsequent data coupled like a chain. In step S46, the value of the pointer variable W is substituted to the element m 2 of the structure A which is pointed out by a pointer variable p i . Step S47 then follows. In step S47, the value of the pointer variable W is substituted to the pointer variable p i and TRUE is substituted to the Boolean variable t b . In step S48, only one area in the structure B is assured and the head address is substituted to a pointer variable X. In step S49, the value of the pointer variable X is substituted to the element m 3 of the structure A which is pointed out by the pointer variable p i and step S53 follows. In step S39, only one area in the structure B is assured and the head address is substituted to the pointer variable X. In step S40, the value of the pointer variable X is substituted to the element m 5 of the structure B pointed out by a pointer variable p j and step S53 follows. In step S53, the value of the pointer variable X is substituted to the pointer variable p j . In step S54, the value of the pointer variable V is substituted to the element m 4 of the structure B pointed out by the pointer variable p j and the NULL pointer is substituted to the element m 5 . The processing routine is returned to step S32. In step S36, a check is made to see if the Boolean variable t b is TRUE or not. The Boolean variable t b indicates whether the command has been registered or not. When it is TRUE, the processing routine advances to step S37 in order to record the color for the series of registered commands. In the other cases, this means that no command is registered, so that the processing routine is returned to step S32 without performing any process. In step S37, the token as a character train indicative of the setting color is substituted to the element m 1 of the structure A pointed out by the pointer variable p i . In step S38, FALSE is substituted to the Boolean variable t b in order to indicate the absence of a group of commands which are at present being registered. The processing routine is returned to step S32. A flowchart of Fig. 9 will now be described. Fig. 9 is a flowchart showing the processes of the main body 1 in the dumping mode. When the main body 1 is set into the dumping mode by the operating panel 9, a part of the contents in the environment information area 8a is initialized in step S71 to print in the dumping mode on the basis of the print environment information 4a in the RAM 4. However, the foregoing pointer variable R, the combinations of the instructions which have been recorded after that, the information regarding the setting colors, and the like are not updated. By the initialization, the print environment in the ordinary operating mode is extinguished at a time point when the operating mode is shifted to the dumping mode. The printing operation is certainly executed in a constant environment in the dumping mode. In the next step S72, the main body 1 is set into the data reception standby mode and waits for the data from the host computer 2. When the data is sent from the host computer 2, it is temporarily stored into the reception buffer 3 and, after that, it is extracted as a token and the next process is started. In step S73, a check is made to see if the extracted token denotes the print data or the print control instruction. When it is the print data, step S74 follows. When it is the print control command, step S76 follows. In step S74, the foreground value preserved in the environment information 8a is substituted to the print color variable C and the ordinary print color is set. In the process step S76 and subsequent steps, a check is made to see if the received data coincides with the command character train group registered in the pointer variable R and subsequent variables or not, and the color is temporarily switched to the registered setting color with respect to the coincident command character train and the data is printed by the switched color. In step S76, the value of the pointer variable R is substituted to the pointer variable S i to refer to the registered information. In step S77, a check is made to see if the pointer variable S i denotes an NULL pointer or not. When it is NULL, step S74 follows. In the other cases, step S78 follows. In step S78, the value of the element m 3 of the structure A pointed out by the pointer variable S i is substituted to the pointer variable S j . In step S79, a check is made to see if the value of S j is NULL or not. When it is NULL, step S85 follows. In the other cases, step S80 follows. In step S80, a check is made to see if the token extracted on the basis of the value of the pointer indicating the command search table 7a recorded in the element m 4 of the structure B pointed out by the pointer variable S j is a target instruction or not. If YES, step S81 follows. If NO, step S85 follows. In step S85, the value of the element m 2 of the structure A which is at present pointed out by the pointer variable S i is substituted to the pointer variable S i . The processing routine is returned to step S77. In step S81, the token registered in the reception buffer 3 is not extracted but is temporarily copied into another area, thereby temporarily reading the subsequent token after the token as a target of the verification at present. In step S82, the value of the element m 5 of the structure B which is at present pointed out by the pointer variable S j is substituted to the pointer variable S j . In step S83, a check is made to see if the value of the pointer variable S j is NULL or not. When it is NULL, step S84 follows. In the other cases, the processing routine is returned to step S80. In step S84, the element m 1 of the structure A which is pointed out by the pointer variable S i is substituted to the print color variable C. Step S75 follows. In step S75, the extracted token is dump printed by the color set into the print color variable C.

Claims: A printing method comprising a step of receiving a group of control commands; a second receiving step is provided to receive a first control command; a storing step is provided to store the received first control command; a comparing step is provided to compare each of the control commands in the received group of control commands to the stored first control command; a first setting step is provided to set a first color for control commands in the received group of control commands which are identical to the stored first control command; a second setting step is provided to set a second color for control commands in the received group of control commands which are not identical to the stored first control command; and said printing step prints the received group of control commands in the first and second colors. A method according to claim 1, wherein said second receiving step receives a plurality of the first control commands. A method according to claim 1, wherein said second receiving step receives a combination of a plurality of the first control commands. A method according to claim 1, wherein the second color is a color preset as a default color. A method according to claim 1, wherein said first receiving step receives information comprising control commands and print character data in mixture. A method according to claim 5, wherein said first receiving step receives the information from a host computer. A method according to claim 1, wherein said steps are performed when a dump print instruction is received. A printing apparatus comprising means for receiving a group of control commands, memory means provided to store a first control command; comparing means provided to compare each of the control commands in the group of control commands received in said receiving means to the first control command stored in said memory means; setting means provided to set first color for control commands in the received group of control commands which are identical to the stored first control command, and to set a second color for control commands in the received group of control commands in the received group of control commands which are not identical to the stored first control command; and means for printing the received group of control commands in the first and second colors. An apparatus according to claim 8, wherein said memory means stores a plurality of the first control commands. An apparatus according to claim 8, wherein said memory means stores a combination of a plurality of the first control command. An apparatus according to claim 8, wherein the second color is a color preset as a default color. An apparatus according to claim 8, wherein said receiving means receives information comprising control commands and print character data in mixture. An apparatus according to claim 12, wherein said receiving means receives the information from a host computer. An apparatus according to claim 8, wherein said apparatus is activated when a dump print instruction is received.

Inventors: NISHIKAWA NAOYUKI, NISHIKAWA, NAOYUKI, NISHIKAWA, NAOYUKI, C/O CANON KABUSHIKI KAISHA
Applicants: CANON KK, CANON KABUSHIKI KAISHA
Application year: 1991
Main classification: G06K15
IPC codes: G06K15