简体   繁体   English

摩托罗拉MC3190扫描时出现异常行为

[英]Motorola MC3190 strange behavior while scanning

I am writing an application to scan bar code and show it to the text box. 我正在编写一个应用程序来扫描条形码并将其显示在文本框中。 I am using Motorola MC3190 device runs on Windows Embedded compact 7.0. 我正在使用在Windows Embedded Compact 7.0上运行的Motorola MC3190设备。 To implement barcode scanning, I used Symbol.dll and Symbol.barcode.dll . 为了实现条形码扫描,我使用了Symbol.dllSymbol.barcode.dll

I have an issue that device is scanning the bar codes but eliminate the characters before and after the spaces. 我有一个问题,就是设备正在扫描条形码,但消除了空格前后的字符。 My code is 我的代码是

private void Form1_Load(object sender, EventArgs e)
    {
        txtBarcode.Focus();
        barcodeReader = new Symbol.Barcode.Reader();
        barcodeReaderData = new Symbol.Barcode.ReaderData(Symbol.Barcode.ReaderDataTypes.Text, Symbol.Barcode.ReaderDataLengths.MaximumLabel);
        barcodeReader.Actions.Enable(); 
        barcodeReader.ReadNotify += new EventHandler(barcodeReader_Read);  
        barcodeReader.Actions.Read(barcodeReaderData);      
    }

private void barcodeReader_Read(object sender, EventArgs e)
    {
        Symbol.Barcode.ReaderData nextReaderData = barcodeReader.GetNextReaderData();  
        txtBarcode.Text = nextReaderData.Text;
        barcodeReader.Actions.Read(barcodeReaderData);  
    }

This code scans bar codes without spaces. 该代码扫描没有空格的条形码。

FYI: Earlier Motorola MC3190 could not scan the characters before and after the spaces, but after contacting the Motorola support team, they told me some changes in the device. 仅供参考:早期的Motorola MC3190无法扫描空格前后的字符,但是在联系Motorola支持团队之后,他们告诉我设备的某些更改。 Now the device is accepting barcodes with spaces. 现在设备正在接受带空格的条形码。 I checked in datawedge demonstration. 我检查了datawedge演示。

Now I am using symbol assembly that means I am overriding the existing functionality in my code but no luck so far. 现在,我正在使用符号汇编,这意味着我将覆盖代码中的现有功能,但到目前为止还没有运气。

Edit: 编辑: 在此处输入图片说明

When I scan this barcode in my application, it is skipping first digit 0 and last digit 2. textbox only shows 825610. But when I try scanning the same barcode in Datawedge Demonstration (software comes with device to test the barcode scanning) it shows 082566102 当我在应用程序中扫描此条形码时,它将跳过第一位数字0和最后一位数字2。文本框仅显示825610。但是,当我尝试在Datawedge演示中扫描相同的条形码(软件随附有用于测试条形码扫描的设备)时,它将显示082566102

The missing zero is included in the barcode format. 缺少的零包含在条形码格式中。 UPC-E barcodes can start with either a 0 or a 1, which are returned by the scanner as UPCE0 and UPCE1. UPC-E条形码可以以0或1开头,由扫描仪以UPCE0和UPCE1返回。 The missing 2 is the check digit. 缺少的2是校验位。

You can include these by setting: 您可以通过设置以下内容来包括这些内容:

barcodeReader.Decoders.UPCE0.Preamble = UPC.Preambles.System;
barcodeReader.Decoders.UPCE0.ReportCheckDigit = true;

The "spaces" only exist in the representation of the barcode for humans, they separate the system and checksum digits from the data that matters. “空格”仅存在于人类条形码中,它们将系统和校验和数字与重要数据区分开。 There are no spaces encoded in the barcode itself. 条形码本身没有编码的空格。

(For more information about UPC-E barcodes see https://en.wikipedia.org/wiki/Universal_Product_Code#UPC-E ) (有关UPC-E条形码的更多信息,请参见https://en.wikipedia.org/wiki/Universal_Product_Code#UPC-E

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM