Discussion:
Scanner not recognized by Microsoft POS
(too old to reply)
Jack
2009-08-27 17:08:01 UTC
Permalink
I have a barcode scanner from Metro Technologies and I am using Microsoft POS
to detect the input from the scanner. It is connected to my system using USB
port. But the scanner is not getting identified by the POS.

public Form1()
{
InitializeComponent();
explorer = new PosExplorer(this);
explorer.DeviceAddedEvent += new
DeviceChangedEventHandler(explorer_DeviceAddedEvent);
}


void explorer_DeviceAddedEvent(object sender, DeviceChangedEventArgs e)
{
if (e.Device.Type == "Scanner")
{
scanner = (Scanner)explorer.CreateInstance(e.Device);
scanner.Open();
scanner.Claim(1000);
scanner.DeviceEnabled = true;
scanner.DataEvent += new
DataEventHandler(activeScanner_DataEvent);
scanner.DataEventEnabled = true;
scanner.DecodeData = true;
}
}

void activeScanner_DataEvent(object sender, DataEventArgs e)
{
UpdateEventHistory("Data Event");
ASCIIEncoding encoder = new ASCIIEncoding();
try
{
// Display the ASCII encoded label text
txtbScanDataLabel.Text =
encoder.GetString(activeScanner.ScanDataLabel);
// Display the encoding type
txtbScanDataType.Text = activeScanner.ScanDataType.ToString();

// re-enable the data event for subsequent scans
activeScanner.DataEventEnabled = true;
}
catch (PosControlException)
{
// Log any errors
UpdateEventHistory("DataEvent Operation Failed");
}
}
Sylvester La Blanc MSFT
2009-09-17 03:02:55 UTC
Permalink
Post by Jack
I have a barcode scanner from Metro Technologies and I am using Microsoft POS
to detect the input from the scanner. It is connected to my system using USB
port. But the scanner is not getting identified by the POS.
public Form1()
{
InitializeComponent();
explorer = new PosExplorer(this);
explorer.DeviceAddedEvent += new
DeviceChangedEventHandler(explorer_DeviceAddedEvent);
}
void explorer_DeviceAddedEvent(object sender, DeviceChangedEventArgs e)
{
if (e.Device.Type == "Scanner")
{
scanner = (Scanner)explorer.CreateInstance(e.Device);
scanner.Open();
scanner.Claim(1000);
scanner.DeviceEnabled = true;
scanner.DataEvent += new
DataEventHandler(activeScanner_DataEvent);
scanner.DataEventEnabled = true;
scanner.DecodeData = true;
}
}
void activeScanner_DataEvent(object sender, DataEventArgs e)
{
UpdateEventHistory("Data Event");
ASCIIEncoding encoder = new ASCIIEncoding();
try
{
// Display the ASCII encoded label text
txtbScanDataLabel.Text =
encoder.GetString(activeScanner.ScanDataLabel);
// Display the encoding type
txtbScanDataType.Text = activeScanner.ScanDataType.ToString();
// re-enable the data event for subsequent scans
activeScanner.DataEventEnabled = true;
}
catch (PosControlException)
{
// Log any errors
UpdateEventHistory("DataEvent Operation Failed");
}
}
Please see post reply in forum at:
http://social.msdn.microsoft.com/Forums/en-US/posfordotnet/thread/0305a26
0-8e3a-4b83-aabe-a4f4c117f0dd
--
This posting is provided "As Is" with no warranties, and confers no rights.
X-Face: 3bv|Grp$j"BCYpET|y@@/5=;***@Zuc[XSbP7Ui8#`J0J|PX0c!m9=]McR9PPq
\TvMOAvJUes)hkN;<}cLH#}@F~*t`[>9@,;4`@OEs?BpPKrJ+x.E{1i.AEbJ6ul-~X/1
6Hqa0bJ4m]?***@j?dy.l_=|b[iZjr>!x:P_&p"[OI@^'^-U[^6FHdTI5~"Ak[Vp%?ba?/
CcQZS+nKY[D!H~08:[_F8^I{%c#yh8;#u7$m0^dZ3DOr=6=!*`"(z3%$HUBVFlfAn4H0
\<f:HYfWP:g<P:3gp?6d,ge~y
Sylvester La Blanc MSFT
2009-09-25 03:26:22 UTC
Permalink
Post by Jack
I have a barcode scanner from Metro Technologies and I am using Microsoft POS
to detect the input from the scanner. It is connected to my system using USB
port. But the scanner is not getting identified by the POS.
public Form1()
{
InitializeComponent();
explorer = new PosExplorer(this);
explorer.DeviceAddedEvent += new
DeviceChangedEventHandler(explorer_DeviceAddedEvent);
}
void explorer_DeviceAddedEvent(object sender, DeviceChangedEventArgs e)
{
if (e.Device.Type == "Scanner")
{
scanner = (Scanner)explorer.CreateInstance(e.Device);
scanner.Open();
scanner.Claim(1000);
scanner.DeviceEnabled = true;
scanner.DataEvent += new
DataEventHandler(activeScanner_DataEvent);
scanner.DataEventEnabled = true;
scanner.DecodeData = true;
}
}
void activeScanner_DataEvent(object sender, DataEventArgs e)
{
UpdateEventHistory("Data Event");
ASCIIEncoding encoder = new ASCIIEncoding();
try
{
// Display the ASCII encoded label text
txtbScanDataLabel.Text =
encoder.GetString(activeScanner.ScanDataLabel);
// Display the encoding type
txtbScanDataType.Text = activeScanner.ScanDataType.ToString();
// re-enable the data event for subsequent scans
activeScanner.DataEventEnabled = true;
}
catch (PosControlException)
{
// Log any errors
UpdateEventHistory("DataEvent Operation Failed");
}
}
Make sure you have the Service Object installed (and configured if
needed). Also, make sure the scanner is configured to work under UPOS.
By default some scanners may be configured as keyboard devices out of
the box and need to be reconfigured.
--
This posting is provided "As Is" with no warranties, and confers no rights.
X-Face: 3bv|Grp$j"BCYpET|y@@/5=;***@Zuc[XSbP7Ui8#`J0J|PX0c!m9=]McR9PPq
\TvMOAvJUes)hkN;<}cLH#}@F~*t`[>9@,;4`@OEs?BpPKrJ+x.E{1i.AEbJ6ul-~X/1
6Hqa0bJ4m]?***@j?dy.l_=|b[iZjr>!x:P_&p"[OI@^'^-U[^6FHdTI5~"Ak[Vp%?ba?/
CcQZS+nKY[D!H~08:[_F8^I{%c#yh8;#u7$m0^dZ3DOr=6=!*`"(z3%$HUBVFlfAn4H0
\<f:HYfWP:g<P:3gp?6d,ge~y
Loading...