Ascom command used to open / close shutter


#1

Hi,

I’m writing an Ascom driver to open & close my shed roof but i’m having issues trying trouble integrating it with SGP. When i connect the driver, i then goto the control panel in SGP and i notice that the status in the observatory control doesn’t seem to work, anlong with the open and close buttons.

Which Ascom command is used for for the shutter status and to open & close the the shutter ?

My next question is about removing asom drivers from the driver list. I have lots of drivers listed due to testing various revisions of my driver and i would like to know how i can get rid of them ?

Many thanks in advance,
Richard.


#2

have you tried cnnecting the dome via poth hub and using the control in poth hub to confrim it behaves by hand?


#3

Does “CanSetShutter” return true?

For the status we use ShutterStatus and it should be returning a ShutterState value.

You should be able to uninstall ASCOM drivers via the normal windows installer if you setup a package. If they’re just COM objects then you can use the ASCOM Profile tool to remove them. Or possibly using the RegSvr to unregister the COM object. To be honest I’m not entirely sure what the “correct” way to do it is. I’ve always used the ASCOM Profile tool. Maybe @Chris can add some more data.

Thanks,
Jared


#4

Hi Jared

Many thanks for the quick response. I’ve not coded anything yet to move the shutter, as i fell at the first hurdle of trying to read the shutter status.

Cureently just testing with a vb form, ans i tried reading the status by doing a textbox1.text = objdome.shutterstatus in an attemp to just read the status and place it into a text box.

Do you know what type of value the shutter status returns, as i also tried reading it as an integer and still no joy.

Rich.


#5

The ASCOM documentation describes the shutter states, basically ShutterState is an an enumeration.

The Profile editor can be used to remove unwanted drivers, or if a driver was installed using a installer use the uninstaller.

Chris


#6

Hi Chris,

Thanks for the reply. i basically dont understand how to hadnle it. looking at the documentation, it’s supposed to a number which represent a given state. when i tried to read that state into a string into a integer or string i get no joy.
/
How have you implemented it in SGP, i.e. what line of code did you use to read the shutter state ? as it might point mein the right direction.

Regards,
Richard.
Richard,


#7

The ShutterStatus property returns a ShutterState Enumeration, look up Enumerations in VB and you should get some ideas about how to use these. It’s not a number, nor a string but can be converted to either.

SGP is nothing to do with me but I expect that there will be code like

’ open the shutter
dome.OpenShutter
while not dome.ShutterStatus = ShutterState.shutterOpen ’ check if the shutter is open
Thread.Sleep 1000 ’ wait a bit
wend
’ the shutter is now open
’ no error checking

That’s my attempt at VB and I may have got the detail wrong.
Try to treat ShutterStatus as an enumeration and use the enueration name. It helps to make your code understandable.

Chris


#8

Well,

I thought this was going to be fairly straight forward, i didn’t think it would be this difficult to write a simple ascom driver. Essentially all i’m trying to do is read a string value from the serialport that i terminated with a “#” and depending on that string value “0” or “1” then update the shutter status in SGP, and if then if i click on the open or close button in SGP send a # terminated string back to the serial port.which will tell my hardware to open or close.


#9

That seems as if it shouldn’t be difficult.

It may be worth zipping up your project and posting it to the ASCOM files area. If we can have a look we may be able to suggest something.

Chris


#10

Hi Chris,

I managed to get lots of help from the world of Ascom, with a special thanks to a chap who goes by the name of Tom How from the Currige observatory who pretty much wrote the code for me for both my Arduino and the VB for the Ascom driver and i’m glad to report that it works perfectly.

Now all i need is to wait and see if a potential bug i reported in SGP with Dome slaving is just down to my pc or if it affects everyone.

For the rest of the week i’ll be adding in the code for the magnetic sensors and a rain sensor along with adding a colour tough screen to my Arduino.

Many thanks for everyones help.
Rich.


www.mainsequencesoftware.com