Library.RequestSubDeviceState Method
Requests a SubDevice to go into a specified EtherCAT state. For example, if the current state is Op and the requested state is PreOp, the SubDevice changes the device's state as follows: Op → SafeOp → PreOp. Similarly, if the current state is Init and the requested state is Op, the SubDevice changes the device state as follows: Init → PreOp → SafeOp → Op.
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
public CommandStatus RequestSubDeviceState(
EcatHandle subDevice,
EcatState state
)
Parameters
subDevice
Type: EcatHandle
A handle to a SubDevice. To retrieve the corresponding handle, use OpenSubDeviceByIndex, OpenSubDeviceByStationAddress, or OpenSubDeviceByExplicitId.
state
Type: EcatState
The 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:
|
|
ecatErrMainDeviceNotReady |
The MainDevice is not ready. |
Passing the returned command status to GetCommandStatus updates the command’s status. If an error occurs during the execution of the command in the system, GetCommandStatus will record the error in the returned command status. For more details, see EcatErrorCode.
See Also: