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 |
Mögliche Fehlercodes
Für diesen Funktionsbaustein sind unter anderem die folgenden Werte für den Ausgang ErrorId möglich:
Fehler(Hex) | Fehler(Dez) | Fehlertyp | Beschreibung |
|---|---|---|---|
0x8145 | 33093 | Funktionsbaustein | Die Verknüpfung des zyklischen Interfaces zwischen NC und SPS fehlt (z.B. AXIS_REF, AXES_GROUP_REF, ...). Eine vom Funktionsbaustein verwendete Referenz (z.B. auf eine Achse, Gruppe, einen Mover oder ein anderes Motion-Objekt) ist nicht mit dem zugehörigen NC-Objekt verknüpft oder die zyklische Verknüpfung ist unvollständig. |
0x8151 | 33105 | Zustand | Das Kommando ist im gegenwärtigen Achszustand nicht erlaubt. Wenn die Achse keine Reglerfreigabe hat, sich im Fehler befindet oder einer Gruppe hinzugefügt wurde, sind einige Kommandos nicht erlaubt. |
0x8196 | 33174 | Initialisierung | Ungültige Position oder Distanz. Die aktuelle oder eingegebene Position oder Distanz konnte nicht ermittelt werden oder ist für das Kommando ungültig. |
0x81b7 | 33207 | Funktionsbaustein | Die angegebene Zeit oder Dauer ist ungültig. |
Eine Übersicht aller NC-Fehlercodes finden Sie hier:
Versionsinformation
- TwinCAT Standard >= v3.1.4026.23.1
- TF5500 MC3 Base >= v4.0.6