High speed scan bar code reader which can read more than one type of bar code

Abstract: A bar code reader using a high speed scanner, containing: a scanning unit for scanning a surface on which a bar code is printed; a bar width detecting unit (122) for successively detecting widths of bars; a bar width storing unit (124) for storing the detected widths; an address generating unit (18) for generating an address of the bar width storing unit at which each of the widths is to be stored; a fast screening unit (123) for determining whether or not a set of widths successively detected by the bar width detecting unit satisfies a predetermined necessary condition for the set of widths constituting a complete bar code; and a bar code decoding unit (113, 114, 115) for reading a set of successive widths from the above generated address, and decodes the bar code determined by the complete bar code detecting unit. Further, a type of bar code detecting unit (701 - 70N) for detecting a type of bar code constituted by the detected widths, and an address & type storing unit (90) for storing the detected type of bar code, together with information on the above generated addresses for the widths of the bar code, may be inserted. In this case, the bar code decoding unit contains a plurality of specific type decoding units for respectively decoding a plurality of types of bar codes. The bar code decoding unit reads the above stored widths from the addresses indicated by the information stored in the address & type storing unit, and decodes the bar code constituted by the widths using one of the above specific type decoding unit corresponding to the type stored in the address & type storing unit together with the above information.

Description: The present invention relates to a bar code reader using a high speed hands-free scanner, which is used in the field of the distribution and transportation industries, and retail stores for selling commodities. For example, the bar code reader with a scanner is used with POS (point of sale) terminal equipment. There are two types of scanners used for bar code readers. In one type, scanning is carried out at high speed, and in the other type, the scanning speed is low. The low speed scanning is used in, for example, pen-type, gun-type, and touch-type bar code readers where the operator holds and applies a hand-held scanner unit to a surface of an article of commerce on which a bar code is printed. In such a bar code reader using a low speed scanning, decoding of the bar code read by the scanning is carried out by software. Therefore, when programs for decoding a plurality of types of bar codes are installed in such a bar code reader using low speed scanning, the bar code reader can read the plurality of types of bar codes with no substantial increase in hardware. However, the reading speed in the above bar code reader using low speed scanning is very low because of the low scanning speed, and the hand operation for applying the scanning unit is bothersome. Therefore, hands-free high speed scanners are now used for bar code reading with POS terminal equipment. In the bar code reader using the hands-free high speed scanner, laser beams, for scanning a bar code at high speed in various directions, are successively output from a window of a fixed scanner, and the operator places an article of commerce on the window so that the surface on which a bar code is printed is exposed to the laser beams. Conventionally, the decoding of the bar codes read by the above high speed scanner is carried out by a hardware logic circuit designed to decode a specific type of bar code, and all bar width data read by the above successive scanning beams are supplied to the hardware logic circuit to be decoded. Software decoding cannot be used in the bar code reader using the high speed scanning because the scanning speed is very high (several hundreds meters/sec), which generates electric signals having periods of a few microseconds. For this reason, the scanner successively supplies all the bar width data to the hardware logic circuit, and thus, high speed data processing is required for decoding the successive bar width data. A decoding speed using software is too slow to decode the above successive bar width data. There are a plurality of types (standards) of bar codes such as the UPC codes (including the EAN code in Europe and the JAN code in Japan) which are widely used in the field of the distribution industry, the CODE 39 which is used in manufacturing industries, the Interleaved 2 of 5 which is used in the transportation industries, the Codabar, and CODE 128. As mentioned above, conventionally, every bar code reader using the high speed scanner can read bar codes of one type only (bar codes in accordance with one standard only). However, more than one type of bar codes is often used by the same user, and it is required for the bar code reader to read more than one type of bar codes. The simple way for enabling the same bar code reader to read more than one type of bar code is to provide a plurality of hardware logic circuits for respectively decoding the different types of bar codes. However, this increases the size and the cost, in particular, when the number of types of bar codes is increased. US 4667089 discloses a bar code reader, suitable for use with a high-speed scanner, which may be considered to comprise: receiving means for receiving from such a high-speed scanner a scanning signal produced by scanning a surface of an article on which a bar code comprising a plurality of elements is printed, the scanning signal being changed between respective first and second levels depending on whether portions of the surface being scanned are black or white; bar width detecting means for successively detecting and outputting width values, each such width value representing a duration for which the scanning-signal level is unchanged; bar width storing means for storing the width values detected by the bar width detecting means; and address generating means for generating an address at which each of the width values is to be stored in the said bar width storing means. In this reader, width values of a bar code being scanned are stored once a space on the left side of the bar code has been detected. A bar code discrimination signal is only produced when four consecutive characters of the bar code are detected. Stored width values of the bar code are passed to a low-calculation-speed processor (which carries out the decoding of the width values) only when both the discrimination signal is produced and a space on the right side of the bar code is detected. This bar code reader is not capable of detecting the type of bar code being scanned and then carrying out decoding appropriate for the detected type. US 4855581 discloses a bar code decoder in which a preprocessor is provided in a stage preceding a microprocessor. In the preprocessor, counted time intervals, corresponding to bar width values, are converted logarithmically into respective single data words that can be processed efficiently by the microprocessor. Also, margins are detected and digital filtering for eliminating noise spikes is carried out in the preprocessor. However, a margin interrupt signal is applied by the preprocessor to the microprocessor when one margin alone is detected, and decoding processing by the microprocessor is not confined to when a complete bar code has been detected by the preprocessor. A bar code reader embodying the present invention is characterised by: type of bar code detecting means for determining whether or not a set of width values successively detected by the bar width detecting means satisfies a predetermined necessary condition for the set of width values to represent a complete bar code of one of a plurality of predetermined types of bar codes readable by the bar code reader and, if so, for detecting the type of bar code represented by the set of width values concerned; address & type storing means for storing information identifying the type of bar code represented by that set and also identifying such addresses generated by the address generating means for width values of that set; and bar code decoding means capable of decoding such a set of width values representing each of the said predetermined plurality of types of bar codes readable by the bar code reader, and activated, following such determination that such a set of width values satisfies the said predetermined necessary condition, to employ the said stored information for that set to decode the width values of that set in a manner appropriate for its detected type of bar code. Such a bar code reader can operate with a high speed scanner and can read a plurality of types of bar codes at a high speed with minimal increase in size and cost. The above determination of the completeness of the scanned bar code may be carried out based on whether or not widths corresponding to predetermined margins on both sides of a bar code are detected. The type of bar code detecting means may contain a unit for determining whether or not widths corresponding to predetermined margins on both sides of a bar code are detected. Further, the above type of bar code detecting means may contain a unit for determining a number of bars detected between the detected margins on both sides of a bar code. Alternatively, the type of bar code detecting means may contain a unit for determining a length of a character which is constituted by a set of successive widths, and located adjacent to the detected margin, or a unit for determining a relationship between widths of two predetermined widths in a character which is constituted by a set of a successive widths, and located adjacent to the detected margin. The address generating means and the type of bar code detecting means should be realized by a construction which enables high speed processing so that processing for all the widths output from the bar width detecting means are carried out without omission. On the other hand, the bar code decoding means may be realized by a construction which processes data at a relatively slow speed because the bar code decoding means operates only when the type of bar code detecting means determines that the above set satisfies the above necessary conditions, and has determined a type of bar code from the widths detected by the bar width detecting unit. For example, the address generating means and the type of bar code detecting means are preferably constructed by a hardware logic circuit, and the bar code decoding means may be realized by software. Reference will now be made, by way of example, to the accompanying drawings, in which: Figure 1 is a diagram indicating the basic construction of a bar code reader embodying the present invention; Figure 2 is a diagram indicating a construction of a bar code reader with a hands-free scanner; Figure 3 is a diagram indicating a construction of the control system in Fig. 2, according to an embodiment of the present invention; Figure 4 indicates two typical paths of the scanning laser beam; Figure 5 is a diagram indicating a structure of a bar code symbol of CODE39; Figure 6 is a diagram showing an example of the output of an analog to digital converter 107 of Fig. 2; Figure 7 is a block diagram indicating a construction of a margin detection circuit; Figure 8 is a block diagram indicating a construction of a margin detection circuit; Figure 9 is a block diagram indicating a construction for realizing parts of the Figure 3 control system in a first embodiment; Figure 10 is a timing chart indicating an example operation of the construction of Fig. 9; Figure 11 indicates examples of the CODE39 characters; Figure 12 is a block diagram indicating a construction for realizing parts of the Figure 3 control system in a second embodiment; Figure 12 is a diagram for indicating an operation to store the address information for bar codes of different types in different areas of the buffer memory in an address memorizing circuit 90 shown in Fig. 12; Figure 14 is a block diagram indicating a construction for realizing parts of the Figure 3 control system in a third embodiment; Figure 15 is a block diagram indicating a construction for realizing parts of the Figure 3 control system in a fourth embodiment; Figure 16 is a block diagram indicating a construction for realizing parts of the Figure 3 control system in a fifth embodiment; Figure 17 is a block diagram indicating a construction for realizing parts of the Figure 3 control system in a sixth embodiment; Figure 18 is a block diagram indicating a construction for realizing parts of the Figure 3 control system in a seventh embodiment; Figure 19 is a diagram showing the construction of a pattern detection circuit 37 in Fig. 18 according to the seventh embodiment; Figure 20 is a block diagram indicating a construction for detecting margins according to an eighth embodiment; Figure 21 is a diagram indicating a construction of comparators 46 and 47 in Fig. 19 and comparators 46' and 47' in Fig. 20; Figure 22 is a diagram indicating a construction of comparators 48 to 51 in Fig. 19; Figure 23 is a diagram indicating a construction for detecting a bar code by detecting a start pattern and a stop pattern; Figure 24 is a diagram indicating a structure of JAN13 as an example of the UPC codes; and Figure 25 is a block diagram indicating a construction for realizing parts of the Figure 3 control system in a tenth embodiment. Basic Operations of the Present Invention (Fig. 1) Figure 1 is a diagram showing a basic construction of a bar code reader embodying the present invention. In Fig. 1, reference numeral 210 denotes a bar width detecting unit, 211 denotes a bar width storing unit, 212 denotes an address generating unit, 213 denotes a fast screening unit, 214 denotes a type of bar code determining unit, 215 denotes an address & type storing unit, 216 denotes a bar code decoding unit, and 217 denotes a decoding program(s) for a (plurality of) type(s) of bar codes. The bar width detecting unit 210 successively detects and outputs widths of the signals corresponding to the scanning of black bars and white spaces, respectively. The output of the bar width detecting unit 210 is stored in the bar width storing unit 211, where the address for storing the widths is generated by the address generating unit 212. Parallel to the above, whether or not a set of widths successively detected by the bar width detecting unit satisfies a predetermined necessary condition for the set of widths constituting a complete bar code, is determined by the fast screening unit 213. Then, the type of bar code detecting unit 214 detects a type of bar code, the widths of elements of which are detected by the above bar width detecting unit, based on the detected widths when the fast screening unit determines that the above set of successive widths satisfies the above predetermined necessary condition, and the detected type of bar code is stored in the address & type storing unit 215, together with information on the above addresses generated by the address generating unit for the widths of the bar code. The bar code decoding unit 216 is provided with a plurality of specific type decoding units (programs 217) for respectively decoding a plurality of types of bar codes. The bar code decoding unit 216 reads the above widths stored in the above bar width storing unit from the addresses indicated by the information stored in the address & type storing unit, and decodes the bar code constituted by the widths using one of the above specific type decoding unit corresponding to the type which is stored in the address & type storing unit 215 together with the above information. Outline Construction of Bar Code Reader (Fig. 2) Figure 2 is a diagram indicating a construction of a bar code reader with a hands-free scanner. The bar code reader with a hands-free scanner comprises an optical system and a control system. In the optical system, reference numeral 101 denotes a laser generating unit for generating a laser beam, 102 denotes a laser control circuit for controlling the laser generating unit 101, 103 denotes an optical unit for scanning a bar code with the laser beam by using a rotating polygon mirror, 104 denotes a motor for rotating the polygon mirror, 105 denotes an optical detector for receiving a laser beam reflected at the bar code, 106 denotes an amplifier for amplifying an output of the optical detector 105, 107 denotes an analog to digital converter for converting an analog output of the amplifier 106 to a digital value, 108 denotes an LED lamp for indicating status of the bar code reader, and 109 denotes a speaker for notifying an operator that a bar code has been read. The control system comprises a scanner control circuit 110 for controlling the optical system, a decoding circuit 111 for decoding bar code data supplied from the analog to digital converter 107, and an interface circuit 112 with POS terminal equipment. Control System (Figs. 3 and 4) Figure 3 is a diagram indicating a construction of the control system in Fig. 2, according to an embodiment of the present invention. In Fig. 3, 113 denotes a CPU, 114 denotes a ROM for storing firmware, 115 denotes a RAM for storing firmware. The CPU 113 carries out an operation for decoding a bar code, controlling the optical system, and controlling a communication with the POS terminal equipment through the interface circuit 112. The digital output of the analog to digital converter 107 in Fig. 2, which is denoted by "BAR CODE SIGNAL", is binary, i.e., "1" while the laser beam is directed on a black bar, and "0" while the laser beam is directed on a white space. The bar width counter 122 counts, as a bar width, each duration in which the value of the BAR CODE SIGNAL is continuously "0" or "1" using a clock signal of a constant frequency. Thus, successive data respectively indicating widths of bars and spaces scanned with the laser beam are output from the bar width counter 122 corresponding to the respective bars and spaces. The bar width counter 122 also outputs a shift clock signal synchronizing with each of the above data. The data denoted by "BAR WIDTH DATA" in Fig. 3, is stored in the buffer memory 124. The above bar width data is also supplied to the bar code detection logic circuit 123 together with the shift clock signal. The construction comprised of the bar code detection logic circuit 123 and the buffer memories 124 and 125 realizes the functions in the various embodiments of the present invention as explained hereinafter. The basic function of the bar code detection logic circuit 123 is to detect a set of successive bar width data which satisfies a predetermined necessary condition for the set constituting a complete bar code, among bar width data supplied from the bar width counter 122. As explained before, in the hands-free scanners, the scanning of a bar code with the laser beam are carried out successively in a plurality of paths in various directions. Figure 4 indicates two typical paths of the scanning laser beam. In Fig. 4, in the path A, the laser beam scans all bars and spaces constituting a complete bar code, but in the path B, the laser beam scans only a portion of bars and spaces constituting a complete bar code. Namely, the output of the bar width counter 122 contains bar width data corresponding to a path of the laser beam in which a complete bar code is not scanned. Further, the laser beam may scan a character or a figure which may be printed near the bar code. Thus, only a part of the successive output of the bar width counter 122 corresponds to a scanned result of a complete bar code. As explained later, when a set of successive bar width data satisfying the necessary condition for a complete bar code is detected by the bar code detection logic circuit 123, the addresses of start and stop codes of the set are memorized in the buffer memory 125. In addition, a bar code detection logic circuit 123, constructed to detect only a predetermined type (kind) of bar code among complete bar codes of various standards, may be provided for each type of bar code to be detected. Or the same bar code detection logic circuit 123 may be constructed to detect only a set of a plurality of predetermined types (kinds) of bar codes among complete bar codes of various standards. In the latter case, the above addresses are stored in the buffer memory 125 with information on the type of the detected bar code. Alternatively, the addresses may be stored in different areas corresponding to the types of the detected bar codes. Further, the bar code detection logic circuit 123 can discard a set of bar width data which is identical with a set of bar width data already stored in the buffer memory 124 during an operation to read a bar code. Thus, the amount of bar width data stored in the buffer memory 124 is considerably reduced compared with a total amount of the output of the bar width counter 122, so that the decoding of the bar width data stored in the buffer memory 124 can be carried out relatively slowly (compared with the hardware logic circuit) by software. The CPU 113 reads the above bar width data from the buffer memory 124 using the addresses (and information on the type of the bar code), and decodes the bar code in accordance with a decoding program (corresponding to the type of the bar code) stored in the ROM 114 and loaded on the RAM 115. Structure of Bar Code (Figs. 5 and 6) Figure 5 is a diagram indicating a structure of a bar code symbol of CODE39. As shown in Fig. 5, the bar code symbol contains start and stop characters, data portion, and start and end margins. When a laser beam scans a bar code symbol in the direction as indicated in Fig. 5, the output of the analog to digital converter 107 of Fig. 2 indicates the levels corresponding to the start margin, the start character, the data portion, the stop character, and the end margin in turn as indicated in Fig. 6. When the laser beam scans the bar code symbol in the opposite direction, the level of the output of the analog to digital converter 107 of Fig. 2 changes corresponding to the end margin, the stop character, the data portion, the start character, and the start margin in turn. Generally, the widths of the start and end margins are about 3.5 to 10 times the widths of the other elements in the start and end characters, and the other characters in the data portions. Therefore, the start and end margins can be detected by monitoring these widths as explained below. Margin Detection Circuit (Figs. 7 and 8) Figures 7 and 8 are block diagrams respectively indicating constructions of margin detection circuits. The circuit of Fig.7 detects a situation wherein the laser beam scans a margin and then characters, and Figure 8 detects a situation wherein the laser beam scans characters and then a margin. In Figs. 7 and 8, reference numerals 11a, 11b, 11c, 11d, 11e, and 11f each denote a register for latching a bar width data, 12a and 12b each denote a multiplier for multiplying a bar width data by N, 13a and 13b each denote a comparator. Although N=3.5 is used in Figs. 7 and 8, the values of N may be changed according to the types of the bar code symbols. In Fig. 7, the shift clock signal is a clock signal synchronizing with the bar width data, and the black/white signal indicates whether or not the element is black or white. The comparator 13a compares {the bar width data latched in the register 11c} with {3.5×(the bar width data latched in the register 11a)}. Since the widths of the start and end margins are more than 3.5 times larger than the width of any element of a character in the case of CODE39, when a width data of a margin is latched in the register 11c, and a bar width data of an element in a character is latched in the register 11a, the comparator 13a outputs an active signal. The AND gate 15a and the inverter 14a are provided for confirming that the output of the register 11c corresponds to a white margin. Thus, the output of the AND gate 15a, which is denoted by MARGIN DETECT A, is active when the laser beam scans a margin and then characters. In Fig. 8, the comparator 13b compares {3.5×(the bar width data latched in the register 11f)} with {the bar width data latched in the register 11d}. Since the widths of the start and end margins are more than 3.5 times larger than the width of any element of a character in the case of CODE39, when width data of a margin is latched in the register 11d, and bar width data of an element in a character is latched in the register 11f, the comparator 13b outputs an active signal. The AND gate 15b and the inverter 14b are provided for confirming that the output of the register 11d corresponds to a white margin. Thus, the output of the AND gate 15b, which is denoted by MARGIN DETECT B, is active when the laser beam scans characters and then a margin. First Embodiment (Figs. 9 and 10) Figure 9 is a block diagram indicating a construction for realizing the bar code detection logic circuit 123 and the buffer memories 124 and 125 in Fig. 3 in a first embodiment of the present invention. In Fig. 9, reference numeral 16 denotes a multiplexer, 17 denotes a RAM, 18 denotes an address counter, 19 denotes an address latch circuit, 20 denotes a flip flop circuit, and 21 denotes an AND gate. The RAM 17 corresponds to the buffer memory 124 in Fig. 3, and the address latch circuit 19 corresponds to the buffer memory 125 in Fig. 3. The bar width data from the bar width counter 122 of Fig. 3 is applied through the multiplexer 16 to the RAM 17, and an address to store the applied bar width data in the RAM 17 is generated in the address counter 18 triggered with the shift clock signal. The address generated by the address counter 18 is also applied to the address latch circuit 19. The output of the address latch circuit 19 is applied to the CPU 113 identical to the CPU 113 in Fig. 3. The MARGIN DETECT A signal from the construction of Fig. 7 is applied to the flip flop circuit 20 and the address latch circuit 19. When the MARGIN DETECT A signal becomes active, the address applied to the address latch circuit 19 is latched therein, and the output of the flip flop circuit 20 changes to a high level. The output of the flip flop circuit 20 is applied to one input terminal of the AND gate 21, and the MARGIN DETECT B signal from the construction of Fig. 8 is applied to the other input terminal of the AND gate 21. Thus, when the MARGIN DETECT A signal becomes active, and then the MARGIN DETECT B signal becomes active, i.e., the laser beam scans a margin, then characters, and again a margin, and the output of the AND gate 21 becomes active. The active output of the AND gate 21 is supplied to the CPU 113 as a CPU interrupt signal. Figure 10 indicates the operation of the construction of Fig. 9. As shown in Fig. 10, bar width data and the shift clock signal are supplied to the construction of Fig. 9, and the address for storing the bar width data in the RAM 17 is generated synchronizing with the shift clock. When the MARGIN DETECT B signal becomes active at the time t1, the flip flop circuit 20 is reset. Then, the MARGIN DETECT A signal becomes active at the time t2, the flip flop circuit 20 is set, and the output of the address counter 18 is latched in the address latch circuit 19. At the time t3, the MARGIN DETECT A signal becomes active again, and thereby a new output of the address counter 18 is latched in the address latch circuit 19. Then, the MARGIN DETECT B signal becomes active at the time t4, and thereby the output of the AND gate 21 becomes active to supply a CPU interrupt signal to the CPU 113. When the CPU 113 receives the CPU interrupt signal, the CPU 113 reads a set of successive bar width data probably corresponding to a bar code, which is stored in the RAM 17 in the addresses beginning with the address output from the address latch circuit 19, through the multiplexer 16, and decodes the bar code in accordance with a bar code decoding program. The construction of Fig. 9 cannot necessarily select a set of successive bar width data corresponding to a bar code only. However, the detection of the MARGIN DETECT A signal followed by the detection of the MARGIN DETECT B signal is a necessary condition for detecting a complete bar code, and therefore, a lot of imperfect data supplied from the bar width counter 122 of Fig. 3 can be screened out by the construction of Fig. 9. Decoding of Bar Code (Fig. 11) Figure 11 indicates examples of the CODE39 characters. In Fig. 11, the bar codes for the characters "1" and "M" are shown. In CODE39, each character is represented by five black and four white elements, and each thick element represents "1" and each thin element represents "0". To determine whether each element is thick or thin, an average width of the nine elements may be used as a threshold value. Thus, a pattern comprised of "1" and "0" is obtained, and the pattern is compared with a table of patterns to determine the character the pattern represents. When the CPU 113 carries out the above operation for all character patterns in a bar code, the decoding operation is completed. The program for carrying out the above operation is stored in the ROM 114 in Fig. 3. Although the outline of the decoding operation of the CODE39 bar code only is explained above, decoding can be carried out for any other type of bar code in accordance with respectively well known procedures. When the decoding operation is completed, the bar code reader of Fig. 2 informs the operator of the completion of the decoding operation by using the LED 108 or the speaker 109 of Fig.2, and the decoded data is transferred through the interface circuit 112 to the POS terminal equipment. Second Embodiment (Figs. 12 and 13) Figure 12 is a block diagram indicating a construction for realizing the bar code detection logic circuit 123 and the buffer memories 124 and 125 in Fig. 3 in the second embodiment. In Fig. 12, reference numerals 701 to 70N each denote a bar code detection logic circuit, 90 denotes an address memorizing circuit, and all the other elements denoted by the same reference numerals as shown in the other figures respectively indicate the same elements. The bar code detection logic circuits 701 to 70N realizes the bar code detection logic circuit 123 in Fig. 3, and the address memorizing circuit 90 comprises a buffer memory corresponding to the buffer memory 125 in Fig. 3 and an address latch circuit similar to the address latch circuit 19 of Fig. 9. Each of the bar code detection logic circuits 701 to 70N corresponds to a specific type of bar code, and determines whether or not bar width data successively output from the bar width counter 122 satisfies a predetermined necessary condition for a bar code of the type corresponding to the bar code detection logic circuit. Each of the bar code detection logic circuits 701 to 70N comprises the margin detection circuits of Figs. 7 and 8 for the corresponding type of bar code, the construction comprised of the flip flop circuit 20 and the AND gate 21 of Fig. 9, and the other construction for determining the satisfaction of the above predetermined necessary condition. When the output of the AND gate 21 becomes active, and the above predetermined necessary condition is determined to be satisfied, the bar code detection logic circuit outputs an active signal. The output of each of the bar code detection logic circuits 701 to 70N becomes active when the bar code detection logic circuit detects a bar code of the type corresponding to the circuit, and the outputs of the bar code detection logic circuits 701 to 70N are supplied to the address memorizing circuit 90. Although not shown, the output of the above address counter is applied to the above address latch circuit, and the output of the address latch circuit is stored in the above buffer memory in the address memorizing circuit 90, together with the above outputs of the bar code detection logic circuits 701 to 70N. Thus, the buffer memory in the address memorizing circuit 90 stores information on the type of the detected bar code, and the top address of an area in which the bar width data of the bar code is stored in the buffer memory 124 (RAM 17). Instead of storing the above information on the type together with the address, different areas may be allocated to the respective types of bar code as indicated in Fig. 13. In Fig. 13, the addresses for storing the bar width data of bar codes of type #1 are stored in the area 1 of the buffer memory in the address memorizing circuit 90, and the addresses for storing the bar width data of bar codes of type #2 are stored in the area 2 of the buffer memory in the address memorizing circuit 90. In this case, although not shown, the outputs of the bar code detection logic circuits 701 to 70N may be used as a part (of bits) of an address of the buffer memory in the address memorizing circuit 90 for storing the above address from the address latch circuit, and the other bits of the address of the buffer memory in the address memorizing circuit 90 can be generated by an address counter (not shown) provided corresponding to each of the bar code detection logic circuits 701 to 70N, and the address of the address counter is incremented by the active output of the corresponding bar code detection logic circuit. The ROM 114 stores decoding programs for all the types of bar codes corresponding to the above bar code detection logic circuits 701 to 70N, and the CPU 113 reads the above content of the address memorizing circuit 90, reads the bar width data stored in the buffer memory 124 using the address stored in the address memorizing circuit 90, and decodes the bar width data using the decoding program for the type which is stored in the address memorizing circuit 90 together with the above address. Although in the above explanation, the details of the operations for determining the satisfaction of the predetermined necessary condition by the bar code detection logic circuits 701 to 70N are not indicated, the necessary condition and the operations for the determination will be understood from the explanations of the fifth and the following embodiments. Third Embodiment (Fig. 14) Figure 14 is a block diagram indicating a construction for realizing the bar code detection logic circuit 123 and the buffer memories 124 and 125 in Fig. 4 in the third embodiment. In Fig. 14, reference numerals 701' to 706' each denote a bar code detection logic circuit, 711 to 716 each denote an AND gate, 720 denotes a control gate, 90' denotes an address memorizing circuit, and all the other elements denoted by the same reference numerals as shown in the other figures respectively indicate the same elements. The bar code detection logic circuits 701' to 706' correspond to the bar code detection logic circuits 701 to 70N in the construction of Fig. 12. In the construction of Fig. 14, the bar code detection logic circuit 701' detects a bar code of UPC (Universal Product Code), the bar code detection logic circuit 702' detects a bar code of ITF (Interleaved 2 out of 5), the bar code detection logic circuit 703' detects a bar code of CODE39, the bar code detection logic circuit 704' detects a bar code of CODE93, the bar code detection logic circuit 705' detects a bar code of CODE128, and the bar code detection logic circuit 706 detects a bar code of NW7 (Narrow wide 7). The control register 720 and the AND gates 711 to 716 constitute a selector to pass an active output from only one of the bar code detection logic circuits 701' to 706'. The selection mode is preset in the control register 720 by the CPU 113. It is known that an incomplete scan result of a bar code of a type may accord with a complete scan result of another bar code of another type to cause an error. Therefore, such an erroneous detection may be prevented by the provision of the above selector. The address memorizing circuit 90' operates in the same way as the corresponding circuit 90 in Fig. 12. Fourth Embodiment (Fig. 15) Figure 15 is a block diagram indicating a construction for realizing the bar code detection logic circuit 123 and the buffer memories 124 and 125 and the buffer memories 124 and 125 in Fig. 3 in the fourth embodiment. In Fig. 15, reference numeral 19a and 19b each denote an address latch circuit, 22 and 23 each denote a multiplexer, 24 denotes a RAM, 25 denotes a pulse generator, 26 denotes a counter, and all the other elements denoted by the same reference numerals as shown in the other figures respectively indicate the same elements. The address output from the address counter 18 is applied to both the address latch circuits 19a and 19b, the MARGIN DETECT A signal is applied to the address latch circuit 19a to control the timing of latching the address applied thereto, and the MARGIN DETECT B signal is applied to the address latch circuit 19b to control the timing of latching the address applied thereto. Thus, the top address of the bar width data of each bar code stored in the RAM 17 is latched in the address latch circuit 19a, and the end address of the bar width data of each bar code stored in the RAM 17 is latched in the address latch circuit 19b. As explained with reference to Fig. 9, when the laser beam scans a margin, then characters, and again a margin, the output of the AND gate 21 becomes active. The output of the AND gate 21 is applied to the counter 26 to increment a count of the counter 26 which indicates the number of bar codes stored in the RAM 17 to be decoded by the CPU 113. The output of the AND gate 21 is also applied to the pulse generator 25. When the pulse generator 25 receives the active output of the AND gate 21, the pulse generator 25 controls the multiplexer 23 to select the output of the multiplexer 22, controls the multiplexer 22 to select the outputs of the address latch circuits 19a and 19b in turn, and enables the RAM 24 to write the output of the multiplexer 23 therein. Thus, when the output of the AND gate 21 becomes active, the top and end addresses of the bar width data of each bar code are stored in the RAM 24. The CPU 113 monitors the count of the counter 26. When the count is more than a predetermined number, the CPU 113 reads the top and end addresses from the RAM 24 through the multiplexer 23, reads the bar width data stored from the top address to the end address of the RAM 17 through the multiplexer 16, and decodes the bar code constituted by the bar width data. Fifth Embodiment (Fig. 16) Figure 17 is a block diagram indicating a construction for realizing the bar code detection logic circuit 123 and the buffer memories 124 and 125 in Fig. 4 in the fifth embodiment. In Fig. 16, reference numeral 27 denote a counter, 28 denotes a comparator, 29 to 31 each denote an AND gate, and all the other elements denoted by the same reference numerals as shown in Fig. 9 respectively indicate the same elements. The counter 27 is incremented when each shift clock signal is applied thereto while the output of the flip flop circuit 20 becomes active. The CPU 113 presets a reference value which is equal to the number of elements in a bar code of a specific type, in the comparator 28. The comparator 28 compares the count of the counter 27 with the reference value, and makes one of its three outputs active according to whether the count is larger than the reference value, the count is equal to the reference value, or the count is smaller than the reference value. The three outputs of the comparator 28 are respectively applied to one of the input terminals of the AND gates 29 to 31. These AND gates receive the output of the AND gate 21 at the other input terminal thereof. Thus, when a scan of a bar code is completed, i.e., the output of the AND gate 21 becomes active, the count of the counter 27 indicates the number of elements existing between the margins of the both sides of the bar code, and the three outputs of the comparator 28, or the outputs of the AND gates 29 to 31 indicate whether the count is larger than the reference value, the count is equal to the reference value, or the count is smaller than the reference value. These outputs are supplied to the CPU 113, and thus, the CPU 113 can receive the information on the number of the elements in the bar code. The number of elements in each UPC bar code is constant, and ITF codes are generally used with a constant number of elements in each bar code. In addition, the minimum number of elements in each bar code is stipulated in the standards of CODE39, CODE93, CODE128, and Codabar (equivalent to NW7), as indicated in Table 1. Therefore, the examination of the number the elements in each bar code can be used as the aforementioned necessary condition the satisfaction of which is to be determined in the aforementioned bar code detection logic circuits in the construction of Figs. 12 and 14, and the construction of Fig. 16 is useful for the above determination. Further, there is a maximum number of elements in a bar code which can be read by a bar code reader because of a physical limit specific to each bar code reader. Therefore, the construction of Fig. 17 may be used for the detection of the excess of the number of elements over the maximum number to prevent such data from being supplied to the CPU 113. MINIMUM NUMBERS OF ELEMENTS IN BAR CODES IN BAR CODE SYMBOLS TYPE OF BAR CODE MINIMUM NUMBER OF ELEMENTS CODE39 29 CODE93 31 CODE128 25 Codabar (NW7) 23 Sixth Embodiment (Fig. 17) Figure 17 is a block diagram indicating a construction for realizing the bar code detection logic circuit 123 and the buffer memories 124 and 125 in Fig. 3 in the sixth embodiment. The construction of Fig. 17 is provided to detect a bar code in which the number of elements between the margins is equal to L×p, or L×p+q where L, p, and q are each a predetermined integer. In Fig. 17, reference numeral 32 denotes a counter, 32a denotes a flip flop circuit, 33 denotes a pulse generation circuit, 34 denotes a shift register, 35 and 36 each denote an AND gate, and all the other elements denoted by the same reference numerals as shown in Fig. 9 respectively indicate the same elements. The CPU 113 applies a preset value L (which is explained below) to the counter 32, and the counter 32 sets the preset value therein when an active signal is output from the pulse generation circuit 33 thereto. The pulse generation circuit 33 outputs the active signal when the output of the flip flop circuit 20 rises, or when the count of the counter 32 reaches zero to output a carry output. The count of the counter 32 is decremented when an shift clock signal is applied thereto. The flip flop circuit 32a is set when the counter 32 outputs a carry output, and is reset when a next shift clock signal is applied thereto. The output of the flip flop circuit 32a is applied to one of the input terminals of the AND gate 35, and to a serial data input terminal of the shift register 34. The AND gate 35 receives the MARGIN DETECT B signal at the other input terminal of thereof. The serial data output of the shift register 34 is applied to one of the input terminals of the AND gate 36, and the MARGIN DETECT B signal is applied to the other input terminal of the AND gate 36. Thus, when the MARGIN DETECT A signal sets the flip flop circuit 20, the active output of the flip flop circuit 20 triggers the pulse generation circuit 33 to preset the counter 32. Then, when L shift clocks are counted by the counter 32, the counter 32 outputs a carry output to set the flip flop circuit 32a, and trigger the pulse generator 33. The flip flop circuit 32a is immediately reset by the next shift clock, and the same operation is repeated until the MARGIN DETECT B signal is input to the construction of Fig. 18. If the timing at which the active MARGIN DETECT B signal is applied to the AND gate 35 coincides with the timing at which the output of the flip flop circuit 32a is active, the output of AND gate 35 becomes active, and the active output is sensed by the CPU 113. Namely, the CPU 113 recognizes that the number of elements in the bar code is equal to L×p. The shift register 34 contains q stages, and the contents of these stages are shifted by one stage when a shift clock is applied to the shift register 34. That is, an active output from the flip flop circuit 32a is output from the serial output terminal of the shift register 34 q shift clock cycles after an active signal is input into the serial input terminal thereof. Since the output of the flip flop circuit 32a becomes active L×p shift clock cycles after the first element of the bar code, the serial output of the shift register 34 becomes active L×p+q shift clock cycles after the first element of the bar code. If the timing at which the MARGIN DETECT B signal is applied to the AND gate 36 coincides with the timing at which the output of the shift register 34 is active, the output of AND gate 36 becomes active, and the active output is sensed by the CPU 113. Namely, the CPU 113 recognizes that the number of elements in the bar code is equal to L×p+q . Table 2 shows the above preset value L to be used for various types of bar codes. Since the number of elements in each character in the CODE39 bar codes is nine, and one space called an inter-character gap is inserted between each adjacent characters in the CODE39 bar codes, the preset value L is set as ten for the CODE39 bar codes. Similarly, since the number of elements in each character in the Codabar (NW7) bar codes is seven, and one inter-character gap is inserted between each adjacent characters in the Codabar (NW7) bar codes, the preset value L is set as eight for the Codabar (NW7) bar codes. Since the number of elements in each character in the CODE93 and CODE128 bar codes is six, and no inter-character gap is inserted between any characters in the CODE93 and CODE128 bar codes, the preset value L is set as six for the CODE93 and CODE128 bar codes. However, the number of elements in the stop character in the CODE93 and CODE128 bar codes is seven, and therefore the number q of stages in the shift register 34, is set to one for the CODE93 and CODE128 bar codes. COUNTER PRESET VALUES L FOR VARIOUS TYPES OF BAR CODES TYPE OF BAR CODE COUNTER PRESET VALUES L CODE39 10 CODE93 6 CODE128 6 Codabar (NW7) 8 Seventh Embodiment (Figs. 18 and 19) Figure 18 is a block diagram indicating a construction for realizing the bar code detection logic circuit 123 and the buffer memories 124 and 125 in Fig. 3 in the seventh embodiment. In the construction of Fig. 18, the pattern detection circuit 37 is added to the construction of Fig. 9. The construction of the pattern detection circuit 37 in Fig. 18 according to the seventh embodiment is indicated in Fig. 19. The construction of Fig. 19 is provided to detect any of the three start codes A, B, and C, and the stop code of CODE128 in addition to the margin detect A signal and the margin detect B signal. In Fig. 19, reference numerals 38 to 44 each denote a latch circuit, 45 denotes an adder, 46 to 51 each denote a comparator, and 52 to 55 each denote an AND gate. The successive bar width data generated in the bar width counter 122 is supplied to the latch circuit 38, and latched therein synchronizing with the shift clock signal. Then, the latched bar width data is shifted through the series of latch circuits 38 to 44 one by one synchronizing with the shift clock signal. Namely, seven bar width data successively output from the bar width counter 122 are latched in the latch circuits 38 to 44. The adder 45 obtains a sum of the bar widths output from the six latch circuits 38 to 43. The number six is determined based on the number of elements in each character of CODE128. Thus, when a bar width of a margin followed by a character is latched in the latch circuit 44, the output of the adder 45 indicates a length of a character following the margin, and the comparator 46, which compares the output of the latch circuit 44 with the output of the adder 45, outputs an active margin detect A signal. When the content of the latch circuit 44 is not the margin followed by a character, the output of the comparator 46 is not active. The detail of the comparator 46 is explained later with reference to Fig. 21. Similarly, when a bar width of a margin following a character is applied to an input side of the latch circuit 38 as a currently newest bar width data, the output of the adder 45 indicates the length of a character preceding the margin, and the comparator 47, which compares the currently newest bar width data with the output of the adder 45, outputs an active margin detect B signal. When the currently newest bar width data is not the margin following a character, the output of the comparator 47 is not active. The detail of the comparator 47 is explained later with reference to Fig. 21. The comparator 48 compares the output of the latch circuit 43 with the output of the latch circuit 41, and outputs a 48< signal which indicates whether or not the output of the latch circuit 41 is smaller than the output of the latch circuit 43. The comparator 49 compares the output of the latch circuit 42 with the output of the latch circuit 40, and outputs a 49> signal which indicates whether or not the output of the latch circuit 40 is larger than the output of the latch circuit 42, and a 49= signal, which indicates whether or not the two compared bar widths are equal. The comparator 50 compares the output of the latch circuit 41 with the output of the latch circuit 39, and outputs a 50> signal, which indicates whether or not the output of the latch circuit 39 is larger than the output of the latch circuit 41, and a 50= signal, which indicates whether or not the two compared bar widths are equal. The comparator 51 compares the output of the latch circuit 40 with the output of the latch circuit 38, and outputs a 51> signal, which indicates whether or not the output of the latch circuit 38 is larger than the output of the latch circuit 40, a 51= signal, which indicates whether or not the two compared bar widths are equal, and a 51< signal, which indicates whether or not the output of the latch circuit 38 is smaller than the output of the latch circuit 40. The details of the comparators 48 to 51 are explained later with reference to Fig. 22. The AND gate 52 receives the above 48<, 49>, 50=, and 51< signals at four input terminals thereof, and outputs an active START CODE A signal when all the above input signals are active. The active START CODE A signal indicates that the START CODE A of CODE128 is detected. The AND gate 53 receives the above 48<, 49>, 50>, and 51= signals at four input terminals thereof, and outputs an active START CODE B signal when all the above input signals are active. The active START CODE B signal indicates that the START CODE B of CODE128 is detected. The AND gate 54 receives the above 48<, 49>, 50>, and 51= signals at four input terminals thereof, and outputs an active START CODE C signal when all the above input signals are active. The active START CODE C signal indicates that the START CODE C of CODE128 is detected. The AND gate 55 receives the above 48<, 49=, 50>, and 51> signals at four input terminals thereof, and outputs an active STOP CODE signal when all the above input signals are active. The active STOP CODE signal indicates that the STOP CODE of CODE128 is detected. Table 3 indicates the bar width patterns of the START CODE A, B, and C, and STOP CODE in CODE128, where each bar width is indicated by a multiple of a minimum bar width of an element, and Table 4 indicates the above four input signals of the AND gates 52 to 55. RELATIONSHIP TO BE DETECTED FOR START/STOP CODES IN CODE128 START/STOP CODE PATTERN TO BE DETECTED (TERMINAL NUMBERS) SCAN DIRECTION 1 2 3 4 START CODE A 48< 49> 50= 51< RIGHT TO LEFT START CODE B 48< 49> 50= 51> RIGHT TO LEFT START CODE C 48< 49> 50> 51= RIGHT TO LEFT STOP CODE 48< 49= 50> 51> LEFT TO RIGHT PATTERNS OFR START/STOP CODES IN CODE128 CODE PATTERN B S B S B S START CODE A 2 1 1 4 1 2 START CODE B 2 1 1 2 1 4 START CODE C 2 1 1 2 3 2 CODE PATTERN B S B S B S B STOP CODE 2 3 3 1 1 1 2 B: WIDTH OF BLACK ELEMENT (BAR) S: WIDTH OF WHITE ELEMENT (SPACE) Eighth Embodiment (Fig. 20) Figure 20 is a block diagram indicating a construction for detecting margins according to the eighth embodiment. The construction of Fig. 20 is provided to obtain the margin detect A signal and the margin detect B signal for the bar codes of CODE39, CODE93, CODE128, NW7, and ITF. In Fig. 20, reference numeral 45' denotes an adder, 46' and 47' each denote a comparator, 60 denotes a control register, and 61 denotes a multiplexer. The successive bar width data generated in the bar width counter 122 is supplied to the latch circuit 57a, and latched therein synchronizing with the shift clock signal. Then, the latched bar width data is shifted through the series of latch circuits 57a to 57c and 58a to 58n one by one synchronizing with the shift clock signal. Namely, seven bar width data successively output from the bar width counter 122 are latched in the latch circuits 57a to 57c and 58a to 58n. The outputs of the latch circuits 58a to 58m are applied through the corresponding AND gates 59a to 59m to the adder 45'. The adder 45' obtains a sum of the bar widths output from a predetermined portion of the latch circuits 58a to 58m, where the AND gates corresponding to the predetermined portion are made opened by the outputs of the control register 60. The control register 60 has a plurality of bits corresponding to the AND gates 59a to 59m, and the output of each bit is applied to one input terminal of the corresponding AND gate. The CPU 113 presets these bits of the control register 60 so that the above predetermined portion of the AND gates 59a to 59m are made opened. The predetermined portion is determined for the type of bar code as indicated in Table 5. The setting of Table 5 is determined based on the fact that each CODE39 character is constituted by nine elements, each CODE93 or CODE128 character is constituted by six elements, and each NW7 character is constituted by seven elements. For the ITF bar codes, bar width data of ten successive elements near either of the margins on both sides of a bar code excluding the three elements nearest to the margin which correspond to a start or stop pattern, are summed in the adder 45'. The comparator 46' compares the output of the latch circuit 58n with the output of the adder 45'. When the latch circuit 58n latches bar width data of a margin followed by a character, the comparator 46' outputs an active MARGIN DETECT A signal. The multiplexer 61 is provided to select bar width data which is to be applied to the comparator 47' for comparing with the output of the adder 45'. For a CODE39 bar code, the multiplexer 61 selects an output of the latch circuit 58d. For a CODE93 or CODE128 bar code, the multiplexer 61 selects an output of the latch circuit 58g. For a NW7 bar code, the multiplexer 61 selects an output of the latch circuit 58f. For a ITF bar code, the multiplexer 61 selects the bar width data last supplied to the construction of Fig. 21, which is applied to the input side of the latch circuit 57a. When the output of the multiplexer 61 is bar width data of a margin following a character, the comparator 47' outputs an active MARGIN DETECT B signal. SETTING IN GATE REGISTER 60 FOR VARIOUS TYPES OF BAR CODES TYPE OF BAR CODES AND GATES 59a 59b 59c 59d 59e 59f 59g 59h 59i 59j 59k 59l 59m CODE39 x x x x o o o o o o o o o CODE93 x x x x x x x o o o o o o CODE128 x x x x x x x o o o o o o NW7 x x x x x x o o o o o o o ITF o o o o o o o o o o x x x o: active x: inactive Comparators 46 and 47 in Fig. 19 and 46' and 47' in Fig. 20 (Fig. 21) Figure 21 is a diagram indicating a construction of the comparators 46 and 47 in Fig. 19 and 46' and 47' in Fig. 20. In Fig. 21, reference numerals 62 and 63 each denote a multiplier, and 64 denotes a comparator. As shown in Fig. 21, when comparing two quantities a and b in the above comparators, one quantity a is multiplied by an integer n, and the other quantity b is multiplied by an integer m, and then, it is determined which is larger between the multiplied quantities n×a and m×b. Table 6 indicates preferable values of the above n and m, together with the lengths of margins to be detected, and the lengths of characters compared with the lengths of margins, respectively for CODE39, CODE93, CODE128, NW7, and ITF. In addition, Table 6 indicates effective threshold values realized by the above preferable values of n and m when comparing the above quantities a and b with the values n and m. All lengths are indicated by multiples of a minimum bar width X of an element. SETTING IN GATE REGISTER 60 FOR VARIOUS TYPES OF BAR CODES TYPE OF BAR CODE n m Th LENGTH OF MARGIN LENGTH OF CHARACTER CODE39 2 1 6.0X TO 7.5X 10X 12X TO 15X CODE93 3 2 6X 10X 9X CODE128 3 2 7.3X 10X 11X NW7 3 2 6.0X TO 8.6X 10X 9X TO 13X ITF 5 2 5.2X TO 7.2X 10X 14X TO 18X Th: THRESHOLD FOR DETECTING MARGIN X: MINIMUM BAR WIDTH OF AN ELEMENT Comparators 48 to 51 in Fig. 19 (Fig.22) Figure 22 is a diagram indicating a construction of the comparators 48 to 51 in Fig. 19. In Fig. 22, reference numerals 65 to 68 each denote a multiplier, 69 and 70 each denote a comparator, 71 and 72 each denote an inverter, and 73 denotes an AND gate. As shown in Fig. 22, when comparing two quantities a and b in the construction of Fig. 22, one quantity a is multiplied by an integer l in the multiplier 65, and is multiplied by an integer m in the multiplier 68. Parallel to these multiplications, the other quantity b is multiplied by an integer n1 in the multiplier 66, and is multiplied by an integer n2 in the multiplier 67. Then, the multiplied quantities l×a and n1×b are compared in the comparator 69, and the multiplied quantities m×a and n2×b are compared in the comparator 70, where l>m. When the quantity l×a is larger than the quantity n1×b, the comparator 69 outputs an active signal d which indicates that it is determined the quantity a is larger than the quantity b. When the quantity n2×b is larger than the quantity m×a, the comparator 70 outputs an active signal f which indicates that it is determined the quantity b is larger than the quantity a. When both the comparators 69 and 70 output an inactive signal, the AND gate 73 outputs an active signal e which indicates that the quantities a and b are determined to be equal. Both the constructions of Figs. 21 and 22 are provided based on the recognition that all widths of printed bar codes should contain an error due to variations in printing conditions. For example, l=0.75, n1=n2=1, and m=1.25 are preset in the construction of Fig. 22, the above signal d is active when 0.75a>b, the above signal e is active when 1.25a>=b>=0.75a, and the above signal f is active when 1.25a<b. Ninth Embodiment (Fig. 23) Figure 23 is a diagram indicating a construction for detecting a bar code by detecting a start pattern and a stop pattern. In Fig. 23, reference numerals 74 denotes a start pattern detection circuit, 75 denotes a stop pattern detection circuit, 76 denotes a shift register, and 77 denotes an AND gate. The start pattern detection circuit 74, the stop pattern detection circuit 75, and the shift register 76, are provided according to the respective bar code types (standards). Namely, the number of stages in the shift register 76 is set so that the number is equal to the number of elements in a bar code symbol. The start pattern detection circuit 74 is designed to output an active signal when a start pattern (character) and a stop pattern, which are stipulated by the corresponding bar code standard, are scanned in the direction from a margin preceding the start or stop pattern. The stop pattern detection circuit 75 is designed to output an active signal when the above start pattern or stop pattern (character) is scanned in the direction from the pattern to a margin following the pattern. Thus, the output of the AND gate 77 becomes active when a bar code of the type to be detected is detected. In addition, when an additional AND gate is provided in the construction of Fig. 23, and the input terminal of the AND gate is connected to the output of the stop pattern detection circuit 75 and one of intermediate stages of the shift register 76; a second bar code having a character length different from the full length of the shift register 76 may be detected by an active output of the above additional AND gate, where the number of stages from the input of the shift register 76 to the intermediate stage is set equal to the above character length of the above second bar code. Tenth Embodiment (Figs. 24 and 25) Figure 24 is a diagram indicating a structure of JAN13 (equivalent to EAN13) as an example of the UPC codes. As shown in Fig. 24, a UPC code comprises a blank portion called a left margin, a left guard bar, a center guard bar, a right guard bar, a right margin, six characters (called left block) between the left guard bar and the center guard bar, and six characters (called right block, and including one modulus check character) between the center guard bar and the right guard bar. The right block and the left block can be read independently. Then, a modulus ten check is carried out for the characters in the sequence of the left and right blocks. Although a JAN13 code contains twelve characters, a thirteenth character is determined based on the pattern of the left block. Although not explained, the structure of a JAN8 (EAN8) code is similar to the above JAN13 code except that the number of the characters in each of the left and right blocks is equal to four. Figure 25 is a block diagram indicating a construction for realizing the bar code detection logic circuit 123 and the buffer memories 124 and 125 in Fig. 3 in the tenth embodiment. The construction of Fig. 25 is provided to detect the UPC codes. In Fig. 25, reference numeral 80 denotes a start guard bar detection circuit, 81 denotes a center guard bar detection circuit, 82 denotes an end guard bar detection circuit, 83a and 83b each denote a shift register, and 84 to 87b each denote an AND gate. The above "start guard bar" means a guard bar which is detected following a margin, and the above "end guard bar" means a guard bar which is detected preceding a margin. The center guard bar is located at the center of symmetry. In the construction of Fig. 25, the start guard bar detection circuit 80 detects the above start guard bar, the center guard bar detection circuit 81 detects the above center guard bar, and the end guard bar detection circuit 82 detects the above end guard bar. The shift register 83a contains a plurality of stages corresponding to a total number of elements between the left and right margins in a UPC code (corresponding to a full length of a JAN13 bar code), and the shift register 83b contains a plurality of stages corresponding to the number of elements before the center guard bar in a UPC code. The shift register 83a has four output terminals respectively denoted by g, h, i, and k, where the output terminal k corresponds to the full length of a JAN13 code, the output terminal i corresponds to the full length of a JAN8 code, and the output terminal h corresponds to the length from the start guard bar to the center guard bar in a JAN13 code, and the output terminal g corresponds to the length from the start guard bar to the center guard bar in a JAN8 code. The shift register 83b has three output terminals respectively denoted by t, r, and s. The output terminal s corresponds to the length from the center guard bar to the end guard bar in a JAN13 code, the output terminal r corresponds to the length from the start guard bar to the center guard bar in a JAN8 code, and the output terminal t corresponds to the length from the center guard bar to the end guard bar in a JAN8 code. The AND gate 84 receives the output from the terminal k in the shift register 83a, the output of the end guard bar detection circuit 82, and the output from the terminal s of the shift register 83b. Thus, the AND gate 84 outputs an active signal S1 when a start guard bar, a center guard bar, an end guard bar of a JAN13 code are detected, the AND gate 85 outputs an active signal S2 when a start guard bar, a center guard bar, and an end guard bar of a JAN8 code are detected, the AND gate 86a outputs an active signal S3 when a start guard bar and a center guard bar of a JAN13 code are detected, the AND gate 87a outputs an active signal S4 when a start guard bar and a center guard bar of a JAN8 code are detected, the AND gate 86b outputs an active signal S5 when a center guard bar and an end guard bar of a JAN13 code are detected, the AND gate 87b outputs an active signal S6 when a center guard bar and an end guard bar of a JAN8 code are detected. The above detection signals S1 to S6 are supplied to the CPU 113. These signals may be used by the CPU 113 as status flags when reading the UPC codes.

