AlicatMC#

class AlicatMC(
visa_resource: str | VisaConfig,
device_id: str = 'A',
)[source]#

Bases: FlowControllerDriverBase

Alicat MC-series mass-flow controller (MC-100SCCM and related MC models).

Communicates in RS-232 polling mode. device_id is the single-letter address (A–Z) configured on the device; default is "A". Default baud is 19200 with 8data-1stop-none_parity-none_flow Termination is always carriage return.

Attributes

GAS_KEY

mass_flow

Current mass flow reading in the device's configured engineering units.

pressure

Current absolute pressure reading in the device's configured engineering units.

process_value

Current process value.

process_value_source

Key constant for the process value measurement.

setpoint

Current setpoint in the device's configured engineering units.

volumetric_flow

Current volumetric flow reading in the device's configured engineering units.

unit_id

known_gas_types

measurement_headings

Methods

cancel_valve_hold

Release any active valve hold and return to normal setpoint control.

close

Close the VISA transport.

define_gas_mixture

Allows defining an arbitrary gas mixture of 2-5 components.

get_flow_data

Poll the device for a single measurement frame.

get_flow_sample_metadata

Return measurement field descriptors; cached after first call unless refresh=True.

hold_valve_at_position

Hold the valve at its current position.

hold_valve_closed

Hold the valve closed.

list_gas_types

Return all gas types the device supports; cached after first call unless refresh=True.

open

Open the VISA transport.

select_working_fluid

Select the active working fluid (gas) by name and return the confirmed fluid name.

set_loop_control_variable

Set the loop control variable (process value source) and update the cache.

set_setpoint

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

set_setpoint_int

Command a setpoint using integer encoding for the given full-scale range and minimum.

tare_barometer

Zero the barometer reading; device must support barometer tare.

tare_flow

Zero the flow reading; device must have zero flow and must support tare.

GAS_KEY: Final[Literal['gas']] = 'gas'#
unit_id: str#
known_gas_types: list[GasTypeEntry]#
measurement_headings: list[MeasurementHeaderEntry]#
open() → None[source]#

Open the VISA transport.

close() → None[source]#

Close the VISA transport.

tare_flow() → AlicatMCFlowData[source]#

Zero the flow reading; device must have zero flow and must support tare.

tare_barometer() → AlicatMCFlowData[source]#

Zero the barometer reading; device must support barometer tare.

list_gas_types(
refresh=False,
) → list[GasTypeEntry][source]#

Return all gas types the device supports; cached after first call unless refresh=True.

select_working_fluid(fluid_name: str) → str[source]#

Select the active working fluid (gas) by name and return the confirmed fluid name.

set_loop_control_variable(
loop_variable: LoopVariable,
) → float[source]#

Set the loop control variable (process value source) and update the cache.

Parameters:

loop_variable

The loop variable (e.g. LoopVariable.MASS_FLOW, LoopVariable.VOLUMETRIC_FLOW).

Returns:

The confirmed setpoint value from the device.

define_gas_mixture(
mix_name: str,
mixture: list[GasMixEntry],
gas_id: int = 0,
) → GasTypeEntry[source]#

Allows defining an arbitrary gas mixture of 2-5 components.

mix_name is an alias for the mixture. Use a maximum of 6 letters (upper and/or lower case), numbers and symbols (space, period or hyphen only).

gas_id is a number from 236-255, selecting 0 will get the next available ID

Returns selected gas_id. If gas_id is not 0, it should return gas_id. If gas_id is 0, it should return an integer from 236-255.

get_flow_data() → AlicatMCFlowData[source]#

Poll the device for a single measurement frame.

property setpoint: float#

Current setpoint in the device’s configured engineering units.

property mass_flow: float#

Current mass flow reading in the device’s configured engineering units.

property volumetric_flow: float#

Current volumetric flow reading in the device’s configured engineering units.

property pressure: float#

Current absolute pressure reading in the device’s configured engineering units.

property process_value: float#

Current process value. Returns the measurement corresponding to the device’s loop control variable.

property process_value_source: str#

Key constant for the process value measurement. Determined by the device’s loop control variable.

get_flow_sample_metadata(
refresh=False,
) → list[MeasurementHeaderEntry][source]#

Return measurement field descriptors; cached after first call unless refresh=True.

set_setpoint(setpt: float) → float[source]#

Command a float setpoint in the device’s configured engineering units.

You can fetch the current units for each value using get_flow_sample_metadata or on the front panel of the device itself.

set_setpoint_int(
setpt: float,
full_scale_range: float,
range_minimum: float,
) → float[source]#

Command a setpoint using integer encoding for the given full-scale range and minimum.

full_scale_range is the span of the control range. For unidirectional controllers (0 to max), use the max value. For bidirectional controllers (+/- max), use the full range (2 * max).

hold_valve_at_position() → AlicatMCFlowData[source]#

Hold the valve at its current position.

Use cancel_valve_hold to remove the hold.

hold_valve_closed() → AlicatMCFlowData[source]#

Hold the valve closed.

Use cancel_valve_hold to remove the hold.

cancel_valve_hold() → AlicatMCFlowData[source]#

Release any active valve hold and return to normal setpoint control.