none
Using a Barcode Scanner and POS for .net 1.12 RRS feed

  • Question

  • Apologies in advance - Iam 'relatively' new to the forum.  I have trawled the net for advice, but come up with nothing that solves my problem.

    I have a Symbol LS2208 Barcode reader and want to use it in a simple vb.net application.  I dont want to use it in keyboard mode as I dont want to have to manage the focus of a textbox.

    I am on windows 7 64 bit.  I am using Visual Basic 2010.  I have downloaded the MS POS of .net 1.12 and referenced the application to the MicrosoftPointOfService.dll.  I have

    Imports

    Microsoft.PointOfService and system.collections.  I have tried to download the OPOS from Symbol - was sure if I have the right one or it is in the right place.  Alot seem to be for 32bit systems.

    DimscannerList = explorer.GetDevices(DeviceType.Scanner)

    ForEachitem AsDeviceInfoInscannerList

    TextBox1.Text = item.ServiceObjectName

    gives

    STI_SCANNER

    STI_USBSCANNER - so there seems to be some connection occuring

    Can anyone help me proceed?

    PS iam using the VB express edition

    Is there another barcode scanner that is easier/more directly compatible with POS 1.12?

    • Edited by Jeynesy Thursday, June 13, 2013 9:07 PM
    Thursday, June 13, 2013 9:05 PM

Answers

  • The Example Service Object that comes with POS for .NET should work with the scanner. There have been reported glitches on 64-bit operating systems. Ideally, you want a service object from the manufacturer. OPOS drivers will work too, but service object is better. Symbol should have one. To verify the service object or OPOS driver is working correctly, please use the TestApp that comes with the POS for .NET SDK.

    I take a more direct approach rather than the ForEach process:

      myExplorer = New PosExplorer(Me)
            'Dim device As DeviceInfo = myExplorer.GetDevice("Scanner")
            Dim device As DeviceInfo = myExplorer.GetDevice("Scanner", "myScanner")
    
            If device Is Nothing Then
                lstItems.Items.Add("Scanner not found")
    
            Else
                myScanner = myExplorer.CreateInstance(device)
    
                myScanner.Open()
                myScanner.Claim(1000)
                myScanner.DeviceEnabled = True
                myScanner.DataEventEnabled = True
                myScanner.DecodeData = True
    
            End If

    I have a few examples of bar code scanners with my eBook: http://www.annabooks.com/Book_PGPOS.html

    More information and examples can be found here: http://www.seanliming.com/POSforNET.html


    www.annabooks.com / www.seanliming.com / Book Author - Pro Guide to WE8S, Pro Guide to WES 7, Pro Guide to POS for .NET


    • Edited by Sean LimingMVP Friday, June 14, 2013 5:45 AM
    • Proposed as answer by Sean LimingMVP Saturday, June 15, 2013 3:13 PM
    • Marked as answer by Jeynesy Sunday, June 23, 2013 4:39 PM
    Friday, June 14, 2013 5:45 AM
  • Lets stick with the test application. The STI_USBSCANNER is working and that is a good sign. Where did STI_USBSCANNER come from? Did you install a SO driver from Motorola? If so, an XML point to the example scanner is not needed since the manufacturers SO is hardcoded - you have to read about service object in the book to understand how they did this. Also, the example scanner that comes with the SDK is just that an example, and not good for production. It is best to use the SO that comes from the manufacturer.

    Remove the XML file and try the custom application.


    www.annabooks.com / www.seanliming.com / Book Author - Pro Guide to WE8S, Pro Guide to WES 7, Pro Guide to POS for .NET

    • Marked as answer by Jeynesy Saturday, October 19, 2013 6:34 PM
    Tuesday, June 18, 2013 9:51 PM

