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 | Further details on External setpoint generation | |
MC_ExtSetPointGenDisable | Cancel MC_ActivateExternalSetpointGeneration with an abort command | Example: MC_Halt |
MC_ExtSetPointGenFeed |
| |
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 | MC3: Takes effect when the axis is in the Error state. An additional asynchronous reset command for Sercos devices is also triggered and evaluated. 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 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 NC2: MC3: |
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 NC2: MC3: |
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_VARCASE 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![]() | Re-triggering an MC function block using MC_MoveAbsolute as an example In NC2, if the This restriction does not apply to MC3. If the |
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 |
|
myAxisRef.ReadStatus() | myAxisRef.McToPlc.Std | Status information can be retrieved directly from the CDT |
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.
- NC2: An axis error is displayed when
MC_Power.Enable = TRUE. In addition, you can check for communication issues, for example, viamyAxisRef.Status.IoDataInvalid. - MC3: Once communication between the axis and the drive is established, the drive status and any errors are evaluated immediately and, if necessary, displayed as axis errors. The state diagram for the MC3 axis has been expanded compared to the NC2 and PLCopen (states: Invalid, NotReady, Enabling, Disabling). The MC3's axis status can be used to centrally monitor its state.
- Example 1: If
MC_Power.Enable := FALSEand communication with the drive is not possible, the axis status remains in the statemyAxisRef.McToPlc.Std.AxisState = EAxisState.NotReady. - Example 2: If
MC_Power.Enable := FALSEand the drive is in an error state, then the MC3 axis reportsmyAxisRef.McToPlc.Std.AxisState = EAxisState.ErrorStop.
