FB_EcFoeAccess
This function block writes or reads data via the communication port of the “File access over EtherCAT” mailbox protocol.
Inputs
VAR_INPUT
hFoe : T_HFoe;
pBuffer : DWORD;
cbBuffer : UDINT;
bExecute : BOOL;
tTimeout : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR
Name | Type | Description |
---|---|---|
hFoe | "File access over EtherCAT" handle | |
pBuffer | DWORD | Contains the address of the buffer into which the data are to be read (read access) or the address of buffer containing the data to be written (write access). The buffer can be a single variable, an array or a structure, whose address can be found with the ADR operator. |
cbBuffer | UDINT | Contains the number of data bytes to be written or 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. |
Outputs
VAR_OUTPUT
bBusy : BOOL;
bError : BOOL;
nErrId : UDINT;
cbDone : UDINT;
bEOF : BOOL;
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. |
cbDone | UDINT | Number of the most recent successfully written or read data bytes |
bEOF | BOOL | End of File, this variable becomes TRUE if the end of the file is reached during read access. For write access this variable has no purpose. |
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v3.1.0 | PC or CX (x86, x64, ARM) | Tc2_EtherCAT |