I've been working on trying to get scanned data from Motorola MC2180. I know this is basic but I am a beginner and never touched a PDA before. I can get it to scan but the result data is still null. I use the following code:
{
public Symbol.Barcode.Reader SymbolReader = null;
public Symbol.Barcode.ReaderData SymbolReaderData = null;
public static System.EventHandler SymbolEventHandler = null;
/// <summary>
/// MyReaderData property provides access to the ReaderData
/// </summary>
public Symbol.Barcode.ReaderData MyReaderData
{
get { return SymbolReader.GetNextReaderData(); }
}
public static System.EventHandler MyEventHandler
{
get { return SymbolEventHandler; }
set { SymbolEventHandler = value; }
}
public bool InitScanner()
{
try
{
SymbolReader = new Symbol.Barcode.Reader();
SymbolReaderData = new Symbol.Barcode.ReaderData(Symbol.Barcode.ReaderDataTypes.Text, Symbol.Barcode.ReaderDataLengths.MaximumLabel);
SymbolReader.Actions.Enable();
SymbolReader.Parameters.Feedback.Success.BeepTime = 0;
SymbolReader.Parameters.Feedback.Success.WaveFile = "\\windows\\alarm3.wav";
}
catch(Exception ex)
{
ex.ToString();
}
return true;
}
public void TermReader()
{
try
{
if (SymbolReader != null)
{
SymbolReader.Actions.Disable();
SymbolReader.Actions.Dispose();
SymbolReader = null;
}
}
catch (Exception ex)
{
ex.ToString();
}
}
private bool ReadData()
{
{
try
{
// Submit a read
SymbolReader.ReadNotify += SymbolEventHandler;
// Prevent duplicate reads
if (!SymbolReaderData.IsPending)
{
SymbolReader.Actions.Read(SymbolReaderData);
return true;
}
else
return false;
}
catch (Exception ex)
{
ex.ToString();
return false;
}
}
}
public string StopRead()
{
if (SymbolReader != null)
{
try
{
// Flush (Cancel all pending reads)
SymbolReader.ReadNotify -= SymbolEventHandler;
SymbolReader.Actions.Flush();
return "Closed";
}
catch (Exception ex)
{
return ex.ToString();
}
}
else
return "Already Closed";
}
public string ToggleTrigger()
{
this.InitScanner();
SymbolReader.Actions.ToggleSoftTrigger();
this.ReadData();
return SymbolReaderData.Text;
}
}
I tried to use the EMDK support site but it keeps locking me out as its on maintenance.
My main issues are: 1. Getting the data after a scan - I'm not sure how it decodes the barcode data 2. How do I get the scanner to trigger for longer? because I can Barcode2.Config.TriggerMode allows me to scan for longer than Barcode.Reader.ToggleSoftTrigger();
I might need an explanation as I can't access EMDK guide or documentation doesn't help :(
Thank you in advance! :)
Note that Zebra Technologies acquired Motorola Solutions enterprise business in October 2014. This is why I'm talking here about Zebra, even the devices may be branded Motorola or Symbol.
Your best option is to start from the sample application included in the Zebra Technologies' EMDK for .NET, latest one is v2.9 available on Zebra support site. Here's a direct link to that page.
The EMDK and the standalone guide are public software and you are not required to login to download them.
Keep in mind that to use the EMDK to write application for the MC2180, you need VisualStudio 2005 + SP1 or VisualStudio 2008. This are the only two version of the Microsoft development tools supporting Windows CE 6.0. Newer version of Microsoft VisualStudio don't support this operative system.