InstroFlowController#

class InstroFlowController(
name: str,
driver: FlowControllerDriverBase,
publishers: list[Publisher] | None = None,
**kwargs,
)[source]#

Bases: Instrument

Flow-controller instrument. Methods return Measurement/Command for publishing.

Initialize an InstroFlowController.

Parameters:
  • name – Channel-name prefix for published data.

  • driver –

    Concrete flow-controller driver; owns its own transport:

    fc = InstroFlowController(
        "main",
        driver=AlicatMC("ASRL7::INSTR", "M"),
    )
    

  • publishers – Publishers that receive emitted Measurement/Command data.

  • **kwargs – Default tags applied to every emitted Measurement/Command. Pass dataset_rid="<rid>" to auto-create a NominalCorePublisher.

Note

Direct access to driver-specific methods not in FlowControllerDriverBase (e.g., AlicatMC.set_loop_control_variable, gas-mixture methods) bypasses _resource_lock and is the caller’s responsibility to synchronize if mixed with concurrent InstroFlowController method calls.

Attributes

background_interval

Seconds between background daemon iterations (0 = no wait).

channel_names

Return an insertion-ordered snapshot of all published channel names.

Methods

add_background_daemon_function

Append method to the daemon's call list.

add_publisher

Register a publisher to receive this instrument's Measurement/Command data.

close

Close the underlying driver and stop the daemon.

define_background_daemon

Replace all daemon functions with a single method (called with the given args).

get_channel

Return the most recent length samples for channel_name from the in-memory buffer.

get_flow_data

Poll the device and publish all live measurements at once.

get_mass_flow

Read the current mass flow.

get_pressure

Read the current pressure.

get_process_value

Read the current process value (primary feedback measurement for control).

get_setpoint

Read the current setpoint.

get_single_channel_value

Return the most recent sample for channel_name from the in-memory buffer.

get_volumetric_flow

Read the current volumetric flow.

open

Open the underlying driver.

publish

Fan data out to every configured publisher; kwargs pass through.

select_working_fluid

Select the active working fluid by name.

set_setpoint

Command a new flow setpoint in the device's configured engineering units.

start

Start the background daemon thread.

stop

Signal the background daemon to stop and join it.

tare_flow

Zero the flow reading.