def t1():
pose = get_actual_tcp_pose()
x = pose[0]
y = pose[1]
z = pose[2]
socket_open("192.168.230.1",23333,"socket_1")
socket_send_string(str(x)+","+str(y),"socket_1")
sleep(5)
# 此处用延时5秒是为了上位机方便监控数据,实际使用时无需sleep
end
def t1():
pose = get_actual_tcp_pose()
x = pose[0]
y = pose[1]
z = pose[2]
socket_open("192.168.230.1",23333,"socket_1")
socket_send_string(str(x)+","+str(y),"socket_1")
sleep(5)
# 此处用延时5秒是为了上位机方便监控数据,实际使用时无需sleep
end
发送的程序为sec开头,属于second 程序,不会打断机器人前台正在执行的程序(sec 程序中不可发送带有需要耗费时间的指令,例如move等)
sec t1(): pose = get_actual_tcp_pose() x = pose[0] y = pose[1] z = pose[2] socket_open("192.168.230.1",23333,"socket_1") socket_send_string(str(x)+","+str(y),"socket_1") sleep(5) # 此处用延时5秒是为了上位机方便监控数据,实际使用时无需sleep end