TcPlcInterpolation Overview

TwinCAT PLC Library: TcPlcInterpolation

[This is preliminary documentation and subject to change.]

Overview

The TcPlcInterpolation library offers an alternative to the usage of g-code (DIN 66025). With this library it is possible to describe interpolated movement commands directly from PLC without using g-code.

In a first step a table of different movement commands and auxiliary functions is described. Therefore structues like ST_NciGeoLine are used. With this structure the FB 'NciFeedTablePreparation' is called and so the command is appended to the table. If the table is full or all required entries are in the table, NciFeedTable is called to transfer the content of the table to the NC-kernel. With the transfer of the data, the execution is started directly.

Function block | Description
NciFeedTablePreparation |
NciFeedTable |

Enum | Description
E_NciEntryType |
E_NciGeoPlane |
E_NciAxesInGroup |
E_TangentialFollowingBehavior |

Structures | Description
ST_NciEndOfTables |
ST_NciDynOvr |
ST_NciGeoCirclePlane |
ST_NciGeoLine |
ST_NciGeoStart |
ST_NciHParam |
ST_NciMFuncFast |
ST_NciMFuncHsk |
ST_NciMFuncResetAllFast |
ST_NciSParam |
ST_NciTangentialFollowingDesc |
ST_NciVertexSmoothing |
ST_NciAxisDynamics |
ST_NciDwellTime |

Development Environment | Target System | PLC Libraries to include
TwinCAT v2.10 | PC (i386) | TcPlcInterpolation.lib


NciFeedTablePreparation

Interface

VAR_INPUT
nEntryType : E_NciEntryType;
pEntry : POINTER TO UDINT;
bResetTable: BOOL;
bResetAll : BOOL;
END_VAR

VAR_IN_OUT
stFeedGroupTable : ST_NciFeedGroupTable
END_VAR

VAR_OUTPUT
nFilledRows : INT;
bError : BOOL;
nErrorId : UDINT;
END_VAR

The function block FB_NciFeedTablePreparation appends an entry of a specified type to the feed group table. One appended entry can generally create more than one row in the table. If there are not enough free rows in the table, an error is returned and no rows is added to the table. So the entry must be added to an other table or same one after execution of FB_NciFeedTable. This function block is taking care about modal functions like tangential following. So it is important to use always the same instance of this function block.

Input | Data type | Description
nEntryType | E_NciEntryType | Specifies the entry type, e.g. line, circle, tangential following
pEntry | POINTER | Pointer to entry structure - must match to nEntryType
bResetTable | BOOL | If bResetTabble =TRUE, the table 'stFeedGroupTable' is set to zero and nFilledRows is set to zero. If nErrorId is ErrNciFeedTableFull, this error is reset. All modal flags (like tangential following) remain constant. If there is an entry a pEntry, it will be disregarded.
bResetAll | BOOL | Same as bResetTable. Beside that, all modal flags are set to its default values and all error id's are reset.
Input/output | Data type | Description
stFeedGroupTable | ST_NciFeedGroupTable | Table that holds the rows for the nc-kernel.

Output | Data type | Description
nFilledRows | INT | Number of filled rows.
bError | BOOL | Becomes true, if an error occured.
nErrorId | UDINT | Contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of an instruction at the inputs. The error numbers in ErrId can be consulted in the ADS error documentation or in the NC error documentation (error codes above 0x4000).

Hint:

  • If one of bResetTable, bResetAll, or bError is true no further entries are accepted.
  • Error code 0x4B72 indicates that the table is full and the last entry was not accepted

Sample:

stGeoLine.nDisplayIndex := 1;
stGeoLine.fEndPosX := 0;
stGeoLine.fEndPosY := 400;
stGeoLine.fEndPosZ := 100;
stGeoLine.fEndPosQ1 :=-90;
stGeoLine.fVelo := 1000; (*mm per sec*)

