Library.FoeWriteFileFromFile Method

Writes a file from the local machine to a SubDevice.

Namespace:  IntervalZero.MaxRT.Ecat.Api.NetApi
Assembly:  IntervalZero.MaxRT.Ecat (in IntervalZero.MaxRT.Ecat.dll) Version: 1.0.0.0 (File version: 1.0.1)

Syntax

Copy
public CommandStatus FoeWriteFileFromFile(
    EcatHandle subDevice,
    bool bootState,
    string name,
    uint password,
    string file
)

Parameters

subDevice

Type: EcatHandle
A handle to a SubDevice. To retrieve the corresponding handle, use OpenSubDeviceByIndex, OpenSubDeviceByStationAddress, or OpenSubDeviceByExplicitId.

bootState

Type: Boolean
Set to true to switch to Bootstrap (Boot) state when using File over EtherCAT (FoE), set to false otherwise.

name

Type: String
The file name to write to the SubDevice.

password

Type: UInt32
The password to access the file in a SubDevice. Set the value to zero (0) if there is no password.

file

Type: String
The file path that stores the data to write to the SubDevice.

Return Value

This method returns a CommandStatus class. If an error occurs, property State in CommandStatus is set to ecatCommandError, and the error code is stored in property ErrorId.

Possible errors:

Error code Meaning

ecatErrNoError

The function succeeded.

ecatErrNullParameter

One of the following conditions occurred:

  • Parameter name is null.
  • Parameter file is null.

ecatErrWrongParameter

One of the following conditions occurred:

  • Parameter subDevice is invalid.
  • Parameter name is 0 or greater than the size that the mailbox can process.
  • Parameter file is 0.

ecatErrMainDeviceNotReady

The MainDevice is not ready.

ecatErrFeatureUnavailable

The SubDevice doesn't support FoE.

ecatErrNoFile

The file path is invalid or inaccessible.

See Also: