Question

I am trying to get my Motorola MC3190 read barcode. But unfortunately there is no response after pressing the hardware scan button. I am using EMDK for .net version 2.0.

Here is my code:

private void Form1_Load(object sender, EventArgs e)
        {
            // Get the first scanning device (Its named SCN1 in my device) 
            myDevice = Symbol.Barcode.Device.AvailableDevices[0];
            myReader = new Reader(myDevice);

            // Make sure the Code-128 decoder is enabled!
            myReader.Decoders.CODE128.Enabled = true;

            // Create an instance of reader
            myReaderData = new Symbol.Barcode.ReaderData(Symbol.Barcode.ReaderDataTypes.Text, Symbol.Barcode.ReaderDataLengths.MaximumLabel);

            // Set the event handler
            myReader.ReadNotify += new EventHandler(myReader_ReadNotify);

            // enable and get ready to read
            myReader.Actions.Enable();
            myReader.Actions.Read(myReaderData);
        }

In my event, I am simply trying to get the decoded text displayed:

void myReader_ReadNotify(object sender, EventArgs e)
        {
            Symbol.Barcode.ReaderData nextReaderData = myReader.GetNextReaderData();
            this.listBox1.Items.Add(nextReaderData.Text);            
            switch (nextReaderData.Result)
            {
                case Symbol.Results.SUCCESS:
                    this.listBox1.Items.Add(nextReaderData.Text);
                    myReader.Actions.Read(myReaderData);
                    break;

                case Symbol.Results.CANCELED:
                    this.listBox1.Items.Add("Canceled!!");
                    break;

                default:
                    string sMsg = "Read Failed\n"
                    + "Result = "
                    + ((int)nextReaderData.Result).ToString("X8");
                    MessageBox.Show(sMsg, "ReadNotify");
                    break;
            }


        }

I do not get any error messages. At the same time, if I list my available scan devices, I am able to see my device namely (SCN1). Is there anything special I need to do to trigger the hardware key?

Any help / ideas to resolving this issue is highly appreciated. Thanks!

Was it helpful?

Solution

Sometimes the motorola units come installed with the DataWedge application. It can claim access to the scanner and cause a number of issues when using the EMDK. Make sure it is disabled or uninstall it.

OTHER TIPS

In your device Settings, is the BarCode Reader turned on? (just getting the whoops! factors out of the way first)

In our devices, we simply treat the Barcode reader as any other form of Text Input.

I've got a TextBox control on my form, the Customer (our employees) select that TextBox, point the device at the label, and scan the barcode.

All I do is read the TextBox1.Text field.

I'm not quite sure if this device uses the same COM port for different hardware. Check in Settings if the COM port is selected to use the Barcode Scanner. In devices with large amount of hardware the COM ports are shared.

Also if you close your app and press the yellow button, Does the barcode beam shows?

Does your type of barcode is supported by the device?

And as @jp2code says for basic functionality you can use the DataWedge and receive the data input as text.

In your myReader_ReadNotify function, after line 4 and before line 5 (switch) put this line:

myReader.Actions.Read(myReaderData);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top