Visual Basic API Example?



I’m writing a Visual Basic application to give me enhanced control over my dome operation with various power on/off options and more flexible weather monitoring and control. I also want to use it to provide a “consolidated” view of the observatory status that can be easily seen using Team Viewer on a smart phone.

I’m also including windows for my IR webcam, weather radar and IR satellite internet images and I’d like to be able to include SGPro status information and basic controls like abort sequence / disconnect gear etc.

I’ve had a look at the console code example for the API in the SGPro manual, but I’m afraid it’s gone straight over my head.

Could anyone point me at some example code in VB (or a tutorial maybe) that would enable my application to access the API please??

Many thanks



The C# example is the only one we have. I would honestly take a look at C# over VB. C# is more the “first class” option as far as Microsoft is considered these days. VB is taking a back seat, though still widely used and supported.



Thanks Jared.

I’ll have go at C# but could you throw any light on how I incorporate the SGP API into a Visual Studio forms application please?

I assume i have to add a Resource to my project in Visual Studio - but which resource?

Thanks again.



Our API is rest based. So it’s like calling a web service vs a COM object. You can add a web reference in VS by pointing it at the url for the API. I believe you just point it here: http://localhost:59590/metadata however it’s been a LONG while since I’ve done that so you may need to point it to the root or to one of the other pages inside of the metadata to get it to generate the reference. Sorry, it’s been a while.



Ok - thanks again Jared - I’ll have a go…and if I get anywhere I’ll post the code in case anyone else is interested.