BAR CODE READING APPARATUS

Abstract: A bar code reading apparatus comprises a reading unit (11) for optically reading a bar code and generating an output data corresponding to this bar code, a memory (22), and a data processing unit (20, 21, 23, 24) for storing the output data from the reading unit (11) into the memory (22) and making a bar code data in accordance with the content of the memory (22). This reading apparatus further has a mode selection flag (PSF) for selectively instructing either one of the first and second modes, and the data processing unit (20, 21, 23, 24) stores the output data from the reading unit (11) as it is into the memory (22) when the first mode is designated by the mode selection flag (PSF), while the data processing unit stores the inverted data of the output data from the reading unit (11) into the memory (22) when the second mode is set by the mode selection flag (PSF).

Description: The present invention relates to a bar code reading apparatus for optically reading a bar code. US-A-4 272 675 discloses such a bar code reading apparatus comprising reading means for optically reading a bar code and generating an output data corresponding to said bar code, memory means, and data processing means for storing the output data from said reading menas into said memory means and making a bar code data in accordance with the content of that memory means. From US-A-413 351 an information reader for reading both light transmissive and light reflective information from an information carrying medium is known. This apparatus is provided with a mode selection switching circuit for inverting the signal produced by photelectric transducers. The mode selection switch has to be set depending on the chosen information carrying medium. Hitherto, bar codes printed on packages of articles have ordinarily been dark black and lacking in brightness, while the background has been pure white having high brightness. For the purpose of properly reading such bar codes, bar code reading apparatuses have been specially designed. Many packages, however, are colored other than in the manner described above, i.e., the packages being of a dark color, creating the possibility that, should an equally dark bar code be printed on such a package, an erroneous reading will ensue. In the interest of preventing such erroneous readings many packages are specially designed and printed so as to include a designated white area on which a black bar code can be printed. Such specific printing, though it solves the problem of erroneous readings, only contributes to an increase both in the cost of printing and, ultimately, in the cost of the articles themseleves. In consideration of such disadvantages, there are packages printed such that the package color is used as the background color of the bar code region. Consequently, by printing the bar code in a color having a brightness different from that of the background color, only two print colors are used, thereby reducing the print cost. Naturally, as described above, if the two print colors are white (background) and black (bar code), the given bar code can be read by a conventional bar code reading apparatus. However, in some cases, packages of a dark color may be used so as to provide a more attractive article package, thereby being inappropriately designed for easy reading by a conventional bar code reading apparatus. There are, in fact, some packages in use whose background color is black and whose bar code and characters are printed in a gold color, such as, for example, packages of tobaccos made in the U.S.A. similarly, some packages have a background color of dark gray or black and a bar code and characters of light gray or the like. Inevitably, the reading of such bar codes by a conventional bar code reading apparatus cannot be done accurately, inverted bar code being obtained as a result of the inversion of the usual background and bar code colors. It is an object of the present invention to provide a bar code reading apparatus which can read both a bar code having a high brightness or a background having low brightness, and a bar code having low brightness or a background having a high brightness. This object is accomplished by a bar code reading apparatus comprising: reading means for optically reading a bar code having a right guard bar and a left guard bar and a center bar, and generating output data corresponding to said bar code; and data reproducing means for producing bar code data in accordance with the output data from said reading means ; wherein said data reproducing means includes: memory means for storing the output data from said reading means , processing means for decoding the content of said memory means and checking whether at least two of the right guard, left guard, and center bars are included in the decoded data to authorize the decoded data as said bar code data; characterized in that said processing means includes control means for inverting the output data from said reading means and replacing the data stored in said memory means by the inverted data when it is detected that said at least two bars are not included in the decoded data. According to a further aspect of the present invention, there is provided a bar code reading apparatus as defined in claim 2. Yet a further aspect of the present invention is defined in claim 3. This invention can be more fully understood from the following detailed description when taken in conjunction with the accompanying drawings, in which: Fig. 1 shows a hand held scanner used in a bar code reading apparatus according to one embodiment of the present invention; Fig. 2 shows an example of a bar code detected by the hand held scanner shown in Fig. 1; Fig. 3 is a constructional diagram of the hand held scanner shown in Fig. 1; Fig. 4 is a constructional diagram of a CCD linear sensor shown in Fig. 3; Fig. 5 is a block diagram of a bar code reading apparatus according to one embodiment of the invention; Fig. 6 is a signal waveform diagram illustrating the operation of the hand held scanner in Fig. 1; Fig. 7 is a flowchart showing a processing routine of an output signal from a CCD linear sensor in Fig. 5; Figs. 8A to 8C are flowcharts explaining the operation of the bar code reading apparatus shown in Fig. 5; Figs. 9A to 9D show bar code data which is stored into registers in Fig. 5; Fig. 10 is a block diagram of a bar code reading apparatus according to another embodiment of the present invention; Fig. 11 is a flowchart showing a processing routine of an output signal from a CCD linear sensor in Fig. 10; Figs. 12A to 12C are flowchart explaining the operation of the bar code reading apparatus shown in Fig. 10; Fig. 13 is a block diagram of a bar code reading apparatus according to still another embodiment of the invention; and Fig. 14 is a flowchart showing a processing routine of an output signal from a CCD linear sensor in Fig. 13. One embodiment of the present invention will now be described with reference to the drawings. By pressing the hand held scanner 11 of a bar code reading apparatus according to one embodiment of the present invention onto a label 2 stuck to an article 1, as shown in Fig. 1, a bar code 3 printed on the label 2 is read. As shown in Fig. 2, the bar code 3 is the universal product code (UPC), and comprises, over an area extending from left to right, a left margin 4 of x modules, a left guard bar 5 of three modules, a data character 6 of forty-two modules which corresponds to six characters, a center bar 7 of five modules, a data character 8 of forty-two modules which corresponds to six characters, a right guard bar 9 of three modules, and a right margin 10 of y modules. The sum of the module numbers x and y is set at 18 or less. As shown in Fig. 3, the scanner 11 includes a lamp 12, a diffusion lens 13 to diffuse the light of the lamp 12 in the direction of the label 2; a CCD linear sensor 15, similar to an image sensor, for receiving the reflected lights from the label 2 through a lens 14; a wave-shaping circuit (WSC) 16 to shape the waveform of an output pulse from the sensor 15, and a shift clock generator circuit (SCG) 17 to supply a shift clock signal to the sensor 15. As shown in Fig. 4, the CCD linear sensor 15 is constituted such that n photodiodes PD₁ to PD n are arranged in a line and connected to a CCD shift register SR through shift gates SG₁ to SG n , respectively. Fig. 5 is a block diagram of a bar code reading apparatus according to one embodiment of the present invention. The bar code reading apparatus includes: a central processing unit (CPU) 20, a read only memory (ROM) 21, a random access memory (RAM) 22, and registers 23 and 24. The CPU 20 is connected to the wave-shaping circuit 16 through an input port 25, and coupled to the shift clock generator circuit 17, CCD linear sensor 15, and oscillators 30 and 31 through output ports 26 to 29, respectively. Output signals of the oscillators 30 and 31 are supplied to a buzzer 32 through an OR gate 33. The CPU 20 is further connected, through a serial transfer interface 34, to a host machine (not shown) such as a cash register or the like. An output terminal of the wave-shaping circuit 16 is connected to the CPU 20 through an inverter 37 and an input port 38. The operation of the bar code reading apparatus shown in Fig. 5 will now be explained. When the detecting surface of the hand held scanner 11 comes into contact with the label 2, the photodiodes PD₁ to PD n of the CCD linear scanner 15 generate output signals in response to the light and shade of the bar code 3, as shown in Fig. 6A. Thereafter, the CPU 20 generates a parallel load signal shown in Fig. 6B at a timing as will be mentioned later in accordance with the flowchart of Fig. 7. In response to the parallel load signal, the output signals from the photodiodes PD₁ to PD n are loaded, in parallel, as bit signals into n stages of the shift register SR through the shift gates SG₁ to SG n , respectively. Next, the CPU 20 supplies a clock trigger signal to the shift clock generator circuit 17, thereby allowing the n bit signals of "0" and or "1", loaded into the shift registers SR, to be sequentially supplied to the wave-shaping circuit 16 in response to shift clock pulses, shown in Fig. 6C, which are generated from the shift clock generator circuit 17. The bit signals supplied to and processed in the wave-shaping circuit 16 in this way are then fetched by the CPU 20 through the input port 25 or 38 in accordance with the content of an input port selection flag PSF in the flag area in the RAM 22, and n-bit data corresponding to the n bit signals is then sequentially loaded into the RAM 22. When it is detected that a predetermined number of shift clock pulses have been generated from the shift clock generator circuit 17, namely, when it is detected that all bit signals have been supplied from the shift register SR to the wave-shaping circuit 16, a subroutine indicative of the reading operation of the bar code detected by the CCD linear sensor 15 shown in Fig. 7 is terminated and, at this time, n-bit data corresponding to the n bit signals is stored in the RAM 22. After completion of the reading operation of the bar code detected by the CCD linear sensor 15, the CPU 20 checks whether or not all bits of the n-bit data from the hand held scanner 11 are "0" or "1" on the basis of the n-bit data stored in the RAM 22, as shown in the flowchart of Figs. 8A to 8C. When all bits of the n-bit data from the scanner 11 are "0" or "1", it is determined that the detecting surface of the scanner 11 has been removed from the label 2, so that the CPU 20 again executes the subroutine shown in Fig. 7. When it is detected that "0" and "1" bits are included in the n-bit data from the scanner 11, the CPU 20 decodes the n-bit data stored in the RAM 22 into corresponding bar code data, which it then stores into the register 23 in STEP 1. Next, the CPU 20 checks to see if the data LG, indicative of the left guard bar 5 of three modules, has been stored in the register 23 in STEP 2. If YES in STEP 2, the CPU 20 checks to see if the data RG, indicative of the right guard bar 9 of three modules, has been stored in the register 23 in STEP 3. If YES in STEP 3, the CPU 20 executes the module check in STEP 4 to see if the bar code data stored in the register 23 is correct. If YES in STEP 4, the CPU 20 supplies a drive signal to the oscillator 30 through the output port 28, thereby energizing the buzzer 32 in response to an output signal from the oscillator 30. At the same time, the CPU 20 transfers, through the interface 3y the bar code data in the register 23 to the host machine. Thereafter, the CPU 20 executes, in STEP 5, the subroutine shown in Fig. 7. After confirmation that all bits of the n-bit data from the scanner 11 are "0" or "1", the CPU 20 reexecutes this processing routine from the beginning. Even if NO in STEP 4, STEP 5 is still executed. A YES in STEP 4, combined with the ringing of the buzzer 32 in response to the output signal from the oscillator 30, means that all of the bar code 3 has been reflected into the detecting surface of the scanner 11 and detected by the single reading operation. In other words, in Fig. 5, a reading completion informing circuit is constituted by the oscillator 30 and buzzer 32. When the entire bar code 3 is detected by the single reading operation in this way, the left guard bar data LG, right guard bar data RG; center bar data CB, indicative of the center bar 7; and character data representative of the data characters 6 and 8 on both sides of the center bar data CB, as shown in Fig. 9A, are stored in the register 23. If NO in STEP 2, a check is made to see if the center bar data CB has been stored in the register 23 in STEP 6. If YES in STEP 6, a check is made to see if the right guard bar data RG has been stored in the register 23. If the right guard bar data has not been stored, STEP 5 is executed after the flag PSF is reset. In contrast, if YES, indicating storage of the right guard bar data, the CPU 20 transfers the bar code data from the register 23 into the register 24, and supplies a drive signal to the oscillator 31 through the output port 29, thereby energizing the buzzer 32 in response to an output signal from the oscillator 31. The oscillating frequencies of the oscillators 30 and 31 differ from each other, so that the buzzer 32 generates two kinds of sounds having different pitches. By listening to the sound generated from the buzzer 32 energized by the output signal from the oscillator 31, the operator can confirm that at least the right or left half of the bar code was read out in the first bar code reading operation. Now, assuming that the scanner 11 has been located at a position on the right side of the bar code 3 and has been set on the label 2 in the first bar code reading operation, the right guard bar data RG, center bar data CB, and character data between these data RG and CB are stored in the register 23 as shown in, for example, Fig. 9B. In contrast, the left guard bar data LB and a part of the character data on the left side of the center bar data CB are stored, as undecodable data F, into the register 23. After the bar code data in the register 23, including the undecodable data F has been transferred to the register 24, the CPU 20 waits until all bits of the n-bit data from the scanner 11 become "0" or "1", that is, until the scanner 11 is moved away from the label 2. After it has been detected that all bits in the n-bit data from the scanner 11 became "0" or "1", the CPU 20 waits until "0" and "1" bit signals are supplied from the scanner 11, namely, until the scanner 11 again comes into contact with the label 2. Thereafter, the CPU 20 decodes the n-bit data stored in the RAM 22, stores the decoded bar code data into the register 23 and then checks to see if the left guard bar data LG is present in the register 23 in STEP 7. If NO in STEP 7, STEP 5 is executed after the flag PSF is reset. If YES, a check is made to see if the center bar data CB has been stored in the register 23. If NO in this step, STEP 5 is executed. after the flag PSF is reset and, if YES in thus step, the right guard bar data RG in the register 24, along with the character data stored in the digits on the right side of the center bar data CB, are transferred to the digit locations on the right side of the center bar data CB in the register 23. Thus, by combining the bar code data (shown in Fig. 9C) stored in the register 23 and obtained through the second bar code reading operation with the bar code data (shown in Fig. 9B) stored in the register 24 and derived through the first reading operation, the bar code data, including the right guard bar data RG, center bar data CB, left guard bar data LB, and character data, as shown in Fig. 9D, is stored in the register 23. Thereafter, the CPU 20 executes STEP 4. In the case where the scanner 11 is set to read the left portion of the bar code 3 in the first reading operation, YES is indicated in STEP 2 and NO in STEP 3. Thereafter, the CPU 20 checks to see if the center bar data CB has been stored in the register 23 in STEP 8. If YES in STEP 8, the content of the register 23 is transferred to the register 24 in a similar manner as explained above and, thereafter, the CPU 20 energizes the buzzer 32 by the output signal from the oscillator 31. After that, if the scanner 11 is set to read the right portion of the bar code 3 in the second reading operation, the CPU 20 stores the bar code data obtained by decoding the n-bit data in the RAM 22 into the register 23. Next, the CPU 20 checks to see if the right guard bar data RG has been stored in the register 23 in STEP 9. If NO in STEP 9, STEP 5 is executed after the flag PSF is reset. If YES in STEP 9, after it has been detected that the center bar data CB has been stored in the register 23, the left guard bar data LG in the register 24 and the character data stored in the digit locations to the left of the center bar data CB are transferred to the digit locations on the left side of the center bar data CB of the register 23, respectively. Then, the CPU 20 performs the module check in STEP 4. If NO in STEP 6 or 8, the CPU 20 checks to see if the n-bit data was received through the input port 25 in STEP 10. If NO in STEP 10, STEP 5 is executed after the input port selection flag PSF is reset. If YES in STEP 10, the bar code reading operation shown in Fig. 7 is executed after the input port selection flag PSF is set. However, in this case; since the flag PSF is set, the CPU 20 determines that the bar code having a higher brightness than its background is printed, so that it receives the n-bit data through the input port 38 instead of the input port 25. Subsequently, the CPU 20 executes STEP 1 in a manner similar to that mentioned above. As described above, in this embodiment, the n-bit data from the scanner 11 is detected through the input port 25 in the ordinary operation mode so as to detect the bar code of lower brightness than its background. When it is detected that neither the center bar code nor one of the right and left guard bars can be detected in the ordinary operation mode, the n-bit data from the scanner 11 are inverted so as to detect the bar code having a higher brightness than its background and, thereafter, read through the input port 38. Fig. 10 shows a block diagram of a bar code reading apparatus according to another embodiment of the present invention. This bar code reading apparatus is constituted and operates in a manner similar to that shown in Fig. 5, with the exception that the input port 38 is omitted and a signal selection switch 40 used to selectively supply either one of the output signals of the wave-shaping circuit 16 and inverter 37 to the input port 25. On one hand, the signal selection switch 40 is set in the first switching position by way of, for example, a manual operation when reading a bar code of lower brightness than its background, and transmits the output signal from the wave-shaping circuit 16 to the input port 25. On the other hand, when reading a bar code of higher brightness than the background, the switch 40 is set in the second switching position and transmits the output signals generated from the wave-shaping circuit 16 and inverted by the inverter 37 to the input port 25. Fig. 11 is a flowchart showing the reading operation of the bar code detected by the CCD sensor 15 shown in Fig. 10. In this embodiment, since the n-bit data supplied through the input port 25 always accurately represents the bar code, irrespective of the kinds of bar codes, the n-bit data from the scanner 11 can be written as is into the RAM 22 without, moreover, the need of the flag PSF. Figs. 12A to 12C are flowcharts showing the operation of the bar code reading apparatus shown in Fig. 10. These flowcharts are similar to those shown in Figs. 8A to 8C, with the exception that STEP 5 is immediately executed if NO is indicated in STEP 6 or 8, and the subroutine shown in Fig. 11 is used in place of the subroutine shown in Fig. 7. In this embodiment, since the bar code data which always accurately represents the bar code, irrespective of the kinds of bar codes, is stored in the register 23, by checking the bar code in the register 23 it is possible to easily check whether the left guard bar data LG, right guard bar data RG or center bar data CB has been stored in the register 23 or not. Fig. 13 is a block diagram of a bar code reading apparatus according to still another embodiment of the invention. This bar code reading apparatus is constituted and operates in a manner similar to that shown in Fig. 5, with the exception that the inverter 37 and input port 38 are omitted and a selection switch 41 is connected to the CPU 20 through an input port 42. When reading a bar code of lower brightness than the background, the selection switch 41 is set in the ON position by way of, for instance, a manual operation. In contrast, when reading a bar code of higher brightness than the background, the switch 41 is set in the OFF state. Fig. 14 is a flowchart showing the reading operation of the bar code detected by the CCD sensor 15 shown in Fig. 13. The CPU 20 in this case writes the data received through the input port 25 as is in the RAM 22 or, conversely, in this case writes the received data after it has been inverted in the RAM 22, depending on the switching position of the selection switch 41. In this case, the CPU 20 discriminates the kind of bar code by checking the switching position of the selection switch 41, so that the flag PSF is unnecessary. The operation of the bar code reading apparatus shown in Fig. 13 is executed substantially in accordance with the flowcharts shown in Figs. 12A to 12C, with the exception that the subroutine shown in Fig. 14 is used instead of the subroutine of Fig. 11. Even in this embodiment, the bar code data which always accurately represents the bar code irrespective of the kinds of bar codes is stored in the register 23, so that an effect similar to that of the bar code reading apparatus shown in Fig. 10 is obtained. Although the present invention has been described with respect certain embodiments, it is not limited to only these embodiments. For example, in the case where NO is indicated in STEP 7 or 9, as per the flowcharts of Figs. 8A to 8C and 12A to 12C, the flow of the apparatus can be altered to execute the process of "perform subroutine of Fig. 7 or 11", which occurs three steps before STEP 7 or 9. Further, in the embodiment shown in Fig. 5, the inverter 37 and input port 38 may be omitted, and the process, executed when NO is indicated in the step of "PSF = "0" ?", of the flowchart shown in Fig. 7 can be changed to the process of "receive n-bit data through input port 25, invert received data and store inverted data in RAM 22".

