Library.ReadSubDeviceRegister Method
Reads data from a SubDevice's register.
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<byte[]> ReadSubDeviceRegister(
EcatHandle subDevice,
ushort offset,
uint length
)
Parameters
subDevice
Type: EcatHandle
A handle to a SubDevice. To retrieve the corresponding handle, use OpenSubDeviceByIndex, OpenSubDeviceByStationAddress, or OpenSubDeviceByExplicitId.
offset
Type: UInt16
The offset within the SubDevice's register to start reading.
length
Type: UInt32
The length, in bytes, of the data to be read from the specified offset. The valid range is 1-512.
Return Value
This method returns a CommandStatus<byte[]> class. The read result is stored in property Value. If an error occurs, property State 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. |
See Also: