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.
No. | Data type | Byte | Bit | Def.-Range | Variable name | Variable name (from 2.11 or TcMc2) | Description |
---|---|---|---|---|---|---|---|
1 | UINT32 | 0-3 | - | 0/1 | nDeCtrlDWord | ControlDWord | Control double word |
|
|
| 0 | 0/1 | Enable | Enable | Controller enable |
|
|
| 1 | 0/1 | FeedEnablePlus | FeedEnablePlus | Feed enable plus |
|
|
| 2 | 0/1 | FeedEnableMinus | FeedEnableMinus | Feed enable minus |
|
|
| 3 | 0/1 | - | - | RESERVE |
|
|
| 4 | 0/1 | - | - | RESERVE |
|
|
| 5 | 0/1 | HomingSensor | HomingSensor | Referencing cam or referencing sensor |
|
|
| 6 | 0/1 | - | - | RESERVE |
|
|
| 7 | 0/1 | - | - | RESERVE |
|
|
| 8 | 0/1 | AcceptBlockedDrive | AcceptBlockedDrive | Accept blocking of the drive setpoint adoption (e.g. hardware end positions) |
|
|
| 9 | 0/1 | BlockedDriveDetected | BlockedDriveDetected | User signal Axis is blocked (e.g. mechanical fixed stop). |
|
|
| 10-29 | 0/1 | - | - | RESERVE |
|
|
| 30 | 0/1 | PlcDebugFlag | PlcDebugFlag | PLC debug function. For internal use only! |
|
|
| 31 | 0/1 | NcDebugFlag | NcDebugFlag | NC debug function. For internal use only! |
|
|
|
|
|
|
|
|
2 | UINT32 | 4-7 | - | 0...1000000 | nOverride | Override | Velocity override (0% to 100%) |
3 | UINT32 | 8-11 | - |
| nAxisModeReq | AxisModeRequest | Axis operating mode. Only provided for internal use! |
4 | UINT32 | 12-15 | - |
| nAxisModeDWord | AxisModeDWord | Only provided for internal use! |
5 | REAL64 | 16-23 | - |
| fAxisModeLReal | AxisModeLReal | Only provided for internal use! |
6 | REAL64 | 24-31 | - |
| fActPosCorrection | PositionCorrection | Actual position correction value |
7 | REAL64 | 32-39 | - |
| fExtSetPos | ExtSetPos | External set position |
8 | REAL64 | 40-47 | - |
| fExtSetVelo | ExtSetVelo | External set velocity |
9 | REAL64 | 48-55 | - |
| fExtSetAcc | ExtSetAcc | External set acceleration |
10 | INT32 | 56-59 | - |
| nExtSetDirection | ExtSetDirection | External set travel direction [-1,0,1] |
11 | UINT32 | 60-63 | - |
| nReserved1 | - | RESERVE |
12 | REAL64 | 64-71 | - |
| fExtCtrlOutput | ExtControllerOutput | External controller output. Not yet released! |
13 | REAL64 | 72-79 | - | ±∞ | - | GearRatio1 | Gear ratio (coupling factor) 1 |
14 | REAL64 | 80-87 | - | ±∞ | - | GearRatio2 | Gear ratio (coupling factor) 2 |
15 | REAL64 | 88-95 | - | ±∞ | - | GearRatio3 | Gear ratio (coupling factor) 3 |
16 | REAL64 | 96-103 | - | ±∞ | - | GearRatio4 | Gear ratio (coupling factor) 4 |
|
|
|
|
|
|
|
|
17 | - | 104-127 | - | - | nReserved | - | RESERVE |
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v2.7.0 | PC (i386) | PlcNc.Lib |
TwinCAT v2.8.0 | PC (i386) | TcNC.Lib |