Skip to content

Tricontinent Api

This module provides a class for controlling TriContinent pumps.

ATTRIBUTE DESCRIPTION
MAX_CHANNELS

Maximum number of channels.

TYPE: int

ACCEL_MULTIPLIER

Acceleration multiplier.

TYPE: int

BUSY

Busy status codes.

TYPE: str

IDLE

Idle status codes.

TYPE: str

READ_FORMAT

Read format template.

TYPE: str

WRITE_FORMAT

Write format template.

TYPE: str

Data

Data type for the device.

TYPE: NamedTuple

BoolData

Boolean data type for the device.

TYPE: NamedTuple

FloatData

Float data type for the device.

TYPE: NamedTuple

IntData

Integer data type for the device.

TYPE: NamedTuple

CLASS DESCRIPTION
TriContinentDevice

TriContinent pump device class.

Documentation last updated: 2025-02-22

TriContinentDevice

TriContinentDevice(
    port: str | None = None,
    baudrate: int = 9600,
    timeout: int = 1,
    *,
    init_timeout: int = 1,
    data_type: NamedTuple = Data,
    read_format: str = READ_FORMAT,
    write_format: str = WRITE_FORMAT,
    simulation: bool = False,
    verbose: bool = False,
    **kwargs,
)

Bases: SerialDevice

TriContinent pump device class.

ATTRIBUTE DESCRIPTION
info

Model and version information of the pump.

TYPE: str

model

Model of the pump.

TYPE: str

version

Version of the pump.

TYPE: str

channel

Channel number of the pump.

TYPE: int

position

Current position of the pump.

TYPE: int

status

Status of the pump.

TYPE: int

start_speed

Start speed of the pump.

TYPE: int

speed

Top speed of the pump.

TYPE: int

acceleration

Acceleration of the pump.

TYPE: int

valve_position

Valve position of the pump.

TYPE: str

init_status

Initialization status of the pump.

TYPE: bool

pump_config

Pump configuration.

TYPE: str

command_buffer

Command buffer.

TYPE: str

output_right

Output side of the pump.

TYPE: bool

max_position

Maximum position of the pump.

TYPE: int

METHOD DESCRIPTION
connect

Connect to the pump

query

Query the pump

setChannel

Set the channel of the pump

getStatus

Get the status of the pump

getPosition

Get the current position of the pump

getInfo

Get the model and version information of the pump

getState

Get the state of the pump

getStartSpeed

Get the start speed of the pump

getTopSpeed

Get the top speed of the pump

getValvePosition

Get the valve position of the pump

getAcceleration

Get the acceleration of the pump

getInitStatus

Get the initialization status of the pump

getPumpConfig

Get the pump configuration

setStartSpeed

Set the start speed of the pump

setTopSpeed

Set the top speed of the pump

setValvePosition

Set the valve position of the pump

setAcceleration

Set the acceleration of the pump

initialize

Initialize the pump

reverse

Reverse the pump

wait

Wait for a specified duration

repeat

Repeat the last command for a specified number of cycles

run

Run the command buffer

stop

Stop the pump

aspirate

Aspirate a specified number of steps

dispense

Dispense a specified number of steps

move

Move the plunger by a specified number of steps

moveBy

Move the plunger by a specified number of steps

moveTo

Move the plunger to a specified position

Initialize the TriContinent pump device.

PARAMETER DESCRIPTION
port

The port to connect to. Defaults to None.

TYPE: str DEFAULT: None

baudrate

The baudrate of the connection. Defaults to 9600.

TYPE: int DEFAULT: 9600

timeout

The timeout for the connection. Defaults to 1.

TYPE: int DEFAULT: 1

init_timeout

The timeout for initialization. Defaults to 1.

TYPE: int DEFAULT: 1

data_type

The data type for the device. Defaults to Data.

TYPE: NamedTuple DEFAULT: Data

read_format

The read format for the device. Defaults to READ_FORMAT.

TYPE: str DEFAULT: READ_FORMAT

write_format

The write format for the device. Defaults to WRITE_FORMAT.

TYPE: str DEFAULT: WRITE_FORMAT

simulation

Whether to simulate the device. Defaults to False.

TYPE: bool DEFAULT: False

verbose

Whether to print verbose output. Defaults to False.

TYPE: bool DEFAULT: False

max_position property

max_position: int

Maximum position of the pump

aspirate

aspirate(
    steps: int,
    *,
    blocking: bool = True,
    immediate: bool = True,
)

Aspirate a specified number of steps.

PARAMETER DESCRIPTION
steps

The number of steps to aspirate.

TYPE: int

blocking

Whether to block until the command is executed. Defaults to True.

TYPE: bool DEFAULT: True

immediate

Whether to execute the command immediately. Defaults to True.

TYPE: bool DEFAULT: True

dispense

dispense(
    steps: int,
    *,
    blocking: bool = True,
    immediate: bool = True,
)

Dispense a specified number of steps.

PARAMETER DESCRIPTION
steps

The number of steps to dispense.

TYPE: int

blocking

Whether to block until the command is executed. Defaults to True.

TYPE: bool DEFAULT: True

immediate

Whether to execute the command immediately. Defaults to True.

TYPE: bool DEFAULT: True

getAcceleration

getAcceleration() -> int

Get the acceleration of the pump.

