!CAP Set event when the selected capture input goes low or high |
Syntax
Binary code
The selection between master and load position is done as follows: load position is saved in CAPPOS2 only for the 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:
The programmed event is automatically erased when the event occurs or if the timeout for the WAIT! command expires. Remark: After setting UPD! or STOP! you need to wait until the programmed event occurs using WAIT!, otherwise, the program will continue with the next instructions that may override the event monitoring.
Example //Stop motion on next encoder index ENCAPI1; //Enable 1st capture input for low->high transitions !CAP; // Set event on 1st capture (low->high transition) STOP!;//Stop the motion when event occurs WAIT!;//Wait until the event occurs CPOS = CAPPOS; // new command position = captured position CPA; //position command is absolute MODE PP; TUM1; //set Target Update Mode 1 UPD; //execute immediate !MC; WAIT!; //wait for completion
|