Motion Functions

The Automation1 controller supplies move types and motion-related operations that can be combined to make a full part program.

Enable and Disable

You must enable an axis or axes for motion to occur. When you enable an axis, you enable the amplifier power stage, and torque is applied to the motor.

You can disable an enabled axis. When you do this, you disable the amplifier power stage and stop torque from being applied to the motor.

A disabled axis can continue to move until you apply the brake. See the BrakeSetup Parameter topic for information on how to configure the brake.

Use the functions that follow to enable or disable one or more axes.

function Enable($axis as axis)

Enables the axis so that you can command motion.

Arguments

$axis  The axis to enable.

function Enable($axes[] as axis)

Enables the axes so that you can command motion.

Arguments

$axes  The axes to enable.

function Disable($axis as axis)

Disables the axis so that you cannot command motion.

Arguments

$axis  The axis to disable.

function Disable($axes[] as axis)

Disables the axes so that you cannot command motion.

Arguments

$axes  The axes to disable.

Example: Determine if an axis is enabled

// Determine if the Enabled bit of the DriveStatus item is set on axis X.
var $isEnabled
$isEnabled = (StatusGetAxisItem(X, AxisStatusItem.DriveStatus, DriveStatus.Enabled) == DriveStatus.Enabled)

Homing

When you home an axis, that axis goes to its known hardware reference position. An axis is usually homed at the start of a program so that the axis is at a known location. When homing is complete, the position command value is set to the value of the HomePositionSet Parameter, which defaults to zero. The controller also disables program position offsets, work offsets, and offsets from interrupt motion mode.

Use the HomeType Parameter and the HomeSetup Parameter to configure homing options.

When you home an axis with the Home() function, the process is done synchronously, which means that a task continues only after homing is complete. You can also home an axis asynchronously, which means that a task immediately continues and does not wait for homing to complete.

Use the functions that follow to home one or more axes.

function Home($axis as axis)

Performs a home cycle by moving the axis to a known hardware reference location. The task waits for completion of the home cycle.

Arguments

$axis  The axis to home.

function Home($axes[] as axis)

Performs a home cycle by moving the axes to a known hardware reference location. The task waits for completion of the home cycle.

Arguments

$axes  The axes to home.

function HomeAsync($axis as axis)

Performs a home cycle by moving the axis to a known hardware reference location. The controller performs the home cycle asynchronously so that the task moves on without waiting for completion.

Arguments

$axis  The axis to home.

function HomeAsync($axes[] as axis)

Performs a home cycle by moving the axes to a known hardware reference location. The controller performs the home cycle asynchronously so that the task moves on without waiting for completion.

Arguments

$axes  The axes to home.

Example: Determine if an axis is homed

// Determine if the Homed bit of the AxisStatus item is set on axis X.
var $isHomed
$isHomed = (StatusGetAxisItem(X, AxisStatusItem.AxisStatus, AxisStatus.Homed) == AxisStatus.Homed)

Basic Motion

Use the functions that follow to specify basic moves.

function MoveAbsolute($axis as axis, $position as real, $speed as real)

Executes an asynchronous point-to-point move to an absolute target-position on an axis.

Arguments

$axis  The axis on which to perform point-to-point motion.

$position  The absolute target-position of the move.

$speed  The speed at which to move the specified axis.

function MoveAbsolute($axes[] as axis, $positions[] as real, $speeds[] as real)

Executes an asynchronous point-to-point move to an absolute target-position on the specified axes.

Arguments

$axes  The axes on which to perform point-to-point motion.

$positions  The absolute target-positions of the move.

$speeds  The speeds at which to move the specified axes.

function MoveIncremental($axis as axis, $distance as real, $speed as real)

Executes an asynchronous point-to-point move by an incremental distance on an axis.

Arguments

$axis  The axis on which to perform point-to-point motion.

$distance  The distance and direction to move the specified axis relative to the current position. A distance of zero results in no motion.

$speed  The speed at which to move the specified axis.

function MoveIncremental($axes[] as axis, $distances[] as real, $speeds[] as real)

Executes an asynchronous point-to-point move by an incremental distance on the specified axes.

Arguments

$axes  The axes on which to perform point-to-point motion.

$distances  The distances and directions to move the specified axes relative to the current positions. A distance of zero results in no motion.

$speeds  The speeds at which to move the specified axes.

Non-coordinated Moves

Non-coordinated moves start on one or more axes, but each axis moves independently and can reach its endpoint at different times. The executing task does not wait for a basic move to finish before it continues to the next line in the program. If you want a task to wait until a motion is complete, issue the WaitForMotionDone or WaitForInPosition functions on that axis.

The endpoint of a basic move can be specified as an incremental distance from the starting point or as an absolute position.

Freerunning

Freerunning is when an axis or axes moves indefinitely at a specified velocity. As with other basic moves, the executing task continues immediately to the next line of the program and does not wait for the move to finish.

The arithmetic sign (positive or negative) of the provided velocity determines the direction of motion. If you specify zero velocity, the axis will not move, but the axis is still considered in motion.

You can issue a new freerun on an axis that is already freerunning. This causes the velocity of the axis to ramp up or down to the newly-specified velocity.

Use the functions that follow to start or stop a freerun.

function MoveFreerun($axis as axis, $velocity as real)

Executes an asynchronous freerun move on an axis. The axis will move indefinitely at the specified velocity.

Arguments

$axis  The axis on which to perform freerun motion.

$velocity  The velocity at which to move the specified axis. The sign of the velocity specifies the direction of motion.

function MoveFreerun($axes[] as axis, $velocities[] as real)

Executes an asynchronous freerun move on the specified axes. The axes will move indefinitely at the specified velocity.

Arguments

$axes  The axes on which to perform freerun motion.

$velocities  The velocities at which to move the specified axes. The signs of the velocities specify the directions of motion.

function MoveFreerunStop($axis as axis)

Stops an asynchronous freerun move on an axis. The axis velocity decelerates to zero.

Arguments

$axis  The axis on which to stop freerun motion.

function MoveFreerunStop($axes[] as axis)

Stops an asynchronous freerun move on the specified axes. The axis velocities decelerate to zero.

Arguments

$axes  The axes on which to stop freerun motion.

Coordinated Motion

A coordinated move follows a defined path in vector space. During a coordinated move, axes that are part of the move get to the endpoint at the same time, and the controller uses the coordinated speed as the maximum vector speed. Individual axis velocities are adjusted to achieve the vector speed and to get to the target at the same time. See the Motion Setup Functions topic for more information on how to configure axis speeds, coordinated speeds, and ramp rates.

During coordinated motion, the controller continues program execution after the coordinated move is finished, unless lookahead is active. See Velocity Blending Functions for more information.

Linear Moves

A linear move makes a straight line in vector space for one or more axes. If multiple axes are specified, the order of the specified distances should match the order of the specified axes.

The distances specified to a linear move obey the task’s target mode. If incremental mode is active, motion occurs relative to the staring point of the move. If absolute mode is active, motion occurs relative to the origin position. See the Motion Setup Functions topic for more information on configuring the task target mode.

Use the functions that follow to execute linear moves.

function MoveLinear($axis as axis, $distance as real)

Executes a coordinated linear move on the specified axis. A linear move creates a line in vector space on one or more axes.

Arguments

$axis  The axis on which to perform linear motion.

$distance  The end point of the linear move.

function MoveLinear($axes[] as axis, $distances[] as real)

Executes a coordinated linear move on the specified axes. A linear move creates a line in vector space on one or more axes.

Arguments

$axes  The axes on which to perform linear motion.

$distances  The end points of the linear move.

function MoveLinear($axis as axis, $distance as real, $coordinatedSpeed as real)

Executes a coordinated linear move on the specified axis. A linear move creates a line in vector space on one or more axes.

Arguments

$axis  The axis on which to perform linear motion.

$distance  The end point of the linear move.

$coordinatedSpeed  The speed of the coordinated linear motion.

function MoveLinear($axes[] as axis, $distances[] as real, $coordinatedSpeed as real)

Executes a coordinated linear move on the specified axes. A linear move creates a line in vector space on one or more axes.

Arguments

$axes  The axes on which to perform linear motion.

