통합 예제 - A-Series 전용 명령어
Pseudo Flange Serial을 이용하여 robotiq 2f를 제어하는 예제입니다
예제 : robotiq 2f
Def recv_data():
Res, data = flange_serial_read(3) #timeout 3s
If res == -1:
#Exception Handling Required
tp_log(“Response time out!!”)
elif res == -2
#Exception Handling Required
tp_log(“Buffer Overflow!!”)
else :
if Modbus_recv_check(data) == True:
tp_log(“recv size [“+str(res)+”] :” +str(data))
else
#Exception Handling Required
tp_log(“CRC Check Fail!!”)
flange_serial_open(baudrate=115200, bytesize=DR_EIGHTBITS, parity=DR_PARITY_NONE, stopbits = DR_STOPBITS_ONE)
wait(0.1)
#Step1:Activation Request(clear Act)
flange_serial_write(modbus_send_make(b"\x09\x10\x03\xE8\x00\x03\x06\x00\x00\x00\x00\x00\x00"))
res, data = flange_serial_read()
#Step1:Activation Request(set Act)
flange_serial_write(modbus_send_make(b"\x09\x10\x03\xE8\x00\x03\x06\x01\x00\x00\x00\x00\x00"))
res, data = flange_serial_read()
#Step 2: Read Gripper status until the activation is completed
flange_serial_write(modbus_send_make(b"\x09\x03\x07\xD0\x00\x01"))
res, data = flange_serial_read()
#Step 3: Move the robot to the pick-up location
wait(1)
#Step 4: Close the Gripper at full speed and full force
flange_serial_write(modbus_send_make(b"\x09\x10\x03\xE8\x00\x03\x06\x09\x00\x00\xFF\xFF\xFF"))
res, data = flange_serial_read()
#Step 5: Read Gripper status until the grasp is completed
flange_serial_write(modbus_send_make(b"\x09\x03\x07\xD0\x00\x03"))
res, data = flange_serial_read()
#Step 6: Move the robot to the release location
wait(1)
#Step 7: Open the Gripper at full speed and full force
flange_serial_write(modbus_send_make(b"\x09\x10\x03\xE8\x00\x03\x06\x09\x00\x00\x00\xFF\xFF"))
res, data = flange_serial_read()
#Step 8: Read Gripper status until the opening is completed
flange_serial_write(modbus_send_make(b"\x09\x03\x07\xD0\x00\x03"))
res, data = flange_serial_read()
flange_serial_close()