You can monitor the run state of a program using the dashboard server. A sample implementation of this can be found here, I beleive the RTDE can also be used, you should be able to find samples of this with a little bit of searching on here too.
1 Like