MC_MoveRelative
Description
Figure 7-138: MC_MoveRelative
Time Diagram
This image is an example of the combination of two relative move Function A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. Blocks.
- The left part of the timing diagram illustrates the case if the Second Function Block A function block groups an algorithm and a set of private data. It has inputs and outputs. is called after the First one.
- If First reaches the commanded distance 6000 (and the velocity is 0), then the output Done causes the Second FB to move to the distance 10000.
- The right part of the timing diagram illustrates the case if the Second move Function Blocks starts the execution while the First FB is still executing.
- In this instance, the First motion is interrupted and aborted by the Test signal during the constant velocity of the First FB.
- The Second FB adds on the actual position of 3250 the distance 4000 and moves the axis to the resulting position of 7250.
Figure 7-139: Time Diagrams: First and Second FBs
Figure 7-140: Time Diagram
-
- This function block starts a motion-related action and therefore stores data for calculations and error checking.
See Call Function Blocks Multiple Times in the Same Cycle if using a dual-core controller.
Arguments
See Function Blocks - General Rules for more information about how inputs and outputs work.
Input
Execute |
Description |
Requests to queue the move. |
Data Type |
BOOL |
|
Range |
0, 1 |
|
Unit |
N/A |
|
Default |
— |
|
Axis |
Description |
Name of a declared instance of the AXIS_REF library function. See Axis Name and Number for more information. |
Data Type |
||
Range |
[1,256] |
|
Unit |
N/A |
|
Default |
— |
|
Distance |
Description |
Distance |
Data Type |
LREAL |
|
Range |
— |
|
Unit |
User unit |
|
Default |
— |
|
Velocity |
Description |
|
Data Type |
LREAL |
|
Range |
— |
|
Unit |
User unit/sec |
|
Default |
— |
|
Acceleration |
Description |
Trapezoidal: Acceleration rate S-curve: Maximum acceleration |
Data Type |
LREAL |
|
Range |
— |
|
Unit |
User unit/sec 2 |
|
Default |
— |
|
Deceleration |
Description |
Trapezoidal: Deceleration rate S-curve: Unused |
Data Type |
LREAL |
|
Range |
— |
|
Unit |
User unit/sec 2 |
|
Default |
— |
|
Description |
Trapezoidal: 0 S-curve: Constant jerk In physics, jerk is the rate of change of acceleration; more precisely, the derivative of acceleration with respect to time |
|
Data Type |
LREAL |
|
Range |
— |
|
Unit |
User unit/sec 3 |
|
Default |
— |
|
BufferMode |
Description |
0 = abort 1 = buffer 2 = blend to active 3 = blend to next 4 = blend to low velocity 5 = blend to high velocity See the table in Buffer Modes. |
Data Type |
SINT |
|
Range |
[0,5] |
|
Unit |
N/A |
|
Default |
— |
Output
Done |
Description |
Indicates the move completed successfully. |
Data Type |
BOOL |
|
Busy |
Description |
High from the moment the Execute input is one-shot to the time the move is ended. |
Data Type |
BOOL |
|
Active |
Description |
Indicates this move is the active move. |
Data Type |
BOOL |
|
CommandAborted |
Description |
Indicates the move was aborted. |
Data Type |
BOOL |
|
Error |
Description |
Indicates an invalid input was specified or the move was terminated due to an error. |
Data Type |
BOOL |
|
ErrorID |
Description |
Indicates the error if Error output is set to TRUE. See the table in PLCopen Function Block ErrorID Output. |
Data Type |
INT |
Example
Structured Text
(* MC_MoveRelative ST example *)
Inst_MC_MoveRelative( MovRelReq, Axis1, 10.0, 200.0,150.0, 150.0, 0,0 );
MovRelDone := Inst_MC_MoveRelative.Done; //store Done output into user defined variable
See Main for more information about how this function is used in the Hole punch project.