labjack#

Import: apstools.devices.labjack

LabJack Data Acquisition (DAQ)#

LabJackBase([prefix, kind, read_attrs, ...])

A labjack T-series data acquisition unit (DAQ).

Ophyd definitions for Labjack T-series data acquisition devices.

Supported devices, all inherit from LabJackBase:

  • T4

  • T7

  • T7Pro

  • T8

These devices are based on EPICS LabJack module R3.0. The EPICS IOC database changed significantly from R2 to R3 when the module was rewritten to use the LJM library.

There are definitions for the entire LabJack device, as well as the various inputs/outputs available on the LabJack T-series. Individual inputs can be used as part of other devices. Assuming analog input 5 is connected to a gas flow meter:

from ophyd import Component as Cpt
from apstools.devices import labjack

class MyBeamline(Device):
    ...
    gas_flow = Cpt(labjack.AnalogInput, "LabJackT7_1:Ai5")

Module Contents#

class apstools.devices.labjack.AnalogInput(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.AnalogInput

Bases: Input

An analog input on a labjack device.

It is based on the synApps input record, but with LabJack specific signals added.

The .trigger() method will retrieve a fresh value using the .PROC field, though based on how EPICS support works, this is likely just the most recently polled value from the device. This can be useful if the .SCAN field is set to passive.

property base_prefix#
property ch_num#
differential#
enable#
high#
low#
mode#
range#
resolution#
temperature_units#
class apstools.devices.labjack.AnalogOutput(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.AnalogOutput

Bases: Output

An analog output on a labjack device.

class apstools.devices.labjack.DigitalIO(*args, ch_num, **kwargs)[source]#

Import: apstools.devices.labjack.DigitalIO

Bases: ophyd.Device

A digital input/output channel on the labjack.

Because of the how the records are structured in EPICS, the prefix must not include the “Bi{N}” portion of the prefix. Instead, the prefix should be prefix for the whole labjack (e.g. LabJackT7_1:), and the channel number should be provided using the ch_num property. So for the digital I/O with its input available at PV LabJackT7_1:Bi3, use:

dio3 = DigitalIO("LabJackT7_1:", name="dio3", ch_num=3)

This will create signals for the input (Bi3), output (Bo3), and direction (Bd3) records.

ch_num: int#
direction#
input#
output#
class apstools.devices.labjack.LabJackBase(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.LabJackBase

Bases: ophyd.Device

A labjack T-series data acquisition unit (DAQ).

To use the individual components separately, consider using the corresponding devices in the list below.

This device contains signals for the following:

The number of inputs and digital outputs depends on the specific LabJack T-series device being used. Therefore, the base device LabJackBase does not implement these I/O signals. Instead, consider using one of the subclasses, like LabJackT4.

The .trigger() method does not do much. To retrieve fresh values for analog inputs where .SCAN is passive, you will need to trigger the individual inputs themselves.

The waveform generator and waveform digitizer are included for convenience. Reading all the analog/digital inputs and outputs can be done by calling the .read() method. However, it is unlikely that the goal is also to trigger the digitizer and generator during this read. For this reason, the digitizer and generator have kind=”omitted”. To trigger the digitizer or generator, they can be used as separate devices:

lj = LabJackT4(...)

# Read a waveform from the digitizer
lj.waveform_digitizer.trigger().wait()
lj.waveform_digitizer.read()

# Same thing for the waveform generator
lj.waveform_generator.trigger().wait()
analog_in_resolution_all#
analog_in_sampling_rate#
analog_in_settling_time_all#
analog_outputs#
device_reset#
device_temperature#
driver_version#
firmware_version#
last_error_message#
ljm_version#
model_name#
poll_sleep_ms#
poll_time_ms#
serial_number#
waveform_generator#
class apstools.devices.labjack.LabJackT4(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.LabJackT4

Bases: LabJackBase

A labjack T-series data acquisition unit (DAQ).

To use the individual components separately, consider using the corresponding devices in the list below.

This device contains signals for the following:

The number of inputs and digital outputs depends on the specific LabJack T-series device being used. Therefore, the base device LabJackBase does not implement these I/O signals. Instead, consider using one of the subclasses, like LabJackT4.

The .trigger() method does not do much. To retrieve fresh values for analog inputs where .SCAN is passive, you will need to trigger the individual inputs themselves.

The waveform generator and waveform digitizer are included for convenience. Reading all the analog/digital inputs and outputs can be done by calling the .read() method. However, it is unlikely that the goal is also to trigger the digitizer and generator during this read. For this reason, the digitizer and generator have kind=”omitted”. To trigger the digitizer or generator, they can be used as separate devices:

lj = LabJackT4(...)

# Read a waveform from the digitizer
lj.waveform_digitizer.trigger().wait()
lj.waveform_digitizer.read()

# Same thing for the waveform generator
lj.waveform_generator.trigger().wait()
class WaveformDigitizer(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.LabJackT4.WaveformDigitizer

Bases: WaveformDigitizer

A feature of the Labjack devices that allows waveform capture.

By itself, this device does not include any actual data. It should be sub-classed for the individual T-series devices to use make_digitizer_waveforms() to produce waveform signals based on the number of inputs, using the ophyd DynamicDeviceComponent.

class T7Digitizer(WaveformDigitizer):
    waveforms = DCpt(make_digitizer_waveforms(14), kind="normal")
waveforms#
analog_inputs#
digital_ios#
waveform_digitizer#
class apstools.devices.labjack.LabJackT7(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.LabJackT7

Bases: LabJackBase

A labjack T-series data acquisition unit (DAQ).

To use the individual components separately, consider using the corresponding devices in the list below.

This device contains signals for the following:

The number of inputs and digital outputs depends on the specific LabJack T-series device being used. Therefore, the base device LabJackBase does not implement these I/O signals. Instead, consider using one of the subclasses, like LabJackT4.

The .trigger() method does not do much. To retrieve fresh values for analog inputs where .SCAN is passive, you will need to trigger the individual inputs themselves.

The waveform generator and waveform digitizer are included for convenience. Reading all the analog/digital inputs and outputs can be done by calling the .read() method. However, it is unlikely that the goal is also to trigger the digitizer and generator during this read. For this reason, the digitizer and generator have kind=”omitted”. To trigger the digitizer or generator, they can be used as separate devices:

lj = LabJackT4(...)

# Read a waveform from the digitizer
lj.waveform_digitizer.trigger().wait()
lj.waveform_digitizer.read()

# Same thing for the waveform generator
lj.waveform_generator.trigger().wait()
class WaveformDigitizer(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.LabJackT7.WaveformDigitizer

Bases: WaveformDigitizer

A feature of the Labjack devices that allows waveform capture.

By itself, this device does not include any actual data. It should be sub-classed for the individual T-series devices to use make_digitizer_waveforms() to produce waveform signals based on the number of inputs, using the ophyd DynamicDeviceComponent.

class T7Digitizer(WaveformDigitizer):
    waveforms = DCpt(make_digitizer_waveforms(14), kind="normal")
waveforms#
analog_inputs#
digital_ios#
waveform_digitizer#
class apstools.devices.labjack.LabJackT7Pro(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.LabJackT7Pro

Bases: LabJackBase

A labjack T-series data acquisition unit (DAQ).

To use the individual components separately, consider using the corresponding devices in the list below.

This device contains signals for the following:

The number of inputs and digital outputs depends on the specific LabJack T-series device being used. Therefore, the base device LabJackBase does not implement these I/O signals. Instead, consider using one of the subclasses, like LabJackT4.

The .trigger() method does not do much. To retrieve fresh values for analog inputs where .SCAN is passive, you will need to trigger the individual inputs themselves.

The waveform generator and waveform digitizer are included for convenience. Reading all the analog/digital inputs and outputs can be done by calling the .read() method. However, it is unlikely that the goal is also to trigger the digitizer and generator during this read. For this reason, the digitizer and generator have kind=”omitted”. To trigger the digitizer or generator, they can be used as separate devices:

lj = LabJackT4(...)

# Read a waveform from the digitizer
lj.waveform_digitizer.trigger().wait()
lj.waveform_digitizer.read()

# Same thing for the waveform generator
lj.waveform_generator.trigger().wait()
class WaveformDigitizer(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.LabJackT7Pro.WaveformDigitizer

Bases: WaveformDigitizer

A feature of the Labjack devices that allows waveform capture.

By itself, this device does not include any actual data. It should be sub-classed for the individual T-series devices to use make_digitizer_waveforms() to produce waveform signals based on the number of inputs, using the ophyd DynamicDeviceComponent.

class T7Digitizer(WaveformDigitizer):
    waveforms = DCpt(make_digitizer_waveforms(14), kind="normal")
waveforms#
analog_inputs#
digital_ios#
waveform_digitizer#
class apstools.devices.labjack.LabJackT8(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.LabJackT8

Bases: LabJackBase

A labjack T-series data acquisition unit (DAQ).

To use the individual components separately, consider using the corresponding devices in the list below.

This device contains signals for the following:

The number of inputs and digital outputs depends on the specific LabJack T-series device being used. Therefore, the base device LabJackBase does not implement these I/O signals. Instead, consider using one of the subclasses, like LabJackT4.

The .trigger() method does not do much. To retrieve fresh values for analog inputs where .SCAN is passive, you will need to trigger the individual inputs themselves.

The waveform generator and waveform digitizer are included for convenience. Reading all the analog/digital inputs and outputs can be done by calling the .read() method. However, it is unlikely that the goal is also to trigger the digitizer and generator during this read. For this reason, the digitizer and generator have kind=”omitted”. To trigger the digitizer or generator, they can be used as separate devices:

lj = LabJackT4(...)

# Read a waveform from the digitizer
lj.waveform_digitizer.trigger().wait()
lj.waveform_digitizer.read()

# Same thing for the waveform generator
lj.waveform_generator.trigger().wait()
class WaveformDigitizer(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.LabJackT8.WaveformDigitizer

Bases: WaveformDigitizer

A feature of the Labjack devices that allows waveform capture.

By itself, this device does not include any actual data. It should be sub-classed for the individual T-series devices to use make_digitizer_waveforms() to produce waveform signals based on the number of inputs, using the ophyd DynamicDeviceComponent.

class T7Digitizer(WaveformDigitizer):
    waveforms = DCpt(make_digitizer_waveforms(14), kind="normal")
waveforms#
analog_inputs#
digital_ios#
waveform_digitizer#
class apstools.devices.labjack.WaveformDigitizer(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.WaveformDigitizer

Bases: ophyd.Device

A feature of the Labjack devices that allows waveform capture.

By itself, this device does not include any actual data. It should be sub-classed for the individual T-series devices to use make_digitizer_waveforms() to produce waveform signals based on the number of inputs, using the ophyd DynamicDeviceComponent.

class T7Digitizer(WaveformDigitizer):
    waveforms = DCpt(make_digitizer_waveforms(14), kind="normal")
auto_restart#
current_point#
dwell#
dwell_actual#
ext_clock#
ext_trigger#
first_chan#
num_chans#
num_points#
read_waveform#
resolution#
run#
settling_time#
timebase_waveform#
total_time#
class apstools.devices.labjack.WaveformGenerator(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, child_name_separator='_', connection_timeout=DEFAULT_CONNECTION_TIMEOUT, **kwargs)[source]#

Import: apstools.devices.labjack.WaveformGenerator

Bases: ophyd.Device

A feature of the Labjack devices that generates output waveforms.

amplitude_0#
amplitude_1#
continuous#
current_point#
dwell#
dwell_actual#
enable_0#
enable_1#
external_clock#
external_trigger#
frequency#
internal_dwell#
internal_frequency#
internal_num_points#
internal_time_waveform#
internal_waveform_0#
internal_waveform_1#
num_points#
offset_0#
offset_1#
pulse_width_0#
pulse_width_1#
run#
total_time#
type_0#
type_1#
user_dwell#
user_frequency#
user_num_points#
user_time_waveform#
user_waveform_0#
user_waveform_1#
apstools.devices.labjack.make_digitizer_waveforms(num_ais: int)[source]#

Import: apstools.devices.labjack.make_digitizer_waveforms

Create a dictionary with volt waveforms for the digitizer.

For use with an ophyd DynamicDeviceComponent.

Each analog input on the labjack could be included here, and probably should be unless there is a specific reason not to.

Parameters#

num_ais

How many analog inputs to include for this Labjack device.