BaseLabJackDataClient#
- class lsst.ts.ess.labjack.BaseLabJackDataClient(config, topics, log, simulation_mode=0)#
Bases:
BaseReadLoopDataClient,ABCBase class for ESS data clients that read a LabJack T7 or similar.
- Parameters:
name (
str)config (
types.SimpleNamespace) – The configuration, after validation by the schema returned byget_config_schemaand conversion to a types.SimpleNamespace.topics (
salobj.Controller) – The telemetry topics this model can write, as a struct with attributes such astel_temperature.log (
logging.Logger) – Logger.simulation_mode (
int, optional) – Simulation mode; 0 for normal operation.
Notes
In simulation mode the mock LabJack returns unspecified values, and those values may change in future versions of the LabJack software.
Attributes Summary
Methods Summary
connect()Connect to the LabJack.
descr()Return a brief description, without the class name.
Disconnect from the LabJack.
run_in_thread(func, timeout)Run a blocking function in a thread pool executor.
start()Start the run task.
stop()Stop reading and publishing data.
Attributes Documentation
- connected#
Methods Documentation
- async connect()#
Connect to the LabJack.
Disconnect first, if connected.
- Raises:
RuntimeError – If we cannot read the data.
- Return type:
- descr()#
Return a brief description, without the class name.
This should be just enough information to distinguish one instance of this client from another.
- Return type:
- async run_in_thread(func, timeout)#
Run a blocking function in a thread pool executor.
Only one function will run at a time, because all calls use the same thread pool executor, which only has a single thread.
- async stop()#
Stop reading and publishing data.
This is alway safe to call, whether connected or not. This should raise no exceptions except asyncio.CancelledError. If
disconnectraises, this logs the exception and continues.- Return type: