Qinstruments Api
QInstruments API for controlling hardware from QInstruments.
ATTRIBUTE | DESCRIPTION |
---|---|
READ_FORMAT |
format for reading data
TYPE:
|
WRITE_FORMAT |
format for writing data
TYPE:
|
Data |
data type for data
TYPE:
|
BoolData |
data type for boolean data
TYPE:
|
FloatData |
data type for float data
TYPE:
|
IntData |
data type for integer data
TYPE:
|
CLASS | DESCRIPTION |
---|---|
QInstrumentsDevice |
provides an interface for available actions to control devices from QInstruments |
Documentation last updated: 2025-02-22
QInstrumentsDevice
QInstrumentsDevice(
port: str | None = None,
baudrate: int = 9600,
timeout: int = 1,
*,
init_timeout: int = 5,
data_type: NamedTuple = Data,
read_format: str = READ_FORMAT,
write_format: str = WRITE_FORMAT,
simulation: bool = False,
verbose: bool = False,
**kwargs,
)
Bases: SerialDevice
QInstrumentsDevice provides an interface for available actions to control devices from QInstruments, including orbital shakers, heat plates, and cold plates.
ATTRIBUTE | DESCRIPTION |
---|---|
port |
device serial port
TYPE:
|
baudrate |
device baudrate
TYPE:
|
timeout |
device timeout
TYPE:
|
connection_details |
connection details for the device
TYPE:
|
serial |
serial object for the device
TYPE:
|
init_timeout |
timeout for initialization
TYPE:
|
message_end |
message end character
TYPE:
|
model |
device model
TYPE:
|
flags |
flags for the device
TYPE:
|
is_connected |
whether the device is connected
TYPE:
|
verbose |
verbosity of class
TYPE:
|
METHOD | DESCRIPTION |
---|---|
clear |
clear the input and output buffers |
connect |
connect to the device |
disconnect |
disconnect from the device |
query |
query the device (i.e. write and read data) |
read |
read data from the device |
write |
write data to the device |
disableBootScreen |
permanent deactivation of the boot screen startup text |
disableCLED |
permanent deactivation of the LED indication lights |
enableBootScreen |
permanent activation of the boot screen startup text |
enableCLED |
permanent activation of the LED indication lights |
flashLed |
user device LED flashes five times |
getCLED |
returns the status LED state |
getDescription |
returns model type |
getErrorList |
returns a list with errors and warnings which can occur during processing |
getSerial |
returns the device serial number |
getVersion |
returns the firmware version number |
info |
retrieve the boot screen text |
resetDevice |
restarts the controller |
setBuzzer |
ring the buzzer for duration in milliseconds |
version |
returns the model type and firmware version number |
leaveEcoMode |
leaves the economical mode and switches into the normal operating state |
setEcoMode |
witches the shaker into economical mode and reduces electricity consumption |
getShakeAcceleration |
returns the acceleration/deceleration value |
getShakeAccelerationMax |
get the maximum acceleration/deceleration time in seconds |
getShakeAccelerationMin |
get the minimum acceleration/deceleration time in seconds |
getShakeActualSpeed |
returns the current mixing speed |
getShakeDefaultDirection |
returns the mixing direction when the device starts up |
getShakeDirection |
returns the current mixing direction |
getShakeMaxRpm |
returns the device specific maximum target speed (i.e. hardware limits) |
getShakeMinRpm |
returns the device specific minimum target speed (i.e. hardware limits) |
getShakeRemainingTime |
returns the remaining time in seconds if device was started with the command shakeOnWithRuntime |
getShakeSpeedLimitMax |
returns the upper limit for the target speed |
getShakeSpeedLimitMin |
returns the lower limit for the target speed |
getShakeState |
returns shaker state as an integer |
getShakeStateAsString |
returns shaker state as a string |
getShakeTargetSpeed |
returns the target mixing speed |
setShakeAcceleration |
sets the acceleration/deceleration value in seconds |
setShakeDefaultDirection |
permanently sets the default mixing direction after device start up |
setShakeDirection |
sets the mixing direction |
setShakeSpeedLimitMax |
permanently set upper limit for the target speed (between 0 to 3000) |
setShakeSpeedLimitMin |
permanently set lower limit for the target speed (between 0 to 3000) |
setShakeTargetSpeed |
set the target mixing speed |
shakeEmergencyOff |
stop the shaker immediately at an undefined position ignoring the defined deceleration time |
shakeGoHome |
move shaker to the home position and locks in place |
shakeOff |
stops shaking within the defined deceleration time, go to the home position and locks in place |
shakeOffNonZeroPos |
tops shaking within the defined deceleration time, do not go to home position and do not lock in home position |
shakeOffWithDeEnergizeSolenoid |
tops shaking within the defined deceleration time, go to the home position and locks in place for 1 second, then unlock home position |
shakeOn |
tarts shaking with defined speed with defined acceleration time |
shakeOnWithRuntime |
starts shaking with defined speed within defined acceleration time for given time value in seconds |
getTemp40Calibr |
returns the offset value at the 40°C calibration point |
getTemp90Calibr |
returns the offset value at the 90°C calibration point |
getTempActual |
returns the current temperature in celsius |
getTempLimiterMax |
returns the upper limit for the target temperature in celsius |
getTempLimiterMin |
returns the lower limit for the target temperature in celsius |
getTempMax |
returns the device specific maximum target temperature in celsius (i.e. hardware limits) |
getTempMin |
returns the device specific minimum target temperature in celsius (i.e. hardware limits) |
getTempState |
returns the state of the temperature control feature |
getTempTarget |
returns the target temperature |
setTemp40Calibr |
permanently sets the offset value at the 40°C calibration point in 1/10°C increments |
setTemp90Calibr |
permanently sets the offset value at the 90°C calibration point in 1/10°C increments |
setTempLimiterMax |
permanently sets the upper limit for the target temperature in 1/10°C increments |
setTempLimiterMin |
permanently sets the lower limit for the target temperature in 1/10°C increments |
setTempTarget |
sets target temperature between TempMin and TempMax in 1/10°C increments |
tempOff |
switches off the temperature control feature and stops heating/cooling |
tempOn |
switches on the temperature control feature and starts heating/cooling |
getElmSelftest |
returns whether the ELM self-test is enabled or disabled at device startup |
getElmStartupPosition |
returns whether ELM is unlocked after device startup |
getElmState |
returns the ELM status |
getElmStateAsString |
returns the ELM status as a string |
setElmLockPos |
close the ELM |
setElmSelftest |
permanently set whether the ELM self-test is enabled at device startup |
setElmStartupPosition |
permanently set whether the ELM is unlocked after device startup |
setElmUnlockPos |
open the ELM |
Initialize QInstrumentsDevice class
PARAMETER | DESCRIPTION |
---|---|
port
|
serial port for the device. Defaults to None.
TYPE:
|
baudrate
|
baudrate for the device. Defaults to 9600.
TYPE:
|
timeout
|
timeout for the device. Defaults to 1.
TYPE:
|
init_timeout
|
timeout for initialization. Defaults to 5.
TYPE:
|
data_type
|
data type for data. Defaults to Data.
TYPE:
|
read_format
|
format for reading data. Defaults to READ_FORMAT.
TYPE:
|
write_format
|
format for writing data. Defaults to WRITE_FORMAT.
TYPE:
|
simulation
|
whether to simulate the device. Defaults to False.
TYPE:
|
verbose
|
verbosity of class. Defaults to False.
TYPE:
|
disableCLED
Permanent deactivation of the LED indication lights. The instrument will reset after this command.
enableCLED
Permanent activation of the LED indication lights. The instrument will reset after this command.
getCLED
Returns the status LED state
RETURNS | DESCRIPTION |
---|---|
bool | None
|
bool|None: whether the LED is enabled |
getDescription
Returns model type
RETURNS | DESCRIPTION |
---|---|
str
|
model type
TYPE:
|
getElmSelftest
Returns whether the ELM self-test is enabled or disabled at device startup
RETURNS | DESCRIPTION |
---|---|
bool
|
whether ELM self-test is enabled at device startup
TYPE:
|
getElmStartupPosition
Returns whether ELM is unlocked after device startup
RETURNS | DESCRIPTION |
---|---|
bool
|
whether ELM is unlocked after device startup
TYPE:
|
getElmState
Returns the ELM status
RETURNS | DESCRIPTION |
---|---|
int | None
|
int|None: ELM status as integer |
getElmStateAsString
Returns the ELM status as a string
RETURNS | DESCRIPTION |
---|---|
str | None
|
str|None: ELM status as string |
getErrorList
Returns a list with errors and warnings which can occur during processing
RETURNS | DESCRIPTION |
---|---|
list[str]
|
list[str]: list of errors and warnings |
getSerial
Returns the device serial number
RETURNS | DESCRIPTION |
---|---|
str
|
device serial number
TYPE:
|
getShakeAcceleration
Returns the acceleration/deceleration value
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: acceleration/deceleration value |
getShakeAccelerationMax
Get the maximum acceleration/deceleration time in seconds
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: acceleration/deceleration time in seconds |
getShakeAccelerationMin
Get the minimum acceleration/deceleration time in seconds
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: acceleration/deceleration time in seconds |
getShakeActualSpeed
Returns the current mixing speed
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: current mixing speed |
getShakeDefaultDirection
Returns the mixing direction when the device starts up
RETURNS | DESCRIPTION |
---|---|
bool | None
|
bool|None: whether mixing direction is counterclockwise |
getShakeDirection
Returns the current mixing direction
RETURNS | DESCRIPTION |
---|---|
bool | None
|
bool|None: whether mixing direction is counterclockwise |
getShakeMaxRpm
Returns the device specific maximum target speed (i.e. hardware limits)
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: maximum target shake speed |
getShakeMinRpm
Returns the device specific minimum target speed (i.e. hardware limits)
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: minimum target shake speed |
getShakeRemainingTime
Returns the remaining time in seconds if device was started with the command shakeOnWithRuntime
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: minimum target shake speed |
getShakeSpeedLimitMax
Returns the upper limit for the target speed
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: upper limit for the target speed |
getShakeSpeedLimitMin
Returns the lower limit for the target speed
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: lower limit for the target speed |
getShakeState
Returns shaker state as an integer
RETURNS | DESCRIPTION |
---|---|
int | None
|
int|None: shaker state as integer |
getShakeStateAsString
Returns shaker state as a string
RETURNS | DESCRIPTION |
---|---|
str | None
|
str|None: shaker state as string |
getShakeTargetSpeed
Returns the target mixing speed
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: target mixing speed |
getTemp40Calibr
Returns the offset value at the 40°C calibration point
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: offset value at the 40°C calibration point |
getTemp90Calibr
Returns the offset value at the 90°C calibration point
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: offset value at the 90°C calibration point |
getTempActual
Returns the current temperature in celsius
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: current temperature in celsius |
getTempLimiterMax
Returns the upper limit for the target temperature in celsius
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: upper limit for the target temperature in celsius |
getTempLimiterMin
Returns the lower limit for the target temperature in celsius
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: lower limit for the target temperature in celsius |
getTempMax
Returns the device specific maximum target temperature in celsius (i.e. hardware limits)
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: device specific maximum target temperature in celsius |
getTempMin
Returns the device specific minimum target temperature in celsius (i.e. hardware limits)
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: device specific minimum target temperature in celsius |
getTempState
Returns the state of the temperature control feature
RETURNS | DESCRIPTION |
---|---|
bool
|
whether temperature control is enabled
TYPE:
|
getTempTarget
Returns the target temperature
RETURNS | DESCRIPTION |
---|---|
float | None
|
float|None: target temperature |
getVersion
Returns the firmware version number
RETURNS | DESCRIPTION |
---|---|
str
|
firmware version number
TYPE:
|
leaveEcoMode
Leaves the economical mode and switches into the normal operating state
PARAMETER | DESCRIPTION |
---|---|
timeout
|
number of seconds to wait before aborting. Defaults to 5.
TYPE:
|
query
query(
data: Any,
multi_out: bool = False,
*,
timeout: int | float = 0.3,
format_in: str | None = None,
format_out: str | None = None,
data_type: NamedTuple | None = None,
timestamp: bool = False,
) -> Any
Query the device (i.e. write and read data)
PARAMETER | DESCRIPTION |
---|---|
data
|
data to write to the device
TYPE:
|
multi_out
|
whether to expect multiple outputs. Defaults to False.
TYPE:
|
timeout
|
timeout for the query. Defaults to 0.3.
TYPE:
|
format_in
|
format for writing data. Defaults to None.
TYPE:
|
format_out
|
format for reading data. Defaults to None.
TYPE:
|
data_type
|
data type for data. Defaults to None.
TYPE:
|
timestamp
|
whether to include a timestamp. Defaults to False.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Any
|
str|float|None: response (string / float) |
resetDevice
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:
|
setBuzzer
Ring the buzzer for duration in milliseconds
PARAMETER | DESCRIPTION |
---|---|
duration
|
duration in milliseconds, from 50 to 999
TYPE:
|
setEcoMode
Switches the shaker into economical mode and reduces electricity consumption.
Note: all commands after this, other than leaveEcoMode, will return e
PARAMETER | DESCRIPTION |
---|---|
timeout
|
number of seconds to wait before aborting. Defaults to 5.
TYPE:
|
setElmLockPos
Close the ELM
PARAMETER | DESCRIPTION |
---|---|
timeout
|
number of seconds to wait before aborting. Defaults to 5.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
whether the ELM was successfully closed
TYPE:
|
setElmSelftest
Permanently set whether the ELM self-test is enabled at device startup
PARAMETER | DESCRIPTION |
---|---|
enable
|
whether the ELM self-test is enabled at device startup
TYPE:
|
setElmStartupPosition
Permanently set whether the ELM is unlocked after device startup
PARAMETER | DESCRIPTION |
---|---|
unlock
|
whether the ELM is unlocked after device startup
TYPE:
|
setElmUnlockPos
Open the ELM
Note: The ELM should only be opened when the tablar is in the home position.
PARAMETER | DESCRIPTION |
---|---|
timeout
|
number of seconds to wait before aborting. Defaults to 5.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
whether the ELM was successfully opened
TYPE:
|
setShakeAcceleration
Sets the acceleration/deceleration value in seconds
PARAMETER | DESCRIPTION |
---|---|
acceleration
|
acceleration value
TYPE:
|
setShakeDefaultDirection
Permanently sets the default mixing direction after device start up
PARAMETER | DESCRIPTION |
---|---|
counterclockwise
|
whether to set default mixing direction to counter clockwise
TYPE:
|
setShakeDirection
Sets the mixing direction
PARAMETER | DESCRIPTION |
---|---|
counterclockwise
|
whether to set mixing direction to counter clockwise
TYPE:
|
setShakeSpeedLimitMax
Permanently set upper limit for the target speed (between 0 to 3000)
PARAMETER | DESCRIPTION |
---|---|
speed
|
upper limit for the target speed
TYPE:
|
setShakeSpeedLimitMin
Permanently set lower limit for the target speed (between 0 to 3000)
Note: Speed values below 200 RPM are possible, but not recommended
PARAMETER | DESCRIPTION |
---|---|
speed
|
lower limit for the target speed
TYPE:
|
setShakeTargetSpeed
Set the target mixing speed
Note: Speed values below 200 RPM are possible, but not recommended
PARAMETER | DESCRIPTION |
---|---|
speed
|
target mixing speed
TYPE:
|
setTemp40Calibr
Permanently sets the offset value at the 40°C calibration point in 1/10°C increments
PARAMETER | DESCRIPTION |
---|---|
temperature_calibration_40
|
offset value (between 0°C and 99°C)
TYPE:
|
setTemp90Calibr
Permanently sets the offset value at the 90°C calibration point in 1/10°C increments
PARAMETER | DESCRIPTION |
---|---|
temperature_calibration_90
|
offset value (between 0°C and 99°C)
TYPE:
|
setTempLimiterMax
Permanently sets the upper limit for the target temperature in 1/10°C increments
PARAMETER | DESCRIPTION |
---|---|
temperature_max
|
upper limit for the target temperature (between -20.0°C and 99.9°C)
TYPE:
|
setTempLimiterMin
Permanently sets the lower limit for the target temperature in 1/10°C increments
PARAMETER | DESCRIPTION |
---|---|
temperature_min
|
lower limit for the target temperature (between -20.0°C and 99.9°C)
TYPE:
|
setTempTarget
Sets target temperature between TempMin and TempMax in 1/10°C increments
PARAMETER | DESCRIPTION |
---|---|
temperature
|
target temperature (between TempMin and TempMax)
TYPE:
|
shakeEmergencyOff
Stop the shaker immediately at an undefined position ignoring the defined deceleration time
shakeGoHome
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:
|
shakeOff
Stops shaking within the defined deceleration time, go to the home position and locks in place
shakeOffNonZeroPos
Stops shaking within the defined deceleration time, do not go to home position and do not lock in home position
shakeOffWithDeEnergizeSolenoid
Stops shaking within the defined deceleration time, go to the home position and locks in place for 1 second, then unlock home position
shakeOnWithRuntime
Starts shaking with defined speed within defined acceleration time for given time value in seconds
PARAMETER | DESCRIPTION |
---|---|
duration
|
shake duration in seconds (from 0 to 999,999)
TYPE:
|