Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jan 2013
    Location
    Bourne, MA
    Posts
    224

    Default Debugging a UserAction

    I would like to add a function to the UserActions.wsc. How do I debug?

    I've created a script:
    Code:
    function main()
    {
        var ua;
        ua = new ActiveXObject("ACP.UserActions");
        ua.SetGuiderFilter();
    }
    And try to run it from the ACP. But no go:
    Code:
    **Script Error**
    Source:   Microsoft JScript runtime error
    Message:  Syntax error
    Location: line 4 column 2.
    Script Context:
           1: function main()
           2: {
           3:     var ua;
    =>     4:     ua = new ActiveXObject("ACP.UserActions");
               ^
           5:     ua.SetGuiderFilter();
           6: }
    -- end --
    Not sure what it is complaining about. Suggestions?
    Thx,
    George

  2. #2
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,238

    Default

    On the road ... handled by phone.
    -- Bob

  3. #3
    Join Date
    Jan 2013
    Location
    Bourne, MA
    Posts
    224

    Default

    The tip to set component error="true" in the UserAction worked a treat. It allowed the syntax error in the UserAction to bubble to the surface so I could fix it.

    The the issue is getting a hold of the camera.

    I thought running the script from the ACP console would attach it to Util.ScriptCamera. Not so much. So I have:
    try {
    cam= Util.ScriptCamera;
    } catch(e) {
    cam= new ActiveXObject("MaxIm.CCDCamera");
    cam.LinkEnabled= true;
    }
    I assume that when this executes from within the Scheduler stack the first alternative will work. I'm running standalone so need to grab the camera directly.

    But now I'm getting an object error on cam.GuiderFilterNames
    Object error.
    Issue of dealing with an array??

    Thx for the help!
    George

  4. #4
    Join Date
    Jan 2013
    Location
    Bourne, MA
    Posts
    224

    Default

    Passing an array to the jscript is awkward/not possible. I tried cam.FilterNames and that doesn't work either. Getting the BSTR arrays into jscript is difficult by all reports.

    But the bigger problem is that the guider information is not available at all. cam.GuiderFilter, which should be a number reporting which slot is in place, is not coming through. cam.Filter, for the camera filter wheel comes through, but the guider, no.

    Is the interface to the Maxim.CCDCamera not complete or is Maxim not providing all the interface described in the help file. Or, more likely, I'm doing something wrong.

    George

  5. #5
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,238

    Default

    To get those names, cam.FilterNames.toArray() to convert from an ‘automation’ or cross-language array type to the internal Javascript array format. You will get an array of strings.

    Cam.Filter should definitely be returning the integer filter number of the current filter of Camera 1. cam.GuiderFilter should return the filter number on the guider.

    This one may need to go to Diffraction.
    -- Bob

  6. #6
    Join Date
    Jan 2013
    Location
    Bourne, MA
    Posts
    224

    Default

    Bob,
    This effort to add code to the UserAction is in an effort to work around problems using the Maxim Dual Wheels filter configuration using two, identical, ZWO filter wheels.

    If we configure one wheel on the camera (driverID= ASCOM.EFW2.FilterWheel) and the other on the guider (driverID= ASCOM.EFW2_2.FilterWheel) things function okay. The wheels follow instructions. But when the wheels are both selected in a Dual Wheel configuration then the wheel action is erratic; I'm still trying to nail down what is happening.

    In our phone conversation you mentioned that this setup was going to run into a limitation of the ASCOM protocol which was not designed to have multiple instances of the same device. Can you explain in more detail?

    The other possibility is that Maxim is picking up the same driverID for both of the 2 wheels in the Dual Wheel configuration; it's not clear from the setup information which driver's it is picking up. (that is, when selecting the 2 wheels it is not offering the Chooser).

    Thanks,
    George

  7. #7
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,238

    Default

    If you can use separate (but identical) driver instances, with only their DriverIDs different (EFW vs EFW_2) and they are DLL (in process type) drivers, then it's no problem architecturally. I assume that each filter wheel is running off a separate COM/USB port? If so it should be fine. But Diffraction will need to give you the definitive answer on this.
    -- Bob

 

 

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How to Begin Debugging
    By Ronald Crouch in forum Hardware/Software/Driver Topics Not Directly Related to Our Software
    Replies: 8
    Last Post: Oct 24, 2019, 17:47
  2. Script debugging
    By Howard C. Anderson in forum Add-Ons, Enhancements, and Helper Components
    Replies: 3
    Last Post: Feb 26, 2012, 02:13

Posting Permissions

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