3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish
3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish

Integrated Example - Serial(Flange I/O)

Example 1) Controls a Robotiq 2F using Pseudo Flange Serial. 

Python
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() 


Example 2) Controls a onRobot RC6 V2 using New Flange Serial

Python
# select port (1,2)
# If your robot is A, you can select 1 only
port = 1

tp_log("===START OPEN===")
flange_serial_write(modbus_send_make(b"\x41\x06\x00\x00\x01\x2c"), port)
wait(1)
res, data = flange_serial_read(1,port )
wait(1)

flange_serial_write(modbus_send_make(b"\x41\x06\x00\x01\x03\xe8"), port )
wait(1)
res, data = flange_serial_read(1,1)
wait(1)

flange_serial_write(modbus_send_make(b"\x41\x06\x00\x02\x00\x01"), port )
wait(1)
res, data = flange_serial_read(1,port )
wait(1)


tp_log("===START CLOSE===")
flange_serial_write(modbus_send_make(b"\x41\x06\x00\x00\x01\x2c"), port )
wait(1)
res, data = flange_serial_read(1,port )
wait(1)

flange_serial_write(modbus_send_make(b"\x41\x06\x00\x01\x00\x00"), port )
wait(1)
res, data = flange_serial_read(1,port )
wait(1)

flange_serial_write(modbus_send_make(b"\x41\x06\x00\x02\x00\x01"), port )
wait(1)
res, data = flange_serial_read(1,port )
wait(1)