Bioshake
This module provides a class to control the QInstruments BioShake device.
ATTRIBUTE | DESCRIPTION |
---|---|
MAX_LEN |
maximum length of data buffer
TYPE:
|
ACCELERATION_LIMIT |
lower and upper limits for acceleration
TYPE:
|
CLASS | DESCRIPTION |
---|---|
BioShake |
BioShake provides methods to control the QInstruments BioShake device. |
Documentation last updated: 2025-02-22/i>
BioShake
BioShake(
port: str,
*,
speed_tolerance: float = 10,
temp_tolerance: float = 1.5,
stabilize_timeout: float = 10,
verbose: bool = False,
simulation: bool = False,
**kwargs,
)
Bases: HeaterMixin
, Maker
BioShake provides methods to control the QInstruments BioShake device.
ATTRIBUTE | DESCRIPTION |
---|---|
buffer_df |
buffer dataframe to store collected data
TYPE:
|
records_df |
records dataframe to store collected data
TYPE:
|
limits |
hardware limits for device
TYPE:
|
ranges |
user-defined ranges for controls
TYPE:
|
model |
device model description
TYPE:
|
serial_number |
device serial number
TYPE:
|
acceleration |
acceleration / deceleration of the shaker in seconds
TYPE:
|
speed |
actual speed of shake in rpm
TYPE:
|
set_speed |
target speed
TYPE:
|
speed_tolerance |
fractional tolerance to be considered on target for speed
TYPE:
|
shake_time_left |
remaining time left on shaker
TYPE:
|
temperature |
actual temperature of the plate in °C
TYPE:
|
set_temperature |
target temperature
TYPE:
|
temp_tolerance |
fractional tolerance to be considered on target for temperature
TYPE:
|
stabilize_timeout |
time in seconds to wait before considering temperature stabilized
TYPE:
|
is_counterclockwise |
returns the current mixing direction
TYPE:
|
is_locked |
returns the current ELM state
TYPE:
|
connection_details |
connection details for the device
TYPE:
|
device |
device object that communicates with physical tool
TYPE:
|
flags |
flags for the class
TYPE:
|
is_busy |
whether the device is busy
TYPE:
|
is_connected |
whether the device is connected
TYPE:
|
verbose |
verbosity of class
TYPE:
|
METHOD | DESCRIPTION |
---|---|
clearCache |
clears and remove data in buffer |
connect |
connect to the device |
controlTemp |
switches on/off the temperature control feature and starts/stops heating/cooling |
execute |
Set target temperature, then shake the plate at target speed and hold target temperature for desired duration |
getAcceleration |
returns the acceleration/deceleration value |
getDefaults |
retrieve the default and starting configuration of the device upon start up |
getErrors |
returns a list with errors and warnings which can occur during processing |
getShakeDirection |
returns the current mixing direction |
getElmState |
returns the current ELM state |
getErrors |
returns a list with errors and warnings which can occur during processing |
getShakeTimeLeft |
returns the remaining shake time in seconds if device was started with the a defined duration |
getSpeed |
returns the set speed and current mixing speed in rpm |
getStatus |
retrieve the status of the device's ELM, shaker, and temperature control |
getTemperature |
returns the set temperature and current temperature in °C |
getUserLimits |
retrieve the user defined limits for speed and temperature |
grip |
grip or release the object |
holdTemperature |
hold target temperature for desired duration |
home |
move shaker to the home position and locks in place |
record |
start or stop data recording |
reset |
restarts the controller |
setAcceleration |
sets the acceleration/deceleration value in seconds |
setCounterClockwise |
sets the mixing direction to counter clockwise |
setSpeed |
set the target mixing speed |
setTemperature |
sets target temperature between TempMin and TempMax in 1/10°C increments |
shake |
shake the plate at target speed, for specified duration |
shutdown |
shutdown procedure for tool |
stop |
stop the shaker immediately at an undefined position, ignoring the defined deceleration time if in an emergency |
toggleECO |
toggle the economical mode to save energy and decrease abrasion |
toggleRecord |
start or stop data recording |
toggleShake |
starts/stops shaking with defined speed with defined acceleration/deceleration time |
toggleTemperature |
switches on/off the temperature control feature and starts/st |
Initialize the class
PARAMETER | DESCRIPTION |
---|---|
port
|
serial port address
TYPE:
|
speed_tolerance
|
fractional tolerance to be considered on target for speed. Defaults to 10.
TYPE:
|
temp_tolerance
|
fractional tolerance to be considered on target for temperature. Defaults to 1.5.
TYPE:
|
stabilize_timeout
|
time in seconds to wait before considering temperature stabilized. Defaults to 10.
TYPE:
|
verbose
|
verbosity of class. Defaults to False.
TYPE:
|
simulation
|
whether to simulate. Defaults to False.
TYPE:
|
__serial__
Returns the device serial number
RETURNS | DESCRIPTION |
---|---|
str
|
device serial number
TYPE:
|
__version__
Retrieve the software version on the device
RETURNS | DESCRIPTION |
---|---|
str
|
device version
TYPE:
|
atSpeed
Checks and returns whether target speed has been reached
PARAMETER | DESCRIPTION |
---|---|
speed
|
target speed. Defaults to None.
TYPE:
|
tolerance
|
fractional tolerance to be considered on target. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
whether target speed has been reached
TYPE:
|
atTemperature
atTemperature(
temperature: float | None = None,
*,
tolerance: float | None = None,
stabilize_timeout: float | None = None,
) -> bool
Checks and returns whether target temperature has been reached
PARAMETER | DESCRIPTION |
---|---|
temperature
|
target temperature. Defaults to None.
TYPE:
|
tolerance
|
fractional tolerance to be considered on target. Defaults to None.
TYPE:
|
stabilize_timeout
|
time in seconds to wait before considering temperature stabilized. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
whether target temperature has been reached
TYPE:
|
controlTemp
Switches on/off the temperature control feature and starts/stops heating/cooling
PARAMETER | DESCRIPTION |
---|---|
on
|
whether to start temperature control
TYPE:
|
execute
execute(
shake: bool,
temperature: float | None = None,
speed: int | None = None,
duration: int | None = None,
acceleration: int | None = None,
*args,
**kwargs,
)
Set target temperature, then shake the plate at target speed and hold target temperature for desired duration
Alias for holdTemperature()
and shake()
PARAMETER | DESCRIPTION |
---|---|
shake
|
whether to shake
TYPE:
|
temperature
|
temperature in degree °C. Defaults to None.
TYPE:
|
speed
|
shaking speed. Defaults to None.
TYPE:
|
duration
|
duration of shake. Defaults to None.
TYPE:
|
acceleration
|
acceleration value. Defaults to None.
TYPE:
|
getAcceleration
Returns the acceleration/deceleration value
RETURNS | DESCRIPTION |
---|---|
float
|
acceleration/deceleration value
TYPE:
|
getData
Get data from device
PARAMETER | DESCRIPTION |
---|---|
query
|
query to device. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
FloatData | None
|
FloatData|None: data from device |
getDefaults
Retrieve the default and starting configuration of the device upon start up
getElmState
Returns the current ELM state
RETURNS | DESCRIPTION |
---|---|
int
|
ELM state
TYPE:
|
getErrors
Returns a list with errors and warnings which can occur during processing
RETURNS | DESCRIPTION |
---|---|
list[str]
|
list[str]: list of errors and warnings |
getShakeDirection
Returns the current mixing direction
RETURNS | DESCRIPTION |
---|---|
bool
|
whether mixing direction is counterclockwise
TYPE:
|
getShakeTimeLeft
Returns the remaining shake time in seconds if device was started with the a defined duration
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: minimum target shake speed |
getSpeed
Returns current mixing speed in rpm
RETURNS | DESCRIPTION |
---|---|
float
|
current mixing speed
TYPE:
|
getStatus
Retrieve the status of the device's ELM, shaker, and temperature control
RETURNS | DESCRIPTION |
---|---|
dict[str, int | None]
|
dict[str, int|None]: dictionary of states |
getTargetSpeed
Returns the set temperature
RETURNS | DESCRIPTION |
---|---|
float
|
set temperature
TYPE:
|
getTargetTemp
Returns the set temperature
RETURNS | DESCRIPTION |
---|---|
float
|
set temperature
TYPE:
|
getTemperature
Get temperature
RETURNS | DESCRIPTION |
---|---|
float
|
actual temperature
TYPE:
|
grip
Grip or release the object
PARAMETER | DESCRIPTION |
---|---|
on
|
whether to grip the object
TYPE:
|
home
Move shaker to the home position and locks in place
Note: Minimum response time is less than 4 sec (internal failure timeout)
PARAMETER | DESCRIPTION |
---|---|
timeout
|
number of seconds to wait before aborting. Defaults to 5.
TYPE:
|
record
Start or stop data recording
PARAMETER | DESCRIPTION |
---|---|
on
|
whether to start recording
TYPE:
|
show
|
whether to print out data. Defaults to False.
TYPE:
|
clear_cache
|
whether to clear cache. Defaults to False.
TYPE:
|
reset
Restarts the controller
Note: This takes about 30 seconds for BS units and 5 for the Q1, CP models
PARAMETER | DESCRIPTION |
---|---|
timeout
|
number of seconds to wait before aborting. Defaults to 30.
TYPE:
|
setAcceleration
Sets the acceleration/deceleration value in seconds
PARAMETER | DESCRIPTION |
---|---|
acceleration
|
acceleration value
TYPE:
|
as_default
|
whether to change the default acceleration. Defaults to False.
TYPE:
|
setCounterClockwise
Sets the mixing direction to counter clockwise
PARAMETER | DESCRIPTION |
---|---|
counterclockwise
|
whether to set mixing direction to counter clockwise
TYPE:
|
setSpeed
Set the target mixing speed
Note: Speed values below 200 RPM are possible, but not recommended
PARAMETER | DESCRIPTION |
---|---|
speed
|
target mixing speed
TYPE:
|
as_default
|
whether to change the default speed. Defaults to False.
TYPE:
|
setTemperature
setTemperature(
temperature: float,
blocking: bool = True,
*,
tolerance: float = None,
release: Event = None,
) -> tuple[Thread, Event] | None
Set target temperature between TempMin and TempMax in 1/10°C increments
PARAMETER | DESCRIPTION |
---|---|
temperature
|
target temperature
TYPE:
|
blocking
|
whether to block until temperature is reached. Defaults to True.
TYPE:
|
tolerance
|
fractional tolerance to be considered on target. Defaults to None.
TYPE:
|
release
|
event to release thread. Defaults to None.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
tuple[Thread, Event] | None
|
tuple[threading.Thread, threading.Event]|None: thread and event |
shake
shake(
speed: int | None = None,
duration: int | None = None,
blocking: bool = True,
*,
acceleration: int | None = None,
release: Event | None = None,
)
Shake the plate at target speed, for specified duration
PARAMETER | DESCRIPTION |
---|---|
speed
|
shaking speed. Defaults to None.
TYPE:
|
duration
|
duration of shake. Defaults to None.
TYPE:
|
blocking
|
whether to block until shake is complete. Defaults to True.
TYPE:
|
acceleration
|
acceleration value. Defaults to None.
TYPE:
|
release
|
event to release thread. Defaults to None.
TYPE:
|
stop
Stop the shaker immediately at an undefined position, ignoring the defined deceleration time if in an emergency
PARAMETER | DESCRIPTION |
---|---|
emergency
|
whether to perform an emergency stop. Defaults to True.
TYPE:
|
stream
Start or stop data streaming
PARAMETER | DESCRIPTION |
---|---|
on
|
whether to start streaming
TYPE:
|
show
|
whether to print out data. Defaults to False.
TYPE:
|
toggleECO
Toggle the economical mode to save energy and decrease abrasion
PARAMETER | DESCRIPTION |
---|---|
on
|
whether to enter eco mode
TYPE:
|
timeout
|
number of seconds to wait before aborting. Defaults to 5.
TYPE:
|
toggleShake
Starts/stops shaking with defined speed with defined acceleration/deceleration time. Shake runtime can be specified, as well as whether to return to home position after stopping.
PARAMETER | DESCRIPTION |
---|---|
on
|
whether to start shaking
TYPE:
|
duration
|
shake runtime. Defaults to None.
TYPE:
|
home
|
whether to return to home when shaking stops. Defaults to True.
TYPE:
|