$distances  The end points of the linear move.

$coordinatedSpeed  The speed of the coordinated linear motion.

Arc Moves

An arc move uses two axes to make an arc in vector space. Arc moves can be clockwise or counterclockwise. The controller uses the coordinated speed as the maximum vector speed around the arc. See Motion Setup Functions for information on setting the coordinated speed.

An arc can be specified in many ways using combinations of radius, center point, and endpoint distances.

Make an Arc by its Center Point

To make an arc by its center point, specify the incremental offsets from the starting point of the arc to its center point, and specify the end point of the arc. This makes an arc with a radius that is the vector distance from the starting point to the specified center point.

To make a full circle, the endpoints of the arc should be the same as the starting points.

The distances specified for the endpoint obey the target mode of the task. If incremental mode is active, the distances are relative to the starting point of the move. If absolute mode is active, the distances are relative to the origin. See the Motion Setup Functions topic for more information on configuring the task target mode.

Use the functions that follow to make an arc by its center point.

function MoveCcw($axes[] as axis, $distances[] as real, $center[] as real)

Executes a coordinated counterclockwise circular arc move on the specified axes. An arc move creates an arc in vector space using two axes.

Arguments

$axes  The axes on which to perform counterclockwise circular motion.

$distances  The end points of the circular arc.

$center  The relative offsets of the center point from the starting positions of the axes.

function MoveCcw($axes[] as axis, $distances[] as real, $center[] as real, $coordinatedSpeed as real)

Executes a coordinated counterclockwise circular arc move on the specified axes. An arc move creates an arc in vector space using two axes.

Arguments

$axes  The axes on which to perform counterclockwise circular motion.

$distances  The end points of the circular arc.

$center  The relative offsets of the center point from the starting positions of the axes.

$coordinatedSpeed  The speed of the coordinated circular motion.

function MoveCw($axes[] as axis, $distances[] as real, $center[] as real)

Executes a coordinated clockwise circular arc move on the specified axes. An arc move creates an arc in vector space using two axes.

Arguments

$axes  The axes on which to perform clockwise circular motion.

$distances  The end points of the circular arc.

$center  The relative offsets of the center point from the starting positions of the axes.

function MoveCw($axes[] as axis, $distances[] as real, $center[] as real, $coordinatedSpeed as real)

Executes a coordinated clockwise circular arc move on the specified axes. An arc move creates an arc in vector space using two axes.

Arguments

$axes  The axes on which to perform clockwise circular motion.

$distances  The end points of the circular arc.

$center  The relative offsets of the center point from the starting positions of the axes.

$coordinatedSpeed  The speed of the coordinated circular motion.

Make an Arc by Radius

To make an arc using radius, specify the radius of the arc and the end point of the arc. The controller uses the specified radius and endpoint to calculate the center of the arc.

The arithmetic sign of the radius determines whether the arc is greater than or less than 180 degrees. If you specify a positive radius, the arc is always less than 180 degrees. If you specify a negative radius, the arc is always greater than 180 degrees.

Do not use the radius method to specify arcs that are near 180 degrees. This can cause errors while calculating the center point.

You cannot use the radius method to specify a full circle.

The distances specified for the endpoint obey the target mode of the task. If incremental mode is active, the distances are relative to the starting point of the move. If absolute mode is active, the distances are relative to the origin. See the Motion Setup Functions topic for more information on configuring the task target mode.

Use the functions that follow to make an arc by specifying the radius.

function MoveCcw($axes[] as axis, $distances[] as real, $radius as real)

Executes a coordinated counterclockwise circular arc move on the specified axes. An arc move creates an arc in vector space using two axes.

Arguments

$axes  The axes on which to perform counterclockwise circular motion.

$distances  The end points of the circular arc.

$radius  The radius of the circular arc.

function MoveCcw($axes[] as axis, $distances[] as real, $radius as real, $coordinatedSpeed as real)

Executes a coordinated counterclockwise circular arc move on the specified axes. An arc move creates an arc in vector space using two axes.

Arguments

$axes  The axes on which to perform counterclockwise circular motion.

$distances  The end points of the circular arc.

