none
POS.net 1.12.10.0, OPOS v3.31, Symbol LS2208 Barcode Scanner not working on deployment machine RRS feed

  • Question

  • Hi,

    I have a vb.net application created in VS 2013 professional - It utilises a symbol LS2208 Barcode scanner.



    The application builds and works great on the development machine (thanks to help from Sean Liming - and his book), also the application can be published/deployed and installed on the development machine and works well - the problem is running it on another machine



    I have used Microsoft.pointofservice 1.12.0.0 as well as the manufacturers OPOS Driver for symbol Scanners v3.31 - and installed them on both machines (not sure if this was necessary)



    The TestApp within POS.net works on the development machine - The scanner is recognised as STI_USBSCANNER, but does not seem to work on the target computer giving the error below



    System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {027D61A3-4251-11D0-B7A4-80BBFFC00000} failed due to the following error: 80040154.



    If I cut out the Scanner stuff from the application, it deploys fine



    Some insight was gained from regarding x64 and x86 issues

    http://social.msdn.microsoft.com/Forums/zh-TW/0a8cb873-dcf5-49ba-a402-f80e0355ea98/unable-to-open-scanner



    The development machine is Windows 7 (x64) the target computer is running Windows 8 (x64)

    Any help would be gratefully received

    Code...

    Imports Microsoft.PointOfService
    Imports System.Collections
    Imports System.Text
    'Imports System
    'Imports System.ComponentModel
    'Imports System.Threading
    'Imports System.IO.Ports
    'Imports System.Net.Mail
    Imports System.Data
    Imports System.Data.SqlClient
    Imports System.Configuration
    Imports System.Configuration.ConfigurationSettings
    
    Public Class Form1
    
        Dim sampleNo As Integer = 0
    
        Dim AddedDplus As System.DateTime
        Dim ts As TimeSpan
        Dim Day As Integer
        Dim Dplus As Integer
    
        Dim ButtonString As String = ""
    
        Dim tare As Decimal = 0
        Dim lblWeight As Decimal = 0
    
        WithEvents myExplorer As PosExplorer
        WithEvents myScanner As Scanner
    
        Dim myPort As Array 'COM Ports detected on the system will be stored here
        Delegate Sub SetTextCallback(ByVal [Wt] As String) 'Added to prevent threading errors during receiveing of data
    
        Dim product As String
        'Dim grdWeight As Decimal
        'Dim tare As Decimal = 0
        'Dim lblWeight As Decimal = 0
      
        Public Sub New()
            ' This call is required by the designer.
            InitializeComponent()
            ' Add any initialization after the InitializeComponent() call.
            myExplorer = New PosExplorer(Me)
    
            Dim scannerList = myExplorer.GetDevices(DeviceType.Scanner)
    
            For Each item In scannerList
    
                'LstItems.Items.Add(item.ServiceObjectName)
                If item.ServiceObjectName = "STI_USBSCANNER" Then
                    myScanner = myExplorer.CreateInstance(item)
                    myScanner.Open()
                    myScanner.Claim(1000)
                    myScanner.DeviceEnabled = True
                    myScanner.DataEventEnabled = True
                    myScanner.DecodeData = True
                End If
            Next
    
        End Sub
    
        Private Sub myExplorer_DeviceAddedEvent(sender As Object, e As Microsoft.PointOfService.DeviceChangedEventArgs) Handles myExplorer.DeviceAddedEvent
    
            If (e.Device.Type = "Scanner") Then
    
    
                myScanner = myExplorer.CreateInstance(e.Device)
    
                myScanner.Open()
                myScanner.Claim(1000)
                myScanner.DeviceEnabled = True
                myScanner.DataEventEnabled = True
                myScanner.DecodeData = True
                'LstItems.Items.Add("Scanner Attached")
            End If
        End Sub
    
        Private Sub myExplorer_DeviceRemovedEvent(sender As Object, e As Microsoft.PointOfService.DeviceChangedEventArgs) Handles myExplorer.DeviceRemovedEvent
            If (e.Device.Type = "Scanner") Then
                myScanner.DataEventEnabled = False
                myScanner.DeviceEnabled = False
                myScanner.Release()
                myScanner.Close()
                'LstItems.Items.Add("Scanner Removed")
            End If
        End Sub
    
        Private Sub myScanner_DataEvent(sender As Object, e As Microsoft.PointOfService.DataEventArgs) Handles myScanner.DataEvent
           
            Dim myEncoding As New ASCIIEncoding
            TextBoxBarcode.Text = Nothing
            TextBoxBarcode.Text = myEncoding.GetString(myScanner.ScanDataLabel)
            myScanner.Claim(1000)
            myScanner.DataEventEnabled = True
    
    
            'CheckBox if the barcode already exists
            Dim MyConnection As New SqlConnection
            MyConnection.ConnectionString = ConfigurationManager.ConnectionStrings("ShelfLifeSaverConnectionString").ConnectionString
    

    Sunday, January 12, 2014 4:10 PM

Answers

  • Looks like there is something wrong with the OPOS driver. I am not able to find a POS for .NET Service Object on the Motorola site. A Service Object would be better than an OPOS driver.

    I suggest that you contact Motorola / Symbol directly to get support.


    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 Thursday, January 16, 2014 1:25 AM
    • Marked as answer by Jeynesy Friday, January 17, 2014 2:33 PM
    Thursday, January 16, 2014 1:24 AM

