Skip to content

System Configuration controllerConfig

This document is prepared to get the controller state, control the power, clear the error, set the wired network IP address, and get the software information.

Get the controller state rm_get_controller_state()

  • Method prototype:
C
int rm_get_controller_state(rm_robot_handle * handle,float * voltage,float * current,float * temperature,int * err_flag )

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
voltageOutputReturned voltage.
currentOutputReturned current.
temperatureOutputReturned temperature.
err_flagOutputController runtime error code.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • Usage demo
C
//Get the controller state
float voltage = 0;                                                            
float current = 0;                                                            
float temperature = 0;                                                        
int sys_err = 0;                                                         
ret = rm_get_controller_state(robot_handle, &voltage, &current, &temperature, &sys_err);

Set the robotic arm power rm_set_arm_power()

  • Method prototype:
C
int rm_set_arm_power(rm_robot_handle * handle,int arm_power)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
arm_powerInput1: power on, 0: power off.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • Usage demo
C
//Control the robotic arm power
ret = rm_set_arm_power(robot_handle, 1);

Get the power state of the robotic arm rm_get_arm_power_state()

  • Method prototype:
C
int rm_get_arm_power_state(rm_robot_handle * handle,int * power_state)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
power_stateOutputObtained power state of the robotic arm, 1: power on, 0: power off.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • Usage demo
C
//Get the power state of the robotic arm
int power;
ret = rm_get_arm_power_state(robot_handle,&power);

Get the cumulative runtime of the controller rm_get_system_runtime()

  • Method prototype:
C
int rm_get_system_runtime(rm_robot_handle * handle,int * day,int * hour,int * min,int * sec
)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
dayOutputRead time.
hourOutputRead time.
minOutputRead time.
secOutputRead time.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • Usage demo
C
//Get the cumulative runtime of the controller
char state = 0;
int day;
int hour;
int min;
int sec;
ret = rm_get_system_runtime(robot_handle, &day, &hour, &min, &sec);

Clear the cumulative runtime of the controller rm_clear_system_runtime()

  • Method prototype:
C
int rm_clear_system_runtime(rm_robot_handle * handle)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • Usage demo
C
//Clear the cumulative runtime of the controller
ret = rm_clear_system_runtime(robot_handle);

Get the cumulative rotation angle of the joint rm_get_joint_odom()

  • Method prototype:
C
int rm_get_joint_odom(rm_robot_handle * handle,float * joint_odom)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
joint_odomOutputSave the cumulative rotation angle array of each joint.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • Usage demo
C
//Get the cumulative rotation angle of the joint
float odom[7];
ret = rm_get_joint_odom(robot_handle,odom);

Clear the cumulative rotation angle of the joint rm_clear_joint_odom()

  • Method prototype:
C
int rm_clear_joint_odom(rm_robot_handle * handle)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • Usage demo
C
//Clear the cumulative rotation angle of the joint
ret = rm_clear_joint_odom(robot_handle);

Set the wired network IP address rm_set_NetIP()

  • Method prototype:
C
int rm_set_NetIP(rm_robot_handle * handle,const char * ip)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
ipOutputWired network IP address.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • Usage demo
C
//Set the wired network IP address
ret = rm_set_NetIP(robot_handle,(char*)"192.168.1.19");

Clear the system error rm_clear_system_err()

  • Method prototype:
C
int rm_clear_system_err(rm_robot_handle * handle)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • Usage demo
C
//Clear the system error
ret = rm_clear_system_err(robot_handle);

Get the software information of the robotic arm rm_get_arm_software_info()

  • Method prototype:
C
int rm_get_arm_software_info(rm_robot_handle * handle,rm_arm_software_version_t * software_info)

Jump to rm_robot_handle and rm_arm_software_version_t for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
software_infoInputStructure for the robotic arm software information.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • Usage demo
C
//Get the software information of the robotic arm
rm_arm_software_version_t info;
ret = rm_get_arm_software_info(robot_handle, &info);

Get the controller RS485 mode rm_get_controller_RS485_mode()

  • Method prototype:
C
int rm_get_controller_RS485_mode(rm_robot_handle * handle,int * mode,int * baudrate,int * timeout)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
modeOutputSave the mode. 0: RS485 serial communication by default, 1: modbus-RTU master mode, 2: modbus-RTU slave mode.
baudrateOutputSave the baud rate.
timeoutInputmodbus protocol timeout period in 100 ms, available only in modbus-RTU mode.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • Usage demo
C
int mode;
int baudrate;
int timeout;
ret = rm_get_controller_RS485_mode(robot_handle, &mode, &baudrate, &timeout);

Get the tool RS485 mode rm_get_tool_RS485_mode()

  • Method prototype:
C
int rm_get_tool_RS485_mode(rm_robot_handle * handle,int * mode,int * baudrate,int * timeout)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
modeOutputSave the mode. 0: RS485 serial communication by default, 1: modbus-RTU master mode, 2: modbus-RTU slave mode.
baudrateOutputSave the baud rate.
timeoutInputmodbus protocol timeout period in 100 ms, available only in modbus-RTU mode.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.
  • Usage demo
C
int mode;
int baudrate;
int timeout;
ret = rm_get_tool_RS485_mode(robot_handle, &mode, &baudrate, &timeout);

Get the joint software version rm_get_joint_software_version()

  • Method prototype:
C
int rm_get_joint_software_version(rm_robot_handle * handle,int * version)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
versionOutputObtained software version array of each joint.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.

Note: The obtained joint software version must be converted to hexadecimal. For example, if the obtained joint software version is 54536, it is converted to hexadecimal D508, so the current joint software version is Vd5.0.8.

  • Usage demo
C
//Get the joint software version
float ver[6] = {0};
ret = rm_get_joint_software_version(robot_handle,ver);

Get the software version of the end interface board rm_get_tool_software_version()

  • Method prototype:
C
int rm_get_tool_software_version(rm_robot_handle * handle,int * version)

Jump to rm_robot_handle for details of the structure

  • Parameter description:
ParameterTypeDescription
handleInputRobotic arm handle.
versionOutputObtained software version array of each joint.
  • Return value:
ParameterTypeDescription
0intSuccess.
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.
-1intThe data transmission fails, indicating that a problem occurs during the communication.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.

Note: The obtained software version of the end interface board must be converted to hexadecimal. For example, if the obtained software version is 393, it is converted to hexadecimal 189, so the current software version is V1.8.9.

  • Usage demo
C
//Get the software version of the end interface board
int ver = 0;                                                                       
ret = rm_get_tool_software_version(robot_handle,&ver);