Checking to see if the roof is off

Anything that doesn't fit into any of the other forums
Post Reply
yomamma
Posts: 105
Joined: Wed Mar 01, 2023 4:58 pm

Checking to see if the roof is off

#1

Post by yomamma »

I have my scope at a remote site and I have a script that will read their web site and give a text file containing open or closed for the roof disposition.

If I have something like this:

REPEAT UNTIL 9:00 AM
LOOP 10000 TIMES
RUN THE SEQUENCE OF STEPS IN "xxxxxx"
WAIT 1 MINUTE
END LOOP
END REPEAT
End SEQUENCE

At first the the file xxxxx contains spaces so nothing happens.
I am running a script file every minute that will copy over an entire sequence run to replace the old empty xxxx with a full sequence run xxxx when I know the roof is open. This basically fires off my run when the roof opens. As long as I finish before 9 AM will this work or is there another way?

Thanks
User avatar
admin
Site Admin
Posts: 17363
Joined: Sat Feb 11, 2017 3:52 pm
Location: Vale of the White Horse, UK
Contact:

Re: Checking to see if the roof is off

#2

Post by admin »

Hi,

yes, that should work, since SharpCap will re-read the content of the file every time it reaches the 'RUN THE SEQUENCE OF STEPS IN...' step. You would probably need to take a bit of care with the copying as you could try to copy the new file in at the exact moment that SharpCap reads it and get a failure to copy, so a retry on the copying would be a good idea.

Another approach would be some python scripting - probably not too hard to write a few lines of python function that will keep checking the status of the roof and then return when the roof is open, and you can call that from the sequence.

cheers,

Robin
Post Reply