MC_MoveModulo

MC_MoveModulo 1:

The MC_MoveModulo function block carries out a positioning referenced to the modulo position of an axis. Modulo rotation is based on the adjustable axis parameter modulo factor (e.g. 360).

Special cases: Special attention must be paid to the behavior when one or more complete modulo rotations are requested. If the axis is located at an exact set position, such as 90 degrees, and if positioning to 90 degrees is required, no movement is carried out. If required to turn 450 degrees in a positive direction, it will perform just one rotation. The behavior can be different following an axis reset, because the reset will cause the current actual position to be adopted as the set position. The axis will then no longer be exactly at 90 degrees but will be a little under or over. These cases will give rise either to a minimum positioning to 90 degrees, or on the other hand a complete rotation.

Depending on the case, it may be more effective for complete modulo rotations to calculate the desired destination position based on the current absolute position, and then to position using the MC_MoveAbsolute block.

Note: Modulo positioning, like absolute positioning, is available for all axes, regardless of the Modulo setting in the TwinCAT System Manager. The current absolute position, fPosSoll, can be read for any axis from the cyclic axis interface NCTOPLC_AXLESTRUCT.

Important: Detailed information about modulo positioning.

VAR_INPUT

VAR_INPUT
    Execute      : BOOL;
    Position     : LREAL;
    Velocity     : LREAL;
    Acceleration : LREAL;
    Deceleration : LREAL;
    Jerk         : LREAL;
    Direction    : MC_Direction;
END_VAR

Execute : The command is executed with rising edge.

Position : Absolute modulo destination position to be reached.

Velocity : Maximum travel velocity (>0).

Acceleration : Acceleration (≥0). If the value is 0, the standard acceleration from the axis configuration in the System Manager is used.

Deceleration : Deceleration (≥0). If the value is 0, the standard deceleration from the axis configuration in the System Manager is used.

Jerk : Jerk (≥0). If the value is 0, the standard jerk from the axis configuration in the System Manager is used.

Direction : Positioning direction MC_Direction (forwards, reverse or the shortest route)

VAR_OUTPUT

VAR_OUTPUT
    Done           : BOOL;
    CommandAborted : BOOL;
    Error          : BOOL;
    ErrorID        : UDINT;
END_VAR

Done : Becomes TRUE once the target position is reached. More Information…

CommandAborted : Becomes TRUE, if the command could not be fully executed. The reason may be an error, a stop or a superimposed travel command.

Error: Becomes TRUE, as soon as an error occurs.

ErrorID : Supplies the error number when the Error output is set.

VAR_IN_OUT

VAR_IN_OUT
    Axis : NCTOPLC_AXLESTRUCT;
END_VAR

Axis : Axis structure.

Requirements

Development environment

Target system type

PLC libraries to be linked

TwinCAT v2.8

PC (i386)

TcMC.Lib