PLC Library: NCI Interpreter

The TwinCAT library TcNci.lib contains function blocks for operation of the NC interpreter from the PLC.

The following function blocks are contained in the TcNci.lib library.

Function block

Description

ItpConfirmHsk

Acknowledges an M-function of type handshake

ItpDelDtgEx

Triggers “Delete Distance to go” in the NC

ItpEnableDefaultGCode

Executes a user-defined standard G-Code before the start of each NC program

ItpEStopEx

Triggers the NCI EStop

ItpGetBlockNumber

Provides the block number of the NC program for the cyclic interface

ItpGetBottleNeckLookAheadEx

Provides the value of the look-ahead for bottleneck detection

ItpGetBottleNeckModeEx

Provides the response mode for bottleneck detection

ItpGetChannelId

Provides the channel ID

ItpGetChannelType

Provides the channel type of the cyclic interface

ItpGetCyclicLRealOffsets

Provides the index offset of the LREAL variables used in the cyclic channel interface

ItpGetCyclicUdintOffsets

Provides the index offset of the UDINT variables used in the cyclic channel interface

ItpGetError

Provides the error number

ItpGetGroupAxisIds

Provides the axis IDs that were configured for the group

ItpGetGroupId

Provides the group ID

ItpGetHParam

Provides the current H-parameter from the NC

ItpGetHskMFunc

Provides the current M-function number of type handshake

ItpGetItfVersion

Provides the current version of the cyclic interface

ItpGetOverridePercent

Provides the channel override in percent

ItpGetSParam

Provides the current S-parameter from the NC

ItpGetStateInterpreter

Provides the current interpreter state

ItpGetTParam

Provides the current T-parameter from the NC

ItpGetVersion

Provides the version number of this library

ItpGoAheadEx

Triggers the GoAhead function (decoder stop with external trigger event)

ItpHasError

Determines whether an error is present

ItpIsFastMFunc

Determines whether the M-function number provided is present in the form of a fast M-function

ItpIsEStopEx

Determines whether an EStop is executed or pending

ItpIsHskMFunc

Determines whether an M-function of type handshake is present

ItpLoadProgEx

Loads an NC program using program names

ItpReadCyclicLRealParam1

Reads the first LReal parameter from the cyclic channel interface

ItpReadCyclicUdintParam1

Reads the first UDINT parameter from the cyclic channel interface

ItpReadRParamsEx

Reads arithmetic parameters

ItpReadToolDescEx

Reads the tool description from the NC

ItpReadZeroShiftEx

Reads the zero offset shift from the NC

ItpResetEx2

Carries out a reset of the interpreter or of the NC channel

ItpResetFastMFuncEx

Resets a fast signal bit

ItpSetBottleNeckLookAheadEx

Sets the value of the look-ahead for bottleneck detection

ItpSetBottleNeckModeEx

Sets the response mode when bottleneck detection is switched on

ItpSetCyclicLRealOffsets

Sets the index offsets of the LREAL variables used in the cyclic channel interface

ItpSetCyclicUdintOffsets

Sets the index offsets of the UDINT variables used in the cyclic channel interface

ItpSetOverridePercent

Sets the channel override in percent

ItpSetSubroutinePathEx

Optionally sets the search path for subroutines

ItpSetToolDescNullEx

Sets all tool parameters (including number and type) to zero

ItpSetZeroShiftNullEx

Set all zero offset shifts to null

ItpSingleBlock

Enables or disables the single block mode in the NCI.

ItpStartStopEx

Starts or stops the interpreter (NC channel)

ItpStepOnAfterEStopEx

Enables further processing of the parts program after an NCI EStop

ItpWriteRParamsEx

Writes arithmetic parameters

ItpWriteToolDescEx

Writes the tool description into the NC

ItpWriteZeroShiftEx

Writes the zero offset shift into the NC

Block search (for description of the functionality see Blocksearch)

ItpBlocksearch

Sets the interpreter to a user-defined location, so that NC program execution continues from this point.

ItpGetBlocksearchData

Reads the current state after an NC program interruption.

ItpStepOnAfterBlocksearch

Starts the motion after a block search.

Retrace

ItpEnableFeederBackup

Enables the backup list for retracing

ItpIsFeederBackupEnabled

Reads whether the backup list for retracing is active

ItpIsFirstSegmentReached

Reads whether the start position is reached during retracing

ItpIsFeedFromBackupList

Reads whether feeder entries were sent from the backup list

ItpIsMovingBackwards

Reads whether backward movement occurs on the current path

ItpRetraceMoveBackward

Performs a backward movement on the path

ItpRetraceMoveForward

Performs a forward movement on the path. This is called to cancel retracing.

Requirements

The library to be integrated depends on the TwinCAT version. From TwinCAT version 2.8 TcNci.lib should be used. For older versions TcNciItp.lib should be used. The interface for the function blocks etc. of both libraries is the same.

Development environment

Target platform

PLC libraries to include

TwinCAT v2.7.0

PC (i386)

TcNciItp.lib

from TwinCAT v2.8.0

PC (i386)

TcNci.lib

Function blocks for compatibility with existing programs:

PLC Library: NCI Interpreter 1:

Function blocks for compatibility

The purpose of the function blocks listed is to ensure compatibility with existing projects. It is not advisable to use these function blocks for new projects. Instead, the equivalent function blocks shown in the table above should be used.

Function block

Description

ItpDelDtg

Triggers “Delete Distance to go” in the NC

ItpEStop

Triggers the NCI EStop

ItpGetBottleNeckLookAhead

Provides the value of the look-ahead for bottleneck detection

ItpGetBottleNeckMode

Provides the response mode for bottleneck detection

ItpGoAhead

Triggers the GoAhead function

ItpIsEStop

Determines whether an EStop is executed or pending

ItpLoadProg

Loads an NC program using program names

ItpReadRParams

Reads arithmetic parameters

ItpReadToolDesc

Reads the tool description from the NC

ItpReadZeroShift

Reads the zero offset shift from the NC

ItpReset

Carries out a reset of the interpreter or of the NC channel

ItpResetEx

Carries out a reset of the interpreter or of the NC channel.

ItpResetFastMFunc

Resets a fast signal bit

ItpSetBottleNeckLookAhead

Sets the value of the look-ahead for bottleneck detection

ItpSetBottleNeckMode

Sets the response mode when bottleneck detection is switched on

ItpSetSubroutinePath

Optionally sets the search path for subroutines

ItpSetToolDescNull

Sets all tool parameters (including number and type) to zero

ItpSetZeroShiftNull

Sets all origins to zero

ItpStartStop

Starts or stops the interpreter (NC channel)

ItpStepOnAfterEStop

Enables further processing of the parts program after an NCI EStop

ItpWriteRParams

Writes arithmetic parameters

ItpWriteToolDesc

Writes the tool description into the NC

ItpWriteZeroShift

Writes the zero offset shift into the NC