Pycont Package

This is the documentation for the Pycont library. Here, you will find all the methods associated with communicating/controlling the pumps. Please see the Examples page for more coverage!

Module Contents

Custom library designed to control Tricontinent C-series syringe pumps.

List of all modules:

Controller Module

pycont.controller.C3000Broadcast = '_'

Represents the Broadcast of the C3000

class pycont.controller.C3000Controller(pump_io, name, address, total_volume, micro_step_mode=2, top_velocity=6000, initialize_valve_position='I')[source]

Bases: object

This class represents thhe main controller for the C3000. The controller is what controls the pumps.

Args:

pump_io (PumpIO): PumpIO object for communication.

name (str): The name of the controller.

address (str): Address of the controller.

total_volume (int): Total volume of the pump.

micro_step_mode (int): The mode which the microstep will use, default set to MICRO_STEP_MODE_2 (2)

top_velocity (int): The top velocity of the pump, default set to 6000

initialize_valve_position (chr): Sets the valve position, default set to VALVE_INPUT (‘I’)

Raises:
ValueError: Invalid microstep mode.
check_top_velocity_within_range(top_velocity)[source]

Checks that the top velocity is within a maximum range.

Args:
top_velocity (int): The top velocity for the pump.
Returns:
True (bool): Top velocity is within range.
Raises:
ValueError: Top velocity is out of range.
current_steps

See get_plunger_position()

current_volume

See get_volume()

Returns:
(float): self.get_volume()
deliver(volume_in_ml, to_valve=None, speed_out=None, wait=False, secure=True)[source]

Delivers the volume payload.

Warning

Change of speed will last after the scope of this function but will be reset to default each time speed_out == None

Args:

volume_in_ml (float): The supplied volume to deliver.

to_valve (chr): The valve to deliver the payload to, default set to None.

speed_out (int): The speed of delivery, default set to None.

wait (bool): Waits for the pump to be idle, default set to False.

secure (bool): Ensures that everything is correct, default set to False.

ensure_default_top_velocity(secure=True)[source]

Ensures that the top velocity is the default top velocity.

Args:
secure (bool): Ensures that everything is correct, default set to True.
flash_eeprom_3_way_t_valve()[source]

See set_eeprom_config()

flash_eeprom_3_way_y_valve()[source]

See set_eeprom_config()

flash_eeprom_4_way_dist_valve()[source]

See set_eeprom_config()

flash_eeprom_4_way_nondist_valve()[source]

See set_eeprom_config()

classmethod from_config(pump_io, pump_name, pump_config)[source]

Obtains the configuration data.

Args:

cls (Class): The initialising class.

pump_io (PumpIO): PumpIO object.

pump_name (str): Name of the pump.

pump_config (Dict): Dictionary containg the pump configurattion data.

Returns:
C3000Controller: New C3000Controller object with the data set from the configuration.
get_default_top_velocity()[source]

Gets the default top velocity.

Returns:
self.default_top_velocity (int): The default top velocity.
get_eeprom_config()[source]

Gets the EEPROM configuration.

Returns:
eeprom_config (int): The configuration of the EEPROM.
get_plunger_position()[source]

Gets the current position of the plunger.

Returns:
steps (int): The position of the plunger.
get_raw_valve_postion()[source]

Gets the raw value of the valve’s position.

Returns:
raw_valve_position (str): The raw position of the valve.
get_top_velocity()[source]

Gets the current top velocity.

Returns:
top_velocity (int): The current top velocity.
get_valve_position(max_repeat=10)[source]

Gets the position of the valve.

Args:
max_repeat (int): The maximum number of times to repeat an operation, default set to MAX_REPEAT_OPERATION (10).
Returns:
(chr): The position of the valve.
Raises:
ValueError: The valve position is not valid/unknown.
get_volume()[source]

See step_to_volume()

Returns:
(float): self.step_to_volume(self.get_plunger_position())
go_to_max_volume(speed=None, wait=False)[source]

Moves the pump to the maximum volume.

Args:

speed (int): The speed of movement, default set to None.

wait (bool): Waits until the pump is idle, default set to False.

Returns:

True (bool): The maximum volume is valid.