fbFeedTablePrep(
nEntryType := E_NciEntryTypeGeoLine,
pEntry := ADR(stGeoLine),
bResetTable:= FALSE,
stFeedGroupTable:= stNciFeedGroupTable,
nFilledRows=> nFilledRows,
bError => bError,
nErrorId => nErrorId);

Development Environment | Target System | PLC Libraries to include
TwinCAT v2.10.0 | PC (i386) | TcPlcInterpolation.lib


NciFeedTable

Interface

VAR_INPUT
bExecute : BOOL;
bReset : BOOL;
bLogFeederEntries : BOOL;
END_VAR

VAR_IN_OUT
stFeedGroupTable : ST_NciFeedGroupTable;
stNciToPlc : NciChannelToPlc;
END_VAR

VAR_OUTPUT
bFeedingDone : BOOL;
bChannelDone : BOOL;
bError : BOOL;
nErrorId : UDINT;
END_VAR

The function block FB_NciFeedTable feeds a given table to the nc-kernel. If the override is set and the controllers are enabled the execution is directly started. After feeding is completed, bFeedingDone becomes true. This signal can be used to overwrite the table again with NciFeedTablePreparation. In NciFeedTablePreparation the table reset (bResetTable) must be done.

bChannelDone signals the complete execution in the nc-kernel of the tables. Therefore the ST_NciEndOfTables identifier must be set at the end of the last table.

Input | Data type | Description
bExecute | BOOL | The command is triggered by a rising edge on this input
bReset | BOOL | Triggers a channel reset and also a reset of this FB
bLogFeederEntries | BOOL | If true a log file 'PlcItpFeed.log' is written in TwinCAT\CNC-folder. It contains all entries that are send via ADS to the nc-kernel Hint: If bLogFeederEntries is true, the required time until bFeedingDone becomes true will be longer.
Input/output | Data type | Description
stFeedGroupTable | ST_NciFeedGroupTable | Table that holds the rows for the nc-kernel.
stNciToPlc | NciChannelToPlc | The structure of the cyclic channel interface from the NCI to the PLC.

Output | Data type | Description
bFeedingDone | BOOL | Becomes true, if all rows of the table are send to the nc-kernel
bChannelDone | BOOL | Becomes true, if all entries of the table are executed in the nc-kernel and ST_NciEndOfTables is recognized.
bFeedBusy | BOOL | Becomes true, if this FB is active feeding entries to the nc-kernel
bResetBusy | BOOL | Becomes true, if a reset is in progress
bError | BOOL | Becomes true, if an error occured.
nErrorId | UDINT | Contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of an instruction at the inputs. The error numbers in ErrId can be consulted in the ADS error documentation or in the NC error documentation (error codes above 0x4000).

Development Environment | Target System | PLC Libraries to include
TwinCAT v2.10.0 | PC (i386) | TcPlcInterpolation.lib


Types and Enums

E_NciEntryType

TYPE E_NciEntryType :
(
E_NciEntryTypeNone := 0,
E_NciEntryTypeGeoStart := 1,
E_NciEntryTypeGeoLine := 2,
E_NciEntryTypeGeoCirclePlane := 3,
E_NciEntryTypeGeoBezier3 := 10,
E_NciEntryTypeGeoBezier5 := 11,
E_NciEntryTypeMFuncHsk := 20,
E_NciEntryTypeMFuncFast := 21,
E_NciEntryTypeMFuncResetAllFast := 23,
E_NciEntryTypeHParam := 24,
E_NciEntryTypeSParam := 25,
E_NciEntryTypeTParam := 26,
E_NciEntryTypeDynOvr := 50,
E_NciEntryTypeVertexSmoothing := 51,
E_NciEntryTypeBaseFrame := 52,
E_NciEntryTypePathDynamics := 53,
E_NciEntryTypeAxisDynamics := 55,
E_NciEntryTypeDwellTime := 56,
E_NciEntryTypeTfDesc := 100,
E_NciEntryTypeEndOfTables := 1000
);
END_TYPE

