Switch type Ascom device

Got an idea for something that SharpCap should do? Share it here.
Forum rules
'+1' posts are welcome in this area of the forums to indicate your support for a particular feature suggestion. Suggestions that get the most +1's will be seriously considered for inclusion in future versions of SharpCap.
Post Reply
Greyohm
Posts: 2
Joined: Tue Jan 04, 2022 3:23 pm

Switch type Ascom device

#1

Post by Greyohm »

Hello,

As it has been done in the very last version of Sharpcap for the rotator. In the future is it possible to connect a I/O device ​which use a switch-type ASCOM Driver and use it in the control area and in a sequence ?

I/O devices i have in mind:
https://www.amazon.de/-/en/KMtronic-Eth ... 137&sr=8-1

Maybe it is possible by using a script but i don't have the knowledge to do it.

Regards,
Guillaume
User avatar
admin
Site Admin
Posts: 13296
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Switch type Ascom device

#2

Post by admin »

Hi,

I think that the use of the switch device is fairly unusual, so it's unlikely that I will add it to SharpCap in the near future. However, that shouldn't stop you, since it's definitely possible to use the python scripting to talk to the ASCOM Switch object (and the python scripts can be run from the sequencer)

Code: Select all

clr.AddReference("ASCOM.DriverAccess")
from ASCOM.DriverAccess import Switch
x = Switch("ASCOM.Simulator.Switch")
x.Connected = True
print x.MaxSwitch
print x.GetSwitch(1)
x.SetSwitch(1, True)
# clean up
x.Connected = False
x = None
You could save the python above (with modifications to set the switches you want) as a .py file, then use the 'Run a python script' step in the sequencer to run it. If you need different actions at different points, just create multiple .py files, each one does a particular job (switching number 2 on, or number 3 off, or whatever)

Hope this helps,

Robin

PS. it may not be a good idea to set your user name to be your email address - it is publicly visible on the forums and could lead to you getting even more junk mail. If you want to change your user name, please let me know what to change it to (send me a private message).
Greyohm
Posts: 2
Joined: Tue Jan 04, 2022 3:23 pm

Re: Switch type Ascom device

#3

Post by Greyohm »

Hi,

Thanks for the piece of code you put here I think it will help me a lot.

And thanks for your software I like it.

Guillaume

PS: I sent you a mail to correct my mistake.
Post Reply