Cannot find some TSX actions in dragscript

Good day,
I am looking to replace my homemade TheSkyX integration software with Voyager. I installed the trial version and I am building a drag script to replicate the scheduler in my homemade software, before I commit to buying Voyager. So far I really like the drag script concept and I have been able replicate most of my scheduler actions.

However, I cannot find how to do the following:

  1. Setting the focuser to a good starting position: Given the large differences in temperature where I live, the focuser position from the last session is usually not a good starting point the following day. Therefore I would like to reset the focuser to a better starting position before the first autofocus. Is there any way to do this in a drag script, besides an external script?

  2. Aborting TSX actions in an emergency exit block: Before sending a command to TSX to close the shutter, park the mount and park the dome, any action in progress in TSX should be aborted. For instance, if the dome is slewing when rain starts and an emergency exit event is raised, a close shutter command will fail as there is a dome slew in progress. Therefore, the drag script would have to wait until TSX actions in progress are completed before closing the shutter. Is there any way to abort TSX actions in progress in a drag script, besides an external script?

Thanks

Eric

Dear Eric,

if you use TSX action from Voyager this action are aborted from Voyager. Outside started actions cannot be aborted from Voyager. Voyager do not manage the focuser position of the TSX, just ask for autofocus.

If you want in DragScript you can create all the interactions with TSX that you need.

All the best
Leonardo

Good afternoon Leonardo,
I am not sure I understand “if you use TSX action from Voyager this action are aborted from Voyager”.

Assume all commands to TSX are sent from Voyager; no command is sent externally. Assume the dome is slaved to the mount and Voyager commands TSX to slew the telescope, then the dome will start slewing automatically. Assume the rain starts while the mount and dome are slewing and an emergency exit is raised. If the emergency block sends a command to TSX to close the shutter, TSX will fail as there is a slew in progress, unless an abort command is sent to TSX first. Are you saying that Voyager sends an abort command to TSX before every command it sends to TSX?

Eric

Voyager abort the actions that have started , equal the controls managed directly by voyager.

All the best
Leonardo

Great, thank you Leonardo. It looks like I will make the switch to Voyager!

Eric

Voyager have enable and disable of emergency events, so make dome shutter open an atomic action disabling events. Generally do not enable event if your observatory is safe with instruments not exposed to sky. Wait safe block for example disable events and wait safe conditions and restoring event status as before . Check the perpetual script example on this forum

Here is what I use:

Block: Pre-focus
        Remark: ----------------------------------------------------
        Remark: Set an approximate focuser position
        Remark: FocuserPosition = -182 * FocuserTemperature + 12678
        Decimal Number: FocuserPosition - Init Value = 0
        Update Decimal from Focuser Temperature: FocuserPosition
        Multiply Decimal Number: FocuserPosition - Multiply by Value -182
        Update Decimal Number: FocuserPosition - Offset by 12678
        RoboFire Focuser Move From Variable: Label=FocuserPosition - Abs

Hope this helps.
Vitali

Vitali,
Thank you for the example. At this time, I am planning to use TSX to focus unless I run into issues, so below is the vbscript I am planning to use to initialize the focuser position (slope and intercept are examples). I still need to verify that response.write is the correct way of returning a string to the dragscript.

Eric


'Variables must be declared before use.
Option Explicit

'This script handles run time errors.
On Error Resume Next

'Constants. Set the values for the current imaging train.
const focTempSlope = 100
const focTempIntercept = 20000
const tsxVersion = 64 'Options are 32 or 64

'Declare variables.
Dim tsxCamera
Dim focuserPosition

'Create instance of TSX camera (focuser control is in the camera class).
If tsxVersion = 64 then
Set tsxCamera= Wscript.CreateObject(“TheSky64.ccdsoftCamera”)
If Err.Number <> 0 Then Call handleError() 'Handle any error.
Else
Set tsxCamera= Wscript.CreateObject(“TheSkyX.ccdsoftCamera”)
If Err.Number <> 0 Then Call handleError() 'Handle any error.
End if

'Calculate the estimated focuser position for the current temperature.
focuserPosition = CInt(focTempIntercept + focTempSlope * tsxCamera.focTemperature)

'Command TSX to move the focuser position. There are two commands available (move in or move out).
If focuserPosition > tsxCamera.focPosition Then
tsxCamera.focMoveOut(focuserPosition - tsxCamera.focPosition)
If Err.Number <> 0 Then Call handleError() 'Handle any error.
Else
tsxCamera.focMoveIn(tsxCamera.focPosition - focuserPosition)
If Err.Number <> 0 Then Call handleError() 'Handle any error.
End If

'Return “OK”.
Response.Write(“OK”)
'WScript.Echo “OK” 'For testing.

'Procedure to handle errors. All errors are currrently handled the same way. An error code could be used to handle different errors differently.
Sub handleError()
'Return “ERROR”.
WScript.Echo “ERROR”
Err.Clear
WScript.Quit
End Sub

If you are not able to solve and if this is the only stop for get a license I will add an “Autofocus Focuser Move To” action in DragScript and “Autofocus Focuser Move From Variable”

All the best
Leonardo

Leonardo,
I tested calling the external script from a dragscript, using ASCOM simulators in TSX, and it sets the focuser position as expected. Note that I had to use WScript.Echo “OK” to return a value to the dragscript, not Response.Write(“OK”).

There is no need to add an action to the dragscript.

Eric