False (bool): The maximum volume is not valid.

go_to_volume(volume_in_ml, speed=None, wait=False, secure=True)[source]

Moves the pump to the desired volume.

Warning

Change of speed will last after the scope of this function but will be reset to default each time speed == None

Args:

volume_in_ml (float): The supplied volume.

speed (int): The speed of movement, default set to None.

wait (bool): Waits for the pump to be idle, defualt set to False.

secure (bool): Ensures that everything is corect, default set to True.

Returns:

True (bool): The supplied volume is valid.

False (bool): THe supplied volume is not valid.

init_all_pump_parameters(secure=True)[source]

Initialises the pump parameters, Microstep Mode, and Top Velocity.

Args:
secure (bool): Ensures that everything is correct, default set to True.
initialize(valve_position=None, max_repeat=10, secure=True)[source]

Initialises the pump.

Args:

valve_position (int): Position of the valve, default set to None.

max_repeat (int): Maximum number of times to repeat the operation, default set to MAX_REPEAT_OPERATION (10).

secure (bool): Ensures that everything is correct.

Raises:
ControllerRepeatedError: Too many failed attempts to initialise.
initialize_no_valve(operand_value=0, wait=True)[source]

Initialise with no valves.

Args:

operand_value (int): Value of the supplied operand.

wait (bool): Whether or not to wait until the pump is idle, default set to True.

initialize_valve_left(operand_value=0, wait=True)[source]

Initialises the left valve.

Args:

operand_value (int): Value of the supplied operand, default set to 0.

wait (bool): Whether or not to wait until the pump is idle, default set to True.

initialize_valve_only(operand_string='0, 0', wait=True)[source]

Initialise with valves only.

Args:

operand_string (str): Value of the supplied operand.

wait (bool): Whether or not to wait until the pump is idle, default set to True.

initialize_valve_right(operand_value=0, wait=True)[source]

Initialises the right valve.

Args:

operand_value (int): Value of the supplied operand.

wait (bool): Whether or not to wait until the pump is idle, default set to True.

is_busy()[source]

Determines if the pump is busy.

Returns:

True (bool): Pump is busy.

False (bool): Pump is idle.

Raises:
ValueError: Value returned from the pump is not valid.
is_idle()[source]

Determines if the pump is idle or Busy

Returns:

True (bool): The pump is idle.

False (bool): The pump is not idle.

Raises:
ValueError: Value returned from the pump is not valid.
is_initialized()[source]

Determines if the pump has been initialised.

Returns:

True (bool): The pump is initialised.

False (bool): The pump is not initialised.

is_volume_deliverable(volume_in_ml)[source]

Determines if the supplied volume is deliverable.

Args:
volume_in_ml (float): The supplied volume in mL.
Returns:

True (bool): The number of steps is <= the current steps.

False (bool): The number of steps is > the current steps.

is_volume_pumpable(volume_in_ml)[source]

Determines if the volume is pumpable.

Args:
volume_in_ml (float): The supplied volume.
Returns:

True (bool): If the number of steps is <= to the remaining steps.

False (bool): The number of steps is > than the remaining steps.

is_volume_valid(volume_in_ml)[source]

Determines if the supplied volume is valid.

Args:
volume_in_ml (float): The supplied volume.
Returns:

True (bool): The supplied volume is <= the total volume and >= 0

False (bool): The supplied volume is > total volume or < 0

pump(volume_in_ml, from_valve=None, speed_in=None, wait=False, secure=True)[source]

Sends the signal to initiate the pump sequence.

Warning

Change of speed will last after the scope of this function but will be reset to default each time speed_in == None

Args:

volume_in_ml (float): Volume to pump (in mL).

from_valve (chr): Pump using the valve, default set to None.

speed_in (int): Speed to pump, default set to None.

wait (bool): Waits for the pump to be idle, default set to False.

secure (bool): Ensures everything is correct, default set to True.

Returns:

True (bool): The supplied volume is pumpable.

False (bool): Supplied volume is not pumpable.

remaining_steps

Gets the remaining number of steps.

Returns:
(int): self.number_of_steps - self.current_steps
remaining_volume

Gets the remaining volume.

