Syntax question for serverdiscovery

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

Syntax question for serverdiscovery

Postby danthoskin » Thu Nov 14, 2019 9:58 am

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: 268
Joined: Thu Nov 19, 2009 4:41 pm
Contact:

Re: Syntax question for serverdiscovery

Postby fraser » Thu Nov 14, 2019 11:12 am

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: 25
Joined: Wed Oct 30, 2019 5:44 pm
Contact:

Re: Syntax question for serverdiscovery

Postby danthoskin » Thu Nov 14, 2019 11:16 am

I really appreciate the response, my nerves are getting frazzled trying to sort this out.
Thanks,
Dan

danthoskin
Phidgetly
Posts: 25
Joined: Wed Oct 30, 2019 5:44 pm
Contact:

Re: Syntax question for serverdiscovery

Postby danthoskin » Thu Nov 14, 2019 11:59 am

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


Return to “VB .NET”

Who is online

Users browsing this forum: No registered users and 1 guest