Balance
This module provides a class for the balance.
ATTRIBUTE | DESCRIPTION |
---|---|
G |
Acceleration due to gravity
TYPE:
|
CLASS | DESCRIPTION |
---|---|
Balance |
Balance class |
Documentation last updated: 2025-02-22
Balance
Balance(
port: str,
stabilize_timeout: float = 10,
force_tolerance: float = 1.5,
mass_tolerance: float = 0.15,
*,
calibration_factor: float = 1.0,
correction_parameters: tuple[float] = (1.0, 0.0),
baudrate: int = 115200,
verbose: bool = False,
**kwargs,
)
Bases: LoadCell
Balance class for interfacing with a balance.
ATTRIBUTE | DESCRIPTION |
---|---|
mass_tolerance |
The tolerance for the mass measurement.
TYPE:
|
force_tolerance |
Tolerance for force
TYPE:
|
stabilize_timeout |
Time to wait for the device to stabilize
TYPE:
|
baseline |
Baseline value
TYPE:
|
calibration_factor |
counts per unit force
TYPE:
|
correction_parameters |
polynomial correction parameters, starting with highest order
TYPE:
|
buffer |
data buffer for the device
TYPE:
|
buffer_df |
data buffer as a DataFrame
TYPE:
|
records |
records for the device
TYPE:
|
records_df |
records as a DataFrame
TYPE:
|
record_event |
event for recording data
TYPE:
|
program |
program to run
TYPE:
|
runs |
dictionary of runs
TYPE:
|
n_runs |
number of runs
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:
|
METHOD | DESCRIPTION |
---|---|
connect |
Connect to the device |
getDataframe |
Get a DataFrame from the data store |
atMass |
Check if the balance is at a specific mass |
getMass |
Get the mass measured by the balance |
tare |
Tare the balance |
getAttributes |
Get attributes |
getData |
Get data from device |
atForce |
Check if the device is at the target force |
getForce |
Get force |
getValue |
Get value |
reset |
Reset the device |
zero |
Set current reading as baseline |
disconnect |
disconnect from the device |
execute |
execute task |
resetFlags |
reset all flags to class attribute _default_flags |
run |
alias for execute() |
shutdown |
shutdown procedure for tool |
Initialize the balance.
PARAMETER | DESCRIPTION |
---|---|
port
|
The port to connect to.
TYPE:
|
stabilize_timeout
|
The time to wait for the balance to stabilize.
TYPE:
|
force_tolerance
|
The tolerance for the force measurement.
TYPE:
|
mass_tolerance
|
The tolerance for the mass measurement
TYPE:
|
calibration_factor
|
The calibration factor for the balance.
TYPE:
|
correction_parameters
|
The correction parameters for the balance.
TYPE:
|
baudrate
|
The baudrate for the balance.
TYPE:
|
verbose
|
The verbosity of the balance.
TYPE:
|
atMass
Check if the balance is at a specific mass.
PARAMETER | DESCRIPTION |
---|---|
mass
|
The mass to check for.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
float
|
The force measured by the balance.
TYPE:
|
getMass
Get the mass measured by the balance.
RETURNS | DESCRIPTION |
---|---|
float
|
The mass measured by the balance.
TYPE:
|