FB_EcGetSlaveCrcErrorEx

FB_EcGetSlaveCrcErrorEx 1:

The function block FB_EcGetSlaveCrcErrorEx allows the CRC error counters of the individual ports (A, D, B and C) of a slave to be read. If the call is successful, the output variable crcError, whose type is ST_EcCrcErrorEx, contains the requested CRC error counter.

The function block FB_EcGetSlaveCrcErrorEx can also be used with slaves with up to 4 ports (e.g. EK1122). The function block FB_EcGetSlaveCrcError can only be used with slaves with up to 3 ports (e.g. EK1100).

FB_EcGetSlaveCrcErrorEx 2: Inputs

VAR_INPUT
    sNetId      :  T_AmsNetId; (*AmsNetId of the EtherCAT master device*)
    nSlaveAddr  :  UINT; (*Address of the slave device*)
    bExecute    :  BOOL; (*Function block execution is triggered by a rising edge at this input.*)
    tTimeout    :  TIME; (*States the time before the function is cancelled.*)
END_VAR

Name

Type

Description

sNetId

T_AmsNetId

String containing the AMS network ID of the EtherCAT master device (type: T_AmsNetId).

nSlaveAddr

UINT

Fixed address of the EtherCAT slaves whose CRC error counter is to be read.

bExecute

BOOL

The function block is activated by a positive edge at this input.

tTimeout

TIME

Maximum time allowed for the execution of the function block.

FB_EcGetSlaveCrcErrorEx 3: Outputs

VAR_OUTPUT
    bBusy     :  BOOL;
    bError    :  BOOL;
    nErrId    :  UDINT;
    CrcError  :  ST_EcCrcErrorEx; (*Crc error of the EtherCAT slave device*)
END_VAR

Name

Type

Description

bBusy

BOOL

This output is set when the function block is activated, and remains set until a feedback is received.

bError

BOOL

This output is set after the bBusy output has been reset when an error occurs in the transmission of the command.

nErrId

UDINT

Supplies the ADS error code associated with the most recently executed command if the bError output is set.

CrcError

ST_EcCrcErrorEx

CRC error counter of the individual ports
(type: ST_EcCrcErrorEx)

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_EtherCAT