WAIT!                Wait until the programmed event occurs

Syntax                        

WAIT!

WAIT motion event !

WAIT! value32

WAIT motion event ! but exit if time > value32

 

Operandsvalue32: 32-bit long immediate value – wait loop timeout limit

PlaceTML

Binary code

DescriptionStops the TML program execution, until the programmed event occurs. During this period, only the TML commands received via a communication channel are processed. You may also specify the timeout limit for the wait, by adding a time value after the WAIT! command: value32. If the monitored event doesn’t occur in the time limit set, the wait loop is interrupted; the event checking is reset and the TML program passes to the next TML instruction. The timeout is measured in internal time units i.e. slow loop sampling periods.  

 

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