WriteAxisSdoObject
Writes a value of an SDO object into an axis.
Syntax
KsCommandStatus WriteAxisSdoObject(
int Index,
int ObIndex,
int ObSubIndex,
BOOL CompleteAccess,
BYTE* Value,
int Length
);
Parameters
Index: the index of an axis. Indexes are zero based. Aliases affect this parameter.
ObIndex: index of the object. See your device manual to get the value.
ObSubIndex: subindex of the object. See your device manual to get the value.
CompleteAccess: TRUE: writes all subindexes. FALSE: writes a single subindex.
Value: pointer to the buffer containing the data to be written into the object.
Length: length in byte of the value to write.
Return value
Returns the KsCommandStatus structure.
Usable EtherCAT states
ecatOP
Example
Copy
BYTE MOPDisplay = 0;
BYTE MOP = 8;
Command = WaitForCommand(6, TRUE, ReadAxisSdoObject(0, 0X6061, 0, FALSE, &MOPDisplay, 1));
if (!Command.Error && MOPDisplay != 8)
{
Command = WaitForCommand(6, TRUE, WriteAxisSdoObject(0, 0X6060, 0, TRUE, &MOP, 1));
}
Requirements
RT | Win32 | |
---|---|---|
Minimum supported version | 4.0 | 4.0 |
Header | ksapi.h | ksapi.h |
Library | KsApi_Rtss.lib | KsApi.lib |
See also