MC_ReadMoveModulo
This function block provides a read-only view on the parameters and status of the move modulo command attached to CommandHandle. While Enable is TRUE the outputs are updated on every call. Valid signals that they describe a move modulo command. The Command* outputs stay FALSE until the axis has processed the command.
Syntax
Definition:
FUNCTION_BLOCK MC_ReadMoveModulo
VAR_IN_OUT
CommandHandle : Reference To MC_CommandHandle;
END_VAR
VAR_INPUT
Enable : BOOL;
END_VAR
VAR_OUTPUT
Valid : BOOL;
Error : BOOL;
ErrorId : UDINT;
Position : LREAL;
AdditionalTurns : UDINT;
Velocity : LREAL;
Acceleration : LREAL;
Deceleration : LREAL;
Jerk : LREAL;
BufferMode : EBufferMode;
Direction : EModuloDirection;
CommandQueued : BOOL;
CommandDone : 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 modulo command attached to CommandHandle. |
|
Error |
BOOL |
Error occurred within function block, e.g. no command attached to CommandHandle or not a move modulo command. |
|
ErrorId |
UDINT |
Error identifier |
|
Position |
LREAL |
Commanded modulo position ([PosUnit]) |
|
AdditionalTurns |
UDINT |
Number of additional modulo turns in the commanded direction. |
|
Velocity |
LREAL |
Maximum velocity ([PosUnit]/s, positive) |
|
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 | |
|
Direction |
EModuloDirection |
Commanded direction. Must have value <> EModuloDirection.ShortestDistance if AdditionalTurns has value > 0. |
|
CommandQueued |
BOOL |
Command is queued for execution. |
|
CommandDone |
BOOL |
Commanded position 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 |
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 |
|---|---|---|---|
0x8189 | 33161 | Function Block | Invalid reference passed to function block. An invalid reference (or pointer) was used in a function block call. This can happen if a reference type is used before it was initialized. |
0x81ba | 33210 | Function Block | Invalid command type passed to function block. The command type passed to the function block does not match the command expected by it (e.g., a Read function block is given a command of a different type than the one it reads). |
0x81c9 | 33225 | Function Block | Command handle is not initialized. The MC_CommandHandle object does not contain an attached command. |
An overview of all NC error codes can be found here:
If the data size is invalid, the error ADSERR_DEVICE_INVALIDSIZE (0x705; 1797) may occur.
You can find an overview of all ADS return codes here:
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 |
|---|---|---|---|
0x8189 | 33161 | Function Block | Invalid reference passed to function block. An invalid reference (or pointer) was used in a function block call. This can happen if a reference type is used before it was initialized. |
0x81ba | 33210 | Function Block | Invalid command type passed to function block. The command type passed to the function block does not match the command expected by it (e.g., a Read function block is given a command of a different type than the one it reads). |
0x81c9 | 33225 | Function Block | Command handle is not initialized. The MC_CommandHandle object does not contain an attached command. |
An overview of all NC error codes can be found here:
If the data size is invalid, the error ADSERR_DEVICE_INVALIDSIZE (0x705; 1797) may occur.
You can find an overview of all ADS return codes here:
Version information
- TwinCAT Standard >= v3.1.4026.23.1
- TF5500 MC3 Base >= v4.0.24