none
Access Honeywell Xnenon 1900 Barcode Scanner using Microsoft.PointOfService in Windows Forms. RRS feed

  • Question

  • Hi,

    By using bellow code I am trying to access the barcode scanner device which is connected by USB.

     
     private PosExplorer explorer;
    
     private Scanner scanner;
    
     private void Form1_Load(object sender, EventArgs e)
    
       {
    
         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(scanner_DataEvent);
    
              scanner.DataEventEnabled = true;
    
              scanner.DecodeData = true;
    
           }
    
       }
    
     void scanner_DataEvent(object sender, DataEventArgs e)
    
        {
    
           // Reading barcode data
    
        }

    In explorer I am unable to find the attached scanner.

    Note : Installed required drivers also. 

    Please suggest me if anything wrong.
    • Edited by A.suresh1 Saturday, March 31, 2018 7:10 AM
    • Moved by Stanly Fan Tuesday, April 3, 2018 7:00 AM
    Saturday, March 31, 2018 6:50 AM

All replies

  • Hi,

    Do you use it for 1D or 2D scanning. Using windows 10? For 1D scanning a barcode scanner act as a keyboard. Did you had the message from windows "keyboard attached" I do not known the brand, i have programmed a barcode scanner code with an scanner act as a keyboard, no driver installed, plug and play.


    Greetings from Amsterdam the Netherlands

    Saturday, March 31, 2018 10:58 AM
  • In explorer I am unable to find the attached scanner.

    Note : Installed required drivers also. 

    Hi A.suresh1,

    I'm afraid this question is not related to Winform, it sounds more like a scanner can't connect to a computer, I suggest you connect the scanner provider for help, and ask your question at Microsoft Community.

    Regards,

    Frankie


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 2, 2018 6:19 AM
  • scanner act as a keyboard, no driver installed, plug and play.

    I am using Windows 8.1 and 2D scanning and moreover I have to do other coding after scanning complete event raised. If it is connected as keyboard there are no events raising for scanner.
    Monday, April 9, 2018 12:44 PM
  • scanner act as a keyboard, no driver installed, plug and play.

    I am using Windows 8.1 and 2D scanning and moreover I have to do other coding after scanning complete event raised. If it is connected as keyboard there are no events raising for scanner.

    Have you tried a form with a textbox in it. Intercept the keydown event and try. With 2d scanning properly multiline textbox. Set focus on the textbox if you try.

    Succes


    Greetings from Amsterdam the Netherlands

    Monday, April 9, 2018 5:40 PM