syringe_pump
korobka.pumps.syringe_pump
¤
Module for working with KDScientific Legato 180 syringe pump using RS485 Protocol.
Uses the BaseSerial class for serial communication.
Classes¤
PumpStatus
¤
Bases: NamedTuple
Parsed fields of a Legato status reply.
SyringePump(port, baudrate=115200, timeout=1)
¤
Bases: BaseSerial
Handles direct communication with the syringe pump over RS485.
:param port: Serial port for the pump. :param baudrate: Communication baud rate (default: 115200). :param timeout: Serial read timeout (default: 1s).
Initializes the pump communication using BaseSerial.
:param port: Serial port for the pump. :param baudrate: Communication baud rate (default: 115200). :param timeout: Serial read timeout (default: 1s).
Source code in korobka/pumps/syringe_pump.py
74 75 76 77 78 79 80 81 82 | |
Methods:¤
config_syringe(diameter, volume)
¤
Configures syringe properties.
:param diameter: Diameter of the syringe. :param volume: Volume of the syringe.
Source code in korobka/pumps/syringe_pump.py
84 85 86 87 88 89 90 91 92 93 | |
infuse(rate, volume, units='ml/min')
¤
Operates the pump to infuse a given volume at a given rate.
:param rate: Infuse rate. :param volume: Infuse volume in ml. :param units: Units, eg 'ml/min'.
Source code in korobka/pumps/syringe_pump.py
215 216 217 218 219 220 221 222 223 224 225 226 227 228 | |
read_status()
¤
Queries the pump and returns its parsed status.
:return: Parsed status fields. :raises ValueError: If no status line can be found in the reply.
Source code in korobka/pumps/syringe_pump.py
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |
stop()
¤
Stops the pump immediately.
Source code in korobka/pumps/syringe_pump.py
126 127 128 129 | |
wait_for_target(poll_interval=0.2, timeout_lim=600)
¤
Polls the pump until the target volume is reached.
:param poll_interval: Pause between polls. The serial read itself already costs roughly 1.5 s btw. :param timeout_lim: Timeout. :raises RuntimeError: If the pump stalls or status becomes unreadable. :raises TimeoutError: If the target is not reached within timeout_lim.
Source code in korobka/pumps/syringe_pump.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 | |
withdraw(rate, volume, units='ml/min')
¤
Operates the pump to withdraw a given volume at a given rate.
For most cases rate can be set to 'max'.
:param rate: Withdraw rate. :param volume: Withdraw volume in ml. :param units: Units, eg 'ml/min'.
Source code in korobka/pumps/syringe_pump.py
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | |