MC_WaitForStableActualPosition
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
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. |
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 |
Possible error codes
For this function block, the following values, among others, are possible for the ErrorId output:
Error(Hex) | Error(Dec) | Error type | Description |
|---|---|---|---|
0x8145 | 33093 | Function Block | Mapping of cyclic interface between NC and PLC is missing (e.g., AXIS_REF, AXES_GROUP_REF, ...). A reference used by the function block (e.g., to an axis, group, mover or other motion object) is not linked to the corresponding NC object, or its cyclic mapping is incomplete. |
0x8151 | 33105 | State | Command is not allowed in current axis state. If the axis has no controller enable, is in error or has been added to a group, some commands are not permitted. |
0x8196 | 33174 | Initialization | Invalid position or distance. The actual or specified position or distance could not be determined or is invalid. |
0x81b7 | 33207 | Function Block | The specified time or duration is invalid. |
An overview of all NC error codes can be found here:
Version information
- TwinCAT Standard >= v3.1.4026.23.1
- TF5500 MC3 Base >= v4.0.6