Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP2753542B2 - Barcode detection device - Google Patents
[go: Go Back, main page]

JP2753542B2 - Barcode detection device - Google Patents

Barcode detection device

Info

Publication number
JP2753542B2
JP2753542B2 JP2045862A JP4586290A JP2753542B2 JP 2753542 B2 JP2753542 B2 JP 2753542B2 JP 2045862 A JP2045862 A JP 2045862A JP 4586290 A JP4586290 A JP 4586290A JP 2753542 B2 JP2753542 B2 JP 2753542B2
Authority
JP
Japan
Prior art keywords
count value
data
counter
circuit
dma
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP2045862A
Other languages
Japanese (ja)
Other versions
JPH03250382A (en
Inventor
潔 田中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
KASHIO KEISANKI KK
Original Assignee
KASHIO KEISANKI KK
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by KASHIO KEISANKI KK filed Critical KASHIO KEISANKI KK
Priority to JP2045862A priority Critical patent/JP2753542B2/en
Publication of JPH03250382A publication Critical patent/JPH03250382A/en
Application granted granted Critical
Publication of JP2753542B2 publication Critical patent/JP2753542B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 [産業上の利用分野] この発明は、バーコードマークのイメージを光電変換
して読取るのみで、バーコードにデコードする機能は有
していないノン・デコード型バーコードスキャナを備え
たバーコード検出装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Application Field] The present invention relates to a non-decode type bar code scanner which only photoelectrically reads an image of a bar code mark and does not have a function of decoding a bar code. The present invention relates to a barcode detection device including:

[発明の概要] この発明は、上記のようなノン・デコード型バーコー
ドスキャナからの白/黒に対応する2つのレベルのデー
タのレベル変化に基づくバーコードの認識処理を、一般
的なデータ処理用のプロセッサが併せて行うデータ処理
装置において、レベル変化情報のメモリへの展開処理、
エンドマージン検出処理を行う専用回路を設け、エンド
マージンが検出されたことを条件して、メモリに展開さ
れたレベル変化情報に基づくデコード処理をプロセッサ
に指示することにより、プロセッサの負担を軽減し、装
置全体の処理速度のアップ等を図ったものである。
[Summary of the Invention] The present invention is directed to a bar code recognition process based on a level change of two levels of data corresponding to white / black from a non-decode type bar code scanner as described above by a general data processing. In a data processing device that is also performed by a processor for processing, a process of developing level change information in a memory;
A dedicated circuit for performing an end margin detection process is provided, and on the condition that the end margin is detected, the processor is instructed to perform a decoding process based on the level change information developed in the memory, thereby reducing the load on the processor. This is to increase the processing speed of the entire apparatus.

[従来の技術] 従来、ノン・デコード型バーコードスキャナを備えた
電子レジスタ等のデータ処理装置では、第3図に示した
ように、ノン・デコード型バーコードスキャナ1により
読取られたバーコードのイメージデータは、入力バッフ
ァ2に格納される。そして、エッジ検出回路4は、クロ
ックジェネレータ3からのサンプリングクロック毎に上
記イメージデータのレベルの変化状況を調べ、レベルが
変化する毎にその変化状況をバー幅カウンタ5に報知し
て、連続する同一レベルの期間におけるサンプリングク
ロックをカウントさせる共に、CPU6に割込みをかける。
[Prior Art] Conventionally, in a data processing device such as an electronic register provided with a non-decode type bar code scanner, as shown in FIG. The image data is stored in the input buffer 2. Then, the edge detection circuit 4 checks the change state of the level of the image data for each sampling clock from the clock generator 3, and notifies the bar width counter 5 of the change state each time the level changes, and continuously outputs the same data. At the same time, the CPU 6 counts the sampling clock during the period of the level and interrupts the CPU 6.

この割込みにより、CPU6は、バー幅カウンタ5のカウ
ント値とレベル情報をリードして順次メモリ7に展開す
る。また、CPU6は、メモリ7に展開された前回カウント
値とバー幅カウンタ5による現在のカウント値とを逐次
比較し、その比較結果に基づいてエンドマージンを検出
する。
Due to this interrupt, the CPU 6 reads the count value of the bar width counter 5 and the level information and sequentially develops them in the memory 7. Further, the CPU 6 sequentially compares the previous count value developed in the memory 7 with the current count value of the bar width counter 5, and detects an end margin based on the comparison result.