Enum | Matching structure
E_NciEntryTypeNone |
E_NciEntryTypeGeoStart | ST_NciGeoStart
E_NciEntryTypeGeoLine | ST_NciGeoLine
E_NciEntryTypeGeoCirclePlane | ST_NciGeoCirclePlane
E_NciEntryTypeGeoBezier3 | ST_NciGeoBezier3
E_NciEntryTypeGeoBezier5 | ST_NciGeoBezier5
E_NciEntryTypeMFuncHsk | ST_NciMFuncHsk
E_NciEntryTypeMFuncFast | ST_NciMFuncFast
E_NciEntryTypeResetAllFast | ST_NciMFuncResetAllFast
E_NciEntryTypeHParam | ST_NciHParam
E_NciEntryTypeSParam | ST_NciSParam
E_NciEntryTypeTParam | ST_NciTParam
E_NciEntryTypeDynOvr | ST_NciDynOvr
E_NciEntryTypeVertexSmoothing | ST_NciVertexSmoothing
E_NciEntryTypeBaseFrame | ST_NciBaseFrame
E_NciEntryTypePathDynamics | ST_NciPathDynamics
E_NciEntryTypeAxisDynamics | ST_NciAxisDynamics
E_NciEntryTypeDwellTime | ST_NciDwellTime
E_NciEntryTypeTfDesc | ST_NciTangentialFollowingDesc
E_NciEntryTypeEndOfTables | ST_NciEndOfTables

ST_NciGeoStart

TYPE ST_NciGeoStart :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeGeoStart; (* do not override this parameter *)
fPosX: LREAL;
fPosY: LREAL;
fPosZ: LREAL;
fPosQ1: LREAL;
fPosQ2: LREAL;
fPosQ3: LREAL;
fPosQ4: LREAL;
fPosQ5: LREAL;
END_STRUCT
END_TYPE

Sets the start position of the first geometric-entry. Is required if the first geo-entry is a circle or tangential following is ON in the first segment. Optional this structure can be written always by starting the first table.

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
fPosX | LREAL | Start position X
fPosY | LREAL | Start position Y
fPosZ | LREAL | Start position Z
fPosQ1 | LREAL | Start position Q1
fPosQ2 | LREAL | Start position Q2
fPosQ3 | LREAL | Start position Q3
fPosQ4 | LREAL | Start position Q4
fPosQ5 | LREAL | Start position Q5

ST_NciGeoLine

TYPE ST_NciGeoLine :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeGeoLine; (* do not override this parameter *)
nDisplayIndex: UDINT;
fEndPosX: LREAL;
fEndPosY: LREAL;
fEndPosZ: LREAL;
fEndPosQ1: LREAL;
fEndPosQ2: LREAL;
fEndPosQ3: LREAL;
fEndPosQ4: LREAL;
fEndPosQ5: LREAL;
fVelo: LREAL;
bRapidTraverse: BOOL;
bAccurateStop: BOOL; (* VeloEnd := 0 *)
END_STRUCT
END_TYPE

Describes a straight line with a specified velocity.

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
fEndPosX | LREAL | Target position X
fEndPosY | LREAL | Target position Y
fEndPosZ | LREAL | Target position Z
fEndPosQ1 | LREAL | Target position Q1
fEndPosQ2 | LREAL | Target position Q2
fEndPosQ3 | LREAL | Target position Q3
fEndPosQ4 | LREAL | Target position Q4
fEndPosQ5 | LREAL | Target position Q5
fVelo | LREAL | Target path velocity in base units per seconds (e.g. mm/s), similar to F in G-code
bRapidTraverse | BOOL | True has same effect as G0 False handles this entry like G01
bAccurateStop | BOOL | True has the same effect as G60

ST_NciGeoCirclePlane

