TwinCAT NC Axis components 5.7.3 TYPE PLCTONC_AXLESTRUCT TYPE PLCTONC_AXLESTRUCT TYPE PLCTONC_AXLESTRUCT STRUCT nDeCtrlDWord : DWORD; (* control double word *) nOverride : DWORD; (* velocity override *) nAxisModeReq : DWORD; (* axis operating mode (PLC request) *) nAxisModeDWord : DWORD; (* *) fAxisModeLReal : LREAL; (* *) fActPosCorrection : LREAL; (* correction value for current position *) fExtSetPos : LREAL; (* external position setpoint *) fExtSetVelo : LREAL; (* external velocity setpoint *) fExtSetAcc : LREAL; (* external acceleration setpoint *) nExtSetDirection : DINT; (* external direction setpoint *) nReserved1 : DWORD; (* reserved *) fExtCtrlOutput :
LREAL; (* external controller output *) nReserved_HIDDEN : ARRAY [72..127] OF BYTE; END_STRUCT END_TYPE For each NC axis a data block of 128 bytes is available for data transport from the NC to the PLC, and another data block, also 128 bytes, is available for data transport from the PLC to the NC. The PLC programmer must create a variable for each direction and each axis, and must fix them in the I/O area with the AT instruction to the input and output area. The assignment of NC variables to PLC variables is carried out by the TwinCAT System Manager. Numerical Control (NC) Basics 53 Version: 1.2 No.
Data type Byte Bit Def.- Range Variable name Variable name (from 2.11 or TcMc2) Description 1 UINT32 0-3 - 0/1 nDeCtrlD Word ControlDWord Control double word 0 0/1 Enable Enable Controller enable 1 0/1 FeedEnabl ePlus FeedEnablePlus Feed enable plus 2 0/1 FeedEnabl eMinus FeedEnableMinus Feed enable minus 3 0/1 - - RESERVE 4 0/1 - - RESERVE 5 0/1 HomingSe nsor HomingSensor Referencing cam or referencing sensor 6 0/1 - - RESERVE 7 0/1 - - RESERVE 8 0/1 AcceptBlo ckedDrive AcceptBlockedDriv e Accept blocking of the drive setpoint adoption (e.g. hardware end positions) from TwinCAT V2.10 Build 1311 9 0/1 BlockedDri veDetecte d BlockedDriveDetec ted User signal Axis is blocked (e.g.
mechanical fixed stop). Not yet released! 10- 29 0/1 - - RESERVE 30 0/1 PlcDebugF lag PlcDebugFlag PLC debug function. For internal use only! 31 0/1 NcDebugF lag NcDebugFlag NC debug function. For internal use only! 2 UINT32 4-7 - 0...100 0000 nOverride Override Velocity override (0% to 100%) 3 UINT32 8-11 - nAxisMode Req AxisModeRequest Axis operating mode. Only provided for internal use!