stoner_measurement.instruments.simulated.SimulatedMassFlowController

class stoner_measurement.instruments.simulated.SimulatedMassFlowController(transport=None, protocol=None)[source]

Bases: MassFlowController

Simple simulated mass-flow controller.

get_capabilities() → MassFlowControllerCapabilities[source]

Return the static capability descriptor for this driver.

identify() → str[source]

Return the instrument identification string (*IDN?).

Sends the standard IEEE 488.2 *IDN? query and returns the response. Instruments that do not support *IDN? should override this method.

Returns:

Identification string returned by the instrument.

Return type:

(str)

Raises:

ConnectionError – If the transport is not open.

Examples

>>> from stoner_measurement.instruments.transport import NullTransport
>>> from stoner_measurement.instruments.protocol import ScpiProtocol
>>> from stoner_measurement.instruments.base_instrument import BaseInstrument
>>> t = NullTransport(responses=[b"ACME,Model1,SN001,v1.0\n"])
>>> instr = BaseInstrument(t, ScpiProtocol())
>>> instr.connect()
>>> instr.identify()
'ACME,Model1,SN001,v1.0'
>>> instr.disconnect()
read_actual_value(channel: int = 1) → float[source]

Return the current measured value for channel.

read_range(channel: int = 1) → float[source]

Return the configured full-scale/range value for channel.

read_setpoint(channel: int = 1) → float[source]

Return the programmed setpoint for channel.

read_unit(channel: int = 1) → int | str[source]

Return the configured engineering-unit code for channel.

set_range(full_scale: float, channel: int = 1) → None[source]

Set the configured full-scale/range value for channel.

set_setpoint(value: float, channel: int = 1) → None[source]

Set the programmed setpoint for channel.

set_unit(unit_code: int | str, channel: int = 1) → None[source]

Set the configured engineering-unit code for channel.