TYPE ST_NciGeoCirclePlane :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeGeoCirclePlane; (* do not override this parameter *)
nDisplayIndex: UDINT;
fEndPosX: LREAL;
fEndPosY: LREAL;
fEndPosZ: LREAL;
fCenterX: LREAL;
fCenterY: LREAL;
fCenterZ: LREAL;
fEndPosQ1: LREAL;
fEndPosQ2: LREAL;
fEndPosQ3: LREAL;
fEndPosQ4: LREAL;
fEndPosQ5: LREAL;
fVelo: LREAL;
bClockwise: BOOL;
bAccurateStop: BOOL; (* VeloEnd := 0 *)
nPlane: E_NciGeoPlane := E_NciGeoPlaneXY;
END_STRUCT
END_TYPE

Describes a circle in the main plane. The center point is in absolute co-ordinates.

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
fEndPosX | LREAL | Target position X
fEndPosY | LREAL | Target position Y
fEndPosZ | LREAL | Target position Z
fCenterX | LREAL | Center position X in absolute co-ordinates
fCenterY | LREAL | Center position Y in absolute co-ordinates
fCenterZ | LREAL | Center position Z in absolute co-ordinates
fEndPosQ1 | LREAL | Target position Q1
fEndPosQ2 | LREAL | Target position Q2
fEndPosQ3 | LREAL | Target position Q3
fEndPosQ4 | LREAL | Target position Q4
fEndPosQ5 | LREAL | Target position Q5
fVelo | LREAL | Target path velocity in base units per seconds (e.g. mm/s), similar to F in G-code
bClockwise | BOOL | If true, the circle is done clockwise otherwise counterclockwise (similar to G02, G03)
bAccurateStop | BOOL | True has the same effect as G60
nPlane | E_NciGeoPlane | Specifies the plane: XY, YZ, or ZX (similar to G17..G19)

ST_NciGeoBezier3

TYPE ST_NciGeoBezier3:
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeGeoBezier3; (* do not override this parameter *)
nDisplayIndex: UDINT;
fControlPoint1X: LREAL;
fControlPoint1Y: LREAL;
fControlPoint1Z: LREAL;
fControlPoint2X: LREAL;
fControlPoint2Y: LREAL;
fControlPoint2Z: LREAL;
fEndPosX: LREAL;
fEndPosY: LREAL;
fEndPosZ: LREAL;
fEndPosQ1: LREAL;
fEndPosQ2: LREAL;
fEndPosQ3: LREAL;
fEndPosQ4: LREAL;
fEndPosQ5: LREAL;
fVelo: LREAL;
bAccurateStop: BOOL; (* VeloEnd := 0 *)
END_STRUCT
END_TYPE

Describes a bezier of 3rd order with help of control points. Start position is given by previous segment. The third control point is parameterized with the target position.

Eingang | Datentyp | Beschreibung
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
fControlPoint1X | LREAL | X component control point 1
fControlPoint1Y | LREAL | Y component control point 1
... |  |
fControlPoint2Z | LREAL | Z component control point 2
fEndPosX | LREAL | Target position X
fEndPosY | LREAL | Target position Y
fEndPosZ | LREAL | Target position Z
fEndPosQ1 | LREAL | Target position Q1
fEndPosQ2 | LREAL | Target position Q2
fEndPosQ3 | LREAL | Target position Q3
fEndPosQ4 | LREAL | Target position Q4
fEndPosQ5 | LREAL | Target position Q5
fVelo | LREAL | Target path velocity in base units per seconds (e.g. mm/s), similar to F in G-code
bAccurateStop | BOOL | True has the same effect as G60

ST_NciGeoBezier5

since library version 1.1.31

