Perform a Linear Move
Linear moves can be programmed using absolute or relative positions using these function blocks:
- MC_MoveLinAbs commands interpolated linear movement on an axes group to the specified absolute positions.
- MC_MoveLinRel commands interpolated linear movement on an axes group to the specified relative positions.
Prior to performing any coordinated moves, some setup is needed.
- See Create a Linear or Circular Coordinated Motion Application.
- Once these steps have been performed, a linear move can be performed.
In these examples, two linear moves are performed.
Absolute Linear Move
In this move, an absolute linear move goes from (0, 0) to (100, 200).
- Call MC_MoveLinAbs.
- PositionArray is an array of absolute end positions containing one position for each axis in the group.
- The input velocity, acceleration, deceleration, and jerk establish the maximum values for the move.
PosArrayAbs[0] := 100;
PosArrayAbs[1] := 200;
TransParam[0] := 0;
Inst_MC_MoveLinRel(TRUE, Group1_ref, PosArrayAbs, MaxVel, MaxAcc, MaxDec, 0, CS_ACS, BM_BUFFERED, TM_NONE, TransParam);
In the example, a linear move is performed on axis group Group1_ref.
- PosArrayAbs contains the absolute end points of the axes in the group.
- The axis stored in position 0 (IdentInGroup) of the group is moved to 100.0.
- The axis stored in postiion 1 of the group is moved to 200.0.
- The maximum velocity is specified by variable MaxVel and is specified in User unit/sec.
- The maximum acceleration and deceleration are specified by variables MaxAcc and MaxDec and are specified in User unit/sec2.
- The coordinate system is ACS.
- The BufferMode is set to BM_BUFFERED, indicating the move is buffered.
- See Buffer Modes for detailed information.
- The TransitionMode is set to TM_NONE, indicating no transition mode is used.
- The TransParam array is required.
- The contents can be set to 0 because the transition mode is not being used.
- There has to be one array entry for each axis in the group.
Relative Linear Move
In this move, a relative linear move goes a distance of (-75, 50) from the end of the first move.
- Call MC_MoveLinRel.
- The Distance input is an array of distances, one distance for each axis in the group.
- The input velocity, acceleration, deceleration, and jerk establish the maximum values for the move.
DistArrayRel[0] := -75.0; // Start pt 100 – rel 75 -> 25 absolute end pt
DistArrayRel[1] := 50.0; // Start pt 200 + rel 50 -> 250 absolute end pt
TransParam[0] := 0;
Inst_MC_MoveLinRel(TRUE, Group1_ref, DistArrayRel, MaxVel, MaxAcc, MaxDec, 0, CS_ACS, BM_BUFFERED, TM_NONE, TransParam);
In the example, all the variables have the same meaning as the absolute linear example except DistArrayRel.
- DistArrayRel contains the relative distance to move for each axis in the group.
- The axis stored in position 0 (IdentInGroup) of the group is moved a distance of -75.0.
- The axis stored in position 1 of the group is moved a distance of 50.0.
Linear Move With More Than Two Axes
-
-
The dimensionality of the move is determined by the number of axes mapped to the group.
This implies that a group which could hold a maximum of three or more axes does two dimensional moves if it only has two valid axes mapped to it.
To perform higher dimensional moves, additional axes must be added to the group.
The procedure for this are in Create a Linear or Circular Coordinated Motion Application.
After the additional axes are added, perform these steps.
- From the Dictionary, update the array size of the variable being passed (PosArrayAbs and DistArrayRel in the Absolute Linear Move and Relative Linear Move examples) to the Position input so its length matches the maximum number of axes allowed in the group.
- Set the desired values for the additional axes in the now larger position arrays.