$radius  The radius of the circular arc.

$coordinatedSpeed  The speed of the coordinated circular motion.

function MoveCw($axes[] as axis, $distances[] as real, $radius as real)

Executes a coordinated clockwise circular arc move on the specified axes. An arc move creates an arc in vector space using two axes.

Arguments

$axes  The axes on which to perform clockwise circular motion.

$distances  The end points of the circular arc.

$radius  The radius of the circular arc.

function MoveCw($axes[] as axis, $distances[] as real, $radius as real, $coordinatedSpeed as real)

Executes a coordinated clockwise circular arc move on the specified axes. An arc move creates an arc in vector space using two axes.

Arguments

$axes  The axes on which to perform clockwise circular motion.

$distances  The end points of the circular arc.

$radius  The radius of the circular arc.

$coordinatedSpeed  The speed of the coordinated circular motion.

Rapid Motion

Use rapid moves to specify point-to-point motion on one or more axes when it is not necessary to coordinate motion on multiple axes. When you use rapid motion, axes move at their individual speeds and get to their endpoints at different times. During rapid motion, the program does not continue until all axes of the rapid move are at their endpoints. Use MoveRapid() to move axes to an initial position before issuing MoveLinear(), MoveCw(), or MoveCcw() coordinated moves.

The DefaultAxisSpeed parameter or the SetupAxisSpeed() function specifies the speed of each axis. See the Motion Setup Functions topic for information on how to configure axis speeds and ramp rates.

Use the functions that follow to execute a rapid move on one or more axes.

function MoveRapid($axis as axis, $distance as real)

Executes a point-to-point rapid move on an axis.

Arguments

$axis  The axis on which to perform the point-to-point rapid motion.

$distance  The end point of the rapid move.

function MoveRapid($axes[] as axis, $distances[] as real)

Executes a point-to-point rapid move on the specified axes.

Arguments

$axes  The axes on which to perform the point-to-point rapid motion.

$distances  The end points of the rapid move.

function MoveRapid($axis as axis, $distance as real, $speed as real)

Executes a point-to-point rapid move on an axis.

Arguments

$axis  The axis on which to perform the point-to-point rapid motion.

$distance  The end point of the rapid move.

$speed  The speed at which to move the axis.

function MoveRapid($axes[] as axis, $distances[] as real, $speeds[] as real)

Executes a point-to-point rapid move on the specified axes.

Arguments

$axes  The axes on which to perform point-to-point rapid motion.

$distances  The end points of the rapid move.

$speeds  The speeds at which to move each of the axes.

PVT and PT

Use the MovePvt() and MovePt()  functions to make arbitrary velocity and acceleration profiles. To do this, specify points in the profile by their position, velocity, and time interval (PVT) or by their position and time interval (PT). The MovePvt() and MovePt() functions can make motion for up to 32 axes on a PC-based controller or 12 axes on a drive-based controller.

P is the desired position for the specified axis at the end of the time segment and is in user units. The specified position obeys the target mode of the task. If incremental mode is active, the positions are relative to the starting point of the move. If absolute mode is active, the positions are relative to the origin. Refer to the Motion Setup Functions topic for more information on how to configure the task target mode.

V is the desired velocity for the specified axis at the end of the time segment and is in user units. If the velocity is an approximation and is not the true, mathematically computed velocity, the interpreted velocities will not be continuous between points.

T is the time interval of the duration of the specified move in milliseconds. You can specify a move duration that is more than a millisecond. If more than one point per millisecond is necessary, use one of the time intervals that follow: 

  • Drive-based controller: Time intervals of 1/10 or 1/20 of a millisecond.

  • PC-based controller: Time intervals of 1/10, 1/20, 1/50, or 1/100 of a millisecond.

Use the function that follows to specify individual points using position, velocity, and time interval.

function MovePvt($axes[] as axis, $positions[] as real, $velocities[] as real, $time as real)

Specifies a single point in an arbitrary motion profile. The point contains the position and velocity of one or more axes and a time interval. You must call this function for each point in the motion profile.

Arguments

$axes  The axes of the motion profile point.

$positions  The positions of each axis at the end of the time interval.

