MC_WaitForStableActualPosition

MC_WaitForStableActualPosition 1:

This function block waits for a stable actual position. The command is always buffered and may only be triggered when the previous command ends with zero dynamics.

Syntax

Definition:

FUNCTION_BLOCK MC_WaitForStableActualPosition
VAR_IN_OUT
    Axis              : Reference To AXIS_REF;
END_VAR
VAR_INPUT
    Execute           : BOOL;
    PositionTolerance : LREAL;
    WaitDuration      : LREAL;
    TimeoutDuration   : LREAL;
END_VAR
VAR_OUTPUT
    InPositionWindow  : BOOL;
    Done              : BOOL;
    Busy              : BOOL;
    Active            : BOOL;
    CommandAborted    : BOOL;
    Error             : BOOL;
    ErrorId           : UDINT;
END_VAR

MC_WaitForStableActualPosition 2: Inputs

Name

Type

Default

Description

Execute

BOOL

 

Trigger the command with rising edge.

PositionTolerance

LREAL

#Invalid

Position tolerance around the set position ([PosUnit], positive). The actual position must remain within this window for the command to succeed.

WaitDuration

LREAL

#Invalid

Duration (in seconds) that the actual position needs to consecutively stay inside the position window. Must have a value >= 0.

TimeoutDuration

LREAL

#Ignore

Duration (in seconds) after which an error is triggered if the actual position is not inside the position window. It can be left as 'Ignore' if no timeout is desired, otherwise must have a value > WaitDuration.

MC_WaitForStableActualPosition 3: In/Outputs

Name

Type

Description

Axis

Reference To AXIS_REF

Reference to the axis

MC_WaitForStableActualPosition 4: Outputs

Name

Type

Description

InPositionWindow

BOOL

Actual position is currently inside the position window.

Done

BOOL

Actual position has been consecutively inside the position window for at least WaitDuration.

Busy

BOOL

Function block is not finished and new output values are to be expected.

Active

BOOL

Function block has active control on the axis. While Active is TRUE, the set position remains on the final position of the previous command and the set dynamics remain zero.

CommandAborted

BOOL

Command is aborted by another command.

Error

BOOL

Error occurred within function block.

ErrorId

UDINT

Error identifier

Versionsinformation

  • TwinCAT Standard >= v3.1.4026.23.1
  • TF5500 MC3 Base >= v4.0.6