Returns:
(float): self.total_volume - self.current_volume
set_default_top_velocity(top_velocity)[source]

Sets the default top velocity.

Args:
top_velocity (int): The top velocity for the pump.
set_eeprom_config(operand_value)[source]

Sets the configuration of the EEPROM on the pumps.

Args:
operand_value (int): The value of the supplied operand.
set_microstep_mode(micro_step_mode)[source]

Sets the Microstep Mode to use.

Args:
micro_step_mode (int): Mode to use.
Raises:
ControllerInitError: Attempting to set microstep mode before pump initialisation.
set_top_velocity(top_velocity, max_repeat=10, secure=True)[source]

Sets the top velocity for the pump.

Args:

top_velocity (int): The top velocity.

max_repeat (int): Maximum number of times to repeat an operation, default set to MAX_REPEAT_OPERATION (10).

secure (bool): Ensures that everything is correct.

Returns:
True (bool): Top velocity has been set.
Raises:

ControllerRepeatedError: Too many failed attempts at setting the top velocity.

ControllerInitError: Attempting to set the top velocity befire the pump has been initialised.

set_valve_position(valve_position, max_repeat=10, secure=True)[source]

Sets the position of the valve.

Args:

valve_position (str): Position of the valve.

max_repeat (int): maximum number of times to repeat an operation, default set to MAX_REPEAT_OPERATION (10).

secure (bool): Ensures that everything is correct, default set to True.

Returns:
True (bool): The valve position has been set.
Raises:

ValueError: The valve posiiton is invalid/unknown.

ControllerRepeatedError: Too many failed attempts in set_top_velocity.

smart_initialize(valve_position=None, secure=True)[source]

Initialises the pump and sets all pump parammeters.

Args:

valve_position (int): Position of the valve, default set None.

secure (bool): Ensures that everything is correct, default set to True.

step_to_volume(step)[source]

Determines the volume in a specific step.