$velocities  The velocities, in user units per time base, at which each axis will be moving at the end of the time interval.

$time  The total time interval of the motion profile point in milliseconds.

If the true, mathematically computed velocity is not available, you can specify individual points with only position and time interval. To do this, you must change the controller’s interpolation mode to 3-position / 1-velocity with the MotionInterpolationMode Parameter.

Use the function that follows to specify individual points with position and time interval.

function MovePt($axes[] as axis, $positions[] as real, $time as real)

Specifies a single point in an arbitrary motion profile. The point contains the position of one or more axes and a time interval. You must call this function for each point in the motion profile.

Arguments

$axes  The axes of the motion profile point.

$positions  The positions of each axis at the end of the time interval.

$time  The total time interval of the motion profile point in milliseconds.

Abort

Use the abort functions to safely stop motion on one or more axes. When you abort motion on an axis, the velocity of the axis is ramped down to zero. To control the abort deceleration rate used by the controller, refer to the AbortDecelRate Parameter.

If one or more of the specified axes are part of a coordinated move when you issue an abort function, the coordinated move and all of its axes will decelerate to zero, and the task executing motion will have an error.

If you issue an abort function on a follower axis that has a camming or gearing configuration, only the follower axis will abort, and the camming or gearing relationship will stop.

Use the functions that follow to abort one or more axes.

function Abort($axis as axis)

Aborts motion on the specified axis. The controller stops all motion and ramps the axis to zero speed.

Arguments

$axis  The axis to abort.

function Abort($axes[] as axis)

Aborts motion on the specified axes. The controller stops all motion and ramps the axes to zero speed.

Arguments

$axes  The axes to abort.

Dwell

Use the Dwell() function to delay program and motion execution for a quantity of time specified in seconds. For coordinated moves, the Dwell() function delays for the specified number of seconds between the end of the preceding move and the start of the next move. For the MoveFreerun(), MoveIncremental(), and MoveAbsolute() functions, the Dwell() function delays for the specified number of seconds between the start of the preceding move and the start of the next move.

You can also use Dwell() during normal program execution to delay operations that are not moves.

The dwell time is specified in seconds and has a resolution of 0.001 seconds or 1 millisecond. The specified dwell time must be greater than or equal to zero.

Use the function that follows to delay program of motion execution.

function Dwell($dwellTime as real)

Suspends the execution of the task for a specified quantity of time.

Arguments

$dwellTime  The quantity of time to suspend the task, in seconds.

Motion Waiting

Use motion waiting functions to program the controller to wait until a move is complete before it continues to execute the program. The controller determines if a move is complete with one of the two methods that follow.

  • The function WaitForMotionDone($axis as axis) and function WaitForMotionDone($axes[] as axis) wait for the commanded velocity to get to zero.
  • The function WaitForInPosition($axis as axis) and function WaitForInPosition($axes[] as axis) wait for the commanded velocity to get to zero and for the preceding move to get to its specified position. The controller uses a position threshold specified by the InPositionDistance Parameter. The position must be within the given threshold for the amount of time specified by the InPositionTime Parameter before the "in position” condition is true.

Use the functions that follow to wait for motion to be done.

function WaitForMotionDone($axis as axis)

Waits for motion to be done on the specified axis. The motion is done when the commanded velocity is at zero.

Arguments

$axis  The axis on which to wait for motion to be done.

function WaitForMotionDone($axes[] as axis)

Waits for motion to be done on the specified axes. The motion is done when the commanded velocity is at zero.

Arguments

$axes  The axes on which to wait for motion to be done.

function WaitForInPosition($axis as axis)

Waits for motion to be done on the specified axis and for the axis to be in position. The motion is done when the commanded velocity is at zero. The axis is in position when the position error is at the threshold specified by the InPositionTime and InPositionDistance parameters.

Arguments

$axis  The axis on which to wait for motion to be done and in position.

function WaitForInPosition($axes[] as axis)

Waits for motion to be done on the specified axes and for the axes to be in position. The motion is done when the commanded velocity is at zero. The axes are in position when the position error is at the threshold specified by the InPositionTime and InPositionDistance parameters.

Arguments

