Upgrade from NC2 to MC3

Function blocks

NC2 function block

MC3 function block

Note

MC_Power.Enable_Positive

MC_Power.Enable_Negative

MC_Power.EnablePositive

MC_Power.EnableNegative

Underscore removed

MC_ExtSetPointGenEnable

MC_ActivateExternalSetpointGeneration

Further details on External setpoint generation

MC_ExtSetPointGenDisable

Cancel MC_ActivateExternalSetpointGeneration with an abort command

Example: MC_Halt

MC_ExtSetPointGenFeed

See ITcNcExternalSetpointGeneration

 

MC_ExtSetPointGenFeedWithTorque

-

 

 

 

 

MC_GearInDyn

In the Future via MC_GearIn

 

MC_GearOut

 

Issuing a motion or hold/stop command to a slave axis disconnects it from the master.

MC_CamOut

 

Issuing a motion or hold/stop command to a slave axis disconnects it from the master.

MC_Power.Override

(Value range in %)

MC_SetOverride.VelocityFactor

(Value range normalized to 1)

On the MC3, the override is set to 1 (100%) by default. In Motion UI, values are entered as percentages.

MC_SetPosition.Mode

MC_SetPosition.Relative

Renaming the input for better readability in the code.

MC_Reset

MC_Reset

MC3: Takes effect when the axis is in the Error state. An additional asynchronous reset command for Sercos devices is also triggered and evaluated. MC_Reset.Done = TRUE, if the hardware has been reset (including an additional reset for Sercos) and the axis status has changed to “Disabled” or “Standstill.”

The position lag is not reset and persists despite the reset command.

MC_Home.bCalibrationCam

See the MC_Home and Homing Modules chapters

Centralized configuration, parameterization, and linking of I/O components in Homing modules

MC_Home.HomingMode := MC_DefaultHoming

MC_Home

MC_Home performs the standard homing procedure configured in the Homing object.

MC_Home.HomingMode := MC_Direct

MC_SetHomingState.Mode := EHomingMode.DirectSetPosition

Additional function block in addition to MC_Home.

MC_Home.HomingMode := MC_ForceCalibration

MC_SetHomingState.Mode := EHomingMode.ForceIsPositionValid

Additional function block in addition to MC_Home.

MC_Home.HomingMode := MC_ResetCalibration

MC_SetHomingState.Mode := EHomingMode.ResetIsPositionValid

Additional function block in addition to MC_Home.

MC_MoveVelocity.InVelocity

MC_MoveVelocity.Busy

MC_MoveVelocity.Active

 

MC_MoveVelocity.InVelocity

MC_MoveVelocity.Busy

MC_MoveVelocity.Active

 

In the initial situation, the command was sent using Execute := TRUE, and Execute := FALSE is set again.

NC2: Busy = TRUE, Active = TRUE and InVelocity = TRUE are reset by a falling edge at the Execute input. However, the outputs (especially InVelocity) signal TRUE for at least one cycle as soon as the target velocity is reached.

MC3: Busy = TRUE, Active = TRUE and InVelocity = TRUE remain set until the motion command is replaced by another command, even if Execute is already set to FALSE (PLCopen-compliant).

MC_GearIn.InGear

MC_GearIn.Busy

MC_GearIn.Active

(same as MC_GearInPos)

MC_GearIn.InGear

MC_GearIn.Busy

MC_GearIn.Active

(same as MC_GearInPos)

In the initial situation, the command was sent using Execute := TRUE, and Execute := FALSE is set again.

NC2: Busy = TRUE, Active = TRUE and InGear = TRUE are reset by a falling edge at the Execute input. However, the outputs (in particular InGear) signal TRUE for at least one cycle as soon as the master and slave axes move in sync with each other.

MC3: Busy = TRUE, Active = TRUE and InGear = TRUE remain set until the motion command is replaced by another command, even if Execute is already set to FALSE (PLCopen-compliant).

Re-triggering an MC function block using MC_MoveAbsolute as an example

VAR
    axis_nc2 : TC2_MC2.AXIS_REF;
    axis_mc3 : Tc3_Mc3Ptp.AXIS_REF;

    move_absolute_mc3 : Tc3_Mc3Ptp.MC_MoveAbsolute;
    move_absolute_nc2_1 : Tc2_MC2.MC_MoveAbsolute;
    move_absolute_nc2_2 : Tc2_MC2.MC_MoveAbsolute;
END_VAR
CASE step OF
    0:
        // MC3 init movement
        move_absolute_mc3(Axis := axis_mc3, Position := 111, Execute := TRUE);

        // NC2 init movement
        move_absolute_nc2_1(Axis := axis_nc2, Position := 111, Velocity := 100, Execute := TRUE);

        step := step + 1;

    1:
        // MC3 retrigger same FB instance during one cycle
        move_absolute_mc3 (Axis := axis_mc3, Position := 111, Velocity := 100, Execute := FALSE);
        move_absolute_mc3 (Axis := axis_mc3, Position := 222, Velocity := 100, Execute := TRUE);

        // NC2 use additional FB instance
        move_absolute_nc2_1(Axis := axis_nc2, Position := 111, Velocity := 100,Execute := FALSE);
        move_absolute_nc2_2(Axis := axis_nc2, Position := 222, Velocity := 100,Execute := TRUE);
        step := step + 1;
END_CASE
Upgrade from NC2 to MC3 1:

Re-triggering an MC function block using MC_MoveAbsolute as an example

In NC2, if the Execute input is triggered again while the command is being executed, the function block does not provide any feedback, nor does it execute any further commands.

This restriction does not apply to MC3. If the Execute input is triggered again while the command is running, the new parameters are applied and the function block is re-executed according to the buffer mode. This can be done within a single PLC cycle. For example, the first call to Execute := FALSE (changing from TRUE to FALSE) is fbMyMoveAbsolute(Axis := ax, Execute := FALSE, Position := 111), and immediately following that is the second call to the same block instance with a new position: fbMyMoveAbsolute(Axis := ax, Execute := TRUE, Position := 222).

Status

NC2

MC3

Note

myAxisRef.Status.IoDataInvalid

myAxisRef.McToPlc.Std.AxisState

PLCopen state diagram expanded (states: Invalid, NotReady, Enabling, Disabling).

Example: The axis remains in the NotReady state if the drive hardware is not ready (see the State Diagram chapter)

myAxisRef.Status.Homed

AxisRef.McToPlc.Std.IsPositionValid

IsPositionValid also takes into account, for example, the state of the axis's driven object (CoE drive input: Position actual value invalid). If the axis starts up using, among other things, an absolute encoder, the axis has a unique reference position and reports IsPositionValid := TRUE.

myAxisRef.ReadStatus()

myAxisRef.McToPlc.Std

Status information can be retrieved directly from the CDT Std.

Error at the drive hardware level or missing communication

The starting point is the transition of the TwinCAT system from Config to Run. This occurs when the drive hardware is in an error state or communication via the EtherCAT fieldbus is disrupted.