All replies

  • Simple question: Is .NET Framework 2.0 installed on the system you are trying to run the application?

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

    Sunday, January 12, 2014 4:29 PM
  • Yes - I believe so -

    Installed .NET Framework packages

    .NET Framework 2.0 Service Pack 2   ver: 2.0.50727.4927

    .NET Framework 3.0 Service Pack 2   ver: 3.0.30729.4926

    .NET Framework 3.5 Service Pack 1   ver: 3.5.30729.4926

    .NET Framework 4.5 Client Profile   ver: 4.5.50709

    .NET Framework 4.5 Full Package   ver: 4.5.50709

    Sunday, January 12, 2014 6:01 PM
  • On the Windows 8 target machine, does the TestApp see the sample service object devices?

    Have you tried a different scanner?


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

    Tuesday, January 14, 2014 2:47 AM
  • Hi Sean,

    I don't have another scanner to try (I know the scanner works on the development machine). 

    On the Windows 8 computer (target), in the testApp - STI_USBSCANNER appears in the treeview on the left, when I highlight it and try to OPEN - I get the following error...

    System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {027D61A3-4251-11D0-B7A4-80BBFFC00000} failed due to the following error: 80040154

    On the windows 7 (development) computer - testApp works fine - STI_USBSCANNER can be opened, claimed and a data can be decoded.

    Tuesday, January 14, 2014 5:26 AM
  • What I was referring to was the simulator POS devices from the POS for .NET SDK. Does the TestApp see those?

    If you run the TestApp application with elevated privileges does it see the scanner?

    It is not making sense why the application are failing.


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

    Tuesday, January 14, 2014 4:11 PM
  • In TestApp (Pos.net SDK) I can see Microsoft Scanner Simulator, Example Scanner, STI_SCANNER and STI_USBSCANNER

    On the development machine (where scanner works) the scanner is recognised as STI_USBSCANNER

    I can open, claim, enable the Microsoft scanner simulator.

    I cannot open the Example Scanner - Error...

    "POSControlException ErrorCode(Illegal) ExtendedErrorCode(0) occurred: The value of the 'DevicePath' property must be defined by the service object before Open() can be called. Created instance of device: Example Scanner"

    I have another test application (maybe came with OPOS driver??) called "Scanner OPOS Sample App"

    Here the scanner (as STI_USBSCANNER) can be opened, claimed, enabled and a scan can be decoded on the windows 8/target machine.

    My application still does not work though - I am guessing for the same reason the TestApp (Pos.net SDK) doesn't work

    Wednesday, January 15, 2014 7:22 PM
  • If it helps - my problem looks identical to this previous issue you were involved with

    http://social.msdn.microsoft.com/Forums/en-US/0a8cb873-dcf5-49ba-a402-f80e0355ea98/unable-to-open-scanner?forum=posfordotnet

    Wednesday, January 15, 2014 7:35 PM
  • More info from error - when I use testApp (Pos.net SDK) and I try to open STI_USBSCANNER.  I hope this may help

    Error...

    System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {027D61A3-4251-11D0-B7A4-80BBFFC00000} failed due to the following error: 80040154.

       at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck)

       at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache)

       at System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache)

       at System.Activator.CreateInstance(Type type, Boolean nonPublic)

       at Microsoft.PointOfService.Management.Explorer.GenerateLegacyProxy(String progId, String deviceName, String deviceType, Boolean strictErrorChecking)

       at Microsoft.PointOfService.Management.Explorer.CreateInstance(DeviceInfo device)

       at Microsoft.PointOfService.PosExplorer.CreateInstance(DeviceInfo device)

       at TestApplication.MainForm.OpenDevice(TreeNode node)

    Wednesday, January 15, 2014 7:56 PM
  • Looks like there is something wrong with the OPOS driver. I am not able to find a POS for .NET Service Object on the Motorola site. A Service Object would be better than an OPOS driver.

    I suggest that you contact Motorola / Symbol directly to get support.


    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 Thursday, January 16, 2014 1:25 AM
    • Marked as answer by Jeynesy Friday, January 17, 2014 2:33 PM
    Thursday, January 16, 2014 1:24 AM
  • Thanks Sean, I am considering using POS.net alone for communication with the scanner and doing away with the OPOS driver.  I have written the XML file as it advises in your book using the HID_ID from device manager.  I am have saved the file to

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

    But I note it recommends you save in a different directory if running Windows 7

    I wasn't sure where to put this file.

    From the command prompt when I run the Posdm Listdevices command

    I see the 'Example Scanner' - but no device path is showing

    In TestApp - When I try to open the 'example scanner' I get...

    POSControlException ErrorCode(Illegal) ExtendedErrorCode(0) occurred: The value of the 'DevicePath' property must be defined by the service object before Open() can be called.
    Created instance of device: Example Scanner

    The code for my XML file is...

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

    Friday, January 17, 2014 1:13 PM
  • Small bit of progress..

    I used...

    <PointOfServiceConfig Version="1.0">
    <ServiceObject Type="Scanner" Name="Example Scanner"
    Override="yes">
    <HardwareId From="HID\VID_05E0&amp;PID_1300"
    To="HID\VID_05E0&amp;PID_1300" />
    </ServiceObject>
    </PointOfServiceConfig>
    

    Instead - now I am getting the device path when I run - Posdm listdevices from the command prompt

    But TestApp is still not opening 'Example Scanner' - I get

    POSControlException ErrorCode(Illegal) ExtendedErrorCode(0) occurred: The value of the 'DevicePath' property must be defined by the service object before Open() can be called.
    Created instance of device: Example Scanner

    Do I need to install Symbol OPOS driver?

    Friday, January 17, 2014 1:34 PM
  • Hi Sean - I uninstalled the Symbol OPOS stuff.

    Application is now running sweet on destination computer.  Thanks again for your help

    Friday, January 17, 2014 2:34 PM
  • Looks like you are using the ExampleScanner service object. This SO will work, but it does have some issues. It works with Symbol and Honeywell scanners as an example. Honeywell actually has a service object for their scanners that works well. This would be a different scanner.

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

    Friday, January 17, 2014 4:05 PM