-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows multiple hub handling in MultiPumpController
This new implementations allows to control pumps shared between different controllers (i.e. different serial connections) effectively allowing to control more than 15 pumps with the same object. Rather than introducing a new, higher level of abstraction, the existing MultiPumpController has been modified to allow both the former config syntax (with the JSON settings assuming a one-to-one relationship between serial connection and MultiPumpController) and the updated syntax featuring an "hubs" parameter aggregating the pump settings per serial connection, providing the I/O settings of each hub. Note that, if the "hubs" parameter is provided in the configuration dictionary, the latter configuration mode is assumed. A new example has been added to clarify the matter. Version number has been bumped.
- Loading branch information
Dario Cambié
committed
Jul 5, 2019
1 parent
dc5d05c
commit 42b812e
Showing
5 changed files
with
127 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = '0.9.9' | ||
__version__ = '1.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"default": { | ||
"volume": 5, | ||
"micro_step_mode": 2, | ||
"top_velocity": 6000 | ||
}, | ||
"groups": { | ||
"oils": ["oil1", "oil2", "oil3", "oil4"], | ||
"solvents": ["water", "acetone"] | ||
}, | ||
"hubs": [{ | ||
"io": { | ||
"port": "/dev/trihub", | ||
"baudrate": 38400, | ||
"timeout": 1 | ||
}, | ||
"pumps": { | ||
"acetone": { | ||
"switch": "0" | ||
}, | ||
"water": { | ||
"switch": "1" | ||
}, | ||
"oil1": { | ||
"switch": "2" | ||
} | ||
}}, { | ||
"io": { | ||
"port": "/dev/tricable", | ||
"baudrate": 38400, | ||
"timeout": 1 | ||
}, | ||
"pumps": { | ||
"oil2": { | ||
"switch": "0" | ||
}, | ||
"oil3": { | ||
"switch": "1" | ||
}, | ||
"oil4": { | ||
"switch": "2" | ||
} | ||
}}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import time | ||
|
||
import logging | ||
logging.basicConfig(level=logging.DEBUG) | ||
|
||
# Import the controller | ||
from pycont import MultiPumpController | ||
|
||
# link to your config file | ||
SETUP_CONFIG_FILE = './pump_multihub_config.json' | ||
|
||
# and load the config file in a MultiPumpController | ||
controller = MultiPumpController.from_configfile(SETUP_CONFIG_FILE) | ||
|
||
# Initialize the pumps in a smart way. Smart way here means that: | ||
# | ||
# - if they are already initialized they are not re-initialized (this would cause their plunger to go back to volume=0) | ||
# - before initializing the plunger, the valve is set to the position specified as 'initialize_valve_position' | ||
# this is defaulted to 'I' and is important as initialization with valve connected to a fluidic path characterized by | ||
# high pressure drop is likely to fail due to the relatively high plunger speeds normally used during initialization | ||
controller.smart_initialize() | ||
|
||
controller.apply_command_to_group(group_name="oils", command="transfer", volume_in_ml=5, from_valve='I', to_valve='O') | ||
controller.apply_command_to_group(group_name="oils", command="wait_until_idle") |