Claims: A bar code reader, for use with a high-speed scanner, comprising: receiving means for receiving from such a high-speed scanner a scanning signal produced by scanning a surface of an article on which a bar code comprising a plurality of elements is printed, the scanning signal being changed between respective first and second levels depending on whether portions of the surface being scanned are black or white; bar width detecting means (122) for successively detecting and outputting width values, each such width value representing a duration for which the scanning-signal level is unchanged; bar width storing means (124) for storing the width values detected by the bar width detecting means; and address generating means (18) for generating an address at which each of the width values is to be stored in the said bar width storing means (124); characterized by: type of bar code detecting means (701-70N; 701'-706') for determining whether or not a set of width values successively detected by the bar width detecting means satisfies a predetermined necessary condition for the set of width values to represent a complete bar code of one of a plurality of predetermined types of bar codes readable by the bar code reader and, if so, for detecting the type of bar code represented by the set of width values concerned; address & type storing means (90) for storing information identifying the type of bar code represented by that set and also identifying such addresses generated by the address generating means (18) for width values of that set; and bar code decoding means (113, 114, 115), capable of decoding such a set of width values representing each of the said predetermined plurality of types of bar codes readable by the bar code reader, and activated, following such determination that such a set of width values satisfies the said predetermined necessary condition, to employ the said stored information for that set to decode the width values of that set in a manner appropriate for its detected type of bar code. A bar code reader as claimed in claim 1, wherein the said predetermined necessary condition is determined to have been satisfied when, in the set of width values, firstly width values corresponding to a margin followed by characters are identified and, subsequently in the set, width values corresponding to characters followed by a margin are identified. A bar code reader according to claim 1 or 2, wherein said type of bar code detecting means (701 - 70N;701'-706') are realized by hardware logic circuitry, and said bar code decoding means is realized by software. A bar code reader according to claim 1, 2 or 3, wherein said type of bar code detecting means (701 70N;701'-706') comprise a plurality of bar code detection logic circuits (701 - 70N;701'-706') each for detecting a bar code of one of the said predetermined types. A bar code reader according to claim 4, further comprising selector means (711 - 716, 720) for selecting one of said plurality of bar code detection logic circuits (701' - 706'). A bar code reader according to any preceding claim, wherein said address & type storing means (90) contains a plurality of areas corresponding respectively to the said plurality of predetermined types of bar code readable by the reader. A bar code reader according to any preceding claim, wherein said type of bar code detecting means (701 - 70N) comprise, first margin detecting means (11a - 15a) for detecting a bar width corresponding to a first margin output from said bar width detecting means, and second margin detecting means (11d - 15b) for detecting a bar width corresponding to a second margin output from said bar width detecting means, following a bar width corresponding to an element in said bar code. A bar code reader according to claim 7, wherein said type of bar code detecting means (701 - 70N) further comprise both-side margin detecting means (20) operable to produce a detection signal upon such detection of the bar width corresponding to said second margin after such detection of the bar width corresponding to said first margin. A bar code reader according to claim 8, wherein said type of bar code detecting means (701 - 70N) further comprise interrupt generating means (21) for generating an interrupt signal to be supplied to said bar code decoding means (113, 114, 115) when said both-side margin detecting means produces such a detection signal. A bar code reader according to claim 9, wherein said type of bar code detecting means (701 - 70N) further comprise interrupt indicating means (26) for indicating the number of said interrupt signals which have been generated by said interrupt generating means (21), and whose respective corresponding bar codes have not been decoded by said bar code decoding means (113, 114, 115). A bar code reader according to claim 9 or 10, further comprising: first address latch means (19a) for latching the address generated by said address generating means (18) when said first margin detecting means (11a - 15a) detects the bar width corresponding to said first margin; second address latch means (19b) for latching the address generated by said address generating means (18) when said second margin detecting means (11d - 15b) detects the bar width corresponding to said second margin; and address memorizing means (24) for storing said addresses latched in said first and second address latching means (19a, 19b) when said interrupt signal is generated by said interrupt generating means (21). A bar code reader according to claim 8, further comprising number-of-elements counting means (27) for counting a number of elements for which said bar widths are output from said bar width detecting means (122) after said first margin detecting means (11a - 15a) detects the bar width corresponding to said first margin until said second margin detecting means (11d - 15b) detects the bar width corresponding to said second margin. A bar code reader according to claim 12, further comprising number-of-elements comparing means (28) for comparing said number of elements, counted by said number-of-elements counting means (27), with a predetermined reference value. A bar code reader according to claim 7, further comprising: unit length counting means (32) for counting a number of elements for which said bar widths are output from said bar width detecting means (122) after said first margin detecting means (11a - 15a) detects the bar width corresponding to said first margin, and detecting a time at which said number reaches an arbitrary multiple (PL) of a predetermined number (L); and coincidence detecting means (35) for detecting a coincidence between said time detected by said unit length counting means (32) and a time at which said second margin detecting means (11d - 15b) detects the bar width corresponding to said second margin. A bar code reader according to claim 7 or 14, further comprising: element length counting means (32, 32a, 34) for counting a number of elements for which said bar widths are output from said bar width detecting means (122) after said first margin detecting means (11a - 15a) detects the bar width corresponding to said first margin, and detecting a time at which said number reaches a sum (PL + q) of an arbitrary multiple (PL) of a first predetermined number (L) and a second predetermined number (q); and coincidence detecting means (36) for detecting a coincidence between said time detected by said element length counting means (32, 32a, 34) and a time at which said second margin detecting means (11d - 15b) detects the bar width corresponding to said second margin. A bar code reader according to claim 8, wherein said type of bar code detecting means (701 - 70N) further comprise: shift register means (38 - 44), having a series of stages, for receiving, one after the next, bar widths output successively from said bar width detecting means (122) and for shifting the received bar widths through the stages of the series each time the bar width detecting means (122) outputs a bar width and for outputting in parallel the respective bar widths held in the stages of the series; and first comparator means (48 - 51) for comparing with one another the respective bar widths output from odd-numbered stages of said series; and second comparator means (48 - 51) for comparing with one another the respective bar widths output from even-numbered stages of said series. A bar code reader according to claim 8, wherein said type of bar code detecting means (701 - 70N) further comprise: shift register means (57a - 58n), having a series of stages, for receiving, one after the next, bar widths output successively from said bar width detecting means (122) and for shifting the received bar widths through the stages of the series each time the bar width detecting means (122) outputs a bar width and for outputting in parallel the respective bar widths held in the stages of the series; and adder means (45') for obtaining a sum of respective outputs of predetermined successive stages of said series (57a - 58n), first comparator means (46') for comparing an output from a final stage of said series with said sum; and second comparator means (47') for comparing an output of another stage of said series with said sum. A bar code reader according to any one of claims 1 to 6, wherein said type of bar code detecting means (701 - 70N) comprise: start pattern detecting means (74) for detecting a first pattern of successive bar widths which indicates a location of a first character of a bar code, and outputting a first active output when said first pattern is detected; stop pattern detecting means (75) for detecting a second pattern of successive bar widths which indicates a location of a last character of a bar code, and outputting a second active output when said second pattern is detected; delay means (76) for delaying said first active output by a time corresponding to a predetermined number of elements between said first and second patterns in a bar code of one of the said predetermined types; and coincidence detecting means (77) for detecting a coincidence between the first active output delayed by said delay means (76) and said second active signal. A bar code reader according to any one of claims 1 to 6 and 18, wherein said type of bar code detecting means (701 - 70N) comprise: start guard bar detecting means (80) for detecting a first pattern of successive bar widths which indicates a location of a first character of a bar code, and outputting a first active output when said first pattern is detected; stop guard bar detecting means (82) for detecting a second pattern of successive bar widths which indicates a location of a last character of a bar code, and outputting a second active output when said second pattern is detected; center guard bar detecting means (81) for detecting a third pattern of successive bar widths which indicates a center between said first and second patterns, and outputting a third active output when said third pattern is detected; first delay means (83a) for delaying said first active output by a time corresponding to a first predetermined number of elements between said first and second patterns in a bar code of one of the said predetermined types, and outputting a first delayed active signal; second delay means (83a) for delaying said first active output by a time corresponding to a second predetermined number of elements between said first and second patterns in a bar code of the said one type, and outputting a second delayed active signal; third delay means (83b) for delaying said third active output by a time corresponding to a third predetermined number of elements between said third and second patterns in a bar code of the said one type, and outputting a third delayed active signal; first coincidence detecting means (84) for detecting a coincidence of said first delayed active signal with said second active signal; second coincidence detecting means (86a) for detecting a coincidence of said second delayed active signal with said third active signal; and third coincidence detecting means (86b) for detecting a coincidence of said third delayed active signal with said second active signal.

Inventors: ITOH MOTOHIKO, KASHIWAZAKI TOMOYUKI, KAWAI HIROAKI, MORIYA KAZUMASA, OKAWADO AKIRA, SATO SHINICHI, SHINODA ICHIRO, WATANABE MITSUO, ITOH, MOTOHIKO, KASHIWAZAKI, TOMOYUKI, KAWAI, HIROAKI, MORIYA, KAZUMASA, OKAWADO, AKIRA, SATO, SHINICHI, SHINODA, ICHIRO, WATANABE, MITSUO, Itoh, Motohiko, c/o Fujitsu Limited, Kashiwazaki, Tomoyuki, c/o Fujitsu Limited, KAWAI, HIROAKI, C/O FUJITSU LIMITED, Moriya, Kazumasa, c/o Fujitsu Limited, Okawado, Akira, c/o Fujitsu Limited, SATO, SHINICHI, C/O FUJITSU LIMITED, Shinoda, Ichiro, c/o Fujitsu Limited, WATANABE, MITSUO, C/O FUJITSU LIMITED
Applicants: FUJITSU LTD, FUJITSU LIMITED
Application year: 1992
Main classification: G06K7
IPC codes: G06K7