Library.RequestState Method

Requests a MainDevice to switch to a specified EtherCAT state.

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 RequestState(
    EcatHandle mainDevice,
    EcatState state
)

Parameters

mainDevice

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

state

Type: EcatState
A requested EtherCAT state.

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.

ecatErrWrongParameter

One of the following conditions occurred:

  • Parameter mainDevice is invalid.
  • Parameter state is invalid.

ecatErrMainDeviceNotReady

The MainDevice instance does not exist.

ecatErrWrongEnvironment

One of the following conditions occurred:

  • State requests are not allowed when Stop is in progress.
  • Parameter state is ecatStateOffline when the MainDevice is stopped.

See Also: