Syntax question for serverdiscovery

Supporting Visual Studio on Windows
Post Reply
danthoskin
Phidgetly
Posts: 35
Joined: Wed Oct 30, 2019 5:44 pm
Contact:

Syntax question for serverdiscovery

Post by danthoskin »

Hi again,
Working through my VB NET project with a VINT hub and Stepper controllers. The simplest code example I found so far that I can relate to was the Python 4a Stepper sample code and I'm trying to use that as a guide to tell me the individual steps I need to accomplish to get this running in VBNET. (I still haven't been able to find a VBNET code sample that uses the VINT Hub.)
A lot of the code is easy to translate without errors into VBNET, but I am struggling with this one:
Net.enableServerDiscovery(PhidgetServerType.PHIDGETSERVER_DEVICEREMOTE)
Can anyone show me the VBNET equivalent for that, or point me to a resource that explains it?

Thanks again,
Dan
fraser
Engineering
Posts: 324
Joined: Thu Nov 19, 2009 4:41 pm
Contact:

Re: Syntax question for serverdiscovery

Post by fraser »

The VB.NET equivalent is simply

Code: Select all

Phidget22.Net.EnableServerDiscovery(ServerType.DeviceRemote)
Using the VINT Hub only requires a couple extra lines of code. For example, if you have a stepper controller attached to a VINT hub on port 1, you only need to set ".HubPort = 1" on the stepper object before calling open. if you have multiple steppers, it's also a good idea to set the serial number of the hub using ".DeviceSerialNumber"
danthoskin
Phidgetly
Posts: 35
Joined: Wed Oct 30, 2019 5:44 pm
Contact:

Re: Syntax question for serverdiscovery

Post by danthoskin »

I really appreciate the response, my nerves are getting frazzled trying to sort this out.
Thanks,
Dan
danthoskin
Phidgetly
Posts: 35
Joined: Wed Oct 30, 2019 5:44 pm
Contact:

Re: Syntax question for serverdiscovery

Post by danthoskin »

Yup, that was the last bit I needed. All working nicely now. Thanks Fraser.
Dan
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests