MC_SetPosition
This function block shifts the coordinate system of an axis by manipulating both the setpoint position as well as the actual position of an axis with the same value without any movement caused (Re-calibration with same following error). This can be used for instance for a reference situation.
Syntax
Definition:
FUNCTION_BLOCK MC_SetPosition
VAR_INPUT
Axis : Type_PtpSetPosition;
Execute : BOOL;
Position : LREAL;
Relative : BOOL;
ClearPositionLag : BOOL;
END_VAR
VAR_OUTPUT
Done : BOOL;
Busy : BOOL;
Error : BOOL;
ErrorId : UDINT;
END_VAR
Inputs
|
Name |
Type |
Default |
Description |
|---|---|---|---|
|
Axis |
|
Reference to the axis | |
|
Execute |
BOOL |
|
Trigger the command with rising edge. |
|
Position |
LREAL |
#Invalid |
New position value ([PosUnit]) or distance if Relative = TRUE |
|
Relative |
BOOL |
false |
Shift axis position by value |
|
ClearPositionLag |
BOOL |
|
Resets position lag to zero. |
Outputs
|
Name |
Type |
Description |
|---|---|---|
|
Done |
BOOL |
Position has new value. |
|
Busy |
BOOL |
Function block is not finished and new output values are to be expected. |
|
Error |
BOOL |
Error occurred within function block. |
|
ErrorId |
UDINT |
Error identifier |
Weiterführende Informationen
Mit dem Funktionsbaustein MC_SetPosition wir die aktuelle Achsposition auf einen parametrierbaren Wert gesetzt. Die Achse muss sich hierzu im Stillstand befinden.
Im Standardfall (Eingang Relative = FALSE) wird die Istposition auf den parametrierten absoluten Wert des Eingangs Position gesetzt. Im relativen Fall (Eingang Relative = TRUE) wird die Istposition um den Wert des Eingangs Position relativ verschoben. In beiden Fällen wird die Sollposition der Achse so gesetzt, dass ein eventuell vorhandener Schleppfehler erhalten bleibt. Wenn der Schleppfehler gelöscht werden soll, ist das über den den Eingang Options.ClearPositionLag möglich.
Hinweis zum Umstieg von NC2 zu MC3
Der Eingang Relative entspricht dem Eingang Mode des Tc2_MC2.MC_SetPosition Funktionsbausteins.
Versionsinformation
- TwinCAT Standard >= v3.1.4026.23.1
- TF5500 MC3 Base >= v4.0.6