#include pins.h #include func_ihc.h #include vars.h main() { timeout_plasma_ready=10000; timer=0; do_plasma_probe(); do_move_ignition_height(); portset(OUTPUT_PLASMA1); portset(OUTPUT_PLASMA2); timer=5000; //wait up to 5secs till plasma arc ready do{ timer--; a=portget(INPUT_ARC); if (a!=0) { timer=0; }; }while(timer>0); //pause //doublecheck arc sensor a=portget(INPUT_ARC); if (a==0) { message=PLCCMD_TRIGGER2_ON; texit=timer+10;do{timer++;}while(timer0); do_move_cutting_height(); //start_thc(); if (thc_enabled!=0) { //start THC control gvarset(7570,thc_avc_start); //THC #0 ON }; //set OK message and exit proc=plc_proc_plasma; message=PLCCMD_TRIGGER1_ON; timer=2;do{timer--;}while(timer>0); message=PLCCMD_TRIGGER2_ON; timer=2;do{timer--;}while(timer>0); //set OK message and exit message=PLC_MESSAGE_PLASMA_OK; exit(99); };