WAIT! Wait until the programmed event occurs |
Syntax
Binary code
Example1 // Unconditional wait for a motion complete event // Position profile. Position feedback: 500 lines incremental // encoder (2000 counts/rev) CSPD = 10;//slew speed = 300[rpm] CPOS = 4000;//position command = 2[rot] CPR;//position command is relative MODE PP; UPD;//execute immediate !MC; // set motion complete event WAIT!; //wait for the programmed event to occur // if the final position is not reached or the motion complete is // not set because the settle band and time conditions are not met // the TML program will remain at this point
Example2 //Conditional wait for a limit switch event // Speed profile. Position feedback: 500 lines incremental // encoder (2000 counts/rev) CACC = 0.1591;//acceleration rate = 500[rad/s^2] CSPD = 40; //jog speed = 1200[rpm] MODE SP; TUM1; //set Target Update Mode 1 UPD;//execute immediate ENLSP1; // activate LSP input to detect low->high transitions !LSP; // set event of LSP transition WAIT! 5000; //Wait until the event occurs but no more than 5[s] STOP; // stop motion |