FB_EcFoeOpen

FB_EcFoeOpen 1:

This function block opens the communication port for the "File access over EtherCAT" mailbox protocol.

VAR_INPUT

VAR_INPUT
    sNetId      : T_AmsNetId;
    nPort       : UINT;     
    sPathName   : T_MaxString;
    dwPass      : DWORD;
    eMode       : E_EcFoeMode;
    bExecute    : BOOL; 
    tTimeout    : TIME := DEFAULT_ADS_TIMEOUT; 
END_VAR

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

nPort: Fixed address of the EtherCAT device.

sPathName: Path name ( e.g.: 'c:\TwinCAT\FOE\Data.fwp' ).

dwPass: Password.

eMode: Access mode (write/read access).

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;
    hFoe        : T_HFoe;
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.

hFoe: "File access over EtherCAT"-Handle.

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, TcUtilities.Lib are included automatically )