Hello friends. I’m wondering if there’s a way to trigger some code to run whenever my program is paused/stopped to “clean up”/ensure a safe pause, similar to how in other programming languages you would catch the “kill” SIG and flush any IO or close sockets to gracefully shut the program down and ensure you leave the system in the same state as it was before your program started running. In this case, I’d be resetting an output signal and maybe a couple other operations.
Is there some sort of event that is triggered that I could use?
Thank you!
It’s not possible to execute code or commands like that. You do have the option to set outputs high or low when the program is stopped, though.
That’s done in the Installation → I/O Setup and then selecting an output and picking an action.
you could make a section of code to do that clean up & shutdown at the end of your program, but only call it if a given input is on/off