Script control of Switches

Discussion in 'Scripting and Programming' started by Mart, Jun 24, 2015.

  1. Mart

    Mart Standard User

    Joined:
    May 3, 2015
    Messages:
    4
    I have upgraded to MaximDL v6 so that I can use the "Switch" controls that sit on the Webcam observatory tab. I'm using a home made power controller and have develop an ASCOM switch driver which successfully connects MaximDL to my power switches - I can turn lights and different power on and off from within MaximDL.

    I now want to control these switches from a Script - is this possible ?

    I've been searching for what objects are available to scripting and found a very brief reference to Application, CCDCamera, Document and Documents objects - where are the properties and methods for these objects defined ?

    Is there anything there for controlling the switches ?

    Many Thanks,

    Martin
     
  2. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    6,963
    You can control the ASCOM switch driver directly. All the ASCOM interfaces are described under:

    Start Menu / All Programs / ASCOM Platform 6 / Developer Documentation / ASCOM Developer Help, help book is called ASCOM Namespace.
     
  3. Mart

    Mart Standard User

    Joined:
    May 3, 2015
    Messages:
    4
    I've tried controlling the switch directly using MaximDL and VBScripts connecting to the ASCOM switch driver. Both methods work fine.

    The problem I'm trying to solve is the power switch uses an Arduino controller board which resets itself whenever you connect to it. So each time I first connect to the power switch it resets itself and turns all the switches off. That's fine at the start of the session but I'm trying to build imaging scripts that allow me to turn the observatory light on to take my flats (against the inside wall of the observatory). If I use a stand-alone VBScript to turn the light on - when it connects to the switch it turns all the power off to the scope, camera and accessories before then turning the light on !

    So what I'm looking for is a way to connect to the power switch at the start of my session and then just turn the light on and off as and when I need to.

    With MaximDL I can do that manually - but can't see how to do it from a script ? I'm trying to use CCD Commander to run the session but it doesn't support an ASCOM Switch yet.

    I've also looked for ASCOM Servers - I found and tried an Optec ASCOM Server but can't get two clients to connect to the power switch at the same time.

    Suggestions much appreciated (yes, I'm thinking of changing the power switch itself but I thought there must be a software solution to this problem ?)

    Many Thanks,

    Martin
     
  4. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    6,963
    Sounds like you need a hub. I don't think one exists for Switch. You may have to write one yourself...
     

Share This Page