Claims: A bar code reading apparatus comprising: reading means (11) for optically reading a bar code having a right guard bar, a left guard bar and a center bar, and generating output data corresponding to said bar code; and data reproducing means (20, 21, 22, 23, 24) for producing bar code data in accordance with the output data from said reading means (11); wherein said data reproducing means includes: memory means (22) for storing the output data from said reading means (11), processing means (20, 21, 23, 24) for decoding the content of said memory means (22) and checking whether at least two of the right guard, left guard, and center bars are included in the decoded data to authorize the decoded data as said bar code data; characterized in that said processing means includes control means (PSF, 37) for inverting the output data from said reading means (11) and replacing the data stored in said memory means (22) by the inverted data when it is detected that said at least two-bars are not included in the decoded data. A bar code reading apparatus comprising: reading means (11) for optically reading a bar code having a right guard bar, a left guard bar and a center bar, and generating output data corresponding to said bar code; and data reproducing means (20,21,22,23,24) for producing bar code data in accordance with the output data from the reading means (11); wherein said data reproducing means includes: memory means (22) for storing the output data from said reading means (11), processing means (20,21,23,24) for decoding the content of said memory means (22) and checking whether at least two of the right guard, left guard, and center bars are included in the decoded data to authorize the decoded data as said bar code data; characterized in that said processing means includes control means (37, 40) having inverting means (37) for inverting the output data from said reading means (11), switching means (40) for selecting either the output data from said reading means (11) or the output data from said inverting means (37), writing means for writing the output data selected by said switching means (40) in said memory means (22), and means for requesting update of said memory means (22) when it is detected that said at least two bars are not included in the decoded data, thereby inhibitting authorisation of outputting the decoded data. A bar code reading apparatus comprising: reading means (11) for optically reading a bar code having a right guard bar, a left guard bar and a center bar, and generating output data corresponding to said bar code; and data reproducing means (20,21,22,23,24) for producing bar code data in accordance with the output data from the reading means (11); wherein said data reproducing means includes: memory means (22) for storing the output data from said reading means (11), processing means (20,21,23,24) for decoding the content of said memory means (22) and checking whether at least two of the right guard, left guard, and center bars are included in the decoded data to authorize the decoded data as said bar code data; characterized in that said processing means includes control means (41) having switching means for selecting either a first or a second mode, writing means for writing the output data from said reading means (11) into said memory means (22) in said first mode, and inverting the output data from said reading means and writing the inverted data in said memory means in the second mode, and means for requesting update of said memory means (22) when it is detected that said at least two bars are not included in the decoded data, thereby inhibitting authorisation of outputting the decoded data. A bar code reading apparatus according to any one of claims 1-3, characterized in that said control means includes a first memory (23) for storing the decoded data. A bar code reading apparatus according to claim 1 characterized in that said control means includes a flag memory (PSF), and setting means for setting a flag in said flag memory (PSF) when it is detected that said at least two bars are not included in the decoded data. A bar code reading apparatus according to claim 5, characterized in that said control means includes inverting means (37) for inverting the output data from said reading means (11), and writing means for writing the inverted data from said inverting means (37) into said memory means (22) when the flag is set in said flag memory (PSF). A bar code reading apparatus according to claim 4, characterized in that said control means includes informing means (28 to 32) for informing the result of bar code readout operation, and driving means for energizing said informing means (28 to 32) when it is detected that the center bar and one of the guard bars exists in said first memory (23). A bar code reading apparatus according to claim 7 characterized in that said informing means has first and second drivers (28 to 31) and a buzzer; and said control means further has a second memory (24), means for transferring the content of said first memory (23) into said second memory (24) when it is detected in a first readout cycle that the center bar and one of the guard bars exists in said first memory (23) and supplying a drive signal to said first drive means (28, 30) to allow said buzzer (32) to ring, means for transferring said one of the guard bars and data between the center bar and said one of the guard bars from said second memory (24) to said first memory (23) when it is detected in a second readout cycle that the center bar and the other one of the guard bars exists in said first memory (23), and means for supplying a drive signal to said second driver (29, 31) to allow said buzzer (32) to ring after confirming that the content of the first memory (23) is suitable bar code data when it is detected in the first or second readout cycle that the right and left guard bars and center bar exist in said first memory (23).

Inventors: KURIMOTO, YUKUO
Applicants: TOKYO ELECTRIC CO., LTD.
Application year: 1985
Main classification: G06K7
IPC codes: G06K7