!VU                Set event when a selected variable is equal or under a 32-bit value or the value of a fixed or long variable

Syntax                        

!VU VAR32A, value32

! if Var32AUnder value32

!VU VAR32A, VAR32B

! if Var32AUnder VAR32B

 

OperandsVAR32A: fixed or long variable

VAR32B: fixed or long variable

value32: 32-bit fixed or long immediate value

PlaceTMLOnline

Binary code

VU

DescriptionSets the event condition when the selected variable (any 32-bit fixed or long TML data) is equal or under the specified value or the value of another 32-bit 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 the selected variable <= value32, respectively VAR32. This operation erases a previous programmed event that has occurred.

 

Example        

//Wait until master position MREF < 500 counts, then activate

//electronic gearing slave mode

!VU MREF, 500; //Set event when variable MREF is <= 500

GEAR = 1; // gear ratio

GEARMASTER = 1; // Gear ratio denominator

GEARSLAVE = 1; // Gear ratio numerator

EXTREF 2; // read master from 2nd encoder or pulse & dir

MASTERRES = 2000; // master resolution

MODE GS; //Set as slave, position mode

TUM1; //Set Target Update Mode 1

SRB UPGRADE, 0xFFFF, 0x0004;//UPGRADE.2=1 enables CACC limitation

CACC = 0.3183; //Limit maximum acceleration at 1000[rad/s^2]

UPD!; //execute on event