EN2CAPI0        Enable 2nd capture/encoder index input to detect a high to low transition

Syntax                        

EN2CAPI0

Enable 2ndCAPture Index 1->0

Operands

PlaceTMLOnline

Binary code

EN2CAPI0

DescriptionEnables 2nd capture/encoder index input capability to detect a transition from 1(high) to 0(low). When the first transition occurs:
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 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.

 

Example        

//Stop motion on next 2nd encoder index

EN2CAPI0; //Set event: When the 2nd encoder index goes high->low

!CAP;

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