TYPE ST_NciGeoBezier5:
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeGeoBezier5; (* do not override this parameter *)
nDisplayIndex: UDINT;
fControlPoint1X: LREAL;
fControlPoint1Y: LREAL;
fControlPoint1Z: LREAL;
fControlPoint2X: LREAL;
fControlPoint2Y: LREAL;
fControlPoint2Z: LREAL;
fControlPoint3X: LREAL;
fControlPoint3Y: LREAL;
fControlPoint3Z: LREAL;
fControlPoint4X: LREAL;
fControlPoint4Y: LREAL;
fControlPoint4Z: LREAL;
fEndPosX: LREAL;
fEndPosY: LREAL;
fEndPosZ: LREAL;
fEndPosQ1: LREAL;
fEndPosQ2: LREAL;
fEndPosQ3: LREAL;
fEndPosQ4: LREAL;
fEndPosQ5: LREAL;
fVelo: LREAL;
bAccurateStop: BOOL; (* VeloEnd := 0 *)
END_STRUCT
END_TYPE

Describes a bezier of 5th order with help of control points. Start position is given by previous segment. The 5th control point is parameterized with the target position.

Eingang | Datentyp | Beschreibung
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
fControlPoint1X | LREAL | X component control point 1
fControlPoint1Y | LREAL | Y component control point 1
... |  |
fControlPoint4Z | LREAL | Z component control point 4
fEndPosX | LREAL | Target position X
fEndPosY | LREAL | Target position Y
fEndPosZ | LREAL | Target position Z
fEndPosQ1 | LREAL | Target position Q1
fEndPosQ2 | LREAL | Target position Q2
fEndPosQ3 | LREAL | Target position Q3
fEndPosQ4 | LREAL | Target position Q4
fEndPosQ5 | LREAL | Target position Q5
fVelo | LREAL | Target path velocity in base units per seconds (e.g. mm/s), similar to F in G-code
bAccurateStop | BOOL | True has the same effect as G60

ST_NciMFuncHsk

TYPE ST_NciMFuncHsk :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeMFuncHsk; (* do not override this parameter *)
nDisplayIndex: UDINT;
nMFunc: INT;
END_STRUCT
END_TYPE

Describes an m-function of type handshake. The m-function number is between 0 and 159

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
nMFunc | INT | m-function number (0..159)

ST_NciMFuncFast

TYPE ST_NciMFuncFast :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeMFuncFast; (* do not override this parameter *)
nDisplayIndex: UDINT;
nMFuncIn0: INT;
nMFuncIn1: INT;
nMFuncIn2: INT;
nMFuncIn3: INT;
nMFuncIn4: INT;
nMFuncIn5: INT;
nMFuncIn6: INT;
nMFuncIn7: INT;
END_STRUCT
END_TYPE

Parametrizes up to 8 fast m-functions. The first m-function must be assigned to nMFuncIn0, second to nMFuncIn1 and so on. -1 indicates end of assignments.

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
nMFuncIn0 | INT | fast m-function number (0..159)
nMFuncIn1 | INT | fast m-function number (0..159) -1 indicates end of list
nMFuncIn2 | INT | fast m-function number (0..159) -1 indicates end of list
nMFuncIn3 | INT | fast m-function number (0..159) -1 indicates end of list
nMFuncIn4 | INT | fast m-function number (0..159) -1 indicates end of list
nMFuncIn5 | INT | fast m-function number (0..159) -1 indicates end of list
nMFuncIn6 | INT | fast m-function number (0..159) -1 indicates end of list
nMFuncIn7 | INT | fast m-function number (0..159) -1 indicates end of list

ST_NciMFuncResetAllFast

TYPE ST_NciMFuncResetAllFast :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeMFuncResetAllFast; (* do not override this parameter *)
nDisplayIndex: UDINT;
END_STRUCT
END_TYPE

Resets all fast m-functions.

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code

ST_NciHParam

TYPE ST_NciHParam :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeHParam; (* do not override this parameter *)
nDisplayIndex: UDINT;
nHParam: UDINT;
END_STRUCT
END_TYPE

Sets an h-parameter in the cyclic channel interface.

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
nHParam | UDINT | h-parameter from nc to plc

ST_NciSParam

TYPE ST_NciSParam :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeSParam; (* do not override this parameter *)
nDisplayIndex: UDINT;
nSParam: UINT;
END_STRUCT
END_TYPE

