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!
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.