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
(since 2.11 resp. TcMc2)

Description

1

UINT32

0-3

-

0/1

nDeCtrlDWord

ControlDWord

Control double word:

 

 

 

0

0/1

Enable

Enable

Enable controller

 

 

 

1

0/1

FeedEnablePlus

FeedEnablePlus

Feed enable plus

 

 

 

2

0/1

FeedEnableMinus

FeedEnableMinus

Feed enable minus

 

 

 

3

0/1

-

-

RESERVED

 

 

 

4

0/1

-

-

RESERVED

 

 

 

5

0/1

HomingSensor

HomingSensor

Referencing cam signal or homing sensor

 

 

 

6

0/1

-

-

RESERVED

 

 

 

7

0/1

-

-

RESERVED

 

 

 

8

0/1

AcceptBlockedDrive

AcceptBlockedDrive

Accept drive setpoint blocking (e.g. hardware position limits)
(from TwinCAT V2.10 Build 1311)

 

 

 

9

0/1

BlockedDriveDetected

BlockedDriveDetected

Axis is blocked (e.g. mechanical limit). Not implemented yet!

 

 

 

10-29

0/1

-

-

RESERVED

 

 

 

30

0/1

PlcDebugFlag

PlcDebugFlag

Debug function PLC. Only for internal use!

 

 

 

31

0/1

NcDebugFlag

NcDebugFlag

Debug function NC. Only for internal use!

 

 

 

 

 

 

 

 

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 position setpoint

8

REAL64

40-47

-

 

fExtSetVelo

ExtSetVelo

External velocity setpoint

9

REAL64

48-55

-

 

fExtSetAcc

ExtSetAcc

External acceleration setpoint

10

INT32

56-59

-

 

nExtSetDirection

ExtSetDirection

External direction setpoint [-1, 0, 1]

11

UINT32

60-63

-

 

nReserved1

-

RESERVED

12

REAL64

64-71

-

 

fExtCtrlOutput

ExtControllerOutput

External controller output. Not implemented yet!

13

REAL64

72-79

-

±∞

-

GearRatio1

Gear ration (couple factor) 1

14

REAL64

80-87

-

±∞

-

GearRatio2

Gear ration (couple factor) 2

15

REAL64

88-95

-

±∞

-

GearRatio3

Gear ration (couple factor) 3

16

REAL64

96-103

-

±∞

-

GearRatio4

Gear ration (couple factor) 4

 

 

 

 

 

 

 

 

17

-

104-127

-

-

nReserved

 

RESERVED

 

Requirements

Development enviroment

Target System Type

PLC libraries to include 

TwinCAT v2.7.0

PC (i386)

PlcNc.Lib

TwinCAT v2.8.0

PC (i386)

TcNC.Lib