Structure of TwinCAT NC
TwinCAT NC has 2 tasks:
- NC task 1 SVB (Task for the block preparation)
- NC task 1 SAF (Task for the block execution)
The SVB task is responsible for Linking and “Look-Ahead” of NCI segments. The SAF task is responsible for executing the motion command.
The traversing task 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 block in the PLC via the same route. Instructions are issued based on blocks contained in TCMC.lib. Once the NC has accepted the instruction, 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 SEC task is transferred to the SEC.
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 set values | AX5000 set values | NC actual values | AX5000 Actual values |
---|---|---|---|
axis n_Drive / outputs/axis n_DriveOut / nOutData1 | MDT n / position set value (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 set value |
|
|
axis n_Drive / outputs/axis n_DriveOut / nCtrl1 | MDT n / master control word (Hi-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 |