$axes  The axes on which to wait for motion to be done and in position.

If you want to determine the status of motion completion and in position without waiting, see the example that follows.

Example

var $isMotionDone
var $isInPosition
var $isMotionDoneAndInPosition

// Manually check the WaitForMotionDone() condition on axis X:
// - Check for the commanded velocity to get to zero.
$isMotionDone = (StatusGetAxisItem(X, AxisStatusItem.AxisStatus, AxisStatus.MotionDone) == AxisStatus.MotionDone)

// Manually check the WaitForInPosition() condition on axis X:
// - Check for the commanded velocity to get to zero.
// - Also check for the preceding move to get to its specified position by checking for in position.
$isInPosition = (StatusGetAxisItem(X, AxisStatusItem.DriveStatus, DriveStatus.InPosition) == DriveStatus.InPosition)
$isMotionDoneAndInPosition = $isMotionDone && $isInPosition

Position Offsets

Use the position offset functions to set the current program position to specified values. When you use position offset functions, an offset is applied to the position of the axis to define a new coordinate system. Motion does not occur. You can clear the position offset manually with the PositionOffsetClear() functions or you can home the axis.

Use the functions that follow to set the current program position.

function PositionOffsetSet($axis as axis, $programPosition as real)

Sets the program position of the specified axis to the specified value. The controller applies an offset to the current axis position so that the axis does not move. All moves that specify an absolute target-position will be relative to the new program position.

Arguments

$axis  The axis on which to set the program position.

$programPosition  The new program position to set.

function PositionOffsetSet($axes[] as axis, $programPositions[] as real)

Sets the program positions of the specified axes to the specified values. The controller applies an offset to the current axis positions so that the axes do not move. All moves that specify an absolute target-position will be relative to the new program position.

Arguments

$axes  The axes on which to set the program positions.

$programPositions  The new program positions to set.

You can use program position to set a reference point for a series of moves when the target mode of the task is absolute. To do this, provide a program position of zero to the PositionOffsetSet() function. This sets the program position offset to the current axis position, and axes specified with PositionOffsetSet() have a new program position of zero.

When you set the program position to a non-zero value, the offset applied is the difference between the new program position and the original position. This can help determine and set a software home position. For example, if an axis has a current position of 2 and PositionOffsetSet() has a new program position of -1, the applied offset is -3. The new software home where the program position reports as zero is actually at axis position 3.

Clear the position offsets with the functions that follow.

function PositionOffsetClear($axis as axis)

Clears the program position offset on the specified axis. The program position will be restored to the current axis position.

Arguments

$axis  The axis on which to clear the program position offset.

function PositionOffsetClear($axes[] as axis)

Clears the program position offsets on the specified axes. The program positions will be restored to the current axis positions.

Arguments

$axes  The axes on which to clear the program position offsets.

The position offsets are also cleared when a Home() or HomeAsync() function completes.

Example: Position Offsets in a motion program

// Set the motion target mode to absolute
SetupTaskTargetMode(TargetMode.Absolute)

Enable([X, Y])
Home([X, Y])

// Move the X and Y axes to (3, 3).
// - ProgramPositionCommand = (3, 3)
// - PositionCommand = (3, 3)
MoveLinear([X, Y], [3, 3])

// Set the program position of X and Y to (-1, -3) by setting position offsets.
// No motion occurs.
// - ProgramPositionCommand = (-1, -3)
// - PositionCommand = (3, 3)
PositionOffsetSet([X, Y], [-1, -3])

// Move the X and Y axes to the program position of (0, 0).
// - ProgramPositionCommand = (0, 0)
// - PositionCommand = (4, 6)
MoveLinear([X, Y], [0, 0])

// Clear the position offsets on X and Y. No motion occurs.
// - ProgramPositionCommand = (4, 6)
// - PositionCommand = (4, 6)
PositionOffsetClear([X, Y])

The PositionOffset axis signal tracks the program coordinate system offsets that are in effect when you use the PositionOffsetSet() function. The ProgramPosition, ProgramPositionCommand, and ProgramPositionFeedback axis signals track the program position of an axis. For more information on each position signal, refer to Controller Motion Signals. For examples on how to read a position signal of an axis in your AeroScript program, refer to Controller Status Functions.

