End of Sequence Equipment Disconnect and Script

Hello,

I have a sequence when the sequence ends I’ve checked the boxes for SGP to disconnect all equipment and to run an end of sequence script. The script runs, but SGP is not disconnecting the equipment. I’ve tried running the sequence without the script and SGP will disconnect the equipment. I don’t have the option to warm the camera up selected.
I understand the script runs before the equipment is disconnected. Does SGP wait until the script is completely executed before the equipment is disconnected? The last thing the script does is turn the PC off, so if SGP is waiting until the end of script it will never see it. Is that what is happening?

I’ve attached a link to the log file
Thanks for the help, Dan

https://1drv.ms/u/s!ArU9kBNg3bIlgp47ZtkKuMvW_oEbwg?e=wvjwuj

Yes, that’s exactly it. SGP will wait for that script to complete before moving on. your best bet to do this is to have your script launch another script in a different process and then return. That way it returns quickly to SGP and then have the spawned script basically wait for some amount of time for SGP to finish up and then shut down.

Jared

Thanks Jared for clarifying what is happening and for the suggestion. That is a clever idea!
Dan

Hi Jared,

I tried your suggestion, but I’m not sure I understand what to do. What I’ve tried is having SGP run a “bat” file that calls a python program. The python program is really the “script” doing all the work. I also tried having a “bat” file call another “bat” file which then calls the python program. In all cases SGP waits for the python program to complete, which as I noted shuts the PC down before SGP disconnects the equipment.
I’m relatively new to writing scripts/programs so I may not be understanding your suggestion.
thanks for any help.
Dan

One way to do this would be to use the start command in your initial batch script. start will execute another .bat or .exe but it does so in a non-blocking manner. What is likely happening is that whatever script you’re calling is blocking the other console from closing.

Jared

I tried the start command tonight and it worked! Thanks for taking the time to help me through this.
Dan