Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jun 2013
    Location
    Pasadena, CA
    Posts
    295

    Default Digital Logger ASCOM in Startup Script

    Bob,

    I am using a DLI power supply for a system but it is not the usual one that people use. It is a DIN rail mounted switching unit. It has the same web user interface but the ASCOM DLI program doesn't seem to talk to it from the ACP startup Script. This may not have anything to do with ACP but I am not sure who to talk to about updating the driver or modifying the code.

    Paul

  2. #2

    Default

    Paul,

    I have one of the early versions of the DLI DIN switch. I have no problems commanding the switch using the early version of the ASCOM driver via ACP script.

    Tom

  3. #3
    Join Date
    Jun 2013
    Location
    Pasadena, CA
    Posts
    295

    Default

    This is the one I have. I am not sure why I can't control it.

    DIN-Relay-2.jpg
    This is the code at the start of the startup script

    var FSO; // FileSystemObject used in several functions
    var SWID = "ASCOM.DigitalLoggers.Switch"; // ID of power switch driver (e.g. DigitalLoggers)
    var SWT = null; // [sentinel] ASCOM Switch driver


    function main()
    {
    var i;


    FSO = new ActiveXObject("Scripting.FileSystemObject");


    Console.LogFile = Prefs.LocalUser.DefaultLogDir + "\\Scheduler\\StartupObs-" +
    Util.FormatVar(new Date().getVarDate(), "yyyymmdd") + "@" +
    Util.FormatVar(new Date().getVarDate(), "HhNnSs") + ".log";
    Console.Logging = true;


    // ================================================== ===
    // HERE IS WHERE YOU ADD CODE TO TURN POWER ON AS NEEDED
    // ================================================== ===


    // Sample for Digital Loggers Ethernet Power Controller using the
    // ASCOM.DigltalLoggers.Switch driver, available on the ASCOM Initiative
    // website at http://ascom-standards.org/Downloads/SwitchDrivers.htm
    // See the function definition in the Utility Functions section below
    // Set the SWID variable above for the ID of the specific switch driver.
    //
    TurnOnPower(1, "Black Box");
    TurnOnPower(2, "PWI Accessory Power");
    TurnOnPower(5, "L600 Mount");
    TurnOnPower(8, "FLI Camera and Filter Wheel");



    This is the code for a bit further down the script

    // Turn on a switch using the ASCOM switch driver
    // Errors are fatal to the script, right?
    //
    function TurnOnPower(switchNumber, switchName)
    {
    if (SWT === null) {
    SWT = new ActiveXObject(SWID);
    if (!SWT.Connected) SWT.Connected = true;
    }
    if(!SWT.GetSwitch(switchNumber)) {
    SWT.SetSwitch(switchNumber, true);
    Console.PrintLine("...powered on " + switchName);
    } else {
    Console.PrintLine("..." + switchName + " already powered up");
    }
    }

  4. #4

    Default

    Paul,

    I don't see anything inherently wrong in the code.

    So let's start from the beginning:

    Make sure you downloaded the newer ASCOM driver from the ASCOM website. There are two.
    Follow the instructions on the download page:

    Please note

    • You must update your switch to the latest firmware!
    • In the controller web page
      • Set External APIs -> Allow REST-Style API: Enabled
      • Setup -> Access Settings -> Allow legacy plaintext login methods: Enabled

    Make sure you have the correct ethernet address and password entered in the ASCOM setup dialog. You can use the ASCOM Profile Explorer to check.

    Those are the basics. Again, my switch is the older version and uses the older version ASCOM driver.

    Tom


  5. #5
    Join Date
    Jun 2013
    Location
    Pasadena, CA
    Posts
    295

    Default

    I found the issue. I didn't notice there was a "new" DLI driver and an "old" DLI driver. Once I installed the old driver ACP ran the script just fine.

  6. #6
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    5,098

    Default

    Hi Paul,

    Has this worked for you before, or is this a new device that you're setting up for the first time?

    The first thing I would check/review is whether there's an IP addressibility issue.
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    w. focal reducer to f/5.3 ~ FL 1630mm
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XME
    FOV ~ 15' x 10'
    H-alpha, BVRI, RGB & Clear filters
    MaxIm and, of course, ACP!
    AAVSO Code: BRIC

  7. #7
    Join Date
    Jun 2013
    Location
    Pasadena, CA
    Posts
    295

    Default

    I just had the wrong ASCOM driver. Didn't realize there was one for new devices and one for old devices.

  8. #8
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    28,500

    Default

    Oh good news. Yes they radically changed the internet interface in the new generation. We can think out ACP friend Manoj Koushik for doing this!!
    -- Bob

 

 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Digital Logger Power Switches
    By David Trappett in forum Pre-Sales Technical Questions and Help
    Replies: 3
    Last Post: Aug 4, 2016, 23:19

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •