I have a working data acquisition program, but it requires static configuration of the attached Phidgets (thermocouple sensor for now, but more to follow). So I thought I would write a nicer program that used the Manager to dynamically detect attaching Phidgets and configure itself.
I quickly figured out that the Phidget passed to the AttachListener is not a real (typed) Phidget. This is sort of documented ("The Phidget manager deals in base Phidget objects. These objects are not actually connected to opened Phidgets but can be used to get serial number, name, version, etc.") on the Manager page.
OK, I thought, when I get the Manager AttachEvent I will get the serial number out of the "fake" Phidget, create TemperatureSensorPhidget() and call open(int serial) on it. But this doesn't work ("PhidgetException 5 (Phidget not physically attached)").
Of course the Phidget really is physically attached, since I'm in the AttachEvent handler. Which leads me to believe I should have created the TemperatureSensorPhidget before attaching the device. But this means I couldn't have configured it dynamically.
Am I missing something?