BurntCandy
BurntCandy

Reputation: 55

PosExplorer().getDevices not finding my scale

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.PointOfService;
    using System.Collections;

    namespace ScalePOS
    {
        class ScalePOS
        {





            static void Main(string[] args)
            {

                // Create a new instance of PosExplorer and use it to 
                // collect device information.
                PosExplorer explorer = new PosExplorer();
                DeviceCollection devices = explorer.GetDevices();

                // Search all connected devices for an Scale, print its service object name



                foreach (DeviceInfo device in devices)
                {
                    if (device == null)
                    {
                        Console.WriteLine("device is null");
                    }

                   Console.WriteLine(device.ServiceObjectName);
                   Console.WriteLine(device.Type);
                   Console.WriteLine(device.HardwareId);
                   Console.ReadLine();


                            // It is important that applications close all open

                }
            }  
        }
    }

I am trying to interface with a USB Scale and PosExplorer seems to not pick it up. When I run this code I get a bunch of Microsoft MSR,Scanner,Keylock simulators, but my scale is not picked up. Does anyone here know why not?

Upvotes: 0

Views: 2696

Answers (2)

BurntCandy
BurntCandy

Reputation: 55

Figured out what the issue was, I needed an OPOS Driver or a service object associated with the scale. As the manufacturer did not provide one I needed to create my own.

Upvotes: 1

Fooksie
Fooksie

Reputation: 480

You can check for installed Service Objects through Visual Studio by opening the Server Explorer (View menu, then Server Explorer).

Once in the Server Explorer (which is presented as a tree), expand the "Servers" node, then your computer name node, then you can check for your particular device in either the "LogicalDevice", "POSDevice" or "ServiceObject" nodes.

I'd start with the "ServiceObject" node first!

Upvotes: 1

Related Questions