Skip to content

Online Programming File Management ProjectManagement

It is used for the distribution and management of online programming files. The following is a detailed description of the member functions of the distribution and management of online programming files ProjectManagement, including the method prototype, parameter description, return value, and usage demo.

Send files rm_send_project()

  • Method prototype:
python
rm_send_project(self, send_project: rm_send_project_t) -> tuple[int, int]:

Jump to rm_send_project_t for details of the structure

  • Parameter description:
ParameterTypeDescription
send_projectrm_send_project_tFile data to be sent.
  • Return value:tuple[int, int]: a tuple containing two elements.
  1. int: state codes executed by functions.
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.
-5intFile name check failed.
-5intFile reading failed.
  1. int: If the operation fails, this parameter returns the number of error lines
ParameterTypeDescription
0intThe check data length is incorrect.
Other valuesintNumber of error lines.
-1intNo error, the file has been successfully sent.
  • Usage demo
python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)

# Create the robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

# Save the online programming file with the ID 8 and planned speed ratio of 50% to the controller, and execute the file. 
file_path = "../TestDatas/example.txt"
send_project = rm_send_project_t(file_path, 50, 0, 8, 0, 0, 0)
print(arm.rm_send_project(send_project))

arm.rm_delete_robot_arm()

Get online program list rm_get_program_trajectory_list()

  • Method prototype:
python
rm_get_program_trajectory_list(self, page_num: int, page_size: int, vague_search: str) -> tuple[int, dict[str, any]]:
  • Parameter description:
ParameterTypeDescription
page_numintPage.
page_sizeintPage size.
vague_searchstrVague search.
  • Return value:tuple[int, dict[str,any]]: a tuple containing two elements.
  1. int: state codes executed by functions.
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.
  1. Online programming list dictionary
ParameterTypeDescription
rm_program_trajectorys_tdict[str,any]Obtained online programming list dictionary, key: field names of rm_program_trajectorys_t.
  • Usage demo
python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)

# Create the robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

# Vaguely search "a" online programming file
print(arm.rm_get_program_trajectory_list(1, 10, "a"))

arm.rm_delete_robot_arm()

Start running the specified trajectoryrm_set_program_id_run()

  • Method prototype:
python
rm_set_program_id_run(self, tra_id: int, speed: int, timeout: int) -> int:
  • Parameter description:
ParameterTypeDescription
tra_idintRun the specified ID, 1-100. The trajectory will be executed if it exists.
speedint1-100, the speed of the trajectory to be run. If set to 0, it will run at the stored speed.
timeoutintBlocking settings:
multi-thread mode: 0: non-blocking mode, immediately return after sending commands; 1: blocking mode, return after the robotic arm reaches the target position or the planning fails; single-thread mode: 0: non-blocking mode; other values: blocking mode, and timeout period setting, in s.
  • Return value: State codes executed by functions:
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.
-4intThe running has stopped, but the successful running information is not received. The trajectory may have stopped outside the range.
  • Usage demo
python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)

# Create the robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

# Run the online programming with the ID 8 at 20% speed in a blocking mode
print(arm.rm_set_program_id_run(8, 20, 1))

arm.rm_delete_robot_arm()

Query the online program running state rm_get_program_run_state()

  • Method prototype:
python
rm_get_program_run_state(self) -> tuple[int, dict[str, any]]:
  • Return value:tuple[int, dict[str,any]]: a tuple containing two elements.
  1. int: state codes executed by functions.
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.
  1. Online programming running state dictionary
ParameterTypeDescription
rm_program_run_state_tdict[str,any]Obtained online programming running state dictionary, key: field names of rm_program_run_state_t.
  • Usage demo
python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)

# Create the robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

print(arm.rm_get_program_run_state())

arm.rm_delete_robot_arm()

Delete the specified trajectoryrm_delete_program_trajectory()

  • Method prototype:
python
rm_delete_program_trajectory(self, tra_id: int) -> int:
  • Parameter description:
ParameterTypeDescription
tra_idintID of specified trajectory.
  • Return value: State codes executed by functions:
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
python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)

# Create the robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

print(arm.rm_delete_program_trajectory(8))

arm.rm_delete_robot_arm()

Modify the information of the specified trajectoryrm_update_program_trajectory()

  • Method prototype:
python
rm_update_program_trajectory(self, tra_id: int, speed: int, name: str) -> int:
  • Parameter description:
ParameterTypeDescription
tra_idintID of specified trajectory.
speedintUpdated planned speed ratio, 1-100.
namestrUpdated file name.
  • Return value: State codes executed by functions:
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
python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)

# Create the robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

print(arm.rm_update_program_trajectory(8, 20, "test"))

arm.rm_delete_robot_arm()

Set the ID of program that the IO runs by default rm_set_default_run_program()

  • Method prototype:
python
rm_set_default_run_program(self, tra_id: int) -> int:
  • Parameter description:
ParameterTypeDescription
tra_idintSet the ID of online programming file that the IO runs by default. It is configurable from 0 to 100. 0 means canceling the setting.
  • Return value: State codes executed by functions:
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
python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)

# Create the robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

print(arm.rm_set_default_run_program(8))

arm.rm_delete_robot_arm()

Get the ID of program that the IO runs by default rm_get_default_run_program()

  • Method prototype:
python
rm_get_default_run_program(self) -> tuple[int, int]:
  • Return value:tuple[int,int]: a tuple containing two elements.
  1. int: state codes executed by functions.
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.
  1. ID of online programming file
ParameterTypeDescription
-intObtained online programming running state dictionary, key: field names of rm_program_run_state_t.
  • Usage demo
python
from Robotic_Arm.rm_robot_interface import *

# Instantiate the RoboticArm class
arm = RoboticArm(rm_thread_mode_e.RM_TRIPLE_MODE_E)

# Create the robotic arm connection and print the connection ID
handle = arm.rm_create_robot_arm("192.168.1.18", 8080)
print(handle.id)

print(arm.rm_get_default_run_program())

arm.rm_delete_robot_arm()