How To Use Serial Number Or Location Filters
<< Back to the SharedPhidgets 3 page
When you create a new device proxy object, it normally will connect to the first device of the same type (e.g., servo) it founds in the DeviceManager. To connect to a specific device, you can add serial and location filters to the device.
There are two ways to add serial and location filters to your proxy components: with specifying the property in the Visual Studio GUI builder, or by adding the information in the programm code.
1. Using the Visual Studio GUI builder:
1) Create your proxy component by selecting a new object in the toolbox and clicking on your form (here: a servo object as an example, it works in the similar way for all hardware devices):

2) Select the created component and search the property FilterSerialNumber in the properties window of Visual Studio (usually on the right side of the screen)
3) Select the "..." Button of the property entry:

4) Click the Add button and select the Int32 value in the right list of the dialog window.
5) Enter your serial number here (only numeric characters) and click OK.

6) Finished! You can add more serial numbers if you like. The specification of locations works in the smae way, you only have to select the FilterLocations property and then insert the location name.
2. Specifying in the source code
// Create a new proxy component, here as an example the Phidget servo
GroupLab.SharedPhidgets.Servo servo = new GroupLab.SharedPhidgets.Servo();
// Add a serial number information
servo.FilterSerialNumbers.Add("123");
// You can add as many serial numbers as you like, if you want
// that the component can be connected to different physical devices
servo.FilterSerialNumbers.Add("7228");
// Specify the location
servo.FilterLocations.Add("My Location");