C, C++:
System ConfigurationcontrollerConfig
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:
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:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
voltage | Output | Returned voltage. |
current | Output | Returned current. |
temperature | Output | Returned temperature. |
err_flag | Output | Controller runtime error code. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
//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, ¤t, &temperature, &sys_err);
Set the robotic arm power rm_set_arm_power()
- Method prototype:
int rm_set_arm_power(rm_robot_handle * handle,int arm_power)
Jump to rm_robot_handle for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
arm_power | Input | 1: power on, 0: power off. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
//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:
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:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
power_state | Output | Obtained power state of the robotic arm, 1: power on, 0: power off. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
//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:
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:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
day | Output | Read time. |
hour | Output | Read time. |
min | Output | Read time. |
sec | Output | Read time. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
//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:
int rm_clear_system_runtime(rm_robot_handle * handle)
Jump to rm_robot_handle for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
//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:
int rm_get_joint_odom(rm_robot_handle * handle,float * joint_odom)
Jump to rm_robot_handle for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
joint_odom | Output | Save the cumulative rotation angle array of each joint. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
//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:
int rm_clear_joint_odom(rm_robot_handle * handle)
Jump to rm_robot_handle for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
//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:
int rm_set_NetIP(rm_robot_handle * handle,const char * ip)
Jump to rm_robot_handle for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
ip | Output | Wired network IP address. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
//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:
int rm_clear_system_err(rm_robot_handle * handle)
Jump to rm_robot_handle for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
//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:
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:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
software_info | Input | Structure for the robotic arm software information. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
//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:
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:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
mode | Output | Save the mode. 0: RS485 serial communication by default, 1: modbus-RTU master mode, 2: modbus-RTU slave mode. |
baudrate | Output | Save the baud rate. |
timeout | Input | modbus protocol timeout period in 100 ms, available only in modbus-RTU mode. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
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:
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:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
mode | Output | Save the mode. 0: RS485 serial communication by default, 1: modbus-RTU master mode, 2: modbus-RTU slave mode. |
baudrate | Output | Save the baud rate. |
timeout | Input | modbus protocol timeout period in 100 ms, available only in modbus-RTU mode. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The return value parse fails, indicating that the received data format is incorrect or incomplete. |
- Usage demo
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:
int rm_get_joint_software_version(rm_robot_handle * handle,int * version)
Jump to rm_robot_handle for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
version | Output | Obtained software version array of each joint. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The 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
//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:
int rm_get_tool_software_version(rm_robot_handle * handle,int * version)
Jump to rm_robot_handle for details of the structure
- Parameter description:
Parameter | Type | Description |
---|---|---|
handle | Input | Robotic arm handle. |
version | Output | Obtained software version array of each joint. |
- Return value:
Parameter | Type | Description |
---|---|---|
0 | int | Success. |
1 | int | The controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong. |
-1 | int | The data transmission fails, indicating that a problem occurs during the communication. |
-2 | int | The data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout. |
-3 | int | The 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
//Get the software version of the end interface board
int ver = 0;
ret = rm_get_tool_software_version(robot_handle,&ver);