第三方North机器人设备的驱动程序和实用程序
north-devices的Python项目详细描述
北方设备(north_devices
)
north_devices
库包含可在北方使用的第三方设备的驱动程序和实用程序
机器人生态系统。
安装
运行pip install north_devices
进行安装,或将north_devices
添加到requirements.txt
文件中。
泵(north_devices.pumps
)
帝肯卡夫罗(tecan_cavro
)
有一个用于Tecan Cavro系列泵的驱动程序,它使用二进制协议与 卡夫罗泵在网络上。
用法
fromftdi_serialimportSerialfromnorth_devices.pumps.tecan_cavroimportTecanCavroserial=Serial(baudrate=38400)# Cavro pumps default to 9600cavro=TecanCavro(serial,address=0,syringe_volume_ml=1000)TecanCavro.home_all()# Homes all TecanCavro pump instances# you can perform absolute and relative moves in counts or mL, with optional velocitycavro.move_absolute_counts(500)cavro.move_absolute_ml(1000,velocity_counts=500)cavro.move_relative_counts(100,velocity_counts=1000)cavro.move_relative_ml(500)# you can change valve positions with `move_valve`cavro.move_valve(1)# moves valve to port 1# there is also a higher-level dispense method that pumps from a port to a portcavro.dispense_ml(2000,from_port=1,to_port=2)# you can also batch a series of commands to be sent at oncecavro.start_batch()cavro.move_valve(1)cavro.move_absolute_ml(500)cavro.move_valve(2)cavro.move_absolute_ml(0)cavro.execute()# you can use the `broadcast=True` flag to execute batch commands for all pumps at once# there is also a basic loop command that can be used in a batch commandcavro.loop_start()cavro.move_valve(1)cavro.move_absolute_ml(500)cavro.move_valve(2)cavro.move_absolute_ml(0)cavro.loop_end(10)# loop 10 timescavro.execute()# multiple cavro instances can share the same serial connection if they are on a networknetwork=Serial(baudrate=9600)cavro1=TecanCavro(network,0)cavro2=TecanCavro(network,1)# you can send batch commands to multiple cavros then execture them simultaneouslycavro1.start_batch()cavro1.move_relative_ml(100)cavro2.start_batch()cavro2.move_absolute_ml(100)TecanCavro.broadcast_execute(cavro1,cavro2)# this will broadcast to all pumps if none given