MC_MoveRelative (FB)

 

FUNCTION_BLOCK MC_MoveRelative

This function block commands a controlled motion of a specified distance relative to the set position at the time of the execution. The motion ends with velocity is 0.

Example

Use of MC_MoveRelative

The illustration shows how two instances (First and Second) of the type MC_MoveRelative are combined.

In the left-hand part of the illustration, Second is called after First. If First has achieved the specified position 6000, the velocity is 0 and First.Done is set, then the Second instance will cause the axis to move to the posi­tion 10000.

In the right-hand part of the illustration, the execution is started by Second while First is still operating. The motion of First is interrupted and aborted by the Test signal which is transmitted during the constant velocity phase of First. The distance 4000 is added to the actual position 3250. Then Second moves the axis to the resulting position 7250.

MoveRelativeExample.png

Sequence of two complete actions: Sequential execution of two complete motions.

The second motion interrupts the first motion: The motion of instance Second interrupts the motion of instance First.

InOut:

Scope

Name

Type

Initial

Comment

Inout

Axis

AXIS_REF_SM3

Reference to axis

Input

Execute

BOOL

FALSE

TRUE: Starts execution.

Distance

LREAL

0

Relative distance for the motion in technical unit [u].

Velocity

LREAL

0

Maximum velocity

  • Is always positive in [u/s].

  • Does not need to be achieved.

Acceleration

LREAL

0

Acceleration

  • Is always positive in [u/s²].

  • Increasing motor energy

Deceleration

LREAL

0

Deceleration

  • Is always positive in [u/s²].

  • Decreasing motor energy

Jerk

LREAL

0

Jerk always positive in [u/s³]

Output

Done

BOOL

FALSE

TRUE: Distance has been achieved.

Busy

BOOL

FALSE

TRUE: Function block is in operation.

CommandAborted

BOOL

FALSE

TRUE: Execution has been interrupted by another function block instance operating on the axis.

Error

BOOL

FALSE

TRUE: Error has occurred.

ErrorID

SMC_ERROR

0

Error identification