Structure of TwinCAT NC
TwinCAT NC has 2 tasks:
- NC-Task 1 SVB (block preparation task)
- NC-Task 1 SAF (block execution task)
The SVB task is responsible for linking and the Look-ahead function for NCI segments. The SAF task is responsible for executing the motion command.
The motion command leaves the PLC in the direction of the ADS router with destination NC-Task 1 SVB. The router relays the telegram to this task.

The NC accepts or rejects the message. The response arrives back at the calling function block in the PLC via the same route. Orders are issued based on function blocks contained in TCMC.lib. Once the NC has accepted the order, the system tries to calculate a solution taking into account the boundary conditions (max. velocity, acceleration, deceleration, and jerk).

If a solution exists, a table containing the position (s) velocity (v), acceleration/deceleration (a) and jerk (j) for the whole travel time within the sampling time of the SAF task is transferred to the SAF.
If no solution exists, the system deviates downwards based on maximum jerk, maximum acceleration, and maximum velocity (in this order).
Actual and set values shown in the diagram are served by the 1_Enc axis and 1_Drive axis components.

Since the AX5000 is known to the system as a slave, linking can take place automatically if required. In the event of problems the link can be checked by the user.
NC / AX5000 link specification:
NC setpoints | AX5000 setpoints | NC actual values | AX5000 actual values |
|---|---|---|---|
axis n_Drive / outputs/axis n_DriveOut / nOutData1 | MDT n / position setpoint (option) | axis n_Enc / inputs / axis 1_Enc_In / nInData1 | AT n / actual position value sensor 1 |
axis n_Drive / outputs/axis n_DriveOut / nOutData2 | MDT n / velocity setpoint |
|
|
axis n_Drive / outputs/axis n_DriveOut / nCtrl1 | MDT n / master control word (high byte) | axis n_Drive / inputs/axis n_DriveIn / nStatus1 & nStatus2 | AT n / drive status word |
|
| axis n_Drive / inputs/axis n_DriveIn / nStatus4 | WcState' / WcState |