Library.WriteAxisSdoObject Method

Writes an object value to an axis through the CANopen over EtherCAT (CoE) SDO method.

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 CommandStatus WriteAxisSdoObject(
    EcatHandle axis,
    ushort obIndex,
    byte obSubIndex,
    bool completeAccess,
    byte[] value,
    bool priority
)

Parameters

axis

Type: EcatHandle
A handle to an axis. To retrieve the corresponding handle, use OpenAxisByIndex or OpenAxisByLocation.

obIndex

Type: UInt16
An object index in the object dictionary.

obSubIndex

Type: Byte
An object subindex in the object dictionary.

completeAccess

Type: Boolean
true to write all subindexes, false to write a single subindex.

value

Type: Byte[]
A buffer that contains an object value to write to the axis.

priority

Type: Boolean
true to use a higher priority queue, false otherwise.

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

Parameter value is null.

ecatErrWrongParameter

One of the following conditions occurred:

  • Parameter axis is invalid.
  • Parameter value is 0 or greater than 128.

ecatErrMainDeviceNotReady

The MainDevice is not ready.

ecatErrWrongEnvironment

The SDO buffer is full.

ecatErrFeatureUnavailable

One of the following conditions occurred:

  • The SubDevice doesn't support CoE.
  • The axis is a simulated axis, which does not support SDO reading and writing.

ecatErrWrongSubDeviceState

The feature can't be used in the current SubDevice state. The mailbox functionality requires at least a PreOp state to execute.

Remarks

This method does not support writing to simulated axes.

See Also: