FB_NciFeedTablePreparation

FB_NciFeedTablePreparation 1:

The function block FB_NciFeedTablePreparation appends an entry of a specific type to the feed table (stFeedGroupTable). An appended entry can generate more than one row in the table. If the table has not enough free rows, an error is returned and no entry is added to the table. In this case the entry either has to be added to another table or to the same table, after FB_NciFeedTable was executed. This function block deals with modal functions, such as tangential following. It is therefore important to always use the same instance of this function block. The function block can be called repeatedly in a PLC cycle.

VAR_INPUT

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

nEntryType: Specifies the entry type, e.g. line, circle, tangential following

pEntry: Pointer to entry structure – must match nEntryType

bResetTable: If bResetTable is TRUE, the table ‚stFeedGroupTable’ is set to zero and nFilledRows is also set to zero. If nErrorId = ErrNciFeedTableFull, this error is reset. All modal flags (such as tangential following) remain constant.

bResetAll: Like bResetTable. In addition, all modal flags are set to their default values, and all error IDs are reset.

VAR_IN_OUT

VAR_IN_OUT
    stFeedGroupTable : ST_NciFeedGroupTable
END_VAR

stFeedGroupTable: Table containing the rows for the NC kernel.

VAR_OUTPUT

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

nFilledRows: Number of filled rows.

bError: Becomes TRUE as soon as an error has occurred.

nErrorId: 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).

Notice If bResetTable, bResetAll, or bError is true, no further entries are accepted.

Notice The error code 0x4B72 indicates that the table is full and the last entry was not accepted.

Example:

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);

Requirements

Development environment

Target platform

PLC libraries to be linked

TwinCAT v3.1.0

PC or CX (x86 or x64)

Tc2_PlcInterpolation