Skip to content

Appendix: API2 Error Codes

API2 Return Value Definition

  • C/C++: The interface returns an error code. A return value of 0 indicates success. Other return values can be looked up in the table below.
  • Python: The interface returns a tuple in the form of (RetVal, data). RetVal is the error code. A return value of 0 indicates success. Other return values can be looked up in the table below. Data represents the retrieved information.

API2 Error Codes

ParameterTypeDescriptionHandling Suggestions
0intSuccess.-
1intThe controller returns false, indicating that the parameters are sent incorrectly or the robotic arm state is wrong.- Validate JSON Command:
① Enable DEBUG logs for the API to capture the raw JSON data.
② Check JSON syntax: Ensure correct formatting of parentheses, quotes, commas, etc. (You can use a JSON validation tool).
③ Verify against the API documentation that parameter names, data types, and value ranges comply with the specifications.
④ After fixing the issues, resend the command and check if the controller returns a normal status code and business data.
- Check Robot Arm Status:
① Check for real-time error messages in the robot arm controller or logs (such as hardware failures, over-limit conditions), and reset, calibrate, or troubleshoot hardware issues according to the prompts.
② After fixing the issues, resend the command and check if the controller returns a normal status code and business data.
-1intThe data transmission fails, indicating that a problem occurs during the communication.Check Network Connectivity:
Use tools like ping/telnet to check if the communication link with the controller is normal.
-2intThe data reception fails, indicating that a problem occurs during the communication, or the controller has a return timeout.- Check Network Connectivity:
Use tools like ping/telnet to check if the communication link with the controller is normal.
- Verify Version Compatibility:
① Check if the controller firmware version supports the current API functions. For specific version compatibility, refer to the Version Description.
② If the version is too low, upgrade the controller or use an API version that is compatible.
- Call the ModbusTCP interface: Applicable only when reading from or writing to the ModbusTCP device of the controller. After creating the robot arm control handle, you must call the rm_set_modbustcp_mode() interface; otherwise, no return value will be received.
-3intThe return value parse fails, indicating that the received data format is incorrect or incomplete.Verify Version Compatibility:
① Check if the controller firmware version supports the current API functions. For specific version compatibility, refer to the Version Description.
② If the version is too low, upgrade the controller or use an API version that is compatible.
-4intThe current in-position equipment verification fails, indicating the current in-position equipment is not the joints/elevators/grippers/dexterous hands.- Detect Concurrent Control by Multiple Devices: Check if other devices are sending motion commands to the robot arm, including the motion of the robot arm, gripper, dexterous hand, and elevator.
- Monitor Command Events in Real-Time: Register the callback function rm_get_arm_event_call_back:
① Capture device arrival events (such as motion completion, timeout, etc.).
② Determine the specific device type that triggered the event through the device parameter in the callback.
-5intThe single-thread mode does not receive a return value after the timeout, indicating that the timeout period may be improper.- Check Timeout Setting: In single-thread blocking mode, it supports configuring the timeout for waiting for the device to complete its motion. Ensure that the timeout is set longer than the device's motion time.
- Check Network Connectivity:
Use tools like ping/telnet to check if the communication link with the controller is normal.

WARNING

The following interfaces do not use the above error codes. Please refer to the error code list in the corresponding interface documentation.

  • Inverse kinematics function rm_algo_inverse_kinematics(): C/C++, Python;
  • Save the drag teaching trajectory rm_save_trajectory(): C/C++, Python;
  • Set the 6-DoF Drag Mode rm_set_force_drag_mode(): C/C++, Python;
  • Get the 6-DoF Drag Mode rm_get_drag_teach_sensitivity(): C/C++, Python;
  • Release gripperrm_set_gripper_release(): C/C++, Python;
  • Gripper force-controlled graspingrm_set_gripper_pick(): C/C++, Python;
  • Gripper continuous force-controlled graspingrm_set_gripper_pick_on(): C/C++, Python;
  • Set gripper to a specified positionrm_set_gripper_position(): C/C++, Python;
  • Run dexterous hand target gesture sequence number rm_set_hand_posture(): C/C++, Python;
  • Run dexterous hand action sequence number rm_set_hand_seq(): C/C++, Python;
  • Send files rm_send_project(): C/C++, Python;
  • Run Specified Trajectory rm_set_program_id_run(): C/C++, Python;
  • Initialize thread mode rm_init(): C/C++, Python;
  • Delete the specified robotic arm instance rm_delete_robot_arm(): C/C++, Python;
  • Get basic information of robotic arm rm_get_robot_info(): C/C++, Python;