Syntax
W2CAP1 (Slave)
|
Wait for slave’s 2nd CAPture input transition 0 to 1
|
W2CAP0 (Slave)
|
Wait for slave’s 2nd CAPture input transition 1 to 0
|
Operands | Slave: slave axis monitored for event occurrence |
Binary code
Description | Sets the event condition and halts the execution of the TML program from motion controller until the transition occurs on the 2nd capture/encoder index inputs on the slave axis. When the programmed transition occurs the following happens on the slave axis: |
• | The input capability to detect transitions is disabled. It must be enabled again to detect another transition |
• | Motor position APOS_MT is captured and memorized in the TML variable CAPPOS, except the case of open-loop systems, where reference position TPOS is captured instead |
• | Master position APOS2 or load position APOS_LD is captured and memorized in the TML variable CAPPOS2, except the case of steppers controlled open loop with an encoder on the load, when load position is captured in CAPPOS. |
The selection between master and load position is done as follows: load position is saved in CAPPOS2 only for setup configurations which use different sensors for load and motor and foresee a transmission ratio between them. For all the other setup configurations, the master position is saved in CAPPOS2
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.
Execution | Activates the monitoring of the event, when the programmed transition (low to high or high to low) occurs on the selected capture input. This operation erases a previous programmed event that has occurred. |
Example
//Stop motion on all slaves on next 2nd encoder index
// Wait for event : When axis A 2nd encoder index / home input
//goes low->high
W2CAP1 (A);
STOP; // Stop the motion
(A) // Command slave A to move on captured position
CPOS = CAPPOS; // new command position = captured position
CPA; //position command is absolute
MODE PP;
TUM1; //set Target Update Mode 1
UPD; //execute immediate
}
WMC (A); //wait for completion
|