そして、CPU6は、エンドマージンを検出するまで上記
のような各処理を繰返し、エンドマージンが検出される
ことにより、メモリ7に展開された複数組のカウント値
とレベル情報に基づいてデコード処理を行う。
Then, the CPU 6 repeats the above-described processes until the end margin is detected. When the end margin is detected, the CPU 6 performs a decoding process based on a plurality of sets of count values and level information developed in the memory 7. .

[発明が解決しようとする課題] しかし、このようなバーコードの一連の読取り処理が
遅れると、データの読み落としが発生する等のため、CP
U6は当該読取り処理期間中は読取ったバーコードに基く
登録処理等の他の処理を行う時間的余裕がなく、読取処
理のみを行っているのが実情であり、CPU6の使用効率が
悪く、装置全体としての処理速度の低下を招いていた。
[Problems to be Solved by the Invention] However, if a series of barcode reading processes is delayed, data may be missed, and the like.
U6 does not have time to perform other processing such as registration processing based on the read barcode during the reading processing period, and in fact, it performs only reading processing, and the use efficiency of CPU 6 is poor, and This has led to a reduction in the overall processing speed.

これは、CPUの負担が大きくなりすぎることに起因す
るものと考えらる。
This is thought to be due to an excessive load on the CPU.

従って、CPUで行っていた処理の一部をCPU以外の構成
要素で処理して、CPUの負担を軽減できれば、装置全体
としての処理速度の低下を回避できるであろうことは推
測できるが、デコード処理等のCPUの処理に適した処理
までも他の構成要素で処理したのでは、処理速度の低下
の回避と、構成要素の追加に伴うコストアップとのバラ
ンス等の点で問題が残る。
Therefore, if it is possible to reduce the load on the CPU by processing some of the processing performed by the CPU using components other than the CPU, it can be inferred that a decrease in the processing speed of the entire device would be avoided. If processing other than processing suitable for processing by the CPU, such as processing, is performed by other components, problems remain in terms of, for example, a balance between avoiding a reduction in processing speed and increasing costs due to the addition of components.

してみれば、カウント値とレベル情報のメモリへの展
開処理、エンドマージン検出処理といった他の構成要素
で処理した方が処理速度も速くコストアップにならない
と考えられる処理については、CPU以外の構成要素によ
り行えるようにするということが新規な技術的課題とな
ってくる。
In other words, processing that is considered to be faster and not costly if processing with other components such as processing to expand the count value and level information to memory, end margin detection processing, etc. Being able to do so by elements is a new technical challenge.

この発明の課題は、CPU(プロセッサ)以外の構成要
素により、デコード対象データのメモリへの展開とエン
ドマージン検出ができるようにすることである。
An object of the present invention is to enable decoding of data to be decoded to a memory and detection of an end margin by using components other than a CPU (processor).

[課題を解決するための手段] この発明の手段は次の通りである。[Means for Solving the Problems] The means of the present invention are as follows.

スキャナa(第1図のブロック図を参照、以下同じ)
は、走査されたバーコードのイメージを白/黒に対応す
る2つのレベルのデータとして読取る。
Scanner a (refer to the block diagram in FIG. 1, the same applies hereinafter)
Reads the scanned barcode image as two levels of data corresponding to white / black.

検出回路bは、スキャナaからのデータのレベル変化
状況を所定周期のクロックのタイミングで検出する。
The detection circuit b detects a level change state of data from the scanner a at a timing of a clock of a predetermined cycle.

カウンタcは、検出回路bにより次のレベル変化が検
出されるまでカウントする。
The counter c counts until the next level change is detected by the detection circuit b.

転送制御回路dは、カウンタcによる各カウント値を
バッファリングした後、所定メモリに順次DMA転送す
る。
After buffering each count value of the counter c, the transfer control circuit d sequentially performs DMA transfer to a predetermined memory.

指示回路eは、転送制御回路dによりバッファリング
された前回のカウント値と上記カウンタの現在カウント
値とを順次比較し、前回のカウント値に対する現在のカ
ウント値が所定の比率以上になったとき、エンドマージ
ン検出信号を出力して、所定メモリにDMA転送された各
カウント値をバーコードデータにデコードするよう指示
する。
The instruction circuit e sequentially compares the previous count value buffered by the transfer control circuit d with the current count value of the counter, and when the current count value with respect to the previous count value becomes equal to or more than a predetermined ratio, It outputs an end margin detection signal and instructs each count value DMA-transferred to a predetermined memory to be decoded into barcode data.

[作 用] この発明の手段の作用は次の通りである。[Operation] The operation of the means of the present invention is as follows.

