Thanks, Joe!
Actually, the EPO I referred to is a real button on my machine. The EPO button is connected to the PCI7344 board and to the DAQ board so that when the EPO button is pressed, all motors will be shut down. But your code should get me started.
The only thing left is that the "motor operation" is quite complicated and has a lot of user interaction. I'm not sure whether a while loop can do them all. But I won't know that until I start programming. 🙂 Thanks again.