Skip to main content

NRC_ecatGetCommand(unsigned int axisNum, unsigned int index, unsigned int subindex, unsigned char* value, unsigned int size)

Read the value of a certain command word of the servo

Type

int =>Read the value of a certain command word of the servo

Return valueDescription
0The function is called successfully
-101Invalid input parameter
-102The target object does not exist. This typically occurs when the system initialization is incomplete, and calling other functions may return this value
-103The target object is currently in an inoperable state

Parameter Option

ParameterTypeDescription
axisNumunsigned intAxis number of the robot
indexunsigned intCommand word code
subindexunsigned intCommand word subcode
valueunsigned char*The result is stored in this pointer and returned
sizeunsigned intThe number of bytes of the value corresponding to the command word

Sample code

unsigned short value = 0;
NRC_ecatGetCommand(1, 0x6041, 0, (unsigned char* )&value, sizeof(value));
printf("value=%d\n", value);
unsigned int value = 0;
NRC_ecatGetCommand(3, 0x202C, 0, (unsigned char* )&value, sizeof(value));
printf("value=%d\n", value);