今、スキャナaによりバーコードマークがスキャンさ
れている最中であり、バーコードマークの“白”に対応
する“0"ボルトの電圧信号と、“黒”に対応する“5"ボ
ルトの電圧信号からなる2値データが連続的に入力され
ているものとする。
Now, the bar code mark is being scanned by the scanner a, and a voltage signal of “0” volt corresponding to “white” of the bar code mark and a voltage signal of “5” volt corresponding to “black” of the bar code mark. Is continuously input.

すると、検出回路bは、スキャナaからのデータのレ
ベル変化状況を所定周期のクロックのタイミングで検出
し、カウンタcに出力する。
Then, the detection circuit b detects the state of the level change of the data from the scanner a at the timing of the clock of the predetermined cycle, and outputs it to the counter c.

カウンタcは、検出回路bにより次のレベル変化が検
出されるまで、すなわち、同一レベルの読取りデータが
連続している間カウントする。従って、次のレベル変化
(“0"ボルト→“5"ボルト、或いは“5"ボルト→“0"ボ
ルト)が検出された時点でのカウンタcのカウント値
は、バーコードマークの“白バー”、“黒バー”の各幅
に対応していることとなる。
The counter c counts until the next level change is detected by the detection circuit b, that is, while read data of the same level continues. Therefore, when the next level change (“0” volt → “5” volt or “5” volt → “0” volt) is detected, the count value of the counter c is the “white bar” of the bar code mark. , "Black bar".

一方、転送制御回路dは、検出回路bにより次のレベ
ル変化が検出されたときは、その時点でのカウンタcに
よる上記カウント値を、1本前のバーの幅に対応する前
回のカウント値としてバッファリングした後、所定メモ
リにDMA転送する。
On the other hand, when the next level change is detected by the detection circuit b, the transfer control circuit d uses the count value of the counter c at that time as the previous count value corresponding to the width of the immediately preceding bar. After buffering, the data is DMA-transferred to a predetermined memory.

そして、指示回路eは、バッファリングされた前回の
カウント値と、カウンタcにて現在カウントアップ中の
現時点でのカウント値とを、例えば所定周期のクロック
のタイミングで順次比較する。この比較の結果、前回の
カウント値に対する現時点でのカウント値が所定の比率
以上(この比率は、例えば、規格化されたバーコードの
白バー、黒バーの最小幅、最大幅等を考慮したものであ
る)になったとき、すなわち、前回のバー幅に対する現
在読取り中の連続する“白”、又は“黒”の読取り幅が
所定の比率以上になったとき、エンドマージン検出信号
をプロセッサ等に出力して、所定メモリにDMA転送され
た各バー幅に対応する各カウント値を、バーコードデー
タにデコードするようプロセッサ等に指示する。
Then, the instruction circuit e sequentially compares the buffered previous count value and the current count value currently being counted up by the counter c, for example, at a timing of a clock of a predetermined cycle. As a result of this comparison, the current count value with respect to the previous count value is equal to or greater than a predetermined ratio (for example, the ratio is determined in consideration of the minimum width, the maximum width, and the like of a white bar and a black bar of a standardized barcode). ), That is, when the continuous reading width of “white” or “black” currently being read with respect to the previous bar width has exceeded a predetermined ratio, an end margin detection signal is sent to a processor or the like. Then, it instructs a processor or the like to decode each count value corresponding to each bar width DMA-transferred to a predetermined memory into barcode data.

従って、プロセッサ以外の構成要素により、デコード
対象データのメモリへの展開とエンドマージン検出がで
きる。
Therefore, the components other than the processor can load the decoding target data into the memory and detect the end margin.

[実施例] 以下、一実施例を第2図を参照しながら説明する。Embodiment An embodiment will be described below with reference to FIG.

第2図は、バーコードスキャナ用のインタフェース回
路のブロック構成図であり、ノン・デコード型バーコー
ドスキャナ1、入力バッファ2を有し、スタートマージ
ン検出機能、データ展開機能、エンドマージン検出機能
を備えており、スタートマージンが検出された後、実質
的なデータ展開処理とエンドマージン検出処理が同時並
行的に実行されるよう構成されている。
FIG. 2 is a block diagram of an interface circuit for a bar code scanner, which has a non-decode type bar code scanner 1, an input buffer 2, and has a start margin detecting function, a data expanding function, and an end margin detecting function. After the start margin is detected, the substantial data expansion processing and the end margin detection processing are performed simultaneously and in parallel.

