WIN#n                Set and wait event when the slave’s digital input #n goes low or high

Syntax                        

WIN#n (Slave), 0

Wait for slave’s Input#n is 0

WIN#n (Slave), 1

Wait for slave’s Input#n is 1

 

OperandsSlave: slave axis monitored for event occurrence

n: input line number (0<=n<=39)

PlaceTMLOnline

Binary code

WIN_n

DescriptionSets the event condition and halts the execution of the TML program from motion controller until the slave’s digital input #n becomes 0, respectively 1. The slave checks the condition of the input #n is tested at each slow loop sampling period. After you have programmed an event, you can do the following actions:
Change the motion mode and/or the parameters when the event occurs, with command UPD!
Stop the motion when the event occurs, with command STOP.

The programmed event is automatically erased when the event occurs or if the timeout for the wait expires.

ExecutionActivates monitoring of the event on the slave axis, when the digital input #n becomes 0 (!IN#n 0), respectively 1 (!IN#n 1). The motion controller application remains in a loop until the event on the slave axis occurs or it timeouts. This operation erases a previous programmed event that has occurred.

 

Example                

// Start motion on slave A when digital input #36 from slave C is high

// Wait for event: When axis C digital input 36/IN36 is high

WIN#36 (C), 1;

(A) {

   //Position profile

   CACC = 0.3183;//acceleration rate = 1000[rad/s^2]

   CSPD = 40.;//slew speed = 1200[rpm]

   CPOS = 12000L;//position command = 6[rot]

   CPR; //position command is relative

   MODE PP;

   TUM1; //set Target Update Mode 1

   UPD; // execute immediate

}

WMC (A); // wait for motion completion