Args:
step (int): Step number.
Returns:
step / float(self.steps_per_ml
transfer(volume_in_ml, from_valve, to_valve, speed_in=None, speed_out=None)[source]

Transfers the desired volume in mL.

Args:

volume_in_ml (float): The volume to transfer.

from_valve (chr): The valve to transfer from.

to_valve (chr): The valve to transfer to.

speed_in (int): The speed of transfer to valve, default set to None.

speed_out (int): The speed of transfer from the valve, default set to None.

volume_to_step(volume_in_ml)[source]

Determines the number of steps for a given volume.

Args:
volume_in_ml (float): Volume in millilitres.
Returns:
int(round(volume_in_ml * self.steps_per_ml))
wait_until_idle()[source]

Waits until the pump is not busy for WAIT_SLEEP_TIME, default set to 0.1

write_and_read_from_pump(packet, max_repeat=10)[source]

Writes packets to and reads the response from the pump.

Args:

packet (DTInstructionPacket): The packet to be written.

max_repeat (int): The maximum time to repeat the read/write operation.

Returns:
decoded_response (str): The decoded response.
Raises:

PumpIOTimeOutError: If the response itme is greater than the timeout threshold.

ControllerRepeatedError: Error in decoding.

pycont.controller.C3000SwitchToAddress = {'A': ';', 'BROADCAST': '_', 'C': '=', 'B': '<', 'E': '?', 'D': '>', '1': '2', '0': '1', '3': '4', '2': '3', '5': '6', '4': '5', '7': '8', '6': '7', '9': ':', '8': '9'}

Switches the C3000 to a certain address

exception pycont.controller.ControllerInitError[source]

Bases: exceptions.Exception

Exception for when there is a failure in initialising the Controller.

exception pycont.controller.ControllerRepeatedError[source]

Bases: exceptions.Exception

Exception for when there has been too many repeat attempts.

pycont.controller.DEFAULT_IO_BAUDRATE = 9600

default Input/Output (I/O) Baudrate

pycont.controller.DEFAULT_IO_TIMEOUT = 1

Default timeout for I/O operations

pycont.controller.MAX_REPEAT_OPERATION = 10

Sets the maximum time to repeat a specific operation

pycont.controller.MAX_REPEAT_WRITE_AND_READ = 10

Sets the maximum number of attempts to Write and Read

pycont.controller.MAX_TOP_VELOCITY_MICRO_STEP_MODE_0 = 6000

The maximum top velocity for Microstep Mode 0

pycont.controller.MAX_TOP_VELOCITY_MICRO_STEP_MODE_2 = 48000

The maximum top velocity for Microstep Mode 2

pycont.controller.MICRO_STEP_MODE_0 = 0

Microstep Mode 0

pycont.controller.MICRO_STEP_MODE_2 = 2

Microstep Mode 2

class pycont.controller.MultiPumpController(setup_config)[source]

Bases: object

This class deals with controlling multiple pumps at a time.

Args:
setup_config (Dict): The configuration of the setup.
apply_command_to_all_pumps(command, *args, **kwargs)[source]

Applies a given command to all of the pumps.

Args:

command (str): The command to apply.

*args: Variable length argument list.

**kwargs: Arbitrary keyword arguments.

Returns:
returns (Dict): Dictionary of the functions.
apply_command_to_group(group_name, command, *args, **kwargs)[source]

Applies a given command to the group.

Args:

group_name (str): Name of the group.

command (str): The command to apply.

*args: Variable length argument list.

**kwargs: Arbitrary keyword arguements.

Returns:
returns (Dict) Dictionary of the functions.
apply_command_to_pumps(pump_names, command, *args, **kwargs)[source]

Applies a given command to the pumps.

Args:

pump_names (List): List containing the pump names.

command (str): The command to apply.

*args: Variable length argument list.

**kwargs: Arbitrary keyword arguements.

Returns:
returns (Dict): Dictionary of the functions.
are_pumps_busy()[source]

Determines if the pumps are busy.

Returns:

True (bool): The pumps are busy.

False (bool): The pumps are not busy.

are_pumps_idle()[source]

Determines if the pumps are idle.

Returns:

True (bool): The pumps are idle.

False (bool): The pumps are not idle.

are_pumps_initialized()[source]

Determines if the pumps have been initialised.

Returns:

True (bool): The pumps have been initialised.

False (bool): The pumps have not been initialised.

default_pump_config(pump_config)[source]

Creates a default pump configuration.

Args:
pump_config (Dict): Dictionary containing the pump configuration.
Returns:
defaulted_pump_config (Dict): A new defualt pump configuration mirroring that of pump_config.
deliver(pump_names, volume_in_ml, to_valve=None, speed_out=None, wait=False, secure=True)[source]

Delivers the desired volume.

Note

Reimplemented as MultiPump so it is really synchronous

Args:

pump_names (List): The name of the pumps.

volume_in_ml (float): The volume to be delivered.

to_valve (chr): The valve to deliver to.

speed_out (int): The speed at which to deliver.

wait (bool): Wait for the pumps to be idle ,default set to False.

secure (bool): Ensures everything is correct, default set to True.

classmethod from_configfile(setup_configfile)[source]

Obtains the configuration data from the supplied configuration file.

Args:

cls (Class): The initialising class.

setup_configfile (File): The configuration file.

Returns:
MultiPumpController: A new MultiPumpController object with the configuration set from the config file.
get_pumps(pump_names)[source]

Obtains a list of all pumps.

Args:
pump_names (List): A list of the pump names
Returns:
pumps (List): A list of the pump names.
pump(pump_names, volume_in_ml, from_valve=None, speed_in=None, wait=False, secure=True)[source]

Pumps the desired volume.

Note

Reimplemented as MultiPump so it is really synchronous

Args:

pump_names (List): The name of the pumps.

volume_in_ml (float): The volume to be pumped.

from_valve (chr): The valve to pump from.

speed_in (int): The speed at which to pump, default set to None.

wait (bool): Waits for the pumps to be idle, default set to False.

secure (bool): Ensures everything is correct, default set to False.

set_pumps_as_attributes()[source]

Sets the pumps as attributes.

smart_initialize(secure=True)[source]

Initialises the pumps, setting all parameters.

Args:
secure (bool): Ensures everything is correct, default set to True.
transfer(pump_names, volume_in_ml, from_valve, to_valve, speed_in=None, speed_out=None, secure=True)[source]

Transfers the desired volume between pumps.

Note

Reimplemented as MultiPump so it is really synchronous, needed

Args:

pump_names (List): The name of the pumps.

volume_in_ml (float): The volume to be transfered.

from_valve (chr): The valve to transfer from.

to_valve (chr): the valve to transfer to.

speed_in (int): The speed at which to receive transfer, default set to None.

speed_out (int): The speed at which to transfer, default set to None

secure (bool): Ensures that everything is correct, default set to False.

wait_until_all_pumps_idle()[source]

Sends the command ‘wait_until_idle’ to the pumps.

pycont.controller.N_STEP_MICRO_STEP_MODE_0 = 3000

Number of steps in Microstep Mode 0

pycont.controller.N_STEP_MICRO_STEP_MODE_2 = 24000

Number of steps in Microstep Mode 2

class pycont.controller.PumpIO(port, baudrate=9600, timeout=1)[source]

Bases: object

This class deals with the pump I/O instructions.

Args:

port (int): The port number

baudrate (int): Baudrate of the communication, default set to DEFAULT_IO_BAUDRATE(9600)

timeout (int): The timeout of communication, default set to DEFAULT_IO_TIMEOUT(1)

close()[source]

Closes the communication with the hardware.

flushInput()[source]

Flushes the input buffer of the serial communication.

classmethod from_config(io_config)[source]

Sets details laid out in the configuration .json file

Args:

cls (Class): The initialising class.

io_config (Dict): Dictionary holding the configuration data.

Returns:
PumpIO: New PumpIO object with the variables set from the configuration file.
classmethod from_configfile(io_configfile)[source]

Opens the configuration file and parses the data to be used in the from_config method.

Args:

cls (Class): The initialising class.

io_configfile (File): File which contains the configuration data.

Returns:
PumpIO: New PumpIO object with the variables set form the configuration file.
open(port, baudrate=9600, timeout=1)[source]

Opens a communication with the hardware.

Args:

port (int): The port number on which the communication will take place.

baudrate (int): The baudrate of the communication, default set to DEFAULT_IO_BAUDRATE(9600).

timeout (int): The timeout of the communication, default set to DEFAULT_IO_TIMEOUT(1).

readline()[source]

Reads a line from the serial communication.

Raises:
PumpIOTimeOutError: If the response time is greater than the timeout threshold.
write(packet)[source]

Writes a packet along the serial communication.

Args:
packet (DTInstructionPacket): The packet to send along the serial communication.

Note

Unsure if this is the correct packet type (GAK).

write_and_readline(packet)[source]

Writes a packet along the serial communication and waits for a response.

Args:
packet (DTInstructionPacket): The packet to be written.

Note

Unsure if this is the correct packet type (GAK).

Returns:
reponse (str): The received response.
Raises:
PumpIOTimeOutError: If the response time is greater than the timeout threshold.
exception pycont.controller.PumpIOTimeOutError[source]

Bases: exceptions.Exception

Exception for when the response time is grerater than the timeout threshold.

pycont.controller.VALVE_BYPASS = 'B'

Bypass for the valve

pycont.controller.VALVE_EXTRA = 'E'

Extra for the valve

pycont.controller.VALVE_INPUT = 'I'

Input for the valve

pycont.controller.VALVE_OUTPUT = 'O'

Output for the valve

pycont.controller.WAIT_SLEEP_TIME = 0.1

Specifies a time to wait

Pump Protocol Module

class pycont.pump_protocol.C3000Protocol(address)[source]

Bases: object

This class is used to represent the protocol which the pumps will follow when controlled.

Args:
address (str): Address of the pump.
decode_packet(dtresponse)[source]

Decodes the response packet form the device.

Args:
dtresponse (str): The response from the device.
Returns:
DTStatus: The decoded status of the device.
forge_deliver_packet(operand_value)[source]

Creates a packet for delivering the payload.

Args:
operand_value (int): The value of the supplied operand.
Returns:
DTInstructionPacket: The created packet for delivering the payload.
forge_eeprom_config_packet(operand_value)[source]

Creates a packet for accessing the EEPROM configuration of the device.

Args:
operand_value (int): The value of the supplied operand.
Returns:
DTInstructionPacket: The created packet for accessing the EEPROM configuration of the device.
forge_initialize_no_valve_packet(operand_value=0)[source]

Creates a packet for initialising with no valves.

Args:
operand_value (int): The value of the supplied operand, 0 by default.
Returns:
DTInstructionPacket: The created packet for initialising with no valves.
forge_initialize_valve_left_packet(operand_value=0)[source]

Creates a packet for initialising the left valve.

Args:
operand_value (int): The value of the supplied operand, 0 by defualt.
Returns:
DTInstructionPacket: The created packet for initialising the left valve.
forge_initialize_valve_only_packet(operand_string=None)[source]

Creates a packet for initialising with valves only.

Args:
operand_string (str): String representing the operand, None by default
Returns:
DTInstructionPacket: The created packet for initialising with valves only
forge_initialize_valve_right_packet(operand_value=0)[source]

Creates a packet for initialising the right valve.

Args:
operand_value (int): The value of the supplied operand, 0 by default.
Returns:
DTInstructionPacket: The created packet for initialising the right valve.
forge_microstep_mode_packet(operand_value)[source]

Creates a packet for initialising microstep mode.

Args:
operand_value (int): The value of the supplied operand.
Returns:
DTInstructionPacket: The created packet for initialising microstep mode.
forge_move_to_packet(operand_value)[source]

Creates a packet for moving the device to a location.

Args:
operand_value (int): The value of the supplied operand.
Returns:
DTInstructionPacket: The created packet for moving the device to a location.
forge_packet(dtcommands, execute=True)[source]

Creates a packet which will be sent to the device.

Args:

dtcommands (list): List of dtcommands.

execute (bool): Sets the execute value, True by default.

Returns:
DTInstructionPacket: The created packet.
forge_pump_packet(operand_value)[source]

Creates a packet for the pump action of the device.

Args:
operand_value (int): The value of the supplied operand
Returns:
DTInstructionPacket: The created packet for the pump action of the device.
forge_report_cutoff_velocity_packet()[source]

Creates a packet for reporting the device’s cutoff velocity.

Returns:
DTInstructionPacket: The created packet for reporting the device’s cutoff velocity.
forge_report_eeprom_packet()[source]

Creates a packet for reporting the EEPROM.

Returns:
The created packet for reporting the EEPROM.
forge_report_initialized_packet()[source]

Creates a packet for reporting the initialisation of the device.

Returns:
DTInstructionPacket: The created packet for reporting the initialisation of the device.
forge_report_peak_velocity_packet()[source]

Creates a packet for reporting the device’s peak velocity.

Returns:
DTInstructionPacket: The created packet for reporting the device’s peak velocity.
forge_report_plunger_position_packet()[source]

Creates a packet for reporting the device’s plunger position.

Returns:
DTInstructionPacket: The created packet for reporting the device’s plunger position.
forge_report_start_velocity_packet()[source]

Creates a packet for reporting the device’s start velocity.

Returns:
DTInstructionPacket: The created packet for reporting the device’s starting velocity.
forge_report_status_packet()[source]

Creates a packet for reporting the device status.

Returns:
DTInstructionPacket: The created packet for reporting the device status.
forge_report_valve_position_packet()[source]

Creates a packet for reporting the device’s valve position.

Returns:
DTInstructionPacket: The created packet for reporting the device’s valve position.
forge_top_velocity_packet(operand_value)[source]

Creates a packet for the top velocity of the device.

Args:
operand_value (int): The value of the supplied operand.
Returns:
DTInstructionPacket: The created packet for the top velocity of the device.
forge_valve_bypass_packet()[source]

Creates a packet for bypassing a valve on the device.

Returns:
DTInstructionPacket: The created packet for bypassing a valve on the device.
forge_valve_extra_packet()[source]

Creates a packet for an extra valve.

Returns:
DTInstructionPacket: The created packet for an extra valve.
forge_valve_input_packet(operand_value=None)[source]

Creates a packet for the input into a valve on the device.

Args:
operand_value (int): The value of the supplied operand, None by default.
Returns:
DTInstructionPacket: The created packet for the input into a valve on the device.
forge_valve_output_packet(operand_value=None)[source]

Creates a packet for the output from a valve on the device.

Args:
operand_value (int): The value of the supplied operand, None by default.
Returns:
DTInstructionPacket: The created packet for the output from a valve on the device.
pycont.pump_protocol.CMD_DELIVER = 'D'

Command to deliver payload

pycont.pump_protocol.CMD_EEPROM_CONFIG = 'U'

Command to access the EEPROM configuration .. warning:: Requires power restart to take effect

pycont.pump_protocol.CMD_EXECUTE = 'R'

Command to execute

pycont.pump_protocol.CMD_INITIALIZE_NO_VALVE = 'W'

Command to initialise with no valve

pycont.pump_protocol.CMD_INITIALIZE_VALVE_LEFT = 'Y'

Command to initialise with the left valve

pycont.pump_protocol.CMD_INITIALIZE_VALVE_ONLY = 'w'

Command to initialise with valves only

pycont.pump_protocol.CMD_INITIALIZE_VALVE_RIGHT = 'Z'

Command to initialise with the right valve

pycont.pump_protocol.CMD_MICROSTEPMODE = 'N'

Command to invoke microstep mode

pycont.pump_protocol.CMD_MOVE_TO = 'A'

Command to move the pump to a location

pycont.pump_protocol.CMD_PUMP = 'P'

Command to access a specific pump

pycont.pump_protocol.CMD_REPORT_CUTOFF_VELOCITY = '?3'

Command for reporting the cutoff velocity

pycont.pump_protocol.CMD_REPORT_EEPROM = '?27'

Command for reporting the EEPROM

pycont.pump_protocol.CMD_REPORT_INTIALIZED = '?19'

Command for reporting initialisation

pycont.pump_protocol.CMD_REPORT_PEAK_VELOCITY = '?2'

Command for reporting the peak velocity

pycont.pump_protocol.CMD_REPORT_PLUNGER_POSITION = '?'

Command for reporting hte plunger position

pycont.pump_protocol.CMD_REPORT_START_VELOCITY = '?1'

Command for reporting the start velocity

pycont.pump_protocol.CMD_REPORT_STATUS = 'Q'

Command for the reporting the status

pycont.pump_protocol.CMD_REPORT_VALVE_POSITION = '?6'

Command for reporting the valve position

pycont.pump_protocol.CMD_TOPVELOCITY = 'V'

Command to achieve top velocity

pycont.pump_protocol.CMD_VALVE_BYPASS = 'B'

Command for the valve bypass

pycont.pump_protocol.CMD_VALVE_EXTRA = 'E'

Command for the extra valve

pycont.pump_protocol.CMD_VALVE_INPUT = 'I'

Command for the valve init_all_pump_parameters .. note:: Depending on EEPROM settings (U4 or U11) 4-way distribution valves either use IOBE or I<n>O<n>

pycont.pump_protocol.CMD_VALVE_OUTPUT = 'O'

Command for the valve output

pycont.pump_protocol.STATUS_BUSY_ERROR_FREE = '@'

Busy status when there are no errors

pycont.pump_protocol.STATUS_IDLE_ERROR_FREE = '`'

Idle status when there are no errors

DTProtocol Module

class pycont.dtprotocol.DTCommand(command, operand=None)[source]

Bases: object

This class is used to represent a DTcommand.

Args:

command (str): The command to be sent

operand (str): The parameter of the command, None by default

(for more details see http://www.tricontinent.com/products/cseries-syringe-pumps)

to_array()[source]
to_string()[source]
class pycont.dtprotocol.DTInstructionPacket(address, dtcommands)[source]

Bases: object

This class is used to represent a DT instruction packet.

Args:

address (str): The address to talk to

dtcommands (list): List of DTCommand

(for more details see http://www.tricontinent.com/products/cseries-syringe-pumps)

to_array()[source]
to_string()[source]
class pycont.dtprotocol.DTStatus(response)[source]

Bases: object

This class is used to represent a DTstatus, the response of the device from a command.

Args:
response (str): The response from the device

(for more details see http://www.tricontinent.com/products/cseries-syringe-pumps)

decode()[source]