improvment
This commit is contained in:
@@ -8,6 +8,7 @@ def initialization():
|
||||
hr = openapi.HmiRequest()
|
||||
pd = openapi.PreDos()
|
||||
# 推送配置文件
|
||||
clibs.logger.info("推送配置文件 fieldbus_device.json/registers.json/registers.xml 到控制器,并配置 IO 设备,设备号为 5...")
|
||||
robot_params = hr.get_robot_params
|
||||
robot_type = robot_params["robot_type"]
|
||||
security_type = robot_params["security_type"]
|
||||
@@ -55,33 +56,41 @@ def initialization():
|
||||
md.r_soft_estop(1)
|
||||
|
||||
# 断开示教器连接
|
||||
clibs.logger.info("断开示教器连接...")
|
||||
hr.switch_tp_mode("without")
|
||||
|
||||
# 清空 system IO 配置
|
||||
clibs.logger.info("清空所有的 System IO 功能配置...")
|
||||
hr.update_system_io_configuration([], [], [], [], [])
|
||||
|
||||
# 关闭缩减模式
|
||||
md.r_reduced_mode(0)
|
||||
|
||||
# 关闭安全区域
|
||||
clibs.logger.info("正在关闭所有的安全区,并关闭总使能开关...")
|
||||
hr.set_safety_area_overall(False)
|
||||
hr.set_safety_area_signal(False)
|
||||
for i in range(10):
|
||||
hr.set_safety_area_enable(i, False)
|
||||
|
||||
# 打开外部通信
|
||||
clibs.logger.info("配置并打开外部通信,默认服务器,8080端口,后缀为 \"\\r\"...")
|
||||
hr.set_socket_params(True, "", "name", "8080", "\r", 1, True, True, 0, 10)
|
||||
|
||||
# 关闭拖动
|
||||
clibs.logger.info("关闭拖动模式...")
|
||||
hr.set_drag_params(False, 1, 2)
|
||||
|
||||
# 关闭碰撞检测
|
||||
clibs.logger.info("关闭碰撞检测...")
|
||||
hr.set_collision_params(False, 0, 1, 100)
|
||||
|
||||
# 清除所有错误码
|
||||
# 清除所有过滤错误码
|
||||
clibs.logger.info("清除所有过滤错误码设定...")
|
||||
hr.set_filtered_error_code("clear", [])
|
||||
|
||||
# 回拖动位姿
|
||||
clibs.logger.info("正在回拖动位姿...")
|
||||
hr.switch_operation_mode("manual")
|
||||
hr.switch_motor_state("on")
|
||||
hr.set_quickturn_pos(enable_drag=True)
|
||||
|
||||
Reference in New Issue
Block a user