MC_ReadMoveVelocity
This function block provides a read-only view on the parameters and status of the move velocity command attached to CommandHandle. While Enable is TRUE the outputs are updated on every call. Valid signals that they describe a move velocity command. The Command* outputs stay FALSE until the axis has processed the command.
Syntax
Definition:
FUNCTION_BLOCK MC_ReadMoveVelocity
VAR_IN_OUT
CommandHandle : Reference To MC_CommandHandle;
END_VAR
VAR_INPUT
Enable : BOOL;
END_VAR
VAR_OUTPUT
Valid : BOOL;
Error : BOOL;
ErrorId : UDINT;
Velocity : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk : LREAL;
BufferMode : EBufferMode;
CommandQueued : BOOL;
CommandInVelocity : BOOL;
CommandActive : BOOL;
CommandAborted : BOOL;
CommandError : BOOL;
CommandErrorId : UDINT;
END_VAR
Inputs
|
Name |
Type |
Default |
Description |
|---|---|---|---|
|
Enable |
BOOL |
|
The outputs are updated while TRUE. |
In/Outputs
|
Name |
Type |
Description |
|---|---|---|
|
CommandHandle |
Reference To MC_CommandHandle |
Handle of the command to observe |
Outputs
|
Name |
Type |
Description |
|---|---|---|
|
Valid |
BOOL |
The outputs describe the move velocity command attached to CommandHandle. |
|
Error |
BOOL |
Error occurred within function block, e.g. no command attached to CommandHandle or not a move velocity command. |
|
ErrorId |
UDINT |
Error identifier |
|
Velocity |
LREAL |
Commanded velocity ([PosUnit]/s). |
|
Acceleration |
LREAL |
Maximum acceleration ([PosUnit]/s^2, positive) |
|
Deceleration |
LREAL |
Maximum deceleration ([PosUnit]/s^2, positive) |
|
Jerk |
LREAL |
Maximum jerk ([PosUnit]/s^3, positive) |
|
BufferMode |
Chronological sequence of the command | |
|
CommandQueued |
BOOL |
Command is queued for execution. |
|
CommandInVelocity |
BOOL |
Commanded velocity reached. |
|
CommandActive |
BOOL |
The command is currently active. |
|
CommandAborted |
BOOL |
Command is aborted by another command. |
|
CommandError |
BOOL |
Error occurred while executing the command. |
|
CommandErrorId |
UDINT |
Error identifier of the command |
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 |
|---|---|---|---|
0x8189 | 33161 | Funktionsbaustein | Ungültige Referenz an Funktionsbaustein übergeben. Eine ungültige Referenz (bzw. ein ungültiger Pointer) wurde im Aufruf des Funktionsbausteins übergeben. Das kann passieren, wenn eine Referenz verwendet wird, bevor sie initialisiert wurde. |
0x81ba | 33210 | Funktionsbaustein | Ungültiger Kommandotyp an Funktionsbaustein übergeben. Der an den Funktionsbaustein übergebene Kommandotyp passt nicht zu dem von ihm erwarteten Kommando (z.B. wird einem Read-Funktionsbaustein ein Kommando eines anderen Typs übergeben, als er anzeigt). |
0x81c9 | 33225 | Funktionsbaustein | Kommando-Handle enthält kein Kommando. Das MC_CommandHandle-Objekt enthält kein angehängtes Kommando. |
Eine Übersicht aller NC-Fehlercodes finden Sie hier:
Bei einer ungültigen Größe der Daten kann es zum Fehler ADSERR_DEVICE_INVALIDSIZE (0x705; 1797) kommen.
Eine Übersicht aller ADS Return Codes finden Sie hier:
Versionsinformation
- TwinCAT Standard >= v3.1.4026.23.1
- TF5500 MC3 Base >= v4.0.24