Api.CoeWriteSdoObject method
Writes the value of an SDO object through CANopen over EtherCAT (CoE). The module table is different for each module and can be obtained in the user manual of the module. This method takes multiple cycles to finish.
Namespace: IntervalZero.KINGSTAR.OpcUa.Api
Assembly: IntervalZero.KINGSTAR.OpcUa.Api (in IntervalZero.KINGSTAR.OpcUa.Client.dll) Version: 4.4.0.0
Syntax
public KsCommandStatus CoeWriteSdoObject(
int SlaveId,
int ObIndex,
int ObSubIndex,
bool CompleteAccess,
byte[] Value
)
Public Function CoeWriteSdoObject(
SlaveId As Integer,
ObIndex As Integer,
ObSubIndex As Integer,
CompleteAccess As Boolean,
Value As Byte[]
) As KsCommandStatus
Parameters
SlaveId
Type: int
The slave index. This index value is automatically assigned by the KINGSTAR master when the EtherCAT network starts, based on the physical connection order. The first device connected directly to the master is assigned Index 0, followed by Index 1, Index 2, and so on. These indexes remain consistent within the slave array even if devices are added, removed, or reconnected. Please refer to the use cases in HotConnect, Repair, and Restart for more details.
ObIndex
Type: int
The CANopen index of the object. See your device manual to get the value.
ObSubIndex
Type: int
The CANopen subindex of the object. See your device manual to get the value.
CompleteAccess
Type: bool
TRUE: Writes all subindexes. FALSE: Writes a single subindex.
Value
Type: byte[]
The buffer containing the data to be written to the object.
Return value
Type: KsCommandStatus
Returns the KsCommandStatus class.
Remarks
Used to update the drive configuration while the drive is disabled. You should read the drive's manual to learn when and how to use the SDO. If you call this method when the drive is enabled, an error may occur, depending on the response of your drive.
Usable EtherCAT states
ecatPreOP, ecatSafeOP, ecatOP
Examples
N/A
See also