スタートマージン検出処理は、レベル検出回路8、ス
タートマージン・カウンタ9、スタートマージン・レジ
スタ10、および第1コンパレータ11により実行される。
The start margin detection processing is executed by the level detection circuit 8, the start margin counter 9, the start margin register 10, and the first comparator 11.

データ展開処理は、エッジ検出回路4、バー幅カウン
タ5、メモリ7、ラッチ12、DMAコントロールロジック
回路13、DMAコントローラ14により実行される。
The data expansion processing is executed by the edge detection circuit 4, the bar width counter 5, the memory 7, the latch 12, the DMA control logic circuit 13, and the DMA controller 14.

エンドマージン検出処理は、エッジ検出回路4、バー
幅カウンタ5、ラッチ12、エンドマージン・レジスタ1
5、倍率器16、第2コンパレータ17により実行される。
The end margin detection processing includes an edge detection circuit 4, a bar width counter 5, a latch 12, an end margin register 1
5, executed by the multiplier 16 and the second comparator 17.

なお、図示したCPU6は、後述のデコード処理の他、各
種の処理を行う汎用CPUである。また、クロックジェネ
レータ3は、上記全ての処理において活用されるが、CP
U6の基本クロックとしては活用されず、図示省略したが
CPU6用のクロックジェネレータは別に設けられている。
The illustrated CPU 6 is a general-purpose CPU that performs various processes in addition to the decoding process described below. The clock generator 3 is used in all the above processes,
It is not used as the basic clock of U6 and is not shown.
A clock generator for CPU 6 is provided separately.

上記ノン・デコード型バーコードスキャナ1は、イメ
ージを光学的に読取り、光電変換して、“High(以下
“H"と略す)”レベル、“Low(以下“L"と略す)”レ
ベルの2値データとして入力するのみで、このスキャナ
自体は、読取ったバーコードのイメージデータをデコー
ドする機能は有していない。
The non-decode type barcode scanner 1 optically reads an image, photoelectrically converts the image, and converts the image into a “High (hereinafter abbreviated as“ H ”)” level and a “Low (hereinafter abbreviated as“ L ”)” level. The scanner itself does not have a function of decoding the read barcode image data only by inputting as value data.

入力バッファ2は、ノン・デコード型バーコードスキ
ャナ1からの2値データのレベルを所定レベルに補正し
て緩衝記憶し、エッジ検出回路4とレベル検出回路8に
出力する。
The input buffer 2 corrects the level of the binary data from the non-decode type barcode scanner 1 to a predetermined level, buffers the corrected level, and outputs it to the edge detection circuit 4 and the level detection circuit 8.

クロックジェネレータ3は、CPU6の基本クロックより
も高周波のクロックを発生し、エッジ検出回路4、バー
幅カウンタ5、レベル検出回路8、スタートマージン・
カウンタ9に出力する。
The clock generator 3 generates a clock higher in frequency than the basic clock of the CPU 6, and outputs an edge detection circuit 4, a bar width counter 5, a level detection circuit 8, a start margin
Output to counter 9.

エッジ検出回路4は、入力バッファ2を介して入力さ
れたイメージデータを、クロックジェネレータ3からの
クロックに基づいてサンプリングしてデータのレベル変
化(“H"→“L"、又は“L"→“H")を判別し、レベル変
化した場合には、その変化後のデータ(“H"、又は
“L")を、バー幅カウンタ5にはリセット信号として出
力し、ラッチ12にはラッチ信号として出力し、DMAコン
トロールロジック回路13には、DMA転送開始信号として
出力する。
The edge detection circuit 4 samples the image data input via the input buffer 2 based on the clock from the clock generator 3 and changes the data level (“H” → “L” or “L” → “ H "), and when the level changes, the changed data (" H "or" L ") is output to the bar width counter 5 as a reset signal, and the data is output to the latch 12 as a latch signal. And outputs it to the DMA control logic circuit 13 as a DMA transfer start signal.

バー幅カウンタ5は、エッジ検出回路4から次のリセ
ット信号が入力されるまでの間、クロックジェネレータ
3からのクロックをカウントする。
The bar width counter 5 counts the clock from the clock generator 3 until the next reset signal is input from the edge detection circuit 4.

レベル検出回路8は、入力バッファ2を介して入力さ
れたイメージデータを、クロックジェネレータ3からの
クロックに基づいてサンプリングし、そのサンプリング
データのレベルを検出する。
The level detection circuit 8 samples the image data input via the input buffer 2 based on the clock from the clock generator 3 and detects the level of the sampled data.

スタートマージン・カウンタ9は、レベル検出回路8
により“白”に対応する“L"レベルが検出されている間
だけ、クロックジェネレータ3からのクロックをカウン
トし、そのカウント値を順次第1コンパレータ11に出力
する。
The start margin counter 9 includes a level detection circuit 8
Thus, only while the “L” level corresponding to “white” is detected, the clock from the clock generator 3 is counted, and the count value is sequentially output to the first comparator 11.

スタートマージン・レジスタ10には、ノン・デコード
型バーコードスキャナ1が本インタフェース回路に接続
された際、CPU6により、スタートマージンの最小値がセ
ットされる。なお、この最小値は、ノン・デコード型バ
ーコードスキャナ1のスキャニング速度、バーコードの
規格化された各バー間の幅(白の部分)を考慮して算出
されたものである。
When the non-decode type barcode scanner 1 is connected to the present interface circuit, the minimum value of the start margin is set in the start margin register 10 by the CPU 6. Note that this minimum value is calculated in consideration of the scanning speed of the non-decode type barcode scanner 1 and the width (white portion) between the standardized barcode bars.

第1コンパレータ11は、スタートマージン・カウンタ
9からのカウント値と、スタートマージン・レジスタ10
内の最小値とを比較し、カウント値が最小値に一致した
時点でスタートマージン検出信号をDMAコントロールロ
ジック回路13に出力する。
The first comparator 11 stores the count value from the start margin counter 9 and the start margin register 10
The start margin detection signal is output to the DMA control logic circuit 13 when the count value matches the minimum value.

ラッチ12は、レベル検出回路8にて検出された“H"、
または“L"のレベル情報をラッチする。また、ラッチ12
は、エッジ検出回路4からのラッチ信号に基づいて、バ
ー幅カウンタ5内のその時点でのカウント値を、後述の
オーバーラン・フラグと共にラッチする。この際、バー
幅カウンタ5では、上記カウント値がラッチされた後、
直ちに上記リセット信号に基づいてリセットされ、次の
カウントアップが開始される。従って、ラッチ12には、
前回の1本の“白”または“黒”のバーに対応するレベ
ル情報とカウント値とオーバーラン・フラグとがラッチ
されることとなる。
The latch 12 detects “H” detected by the level detection circuit 8,
Alternatively, the “L” level information is latched. Latch 12
Latches the current count value in the bar width counter 5 together with an overrun flag described later, based on the latch signal from the edge detection circuit 4. At this time, the bar width counter 5 latches the count value,
The reset is immediately performed based on the reset signal, and the next count-up is started. Therefore, the latch 12
The level information, the count value, and the overrun flag corresponding to the previous one “white” or “black” bar are latched.

DMAコントロールロジック回路13は、エッジ検出回路
4からのDMA転送開始信号に基づいて、DMAコントローラ
14によるDMA転送処理を管理する。
Based on the DMA transfer start signal from the edge detection circuit 4, the DMA control logic circuit 13
14 manages DMA transfer processing.

DMAコントローラ14は、DMAコントロールロジック回路
13を介して、ラッチ12からメモリ7へのDMA転送処理を
制御する。
DMA controller 14 is a DMA control logic circuit
Via 13, a DMA transfer process from the latch 12 to the memory 7 is controlled.

エンドマージン・レジスタ15には、ノン・デコード型
バーコードスキャナ1が、本インタフェース回路に接続
された際、CPU6により、所定の比率がセットされる。こ
の比率は、バーコードのスペース(白)/マーク(黒)
の最小、最大の比率となっている。すなわち、スペース
(白)/マーク(黒)の最小、最大の比率という相対的
な比率を用いることにより、スキャニング速度の影響を
受けずにエンドマージンを検出できるようになってい
る。
When the non-decode barcode scanner 1 is connected to the present interface circuit, the CPU 6 sets a predetermined ratio in the end margin register 15. This ratio is the bar code space (white) / mark (black)
Is the minimum and maximum ratio. That is, by using the relative ratio of the minimum and maximum ratio of the space (white) / mark (black), the end margin can be detected without being affected by the scanning speed.

倍率器16は、ラッチ12にラッチされた前回のカウント
値と、エンドマージン・レジスタ15にセットされた比率
とを乗算して変倍し、その変倍値をコンパレータ17に出
力する。
The multiplier 16 multiplies the previous count value latched by the latch 12 by the ratio set in the end margin register 15 to scale the magnification, and outputs the scaled value to the comparator 17.

コンパレータ17は、倍率器16からの変倍された前回の
カウント値と、バー幅カウンタ5からの現在カウントア
ップ中のカウント値とを順次比較する。そして、現在の
カウント値が前回のカウント値と一致したときは、CPU6
の割込み端子にエンドマージン検出信号を出力する。
The comparator 17 sequentially compares the scaled previous count value from the multiplier 16 with the count value currently being counted up from the bar width counter 5. When the current count value matches the previous count value, the CPU 6
An end margin detection signal is output to the interrupt terminal of.

次に、データ展開動作を詳細に説明する。 Next, the data expansion operation will be described in detail.

このデータ展開動作は、実質的には、第1コンパレー
タ11からスタートマーシジン検出信号が出力された後に
行われる。
This data expanding operation is substantially performed after the first comparator 11 outputs the start mercidin detection signal.

すなわち、スキャナ1によりバーコードマークがスキ
ャンされると、レベル検出回路8、スタートマージン・
カウンタ9、スタートマージン・レジスタ10、第1コン
パレータ11によるスタートマージン検出動作が開始され
る。このスタートマージン検出動作と並行して、エッジ
検出回路4からのデータに基づくバー幅カウンタ5によ
るカウント動作、ラッチ12によるラッチ動作も行われる
が、DMAコントロールロジック回路13は、スタートマー
シジン検出信号が検出されるまでの間は、ラッチ12から
のデータ読出しを行わず、DMA転送動作、及びエンドマ
ージン検出動作は実行されない。
That is, when the barcode mark is scanned by the scanner 1, the level detection circuit 8, the start margin
The start margin detection operation by the counter 9, the start margin register 10, and the first comparator 11 is started. In parallel with this start margin detection operation, the count operation by the bar width counter 5 based on the data from the edge detection circuit 4 and the latch operation by the latch 12 are also performed, but the DMA control logic circuit 13 outputs the start margin detection signal. Until the data is detected, data is not read from the latch 12, and the DMA transfer operation and the end margin detection operation are not performed.

そして、スタートマーシジン検出信号が検出された後
は、DMAコントロールロジック回路13は、エッジ検出回
路4からDMA転送開始タイミング信号が入力される毎
に、DMAコントローラ14に対してDMAリクエスト信号を出
力する。
After the start mercidin detection signal is detected, the DMA control logic circuit 13 outputs a DMA request signal to the DMA controller 14 every time the DMA transfer start timing signal is input from the edge detection circuit 4. .

すると、DMAコントローラ14は、DMAコントロールロジ
ック回路13に対してアクノリッジ信号を出力した後、ラ
ッチ12内のデータをメモリ7にDMA転送する。
Then, the DMA controller 14 outputs an acknowledge signal to the DMA control logic circuit 13 and then DMA-transfers the data in the latch 12 to the memory 7.

このとき、DMAコントロールロジック回路13は、DMAリ
クエストをディスエーブル状態にし、DMA転送終了前に
ラッチ12がデータを受取った場合には、オーバーラン・
フラグをセットし、DMA転送終了前にデータを受取らな
かった場合には、オーバーラン・フラグをリセットす
る。すなわち、オーバーラン・フラグはデータの取り零
しの有無を示している。このオーバーラン・フラグの活
用の仕方については後述する。
At this time, the DMA control logic circuit 13 disables the DMA request, and if the latch 12 receives data before the end of the DMA transfer, the overrun
The flag is set, and if no data is received before the end of the DMA transfer, the overrun flag is reset. That is, the overrun flag indicates whether or not the data is zero. How to use this overrun flag will be described later.

このようなDMA転送により、メモリへのデータ展開処
理をCPU6が行う必要はなくなる。
By such a DMA transfer, the CPU 6 does not need to perform data expansion processing on the memory.

次に、エンドマージンの検出動作を詳細に説明する。 Next, the operation of detecting the end margin will be described in detail.

今、ラッチ12には、前回読取った1単位のバーコード
マーク中の1つのバー{スペース(白)バー、黒バー}
の幅に対応するカウント値等がラッチされ、第1コンパ
レータ11からはスタートマージン検出信号が既に出力さ
れ、ラッチ12からのデータ読出しが可能になっているも
のとする。
Now, in the latch 12, one bar (space (white) bar, black bar) in one unit of barcode mark read last time is displayed.
Are latched, a start margin detection signal is already output from the first comparator 11, and data can be read from the latch 12.

この場合、ラッチ12にラッチされた上記の前回カウン
ト値は、倍率器16にも出力される。
In this case, the previous count value latched by the latch 12 is also output to the multiplier 16.

すると、倍率器16は、この前回カウント値とエンドマ
ージン・レジスタ15内の比率とを乗算し、この乗算値を
第2コンパレータ17に出力する。
Then, the multiplier 16 multiplies the previous count value by the ratio in the end margin register 15 and outputs the multiplied value to the second comparator 17.

第2コンパレータ17は、この乗算値と、クロックに基
いてバー幅カウンタ5から順次転送されてくる現在カウ
ントアップ中のカウント値とを、順次比較する。すなわ
ち、第2コンパレータ17は、エッジ検出回路4による次
のエッジ検出があるまでは固定値となっている。ラッチ
12内の前回の1本のバーに対応するカウント値を変倍し
た上記乗算値と、1本のバーに対応して現在カウントア
ップされているバー幅カウンタ5からの各カウント値と
の比較を、各クロックに同期して順次行う。
The second comparator 17 sequentially compares the multiplied value with the count value currently being counted up sequentially transferred from the bar width counter 5 based on the clock. That is, the second comparator 17 has a fixed value until the edge detection circuit 4 detects the next edge. latch
A comparison between the multiplied value obtained by scaling the count value corresponding to the previous one bar in 12 and each count value from the bar width counter 5 which is currently counting up corresponding to one bar is performed. , Sequentially in synchronization with each clock.

そして、第2コンパレータ17は、現在のカウント値が
順次カウントアップされて上記乗算値に一致したとき
は、エンドマージンエリアのスキャンに入ったものとし
て、エンドマージン検出信号をCPU6の割込端子に出力す
る。
The second comparator 17 outputs an end margin detection signal to the interrupt terminal of the CPU 6 assuming that the end margin area has been scanned when the current count value is sequentially counted up and coincides with the multiplied value. I do.

このように、エンドマージン検出処理についても専用
回路のみで行われ、CPU6は一切関与しない。
As described above, the end margin detection process is also performed only by the dedicated circuit, and the CPU 6 is not involved at all.

なお、CPU6は、エンドマージン検出信号が入力される
と、メモリ7にDMA転送されたデータに基づいてデコー
ド処理を行い、上記のオーバーラン・フラグ等に基づい
て正常な読取りを確認し、1単位のバーコードの読取処
理を停止する。もし、ここで、正常な読取りが行われて
いない、すなわち、エンドマージン検出が不当であった
としても、上記のメモリ展開処理やエンドマージン検出
処理は継続されているため、次のエンドマージン検出を
待って、1単位のバーコードの読取処理の停止/続行を
決定することができる。
When the end margin detection signal is input, the CPU 6 performs a decoding process based on the data DMA-transferred to the memory 7, confirms a normal reading based on the overrun flag and the like, and Stops the reading process of the barcode. Here, if the normal reading is not performed, that is, even if the end margin detection is incorrect, the memory expansion processing and the end margin detection processing described above are continued. After waiting, it is possible to determine the stop / continuation of the barcode reading process for one unit.

以上説明したように、クロックに同期して順次行う必
要のある非常に高速性を要求されるスタートマージン検
出処理、メモリ展開処理、エンドマージン検出処理は、
それぞれCPU6とは別の回路群により実行されるので、CP
U6は、エンドマージンが検出されるまでは何も処理を行
う必要がなく、CPUの負担が大巾に軽減される。
As described above, the start margin detection processing, the memory expansion processing, and the end margin detection processing, which require extremely high speed, which need to be sequentially performed in synchronization with the clock,
Since each is executed by a separate circuit group from CPU6, CP
U6 does not need to perform any processing until the end margin is detected, greatly reducing the load on the CPU.

[発明の効果] この発明によれば、CPU(プロセッサ)以外の構成要
素により、デコード対象データのメモリへの展開とエン
ドマージン検出ができ、バーコード読取りに関するプロ
セッサの負担が軽くなるので、プロセッサはより多くの
データ処理を実行でき、装置全体としての処理速度を高
めることが可能となる。
[Effects of the Invention] According to the present invention, components other than the CPU (processor) can load the decoding target data into the memory and detect the end margin, and reduce the load on the processor for reading the barcode. More data processing can be performed, and the processing speed of the entire apparatus can be increased.

【図面の簡単な説明】[Brief description of the drawings]

第1図は本発明のブロック図、第2図は実施例のブロッ
ク構成図、第3図は従来技術を示すブロック構成図であ
る。 1……ノン・デコード型バーコードスキャナ、3……ク
ロックジェネレータ、4……エッジ検出回路、5……バ
ー幅カウンタ、7……メモリ、12……ラッチ、13……DM
Aコントロールロジック回路、14……DMAコントローラ、
15……エンドマージンレジスタ、16……倍率器、17……
第2コンパレータ。
FIG. 1 is a block diagram of the present invention, FIG. 2 is a block diagram of an embodiment, and FIG. 3 is a block diagram showing a conventional technique. 1 Non-decode barcode scanner, 3 Clock generator, 4 Edge detection circuit, 5 Bar width counter, 7 Memory, 12 Latch, 13 DM
A control logic circuit, 14 …… DMA controller,
15 ... End margin register, 16 ... Multiplier, 17 ...
Second comparator.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】走査されたバーコードのイメージを白/黒
に対応する2つのレベルのデータとして読取るスキャナ
と、 このスキャナからのデータのレベル変化状況を所定周期
のクロックのタイミングで検出する検出回路と、 この検出回路により次のレベル変化が検出されるまでカ
ウントするカウンタと、 このカウンタによる各カウント値をバッファリングした
後、所定メモリに順次DMA転送する転送制御回路と、 この転送制御回路によりバッファリングされた前回のカ
ウント値と上記カウンタの現在カウント値とを順次比較
し、前回のカウント値に対する現在のカウント値が所定
の比率以上になったとき、エンドマージン検出信号を出
力して、所定メモリにDMA転送された各カウント値をバ
ーコードデータにデコードするよう指示する指示回路
と、 を備えたことを特徴とするバーコード検出装置。
1. A scanner for reading a scanned barcode image as two-level data corresponding to white / black, and a detecting circuit for detecting a level change state of data from the scanner at a clock timing of a predetermined cycle. A counter that counts until the next level change is detected by the detection circuit, a transfer control circuit that buffers each count value of the counter, and sequentially DMA-transfers the data to a predetermined memory; The ringed previous count value is sequentially compared with the current count value of the above counter, and when the current count value with respect to the previous count value becomes equal to or more than a predetermined ratio, an end margin detection signal is output, and a predetermined memory is output. And an instruction circuit for instructing each of the DMA-transferred count values to be decoded into barcode data. A bar code detection device comprising:
JP2045862A 1990-02-28 1990-02-28 Barcode detection device Expired - Lifetime JP2753542B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2045862A JP2753542B2 (en) 1990-02-28 1990-02-28 Barcode detection device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2045862A JP2753542B2 (en) 1990-02-28 1990-02-28 Barcode detection device

Publications (2)

Publication Number Publication Date
JPH03250382A JPH03250382A (en) 1991-11-08
JP2753542B2 true JP2753542B2 (en) 1998-05-20

Family

ID=12731023

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2045862A Expired - Lifetime JP2753542B2 (en) 1990-02-28 1990-02-28 Barcode detection device

Country Status (1)

Country Link
JP (1) JP2753542B2 (en)

Also Published As

Publication number Publication date
JPH03250382A (en) 1991-11-08

Similar Documents

Publication Publication Date Title
US4703364A (en) Processor synchronous image scanner controlling method
JP2753542B2 (en) Barcode detection device
JP2728817B2 (en) Barcode reading decoder
JPH088647B2 (en) Run-length coding method and apparatus
JPH03144786A (en) Barcode detection device
JPH11154197A (en) Optical information reader
JP2677806B2 (en) Code reader
JPS62256095A (en) Bar code reader
JPH03144787A (en) Barcode detection device
KR930005129B1 (en) Size reduction device for image documents
JP2522515B2 (en) EOL address table creation circuit
JPH0877342A (en) Two-dimensional data converting device
SU1269164A1 (en) Device for reading graphic information
JPS6298473A (en) Image input device
JPH09214776A (en) Decryption device
JPS62212891A (en) Code reading controller
JPH01169682A (en) Multi-window reading method
JPS6295682A (en) Bar code reader
JPS6265555A (en) Image reading device
JPH0769956B2 (en) Image input device
JPH0758504B2 (en) Image input device
JPH01223878A (en) Picture processor
JPH0293765A (en) Character retrieving device
JPH04242373A (en) Image processing device
JPH05268485A (en) Run length coding circuit