Sets an s-parameter in the cyclic channel interface.

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
nSParam | UINT | s-parameter from nc to plc

ST_NciTParam

TYPE ST_NciTParam :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeTParam; (* do not override this parameter *)
nDisplayIndex: UDINT;
nTParam: UINT;
END_STRUCT
END_TYPE

Sets a t-parameter in the cyclic channel interface.

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
nTParam | UINT | t-parameter from nc to plc

ST_NciDynOvr

TYPE ST_NciDynOvr :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeDynOvr; (* do not override this parameter *)
nDisplayIndex: UDINT;
fDynOvr: LREAL;
END_STRUCT
END_TYPE

Modal function to change the path dynamics.

Compare DynOvr in Interpreter documentation.

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
fDynOvr | LREAL | value for dynamic override ( 0.01 < fDynOvr <= 1)

ST_NciVertexSmoothing

since library build 11

TYPE ST_NciVertexSmoothing :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeVertexSmoothing; (* do not override this parameter *)
nDisplayIndex: UDINT;
nType: UDINT; (* type of smoothing, e.g. parabola, bi-quad *)
nSubtype: UDINT; (* e.g. adaptive, constant radius *)
fRadius: LREAL; (* max. radius for tolerance ball *)
END_STRUCT
END_TYPE

Modal function to enable vertex smoothing.

There is a detailed description of the parameter in the interpreter documentation (paramVertexSmoothing) available.

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
nType | UDINT | Type of smoothing (e.g. parabola=2, bi-quadratic=3, bezier 3rd order=4, bezier 5th order=5)
nSubtype | UDINT | 1: constant tolerance radius, 3: adaptive tolerance radius

ST_NciBaseFrame

since library build 21

TYPE ST_NciBaseFrame:
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeBaseFrame; (* do not override this parameter *)
nDisplayIndex: UDINT;
fShfitX: LREAL;
fShiftY: LREAL;
fShiftZ: LREAL;
fRotX: LREAL;
fRotY: LREAL;
fRotZ: LREAL;
fShiftQ1: LREAL;
fShiftQ2: LREAL;
fShiftQ3: LREAL;
fShiftQ4: LREAL;
fShiftQ5: LREAL;
END_STRUCT
END_TYPE

The structure ST_NciBaseFrame describes a modal zero offset shift and rotation. Though the effect is the same as the zero offset shift and rotation in the interpreter. So the point the rotation is done is the current zero point. (compare rotation in Interpreter documentation)

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
fShiftX | LREAL | Zero offst shift in X direction
fShiftY | LREAL | Zero offst shift in Y direction
fShiftZ | LREAL | Zero offst shift in Z direction
fRotX | LREAL | Rotation of X axis
fRotY | LREAL | Rotation of Y axis
fRotZ | LREAL | Rotation of Z axis
fShiftQ1 | LREAL | Offset of Q1 axis
fShfitQ2 | LREAL | Offset of Q2 axis
fShiftQ3 | LREAL | Offset of Q3 axis
fShiftQ4 | LREAL | Offset of Q4 axis
fShiftQ5 | LREAL | Offset of Q5 axis

ST_NciPathDynamics

since library build 22

TYPE ST_NciPathDynamics:
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypePathDynamics; (* do not override this parameter *)
nDisplayIndex: UDINT;
fAcc: LREAL;
fDec: LREAL;
fJerk: LREAL;
END_STRUCT
END_TYPE

The structure ST_NciPathDynamics sets the dynamics (acceleration, deceleration, and jerk) on the path. Though the effect is the same as paramPathDynamics in the interpreter (cf. paramPathDynamics in Interpreter documentation)

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
fAcc | LREAL | max. path acceleration
fDec | LREAL | max. path deceleration
fJerk | LREAL | max. path Jerk

ST_NciAxisDynamics

since library build 30

TYPE ST_NciAxisDynamics:
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeAxisDynamics; (* Do not override this parameter *)
nDisplayIndex: UDINT;
nAxis: UDINT;
fAcc: LREAL;
fDec: LREAL;
fJerk: LREAL;
END_STRUCT
END_TYPE

