1. 获取类功能都添加 @property 装饰器

2. 修复 Modbus 安全区相关的功能
3. 重新调整了建联的逻辑
This commit is contained in:
2024-09-24 21:30:35 +08:00
parent b381ee92f5
commit 5a52f6262d
3 changed files with 187 additions and 59 deletions

View File

@@ -1,13 +1,14 @@
import time
import openapi
import json
import clibs
def initialization():
hr = openapi.HmiRequest()
pd = openapi.PreDos()
# 推送配置文件
robot_params = hr.get_robot_params()
robot_params = hr.get_robot_params
robot_type = robot_params["robot_type"]
security_type = robot_params["security_type"]
controller_type = robot_params["controller_type"]
@@ -86,12 +87,13 @@ def initialization():
hr.set_quickturn_pos(enable_drag=True)
hr.move2quickturn("drag")
while True:
if md.w_robot_moving():
if md.w_robot_is_moving:
time.sleep(1)
else:
break
hr.stop_move(1)
hr.switch_motor_state("off")
hr.close()
# 清除所有告警
md.r_clear_alarm()