!LSP                Set event when positive limit switch (LSP) goes low or high

Syntax                        

!LSP

! if LimitSwitchPositive active

Operands

PlaceTMLOnline

Binary code

DescriptionSets the event condition when the programmed transition occurs at the positive limit switch input. 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!
Wait for the programmed event to occur, with command WAIT!

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.

ExecutionActivates monitoring of the event when the programmed transition occurs at the positive limit switch input. This operation erases a previous programmed event that has occurred.

 

Example                

//Reverse when positive limit switch is reached

//Position feedback: 500 lines encoder (2000 counts/rev)

CACC = 0.0637;        //acceleration rate = 200[rad/s^2]

CSPD = 16.6667;        //jog speed = 500[rpm]

MODE SP;

UPD;                        //execute immediate

ENLSP1;//Enable positive limit switch for low->high transitions

!LSP;  //Set event on positive limit switch(low->high transition)

WAIT!;//Wait until the event occurs

!MC;        // limit switch is active -> quick stop mode active

WAIT!;// wait until the motor stops because only then the new

// motion commands are accepted

CSPD = -40;                //jog speed = -1200[rpm]

MODE SP;                //after quick stop set again the motion mode

UPD;                        //execute immediate