完成了所有功能的测试,基本无问题,不全了注释,完善了初始化功能

This commit is contained in:
2024-09-26 14:04:49 +08:00
parent c88015ff78
commit 4b832b3ed1
2 changed files with 48 additions and 25 deletions

View File

@@ -66,6 +66,10 @@ def initialization():
# 关闭缩减模式
md.r_reduced_mode(0)
# 打开软限位
clibs.logger.info("打开软限位开关...")
hr.set_soft_limit_params(enable=True)
# 关闭安全区域
clibs.logger.info("正在关闭所有的安全区,并关闭总使能开关...")
hr.set_safety_area_overall(False)
@@ -73,9 +77,11 @@ def initialization():
for i in range(10):
hr.set_safety_area_enable(i, False)
# 打开外部通信
# 打开外部通信,并设置控制器时间同步
clibs.logger.info("配置并打开外部通信默认服务器8080端口后缀为 \"\\r\"...")
hr.set_socket_params(True, "8080", "\r", 1)
ec = openapi.ExternalCommunication()
ec.modify_system_time(time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(time.time())))
# 关闭拖动
clibs.logger.info("关闭拖动模式...")