MC_MoveRelative

PLCopen motion icon

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - Performs a single-axis move for a specified distance to perform incremental motion.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

0, 1

N/A

No default

On the rising edgeClosed A rising edge is the transition of a digital signal from low to high. It is also called positive edge, request to queue the move.

Axis

AXIS_REF

1, 256

N/A

No default

Name of a declared instance of the AXIS_REF library function.

Distance

LREAL

No range

User units

No default

Distance.

Velocity

LREAL

No range

User unit/sec

No default

Velocity setpointClosed Setpoint is the target value that an automatic control system, for example PID controller, will aim to reach.

Acceleration

LREAL

No range

User unit/sec2

No default

Trapezoidal: Acceleration rate.

S-curve: Maximum acceleration.

See S-curve and Trapezoidal Acceleration / Deceleration for more information.

Deceleration

LREAL

No range

User unit/sec2

No default

Trapezoidal: Deceleration rate.

S-curve: Unused.

See S-curve and Trapezoidal Acceleration / Deceleration for more information.

JerkClosed In physics, jerk is the rate of change of acceleration; more precisely, the derivative of acceleration with respect to time

LREAL

No range

User unit/sec3

No default

Trapezoidal: 0 (zero).

S-curve: Constant jerkClosed In physics, jerk is the rate of change of acceleration; more precisely, the derivative of acceleration with respect to time.

See S-curve and Trapezoidal Acceleration / Deceleration for more information.

BufferMode

SINT

0, 5

N/A

No default

  • 0 = Abort.
  • 1 = Buffer.
  • 2 = Blend to active.
  • 3 = Blend to next.
  • 4 = Blend to low velocity.
  • 5 = Blend to high velocity.
  • See Buffer Modes for more information.

Outputs

Output

Data Type

Range

Unit

Description

Done

BOOL

No range

N/A

Indicates the move completed successfully.
The Command Position has reached the endpoint.

Busy

BOOL

No range

N/A

High from the moment the Execute input goes high until the time the move is ended.

Active

BOOL

No range

N/A

Indicates this move is the Active move.

CommandAborted

BOOL

No range

N/A

Indicates the move was aborted.

Error

BOOL

No range

N/A

Indicates either:

  • An invalid input was specified.
  • The move was terminated due to an error.

ErrorID

INT

No range

N/A

Indicates the error if Error output is TRUE.

See PLCopen Function Block ErrorIDs for more information.

Remarks

  • See Function Blocks - General Rules for more information about how inputs and outputs work.
  • See Main for more information about how this function is used in the Hole punch project.

MC_MoveRelative

Figure 6-234: MC_MoveRelative

Time Diagram

These images show two examples of the combination of two relative move Function Blocks (FBs).

  • The left part of the diagram illustrates when the second FB is called after the first one.
    • If the first reaches the commanded position of 6000, and the velocity is 0 (zero), the output Done causes the second FB to move to the distance 10000.
  • The right part of the diagram illustrates when the second move FB starts the execution while the first FB is still executing. 
    • 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 6-235: Time Diagrams: First and Second FBs

MC_MoveRelative: Timing Diagram

Figure 6-236: Time Diagram

FBD Language Example

Not available.

FFLD Language Example

MC_MoveRelative: LD example

IL Language Example

Not available.

ST Language Example

(* 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 Also