Skip to main content
The Net class is the primary abstraction for interacting with hardware instruments. It provides a unified interface for controlling different types of hardware including power supplies, oscilloscopes, GPIO, ADC, DAC, and more.

Import

Class Methods

Instance Methods

Method Reference

Net.get(name, type, *, setup_function=None, teardown_function=None)

Create a Net instance for the specified net name and type.
Parameters: Returns: An object for the net’s role. For most roles this is a role-specific class, for example LabJackGPIO, DebugNet, UARTNet, YubiHsm2 or a supply function mapper. Those classes have the methods on the role’s page, and they do not always have enable() and disable().

Net.list_saved()

List all nets configured on the Lager Box.
Returns: list[dict] - List of net configurations with keys:
  • name (str) - Net name
  • role (str) - Net type/role
  • pin (str) - Hardware channel, as lager nets add saved it
  • instrument (str) - Associated instrument type
  • address (str) - Instrument address

Net.list_all_from_env()

List nets from the LAGER_MUXES environment variable (legacy behavior).
Returns: list[dict] - List of net information

Net.save_local_net(data)

Save a net configuration to the Lager Box.
Parameters:

Net.delete_local_net(name, role=None)

Delete a net configuration from the Lager Box.
Parameters: Returns: bool - True if net was deleted

Net.rename_local_net(old_name, new_name)

Rename a net configuration.
Parameters: Returns: bool - True if net was renamed

Net.get_local_nets()

Get all local net configurations.
Returns: list[dict] - List of net configuration dictionaries

Net.save_local_nets(nets)

Save multiple net configurations at once.
Parameters:

Net.delete_all_local_nets()

Delete all net configurations from the Lager Box.
Returns: bool - True if nets were deleted

Net.filter_nets(all_nets, name, role=None)

Return the list without the nets that match a name, and optionally a role. This is the helper delete_local_net() uses. To find a net, filter the list yourself: [n for n in all_nets if n['name'] == 'VDD'].
Parameters: Returns: list[dict] - The nets that do not match

enable()

Enable the net and connect to hardware.
Behavior by net type:
  • Analog: Connects to multiplexer and enables oscilloscope channel
  • Logic: Enables logic analyzer channel
  • Battery: Enables battery simulation output
  • PowerSupply: Enables power supply output
  • ELoad: Enables electronic load

disable(teardown=True)

Disable the net and disconnect from hardware.
Parameters:

NetType Enum

Available net types:

Properties

name

Get the net name.

type

Get the net type.

Examples

List and Use Nets

Simple Nets (GPIO, ADC, DAC)

Complex Nets (Power, Scope)

Manage Net Configuration

Notes

  • Simple nets (GPIO, ADC, DAC, Thermocouple) work directly without enable()/disable() calls
  • Complex nets (Analog, Logic, PowerSupply, Battery, ELoad) require enable() before use
  • Always call disable() when finished with complex nets to properly release hardware
  • Net names must match those configured on the Lager Box
  • Use Net.list_saved() to see all available nets