I am currently a bit stuck. I ask a question in the program and use the function keys to turn a spindle on or off. Currently the only way to leave the question is to turn the spindle on and wait ten seconds for the spindle to ramp up to the correct speed. If you turn the spindle off the question loops as it is meant to. I would like an option in which if you push a button (Cycle_Start) thus temporary turning on a digital input that you could skip out of the question without having to press spindle on and wait ten seconds. This would be done because the program is looping and so after the first cycle the spindle should already be on and you shouldnt need to turn it on again and wait ten seconds.
I thought I could use \DIBreak at the end of the question but this stops the program. Below shows how I tried this. Does anyone know how this should be done?
LOOP_2:
TPErase;
TPWrite "Spindle must be ON";
TPWrite "before starting cycle.";
TPWrite "Press green button to start";
TPReadFK n_select,"","SPIN ON","","","","SPIN OFF"\DIBreak:=CycleStart;
TEST n_select
CASE 1:
Set Start_Spindle;
WaitTime 10;
TPErase;
TPWrite "If the spindle is ON";
TPWrite "press the green button to start.";
WaitDI CycleStart,1;
CASE 5:
Reset Start_Spindle;
GOTO LOOP_2;
ENDTEST