I have been trying to test my Sequencer scripts and I have a subroutine called GoToDSO in a scs file as follows:
SEQUENCE
DEF SUB GotoDSO
PRESERVE CAMERA SETTINGS
LIVE MODE
LOAD PROFILE "TestDSO (Test Camera 1 (Deep Sky))"
MOUNT GOTO RA=05:35:17,DEC=-05:23:28
DELAY 60
MOUNT SOLVEANDSYNC
DELAY 60
END PRESERVE
END SUB
END SEQUENCE
I set up a test call run as follows:
SEQUENCE
IMPORT SUBS FROM C:\Users\drobe\Documents\Sharpcap\GotoDSO.scs
GOSUB GoToDSO
END SEQUENCE
The Sequencer does not recognize the subroutine after I have loaded it into the run and I am not sure how the subroutine should be addressed.
Here is the sequencer run
12:13:58 PM Starting : Sequence
12:13:58 PM Starting : Import subroutines in C:\Users\drobe\Documents\Sharpcap\GotoDSO.scs
12:13:58 PM Starting : Define a subroutine called 'GotoDSO'
12:13:58 PM Completed : Define a subroutine called 'GotoDSO'
12:13:58 PM Completed : Import subroutines in C:\Users\drobe\Documents\Sharpcap\GotoDSO.scs
12:13:58 PM Starting : Call a previously defined subroutine called 'GoToDSO'
12:13:58 PM Error : 'A subroutine named GoToDSO has not been defined' while running step Call a previously defined subroutine called 'GoToDSO'
12:13:59 PM End : Sequence halted due to error.
12:13:59 PM Finished
How do you get the subroutine registered with the main program and how should I call it?
Thanks for your help
Subroutine setup and execution
- admin
- Site Admin
- Posts: 13610
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Subroutine setup and execution
Hi,
subroutine names are case sensitive, so the problem here is that you have named it 'GotoDSO' but are using 'GoToDSO' to call it. I had to run it under the debugger before I spotted it - perhaps I should remove the case sensitivity!
cheers,
Robin
subroutine names are case sensitive, so the problem here is that you have named it 'GotoDSO' but are using 'GoToDSO' to call it. I had to run it under the debugger before I spotted it - perhaps I should remove the case sensitivity!
cheers,
Robin
Re: Subroutine setup and execution
Thanks I should have caught that I was looking to make sure DSO was all caps and missed the problem
Should the subroutines show in the drop down box? Mine dont
Should the subroutines show in the drop down box? Mine dont
- admin
- Site Admin
- Posts: 13610
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Subroutine setup and execution
Hi,
today's update makes calling a subroutine case insensitive. It should also show the names of subroutines in imported sequences in the dropdown to avoid the mismatch issue in the first place.
cheers,
Robin
today's update makes calling a subroutine case insensitive. It should also show the names of subroutines in imported sequences in the dropdown to avoid the mismatch issue in the first place.
cheers,
Robin
Re: Subroutine setup and execution
Thanks Robin. I really like your approach to the scripting process it dramatically shortens development time as I no longer make massive numbers of syntax errors and the commands offered seem to cover everything that needs to be done. I'll be testing this as soon as we have clear skies(an oxymoron here in north Florida in the summer) and when I get it working properly will post the final script
Re: Subroutine setup and execution
Hopefully not wearing out my welcome here, but another question: I am trying to use the "import subroutines" call in the sequence editor but I can't figure out how to refer to the imported subroutine...it would seem like it should show up in the drop down for the "run subroutine previously defined" but the dropdown is empty. The previous thread on this subject seems to indicate that the dropdown issue was rectified??
I was able to insert the subroutine name and make it work by using a manual editor so the problem (if there is one and I am not missing something) would appear to be in populating the drop down (which seems like an interesting task...the sequence editor would have to parse the imported file before execution to populate the drop down...I guess??). Thanks, yet again.
I was able to insert the subroutine name and make it work by using a manual editor so the problem (if there is one and I am not missing something) would appear to be in populating the drop down (which seems like an interesting task...the sequence editor would have to parse the imported file before execution to populate the drop down...I guess??). Thanks, yet again.
Re: Subroutine setup and execution
Sorry, I forgot to mention I checked and I am running the latest release of Sharpcap.
- admin
- Site Admin
- Posts: 13610
- Joined: Sat Feb 11, 2017 3:52 pm
- Location: Vale of the White Horse, UK
- Contact:
Re: Subroutine setup and execution
Hi,
you can type into the box of the dropdown to enter subroutine names. Unfortunately the 'smart' part of the editor that populates the values to show in the dropdown isn't quite smart enough to do the imports yet. I will try to fix that when I get a chance.
cheers,
Robin
you can type into the box of the dropdown to enter subroutine names. Unfortunately the 'smart' part of the editor that populates the values to show in the dropdown isn't quite smart enough to do the imports yet. I will try to fix that when I get a chance.
cheers,
Robin
Re: Subroutine setup and execution
Robin,
Thanks for your response. No rush on my part on the "smart" dropdown. Just wanted to confirm I was not missing something obvious (which I have done several times in the last few weeks working in the script/sequencer).
Thanks for your response. No rush on my part on the "smart" dropdown. Just wanted to confirm I was not missing something obvious (which I have done several times in the last few weeks working in the script/sequencer).