IApi.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.Base.ApiAssembly: IntervalZero.KINGSTAR.Base.Api (in IntervalZero.KINGSTAR.Base.dll) Version: 4.4.0.0
Syntax
KsCommandStatus CoeWriteSdoObject(
int SlaveId,
int ObIndex,
int ObSubIndex,
bool CompleteAccess,
byte[] Value
)
Function CoeWriteSdoObject(
SlaveId As Integer,
ObIndex As Integer,
ObSubIndex As Integer,
CompleteAccess As Boolean,
Value As Byte()
) As KsCommandStatus
Parameters
SlaveId
Type: int
The index of a slave array. When EtherCAT is started, this index has the same value as the SlaveId, which corresponds to the position of the slave in the network. Please note that after EtherCAT is started in the Operational (Op) state, any addition or removal of slaves from the network will change the position of the slaves in the network (SlaveId). Nevertheless, the index of the slave will remain the same. Newly added devices will be added in the back of the slave array. For all slaves after the change, the index and SlaveId will no longer match. This behavior is only available for physical devices; simulated devices are inapplicable. Please refer to the use cases in EnableHotConnect 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