Click to See Complete Forum and Search --> : Event Not Firing, Intermec BarCode Reader


Pheria
July 6th, 2009, 12:19 PM
Greetings,

I'm having some difficulty with an Intermec handheld that uses an integrated barcode scanner. The program is supposed to fire an event when a barcode is successfully read. For some reason I can't figure out, the event isn't firing. I know that the program can interface with the barcode scanner using the BarcodeReader object I have, because if I tell the object to turn on the scanner, the scanner on the device will turn on, etc. I also know that the handheld IS actually reading barcodes because the green check mark LED on the device lights up when a barcode is read.

Here's what the code looks like:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Intermec.DataCollection;

namespace NA
{

public partial class Receipt : Form
{
private Intermec.DataCollection.BarcodeReader bcr;
public Receipt()
{
InitializeComponent();
try
{

//bcr = new BarcodeReader("default");
bcr = new BarcodeReader();

bcr.BarcodeRead +=new BarcodeReadEventHandler(bcr_BarcodeRead);
}
catch (Exception exp)
{
MessageBox.Show(exp.Message);
}
}

void bcr_BarcodeRead(object sender, BarcodeReadEventArgs bre)
{
MessageBox.Show("Event triggered");
this.listBox1.Items.Add(bre.strDataBuffer.ToString());
this.listBox1.Items.Add("SymbologyID = " + bre.SymbologyDetail.ToString());
}
}
}

I've also tried manually enabling the reading of certain code types, and enabling the scanner altogether manually. It doesn't appear to make any difference, and it's all enabled by default.

Any assistance would be appreciated.
Thanks!

Arjay
July 6th, 2009, 09:30 PM
It sure looks like you have the event wired up properly. I would look at altering the config settings for the bar code reader. It might be that you have to enable some other property in order for the reader object to fire events. I would also try to connect to different reader events if available.

Arjay
July 6th, 2009, 09:56 PM
Well, it looks like I was close when I said to look for some property that would enable the event.

You[re missing a method call.

bcr.ThreadedRead( true );

Download the SDK from the Intermet site - there's tons of example code available.

Pheria
July 7th, 2009, 09:15 AM
Woops. I actually DO have the bcr.ThreadedRead(true); bit. I have a lot of commented code that I removed when posting this and I left out that one line that's actually there by mistake. I have downloaded the SDK from Intermec, that's where I'm basing my code from. Thanks a lot for the tip though. I can't seem to find any setting under "Intermec Settings" that would deal with telling it to fire events. Looking around online, this same code seems to work for most people. It's quite puzzling.

karthik0521
July 28th, 2009, 10:54 PM
Pheria,

Did you figure out any solution yet? I have the same exact issue and tried whta you done and for god sake none of the examples in the intermec resource kit work not they have a proper documentaion. It really is frustrating...Please let me know if you did find a solution.

Thanks.