Work Offsets

Use work offsets to program move targets that are relative to a fixed point in space when you do not know the absolute coordinates of those move targets. Move targets that you specify in the absolute target mode are relative to this fixed point in space, not to the zero location established by homing. Work offsets have no effect on move targets that you specify in the incremental target mode. You can use the SetupTaskTargetMode() function to change the target mode of the task.

The controller supports 100 work offsets. Work offsets are numbered 1-100.

You can use the WorkOffsetConfigureOffset() function to configure the axis program positions that define the origin of the coordinate system for the specified work offset. All work offsets can be reset with the WorkOffsetConfigureOffset() function. Work offsets do not need to be reset to be configured again.

function WorkOffsetConfigureOffset($offsetNumber as integer, $axes[] as axis, $programPositions[] as real)

Configures the specified work offset on the specified axes and values. Previously configured axes will retain their values unless overwritten.

Arguments

$offsetNumber  The index of the work offset to configure. An integer between and including 1 and 100.

$axes  The axes on which to configure work offset values.

$programPositions  The program positions to set as the work offset origin.

function WorkOffsetResetConfiguration()

Erases the work offset configurations on all axes. All work offsets must first be disabled.

Use the WorkOffsetEnable() functions to enable the specified work offset. When you enable a work offset, the coordinate systems changes so that absolute axis position coordinates are measured from the origin of the work offset coordinate system. Motion does not occur.

In the function that follows, the controller applies the configured offsets to the current axis positions so that the axes do not move. All absolute moves will be relative to the values configured by the work offset. The specified offset must have at least one offset configured.

function WorkOffsetEnable($offsetNumber as integer)

Activates the specified work offset and applies offsets to all configured axes.

Arguments

$offsetNumber  The index of the work offset to enable. An integer between and including 1 and 100.

In the function that follows, the specified axes must be configured for this offset. The controller applies the configured offsets to the current axis positions so that the axes do not move. All absolute moves will be relative to the values configured by the work offset.

function WorkOffsetEnable($offsetNumber as integer, $axes[] as axis)

Activates the specified work offset and applies offsets to the specified axes.

Arguments

$offsetNumber  The index of the work offset to enable. An integer between and including 1 and 100.

$axes  The axes on which to enable the specified work offset.

Use the WorkOffsetDisable() functions to disable work offsets on the specified axes. Motion does not occur. Work offsets can also be disabled on an axis by homing the axis.

In the function that follows, axis positions will be restored to the current axis position. All axes with work offsets enabled must not be in motion for this function to execute correctly.

function WorkOffsetDisable()

Deactivates all active work offsets.

In the function that follows, the position of the axes will no longer include work offsets. Specified axes must not be in motion for the function to execute correctly.

function WorkOffsetDisable($axes[] as axis)

Deactivates work offsets for all axes on the controller.

Arguments

$axes  The axes on which to disable work offsets.

To get the one-based index of the work offset that is currently being applied to an axis, you must get the WorkOffsetIndex item. To get the work offset value that is currently being applied to an axis, you must get the WorkOffsetValue item. See the example that follows.

// Set the motion target mode to absolute
SetupTaskTargetMode(TargetMode.Absolute)

Enable([X, Y, Z])
Home([X, Y, Z])

// Configure work offset 1.
WorkOffsetConfigureOffset(1, [X, Y, Z], [10, 10, 10])

// Enable work offset 1 on axes X and Y.
WorkOffsetEnable(1, [X, Y])

// This will return 1, which is the enabled offset.
var $workOffsetIndex
$workOffsetIndex = StatusGetAxisItem(X, AxisStatusItem.WorkOffsetIndex)

// This will return -10, which is the configured value negated.
var $workOffsetValue
$workOffsetValue = StatusGetAxisItem(X, AxisStatusItem.WorkOffsetValue)

// Axes X and Y will move to (10, 10), but Z will not move since it is still at 0.
MoveLinear([X, Y, Z], [0, 0, 0])

// This will disable work offset 1 on axes X and Y but not on Z.
WorkOffsetDisable([X, Y])