RETURNS DESCRIPTION
int

The acceleration of the pump.

TYPE: int

getInfo

getInfo() -> str

Get the model and version information of the pump.

RETURNS DESCRIPTION
str

The model and version information of the pump.

TYPE: str

getInitStatus

getInitStatus() -> bool

Get the initialization status of the pump.

RETURNS DESCRIPTION
bool

The initialization status of the pump.

TYPE: bool

getPosition

getPosition() -> int

Get the current position of the pump.

RETURNS DESCRIPTION
int

The current position of the pump.

TYPE: int

getStartSpeed

getStartSpeed() -> int

Get the start speed of the pump.

RETURNS DESCRIPTION
int

The start speed of the pump.

TYPE: int

getState

getState() -> dict[str, int | bool]

Get the state of the pump.

RETURNS DESCRIPTION
dict[str, int | bool]

dict[str, int|bool]: A dictionary containing the state of the pump.

getStatus

getStatus() -> tuple[bool, str]

Get the status of the pump.

RETURNS DESCRIPTION
tuple[bool, str]

tuple[bool,str]: A tuple containing the busy status and the error code.

getTopSpeed

getTopSpeed() -> int

Get the top speed of the pump.

RETURNS DESCRIPTION
int

The top speed of the pump.

TYPE: int

getValvePosition

getValvePosition() -> str

Get the valve position of the pump.

RETURNS DESCRIPTION
str

The valve position of the pump.

TYPE: str

initialize

initialize(
    output_right: bool | None = None,
    *,
    immediate: bool = True,
)

Initialize the pump.

PARAMETER DESCRIPTION
output_right

Whether the output is on the right side.

TYPE: bool DEFAULT: None

immediate

Whether to execute the command immediately. Defaults to True.

TYPE: bool DEFAULT: True

move

move(
    steps: int,
    *,
    blocking: bool = True,
    immediate: bool = True,
)

Move the plunger by a specified number of steps.

PARAMETER DESCRIPTION
steps

The number of steps to move.

TYPE: int

blocking

Whether to block until the command is executed. Defaults to True.

TYPE: bool DEFAULT: True

immediate

Whether to execute the command immediately. Defaults to True.

TYPE: bool DEFAULT: True

moveBy

moveBy(
    steps: int,
    *,
    blocking: bool = True,
    immediate: bool = True,
)

Move the plunger by a specified number of steps.

PARAMETER DESCRIPTION
steps

The number of steps to move.

TYPE: int

blocking

Whether to block until the command is executed. Defaults to True.

TYPE: bool DEFAULT: True

immediate

Whether to execute the command immediately. Defaults to True.

TYPE: bool DEFAULT: True

moveTo

moveTo(
    position: int,
    *,
    blocking: bool = True,
    immediate: bool = True,
)

Move the plunger to a specified position.

PARAMETER DESCRIPTION
position

The position to move to.

TYPE: int

blocking

Whether to block until the command is executed. Defaults to True.

TYPE: bool DEFAULT: True

immediate

Whether to execute the command immediately. Defaults to True.

TYPE: bool DEFAULT: True

repeat

repeat(cycles: int)

Repeat the last command for a specified number of cycles.

PARAMETER DESCRIPTION
cycles

The number of cycles to repeat the last command.

TYPE: int

reverse

reverse(*, immediate: bool = True)

Reverse the pump.

PARAMETER DESCRIPTION
immediate

Whether to execute the command immediately. Defaults to True.

TYPE: bool DEFAULT: True

run

run(command: str | None = None)

Run the command buffer.

PARAMETER DESCRIPTION
command

The command to run. Defaults to None.

TYPE: str DEFAULT: None

setAcceleration

setAcceleration(
    acceleration: int, *, immediate: bool = True
)

Set the acceleration of the pump.

PARAMETER DESCRIPTION
acceleration

The acceleration of the pump.

TYPE: int

immediate

Whether to execute the command immediately. Defaults to True.

TYPE: bool DEFAULT: True

setChannel

setChannel(channel: int)

Set the channel of the pump.

PARAMETER DESCRIPTION
channel

The channel number of the pump.

TYPE: int

setStartSpeed

setStartSpeed(speed: int, *, immediate: bool = True)

Set the start speed of the pump.

PARAMETER DESCRIPTION
speed

The start speed of the pump.

TYPE: int

immediate

Whether to execute the command immediately. Defaults to True.

TYPE: bool DEFAULT: True

setTopSpeed

setTopSpeed(speed: int, *, immediate: bool = True)

Set the top speed of the pump.

PARAMETER DESCRIPTION
speed

The top speed of the pump.

TYPE: int

immediate

Whether to execute the command immediately. Defaults to True.

TYPE: bool DEFAULT: True

setValvePosition

setValvePosition(valve: str, *, immediate: bool = True)

Set the valve position of the pump.

PARAMETER DESCRIPTION
valve

The valve position of the pump.

TYPE: str

immediate

Whether to execute the command immediately. Defaults to True.

TYPE: bool DEFAULT: True

stop

stop()

Stop the pump.

wait

wait(duration: int | float, *, immediate: bool = True)

Wait for a specified duration.

PARAMETER DESCRIPTION
duration

The duration to wait.

TYPE: int | float

immediate

Whether to execute the command immediately. Defaults to True.

TYPE: bool DEFAULT: True