ItpBlocksearch

ItpBlocksearch 1:

The function block ItpBlocksearch sets the interpreter to the point defined at the inputs. The input values can be taken from function block ItpGetBlocksearchData or set manually. Once the interpreter has been set to the defined location with ItpBlocksearch, the motion can continue with ItpStepOnAfterBlocksearch at the position indicated at output sStartPosition.

VAR_INPUT
bExecute          : BOOL;
nBlockId          : UDINT;
eBlockSearchMode  : E_ItpBlockSearchMode;
eDryRunMode       : E_ItpDryRunMode;
fLength           : LREAL;
sPrgName          : STRING(255);
nPrgLength        : UDINT;
tTimeOut          : TIME;
sAxesList         : ST_ItpAxes;
sOptions          : ST_ItpBlockSearchOptions;
END_VAR

bExecute: The command is triggered by a rising edge at this input.

nBlockId: Block number or EntryCounter of the segment in the NC program used as starting point.

eBlockSearchMode:Defines whether the specified nBlockId is a block number (e.g. N4711) or continuous EntryCounter. A prerequisite for using the block number is that it is unique. See E_ItpBlockSearchMode

eDryRunMode: Defines which program lines are executed and which are skipped. See E_ItpDryRunMode

fLength:Remaining length within the segment selected with nBlockId in percent.

sPrgName:Name or path of the program to be executed.

nPrgLength: Indicates the length of string sPrgName.

tTimeOut: ADS timeout delay

sAxesList: Definition of the axes in the NCI group. See ST_ItpAxes

sOptions: Provides information on retrace.

VAR_IN_OUT
sNciToPlc         : NciChannelToPlc;
END_VAR

sNciToPlc: The structure of the cyclic channel interface between NCI and PLC. This structure is only accessed for reading. See NciChannelToPlc

VAR_OUTPUT
bBusy             : BOOL;
bErr              : BOOL;
nErrId            : UDINT;
bDone             : BOOL;
sStartPosition    : ST_ItpBlockSearchStartPosition;
END_VAR

bBusy: Remains TRUE until the function block has executed a command request, but no longer than the time specified at the 'Timeout' input. While Busy = TRUE, no new command will be accepted at the inputs.

bErr: Becomes TRUE if an error occurs while executing the command. The command-specific error code is contained in 'nErrId'. Is reset to FALSE by the execution of a command at the inputs.

nErrId: Contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of a command at the inputs. The error numbers in ErrId can be looked up in the ADS error documentation or in the NC error documentation (error codes above 0x4000).

bDone: The output becomes TRUE when the command was executed successfully.

sStartPosition: Indicates the start position from which the NC program continues. The individual axes should be moved to this position before ItpStepOnAfterBlocksearch is executed. See ST_ItpBlockSearchStartPosition

E_ItpBlockSearchMode

E_ItpBlockSearchMode is used to define in which way the block search is executed.

TYPE E_ItpBlockSearchMode :
(
ItpBlockSearchMode_Disable        := 0,
ItpBlockSearchMode_BlockNo        := 1,
ItpBlockSearchMode_EntryCounter   := 2
);
END_TYPE

ItpBlockSearchMode_Disable: Block search disabled (initial value).

ItpBlockSearchMode_BlockNo: The block search is executed via the block number (e.g. N4711) programmed by the user in the NC program. A prerequisite is that the user-defined block number is unique.

ItpBlockSearchMode_EntryCounter: The block search is executed via a unique EntryCounter. This EntryCounter is implicitly unique, but it is not visible to the user in the NC program.

E_ItpDryRunMode

E_ItpDryRunMode defines how blocks are handled, which are located before the block in which the block search is started, when the program is executed.

TYPE E_ItpDryRunMode :
(
ItpDryRunMode_Disable             := 0,
ItpDryRunMode_SkipAll             := 1,
ItpDryRunMode_SkipMotionOnly      := 2,
ItpDryRunMode_SkipDwellAndMotion  := 3
);
END_TYPE

ItpDryRunMode_Disable: DryRun disabled (initial value).

ItpDryRunMode_SkipAll: All previous blocks are skipped. R-parameters are written.

ItpDryRunMode_SkipMotionOnly: Only movement blocks are skipped. R-parameters are written, and dwell times and M-functions are executed.

ItpDryRunMode_SkipDwellAndMotion: Movement blocks and dwell times are skipped. R-parameters are written and M-functions are executed.

ST_ItpAxes

The structure ST_ItpAxes contains the axes that were in the NCI group during program execution.

TYPE ST_ItpAxes :
STRUCT
nAxisIds          : ARRAY[1..8] OF UDINT;
END_STRUCT
END_TYPE

nAxisIds: Array of axes that were in the NCI group. The order is nAxisIds[1]=X, nAxisIds[2]=Y, nAxisIds[3]=Z, nAxisIds[4]=Q1, nAxisIds[5]=Q2… The axis ID can be read from the cyclic axis interface.

St_ItpBlockSearchOptions

The structure contains information on the retrace functionality.

TYPE ST_ItpBlockSearchOptions :
STRUCT
bIsRetrace        : BOOL:= FALSE;
bRetraceBackward  : BOOL:= FALSE;
END_STRUCT
END_TYPE

bIsRetrace: Indicates whether the retrace functionality is active.

bRetraceBackward: Indicates whether reverse movement took place on the path.

ST_ItpBlockSearchStartPosition

The structure indicates the position at which the NC program continues after a block search. The user is responsible for moving the axes to the corresponding positions.

TYPE ST_ItpBlockSearchStartPosition :
STRUCT
fStartPosition    : ARRAY[1..8] OF LREAL;
END_STRUCT
END_TYPE

fStartPosition: Array of axis positions at which the NC program continues.

The order is fStartPosition[1]=X, fStartPosition [2]=Y, fStartPosition [3]=Z, fStartPosition [4]=Q1, fStartPosition [5]=Q2…