Library.OpenSubDeviceByStationAddress Method

Opens a SubDevice by its station address.

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

Syntax

Copy
public EcatErrorCode OpenSubDeviceByStationAddress(
    EcatHandle mainDevice,
    ref EcatHandle subDevice,
    ushort stationAddress
)

Parameters

mainDevice

Type: EcatHandle
A handle to a MainDevice. To retrieve the corresponding handle, use CreateMainDevice or OpenMainDevice.

subDevice

Type: EcatHandle
A reference to a SubDevice handle.

stationAddress

Type: UInt16
The station address of a SubDevice.

Return Value

EcatErrorCode is thrown when any of these errors occur:

Error code Meaning

ecatErrNoError

The function succeeded.

ecatErrNullParameter

Parameter subDevice is null.

ecatErrWrongParameter

One of the following conditions occurred:

  • Parameter mainDevice is invalid.
  • Parameter stationAddress is invalid.

ecatErrMainDeviceNotReady

The MainDevice is not ready.

ecatErrWrongEnvironment

The MainDevice has not started.

See Also: