ismatec¶
ismatec_scanner¶
Scan system serial ports for connected Ismatec Reglo peristaltic pumps.
- plateflo.ismatec.ismatec_scanner.scan_for_pumps() list ¶
Scans system serial ports for connected Ismatec Reglo peristaltic pumps.
- Returns:
list [{‘pump’ – One dict per pump detected. [{‘pump’:str, ‘port’:str, ‘addr’:int}, …]
pump : str - Pump model, ‘ICC’ or ‘Digital’.
port : str - Serial port name.
addr : int - Pump internal address.
- Return type:
str, ‘port’:str, ‘addr’:int}, …]
ismatec_icc¶
Convenience functions for control of common Ismatec Reglo ICC peristaltic pump functions.
- class plateflo.ismatec.ismatec_icc.RegloICC(port, addr, channels=4, timeout=0.5)¶
Ismatec Reglo ICC pump object, for serial control of multi-channel pump.
- Parameters:
port (str) – Serial port on which Relgo ICC is connected. E.g. ‘COM3’
channels (int, default=4) – Number of channels on ICC pump.
timeout (float, default=0.5) – Time (seconds) to allow pump to respond before commands timeout/fail.
- pump_ser¶
Backend PySerial device object
- Type:
Serial
- port¶
Serial port name
- Type:
str
- addr¶
Pump internal address (for e.g. serial daisy-chaining)
- Type:
str
- status¶
state, direction, and flow rate for all channels. Timestamp of last update.
- Type:
dict
- max_flow¶
Pump maximum flow rate (mL/min)
- Type:
float
- n_channels¶
Number of independant channels on Reglo ICC pump.
- Type:
int
- display_text(txt: str) int ¶
Show text on the pump LCD. Maximum 15 character.
- Parameters:
txt (str) – Text to display on pump LCD. Maximum 15 characters.
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- get_chan_dir(chan: int) int ¶
Query pump channel head direction.
- Parameters:
chan (int) – Pump channel number
- Returns:
1 == clockwise
-1 == counter-clockwise
0 == error
- Return type:
int
- get_chan_flow(chan: int) float ¶
Query channel set flow-rate.
NB: Not supported when daisy-chaining multiple pumps over single serial interface.
- Parameters:
chan (int) – Pump channel number
- Returns:
channel set flow-rate; otherwise,
-1.0 == error
- Return type:
float
- get_chan_run_state(chan: int) int ¶
Query pump channel run state.
- Parameters:
chan (int) – Pump channel number
- Returns:
1 == running,
0 == stopped,
-1 == error
- Return type:
int
- get_dir() int ¶
Query pump head direction.
- Returns:
Pump head direction:
+1 == clockwise
-1 == counter-clockwise
0 == unknown error
- Return type:
int
- get_max_flowrate() float ¶
Query the maximum achievable flow rate in mL/min.
- Returns:
Maximum pump flow rate (mL/min)
- Return type:
float
- kill()¶
Kill all threads and close the pump’s serial port
- restore_display() int ¶
Return the LCD to normal display mode. Used to reset the LCD after display_text, for example.
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- send_cmd_pass_fail(cmd: str) int ¶
Send command ,`cmd`, to pump. Resend if failure up to a total of three attempts.
See Reglo ICC manual (pp. 17-33) for command structure documentation. http://www.ismatec.com/images/pdf/manuals/14-036_E_ISMATEC_REGLO_ICC_ENGLISH_REV.%20C.pdf
- Parameters:
cmd (str) – Command string, CR-terminated.
- Returns:
1 == pass
0 == fail
-1 == error
- Return type:
int
- send_cmd_string_resp(cmd_string: str, EOL='\n') str ¶
Command/query the pump with cmd. Resend if failure up to a total of three attempts.
See Reglo ICC manual (pp. 17-33) for command structure documentation. http://www.ismatec.com/images/pdf/manuals/14-036_E_ISMATEC_REGLO_ICC_ENGLISH_REV.%20C.pdf
- Parameters:
cmd (str) – Command string, CR-terminated.
- Returns:
pump response string
- Return type:
str
- set_chan_dir(chan: int, direction: int) int ¶
Set channel direction: clockwise(+1), or counterclockwise(-1).
- Parameters:
chan (int) – Pump channel number
direction (int {-1, +1}) – Channel direction: clockwise (+1) or counter-clockwise (-1)
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- set_chan_flow(flow_rate, chan)¶
Set channel flow rate in mL/min.
- Parameters:
chan (int) – Pump channel number
flow_rate (float) – Flow rate in mL/min
- Returns:
1 == Pass 0 == Fail -1 == Error
- Return type:
int
- set_dir(direction: int) int ¶
Set pump head direction: clockwise(+1), or counterclockwise(-1)
- Parameters:
direction (int {-1, +1}) – Pump head direction: clockwise (+1) or counter-clockwise (-1)
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- set_flow(flow_rate: float) float ¶
Set pump flow rate (mL/min). If requested flow rate is above pump limit, set to maximum achievable, max_flow.
- Returns:
1 == pass
0 == fail
-1 == error
- Return type:
int
- set_mode_flowrate()¶
Set pump to volumetric flowrate mode.
- Returns:
1 == pass
0 == fail
-1 == error
- Return type:
int
- set_per_chan_mode(mode: int)¶
Set mode for command addressing: channel(1), pump-wide(0)
- Parameters:
mode (int {0, 1}) – Send pump-wide commands (0) or per-channel (1).
- Returns:
1 == pass
0 == fail
-1 == error
- Return type:
int
- start() int ¶
Start/run pump, includes all channels with a non-zero flow rate.
- Returns:
1 == pass
0 == fail
-1 == error
- Return type:
int
- start_chan(chan: int) int ¶
Start/run pump channel.
- Parameters:
chan (int) – Pump channel number
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- stop() int ¶
Stop pump. All channels.
- Returns:
1 == pass
0 == fail
-1 == error
- Return type:
int
- stop_chan(chan: int) int ¶
Stop pump channel.
- Parameters:
chan (int) – Pump channel number
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- update_status()¶
Update the pump status attribute. Must be called manually.
ismatec_dig¶
Convenience functions for control of common Ismatec Reglo Digital peristaltic pump functions
- class plateflo.ismatec.ismatec_dig.RegloDigital(port: str, addr: int)¶
Ismatec Reglo Digital pump control serial control.
- Parameters:
port (str) – Serial port on which Relgo Digital is connected. E.g. ‘COM3’.
timeout (float, default=0.5) – Time (seconds) to allow pump to respond before commands timeout/fail.
- pump_ser¶
Backend PySerial device object
- Type:
Serial
- port¶
Serial port name
- Type:
str
- addr¶
Pump address (for e.g. serial daisy-chaining)
- Type:
int
- status¶
Dictionary of last pump status update values
timestamp - datetime object of last status update
run_state - pump head state ‘Running’, ‘Idle’, or ‘ERROR’
dir - pump head direction. -1 (CCW); +1 (CW); 0 (ERROR)
flow - current set flow rate (mL/min)
- Type:
{‘timestamp’:datetime, ‘run_state’:str, ‘dir’:int, ‘flow’:float}
- max_flow¶
Pump maximum flow rate
- Type:
float
- last_dir¶
Last set pump head direction. CW == +1; CCW == -1; ERROR == 0.
- Type:
int
- display_text(txt)¶
Show text on the pump LCD, 4 characters max.
- Parameters:
txt (str) – Text to display on pump LCD. Maximum 4 characters.
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- get_dir()¶
Returns the last direction set via control software. Note Reglo Digital lacks ability to query pump head direction. Tracked in software.
- Returns:
Last set pump direction:
+1 == clockwise
-1 == counter-clockwise
0 == unknown error
- Return type:
int
- get_flow() float ¶
Query current pump flow rate.
- Returns:
Flow rate in mL/min. OR -1 if an error occured.
- Return type:
float
- get_run_state()¶
Query pump current run status.
- Returns:
1 == Running
0 == Stopped
-1 == Other error
-2 == Stopped, motor overload
- Return type:
int
- kill()¶
Kill all threads and close pump serial port
- restore_display()¶
Return the LCD to normal display mode. Used to clear text displayed using display_text.
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- send_cmd_pass_fail(cmd: str) int ¶
Send command ,`cmd`, to pump. Resend if failure up to a total of three attempts.
See Reglo Digital manual (pp. 33-38) for command structure documentation. http://www.ismatec.com/images/pdf/manuals/Reglo_Digital_new.pdf
- Parameters:
cmd (str) – Command string, CR-terminated.
- Returns:
1 == pass
0 == fail
-1 == error
- Return type:
int
- send_cmd_string_resp(cmd) str ¶
Query the pump with cmd. Resend if failure up to a total of three attempts.
See Reglo Digital manual (pp. 33-38) for command structure documentation. http://www.ismatec.com/images/pdf/manuals/Reglo_Digital_new.pdf
- Parameters:
cmd (str) – Command string, CR-terminated.
- Returns:
pump response string
- Return type:
str
- set_cal_flow(flow_rate=12.4)¶
Set the calibrated volumetric flow rate at maximum pump speed.
- Parameters:
flow_rate (float, default = 12.4) – Volumetric flow rate (mL/min) at maximum pump head speed. Default 12.4 mL/min.
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- set_dir(direction)¶
Set pump head direction clockwise or counterclockwise.
- Parameters:
direction (int {-1, +1}) – Pump head direction: clockwise (+1) or counter-clockwise (-1)
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- set_flow(flow_rate: float) int ¶
Set pump flow rate.
- Parameters:
flow_rate (float) – Flow rate in mL/min.
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- set_mode_flowrate()¶
Change pump flow rate to mL/min mode
- set_mode_rpm()¶
Change pump flow rate to RPM speed mode
- set_tube_diameter(diam_mm)¶
Sets tubing inner diameter. Determines calibrated volumetric flow rate.
0.13, 0.19, 0.25, 0.38, 0.44, 0.51, 0.57, 0.64, 0.76, 0.89, 0.95, 1.02, 1.09, 1.14, 1.22, 1.30, 1.42, 1.52, 1.65, 1.75, 1.85, 2.06, 2.29, 2.54, 2.79, 3.17
- Parameters:
diam_mm (float {0.13, 0.19, 0.25, 0.38, 0.44, 0.51, 0.57, 0.64, 0.76, 0.89, 0.95, 1.02, 1.09, 1.14, 1.22, 1.30, 1.42, 1.52, 1.65, 1.75, 1.85, 2.06, 2.29, 2.54, 2.79, 3.17}) – Tubing inner diameter in millimeters
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- start() int ¶
Start/run the pump.
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- stop() int ¶
Stop the pump.
- Returns:
1 == Pass
0 == Fail
-1 == Other error
- Return type:
int
- update_status()¶
Update the pump status attribute. Must be called manually.