ReadAxisSdoObject

Reads a value of an SDO object from an axis.

Syntax

KsCommandStatus ReadAxisSdoObject(
     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: the index of the object. See your device manual to get the value.

ObSubIndex: the subindex of the object. See your device manual to get the value.

CompleteAccess: TRUE: reads all subindexes. FALSE: reads a single subindex.

Value: pointer to the value to be read.

Length: the length in byte of the value to read.

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

ReadIOSdoObject

WriteAxisSdoObject

WriteIOSdoObject