FB_EcFoeAccess

FB_EcFoeAccess 1:

This functionblock writes or reads data via the communication port of the "File access over EtherCAT" mailbox protocol.

VAR_INPUT

VAR_INPUT
    hFoe      : T_HFoe;
    pBuffer   : DWORD;    
    cbBuffer  : UDINT;
    bExecute  : BOOL; 
    tTimeout  : TIME := DEFAULT_ADS_TIMEOUT; 
END_VAR

hFoe: "File access over EtherCAT" handle.

pBuffer:  Contains the data of the buffer in which the data is to be read (read access) or the address of the buffer which contains the data to be written (write access). The buffer can be a single variable, an array, or a structure, whose addresse can be determined with the ADR operator.

cbBuffer: Contains the number of the data to be written or read, in bytes

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

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

VAR_OUTPUT

VAR_OUTPUT
    bBusy   : BOOL;
    bError  : BOOL;
    nErrId  : UDINT;
    cbDone  : UDINT;
    bEOF    : BOOL;
END_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.

cbDone: Number of  last successfully written or read data bytes.

bEOF: End of File. This output is switched to TRUE if the end of file is reached (for read access). This variable is irrelevant for write access

Requirements

Development Environment

Target System

 PLC Libraries to include

TwinCAT v2.10.0 or higher

PC or CX (x86)
CX (ARM)

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