Load Cell
This module provides a class for the load cell.
ATTRIBUTE | DESCRIPTION |
---|---|
READ_FORMAT |
Format for reading data
TYPE:
|
ValueData |
NamedTuple for value data
TYPE:
|
CLASS | DESCRIPTION |
---|---|
LoadCell |
Load cell class |
Documentation last updated: 2025-02-22
LoadCell
LoadCell(
port: str,
stabilize_timeout: float = 1,
force_tolerance: float = 0.01,
*,
calibration_factor: float = 1.0,
correction_parameters: tuple[float] = (1.0, 0.0),
baudrate: int = 115200,
verbose: bool = False,
**kwargs,
)
Bases: Measurer
Load cell
ATTRIBUTE | DESCRIPTION |
---|---|
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 |
getAttributes |
Get attributes |
getData |
Get data from device |
getDataframe |
Get data as a DataFrame |
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 LoadCell class
PARAMETER | DESCRIPTION |
---|---|
port
|
Serial port
TYPE:
|
stabilize_timeout
|
Time to wait for the device to stabilize
TYPE:
|
force_tolerance
|
Tolerance for force
TYPE:
|
calibration_factor
|
counts per unit force
TYPE:
|
correction_parameters
|
polynomial correction parameters, starting with highest order
TYPE:
|
baudrate
|
Baudrate for serial communication
TYPE:
|
verbose
|
Print verbose output
TYPE:
|
atForce
atForce(
force: float,
current_force: float | None = None,
*,
tolerance: float | None = None,
stabilize_timeout: float = 0,
) -> bool
Check if the device is at the target temperature
PARAMETER | DESCRIPTION |
---|---|
force
|
Target force
TYPE:
|
tolerance
|
Tolerance for force
TYPE:
|
stabilize_timeout
|
Time to wait for the device to stabilize
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
bool
|
True if the device is at the target force
TYPE:
|
getData
Get data from device
RETURNS | DESCRIPTION |
---|---|
ValueData
|
Value data
TYPE:
|