User`s guide

Location, Motion, and External Encoder Functions
V+ provides numerous functions for manipulating and converting location variables. See
Motion Control Operations for details on motion processing and a table that includes all
location-related functions. For details on the external encoders, see Reading Device Data on
page 354.
Examples of Location Functions
The instruction:
rotation = RZ(HERE)
places the value of the current rotation about the Z axis in the variable rotation.
The instruction:
dist = DISTANCE(HERE, DEST)
places the distance between the motion device's current location and its destination (the
value of the next motion instruction) in the variable dist.
The instructions:
IF INRANGE(loc_1) == 0 THEN
IF SPEED(2) > 50 THEN
SPEED 50
END
MOVE(loc_1)
END
ensures that loc_1 is reachable and moves the motion device to that location at a program
speed not exceeding 50.
Location, Motion, and External Encoder Functions
V+Language User's Guide, v17.0
Page 146