FB_EcGetScannedSlaves

FB_EcGetScannedSlaves 1:

Function Block FB_EcGetConfSlaves generates a List of all scanned Slaves from the Master object directory. A scan of the EtherCAT network is automatically generated inside the FB.

VAR_INPUT

VAR_INPUT
    bExecute            : BOOL;
    sNetId              : T_AmsNetId; 
    pArrEcConfSlaveInfo : POINTER TO ARRAY[0..EC_MAX_SLAVES] OF ST_EcSlaveScannedData;
    cbBufLen            : UDINT;    
    tTimeout            : TIME := DEFAULT_ADS_TIMEOUT; 
END_VAR

bExecute: The block is activated by a rising edge at this input.

sNetId: This is a string that contains the AMS network identifier of the EtherCAT master device.

pArrEcConfSlaveInfo : The address (pointer) of the receive buffer. Receive buffer is a array of struct with type ST_EcSlaveScannedData with the data of each scanned slave.

cbBufLen:The maximum available buffer size for the data to be read, in bytes.

tTimeout: Maximum time allowed for the execution of the function block.

VAR_OUTPUT

VAR_OUTPUT
    bBusy       : BOOL;
    bError      : BOOL;
    nErrId      : UDINT;
    nSlaves     : UINT;
ND_VAR

bBusy: This output is set when the function block is activated and remains set until an acknowledgement is received.

bError: This output is set up after the bBusy output has been reset if there has been an error in transmission of the command.

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

nSlaves: Returns the number of configured slaves.

Requirements

Development environment

Target system type

PLC libraries to be linked

TwinCAT v2.10.0 or higher

PC or CX (x86)

TcEtherCAT.lib
( Standard.Lib; TcBase.Lib; TcSystem.Lib, TcUtilities.Lib are included automatically )

TwinCAT v2.10.0 Build >= 1301 or higher

CX (ARM)