6.2.4 Method WriteByIndex

The Method WriteByIndex can be used to access the POWERLINK Object Dictionary by Index and Sub-Index to write values of POWERLINK Objects.

Signature

	WriteByIndex (
		[in]	UInt16		Index
		[in]	Byte			SubIndex
		[in]	BaseDataType	Data
		[out]	UInt32		PowerlinkAbortCode
		);
	
Argument Description
IndexIndex of the POWERLINK Object in the POWERLINK Object Dictionary
SubIndexSub-Index of the POWERLINK Object in the POWERLINK Object Dictionary
DataData to be written to the POWERLINK Object
PowerlinkAbortCode

SDO Abort Code as defined in EPSG DS 301

Some of the SDO Abort Codes defined in POWERLINK are mapped to an OPC UA ResultCode, see table for ‘Method Result Codes’

Method Result Codes

ResultCode SDO Abort Code Description
Good0The write access was successful
Bad_ResourceInvalid-The POWERLINK Device is not available, the output argument PowerlinkAbortCode will be set to 0x0504 0000 (timeout)
Bad_NotFound0x0602 0000Object does not exist in the POWERLINK Object Dictionary
0x0609 0011Sub-Index does not exist
Bad_Timeout0x0504 0000The operation timed out / SDO protocol timed out
Bad_NotSupported0x0601 0000Unsupported access to an POWERLINK Object
Bad_NotWritable0x0601 0002Attempt to write a read-only POWERLINK Object
Bad_OutOfRange0x0609 0030Value range of parameter exceeded
0x0609 0031Value of parameter written too high
0x0609 0032Value of parameter written too low
Bad_TypeMismatch0x0607 0010length of service parameter does not match
0x0607 0012length of service parameter too high
0x0607 0013length of service parameter too low
Bad_CommunicationErrorAll other SDO Abort Codes