ItpGetError

ItpGetError 1:

ItpGetError is a function that returns the error number. A description of the NC error codes can be found here.

VAR_IN_OUT

VAR_IN_OUT
    sNciToPlc           : NCTOPLC_NCICHANNEL_REF;
END_VAR

sNciToPlc: The structure of the cyclic channel interface from the NCI to the PLC. This structure is only accessed for reading. (type: NCTOPLC_NCICHANNEL_REF)

Return value

ItpGetError: Error number

ItpGetError 2:

ItpGetError evaluates the variable 'nItpErrCode' from the cyclic interface.

Sample

VAR
    bItpError      : BOOL;
    nErrId         : UDINT;
    sNciToPlc AT%I*: NCTOPLC_NCICHANNEL_REF;
END_VAR
bItpError := ItpHasError( sNciToPlc );
IF bItpError THEN
    nErrId := ItpGetError( sNciToPlc );
    …
END_IF

Requirements

Development environment

Target platform

PLC libraries to be linked

TwinCAT v3.1.0

PC or CX (x86 or x64)

Tc2_NCI