The structure ST_NciAxisDynamics sets the dynamics (acceleration, deceleration, and jerk) of an axis. The effect is the same as paramAxisDynamics in the interpreter (see paramAxisDynamics in Interpreter documentation)

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
nAxis | UDINT | Axis in the interpolation group X:0 Y:1 Z:2 Q1:3 ... Q5:7
fAcc | LREAL | max. axis acceleration
fDec | LREAL | max. axis deceleration
fJerk | LREAL | max. axis Jerk

ST_NciDwellTime

since library build 30

TYPE ST_NciDwellTime:
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeDwellTime; (* Do not override this parameter *)
nDisplayIndex: UDINT;
fDwellTime: LREAL;
END_STRUCT
END_TYPE

The structure ST_NciDwellTime inserts a dwell in the program (see Dwell Time in Interpreter documentation)

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
nDisplayIndex | UDINT | For displaying purposes, like block number in g-code
fDwellTime | LREAL | Dwell time in seconds

ST_NciTangentialFollowingDesc

TYPE ST_NciTangentialFollowingDesc :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeTfDesc; (* do not override this parameter *)
bTangOn: BOOL;
nTangAxis: E_NciAxesInGroup; (* axis used for tangential following *)
nPathAxis1: E_NciAxesInGroup; (* describing the plane e.g. x *)
nPathAxis2: E_NciAxesInGroup; (* e.g. y ==> g17, xy plane *)
fOffset: LREAL; (* geo tangent is 0 degree, counting is mathmatical positive *)
fCriticalAngle1: LREAL;
nTfBehavior: E_TangentialFollowingBehavior; (* what to do if angle becomes bigger than critical angle 1 *)
END_STRUCT
END_TYPE

This is a modal command to turn on/off the tangential following.

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter
bTangOn | BOOL | If true, tangential following is turned on
nTangAxis | E_NciAxesInGroup | Axis (Q1..Q5) that is used as tangential axis
nPathAxis1 | E_NciAxesInGroup | First path axis, that describes the plane and orientation to calculate the tangent
nPathAxis2 | E_NciAxesInGroup | Second path axis, that describes the plane and orientation to calculate the tangent
fOffset | LREAL | Offset of the tangential axis
fCritialAngle1 | LREAL | Critical angle 1. The reaction if the angle between two segments is bigger than fCriticalAngle1 is specified with nTfBehavior
nTfBehavior | E_TangentialFollowingBehavior | c.f. fCriticalAngle1

ST_NciEndOfTables

TYPE ST_NciEndOfTables :
STRUCT
nEntryType: E_NciEntryType := E_NciEntryTypeEndOfTables; (* do not override this parameter *)
END_STRUCT
END_TYPE

Indicates the last entry of the last table. Is used to signal the bChannelDone-Flag in FB_NciFeedTable.

Input | Data type | Description
nEntryType | E_NciEntryType | Do not override this parameter

E_NciGeoPlane

TYPE E_NciGeoPlane :
(
E_NciGeoPlaneXY := 17,
E_NciGeoPlaneZX := 18,
E_NciGeoPlaneYZ := 19
);
END_TYPE

E_NciAxesInGroup

TYPE E_NciAxesInGroup :
(
NoneAxis := 0,
XAxis,
YAxis,
ZAxis,
Q1Axis,
Q2Axis,
Q3Axis,
Q4Axis,
Q5Axis
);
END_TYPE

E_TangentialFollowingBehavior

TYPE E_TangentialFollowingBehavior :
(
E_TfIngoreAll, (* don't care about critical angle *)
E_TfErrorOnCritical1 (* if angle becomes greater than critical angle1 ==> error *)
);
END_TYPE

Development Environment | Target System | PLC Libraries to include
TwinCAT v2.10.0 | PC (i386) | TcPlcInterpolation.lib