I am running a CNC machine tending operation. Currently I am controlling the opening and closing of my machine vises with a digital output. When I open them, I turn a digital output on, wait for 6 seconds and then turn it off. This works fine, however my robot is sitting idle for those 6 seconds during the wait command.
While the vices are opening for the 6 seconds, I want to allow the robot to continue to move up to a certain point in the program and wait for the 6 seconds to finish passing to optimize my cycle times.
I want to do the same thing when closing my vices. After I place the part in the vise, I want to trigger the vises to close and the robot can continue to run up to a certain point before it must wait for the vises to finish closing before moving forward.
What is the best way to go about doing this? Is a thread the answer?
