!AMPO        Set event when the motor absolute position is equal or over a 32-bit long value or the value of a long variable

Syntax                        

!AMPO value32

! if AbsoluteMotorPositionOver value32

!AMPO VAR32

! if AbsoluteMotorPositionOver VAR32

 

OperandsVAR32: long variable

value32: 32-bit long immediate value

PlaceTMLOnline

Binary code

DescriptionSets the event condition when the motor absolute position is equal or over the specified value or the value of the specified variable. 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 the monitoring of the event, when motor absolute position >= value32, respectively VAR32. This operation erases a previous programmed event that has occurred.

 

Example        

//Reverse when motor position >= 1rev

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

CACC = 0.1591;        //acceleration rate = 500[rad/s^2]

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

MODE SP;                // set trapezoidal speed profile mode

UPD;                        //execute immediate

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

!AMPO 2000; // Set event: when motor absolute position >= 1 rot

WAIT!;                //Wait until the event occurs

UPD;                        //Update. Speed command is reversed

 

Remark: You can activate a new motion on a programmed event in 2 ways:

Set UPD! command then wait the event with WAIT!. This will activate the new motion immediately when the event occurs
Wait the event with WAIT!, then update the motion with UPD. This will activate the new motion with a slight delay compared with the first option