FB_EcMasterFrameStatistic

FB_EcMasterFrameStatistic 1:

The function block FB_EcMasterFrameStatistic can be used to read the frame statistics of the EtherCAT master. A distinction is made between cyclic and acyclic (queued) frames. Acyclic frames are used for the initialization or for parameter access to EtherCAT slaves. Frames are regarded as lost if they fail to return to the master or are invalid.
The number of lost frames (i.e. lost or invalid cyclic frames), the number of cyclic frames per second, the number of lost queued frames (i.e. lost or invalid acyclic frames) and the number of queued frames per second is provided at the function block output.

FB_EcMasterFrameStatistic 2: Inputs

VAR_INPUT
    sNetId   : T_AmsNetId; 
    bExecute : BOOL;
    tTimeout : TIME := DEFAULT_ADS_TIMEOUT; 
END_VAR

Name

Type

Description

sNetId

T_AmsNetId

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

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_EcMasterFrameStatistic 3: Outputs

VAR_OUTPUT
    bBusy                  : BOOL;
    bError                 : BOOL;
    nErrId                 : UDINT;
    nLostFrames            : UDINT;
    fFramesPerSecond       : LREAL;
    nLostQueuedFrames      : UDINT;
    fQueuedFramesPerSecond : LREAL;
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.

nLostFrames

UDINT

Returns the current number of lost or invalid cyclic frames.

fFramesPer
Second

LREAL

Returns the current number of cyclic frames per second.

nLostQueuedFrames

UDINT

Returns the current number of lost or invalid queued (acyclic) frames.

fQueuedFramesPerSecond

LREAL

Returns the current number of queued (acyclic) frames per second.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.0

PC or CX (x86, x64, ARM)

Tc2_EtherCAT