All replies

  • The Example Service Object that comes with POS for .NET should work with the scanner. There have been reported glitches on 64-bit operating systems. Ideally, you want a service object from the manufacturer. OPOS drivers will work too, but service object is better. Symbol should have one. To verify the service object or OPOS driver is working correctly, please use the TestApp that comes with the POS for .NET SDK.

    I take a more direct approach rather than the ForEach process:

      myExplorer = New PosExplorer(Me)
            'Dim device As DeviceInfo = myExplorer.GetDevice("Scanner")
            Dim device As DeviceInfo = myExplorer.GetDevice("Scanner", "myScanner")
    
            If device Is Nothing Then
                lstItems.Items.Add("Scanner not found")
    
            Else
                myScanner = myExplorer.CreateInstance(device)
    
                myScanner.Open()
                myScanner.Claim(1000)
                myScanner.DeviceEnabled = True
                myScanner.DataEventEnabled = True
                myScanner.DecodeData = True
    
            End If

    I have a few examples of bar code scanners with my eBook: http://www.annabooks.com/Book_PGPOS.html

    More information and examples can be found here: http://www.seanliming.com/POSforNET.html


    www.annabooks.com / www.seanliming.com / Book Author - Pro Guide to WE8S, Pro Guide to WES 7, Pro Guide to POS for .NET


    • Edited by Sean LimingMVP Friday, June 14, 2013 5:45 AM
    • Proposed as answer by Sean LimingMVP Saturday, June 15, 2013 3:13 PM
    • Marked as answer by Jeynesy Sunday, June 23, 2013 4:39 PM
    Friday, June 14, 2013 5:45 AM
  • Hi Sean, thank you for your prompt response - I have downloaded the book and followed the step by step guide - VB appication using the Motorola barcode scanner. 

    I have the error ''There is more than 1 SCANNER device installed on the system"

    I believe I have moved the "Microsoft.PointofService.DeviceSimulators.dll" to prevent this

    My XML configuration file may be the problem???

    My XML knowledge is poor

    I simply pasted this from the books download page (and added the & bit)

    The HardwareID in the book correlates with mine (but my scanner appears to have two - HID\VID_05E0&PID_1300 and HID\VID_05E0&PID_1300&REV_0201

    - do I need to reference both??

    <?xml version="1.0"?>
    -<PointOfServiceConfig Version="1.0"> -<ServiceObject Name="Example Scanner" Type="Scanner"> <HardwareId To="HID\VID_05E0&amp;PID_1300" From="HID\VID_05E0&amp;PID_1300"/> </ServiceObject> </PointOfServiceConfig>

    I have been unable to change directory in the command prompt to test this XML file

    When I write 'cd c:\program files(x86)\Microsoft Point of Service'

    I get the error "Cannot find the specified path"

    Again command prompts are not my forte

    (Iam on Windows 7 - your book mentions something may need to be done differently)

    Your help is truely appreciated

    More Info...

    My XML congiguration file is located in the folder

    C:\Program Files (x86)\Common Files\microsoft shared\Point Of Service\Control Configurations

    As mentioned I am on Windows 7

    Not sure if its important - may be me being stupid - but Start Button/All Programs/Microsoft POS for .Net SDK only has documentation in it (is SDK installed properly??





    • Edited by Jeynesy Monday, June 17, 2013 9:23 PM
    Sunday, June 16, 2013 8:06 PM
  • I have made a small amount of progress...

    My XML configuration file is in

    C:\Program Files (x86)\Common Files\microsoft shared\Point Of Service\Control Configurations

    The file (Literally) looks like...

    <?xml version="1.0" encoding="UTF-8"?>
    -<PointOfServiceConfig Version="1.0"> --<ServiceObject Type="Scanner" Name="Example Scanner"><HardwareId From="HID\VID_05E0&PID_1300" To="HID\VID_05E0&PID_1300"/></ServiceObject></PointOfServiceConfig>

    The TestApp in the POS for .net SDK

    Shows Four sub headings under "scanners"

    1. STI_SCANNER

    2. STI_USBSCANNER

    3. Microsoft Scanner Simulator

    And when I plug in the physical Scanner...

    4. EXAMPLE SCANNER

    I have moved the file Microsoft.PointofService.DeviceSimulators.dll

    My application gives the error - ''There is more than 1 SCANNER device installed on the system"

    In the testApp -

    I can open, claim and enable STI_USBSCANNER - the physical scanner can scan a barcode and the data is decoded accurately

    For the EXAMPLE SCANNER I cannot enable the device - giving the error...

    POSControlException ErrorCode(Failure) ExtendedErrorCode(0) occurred: Unable to enable the device.  See inner exception for details.
    System.ComponentModel.Win32Exception: The process cannot access the file because it is being used by another process
       at Microsoft.PointOfService.ExampleServiceObjects.HidReader.HidThread.StartReading()
       at Microsoft.PointOfService.ExampleServiceObjects.ExampleScanner.set_DeviceEnabled(Boolean value)
    Opened device: Example Scanner
    Created instance of device: Example Scanner

    Not sure if this is important - but the TestAPP doesnt seem to be installed - rather is in a folder

    C:\Users\Pete\Desktop\POS\PosFor.Net\Files\SDK\Samples\Sample Application


    • Edited by Jeynesy Tuesday, June 18, 2013 9:09 PM
    Tuesday, June 18, 2013 8:56 PM
  • Lets stick with the test application. The STI_USBSCANNER is working and that is a good sign. Where did STI_USBSCANNER come from? Did you install a SO driver from Motorola? If so, an XML point to the example scanner is not needed since the manufacturers SO is hardcoded - you have to read about service object in the book to understand how they did this. Also, the example scanner that comes with the SDK is just that an example, and not good for production. It is best to use the SO that comes from the manufacturer.

    Remove the XML file and try the custom application.


    www.annabooks.com / www.seanliming.com / Book Author - Pro Guide to WE8S, Pro Guide to WES 7, Pro Guide to POS for .NET

    • Marked as answer by Jeynesy Saturday, October 19, 2013 6:34 PM
    Tuesday, June 18, 2013 9:51 PM