AnalogIO

class pyniryo_nate.models.io.AnalogIO(id: IOLabel | str, value: float | None = None, unavailable_reason: AnalogUnavailableReason | None = None)[source]

Bases: object

An analog input or output of the tool or of the controller.

An input that measures nothing is served without a value: value is then None and unavailable_reason says why. Test is_available or value is None, never a default value, since 0.0 is a legitimate measurement.

Parameters:
  • id (IOLabel | str) – The label of the input or output.

  • value (float | None) – The measurement, in volts in voltage mode and in amperes in current mode. None when no measurement is available.

  • unavailable_reason (AnalogUnavailableReason | None) – Why no measurement is available. Set if and only if value is None.

Attributes

is_available

Whether the input carries a measurement.

unavailable_reason

value

id

Methods

id: IOLabel | str
value: float | None = None
unavailable_reason: AnalogUnavailableReason | None = None
property is_available: bool

Whether the input carries a measurement. False means value is None and unavailable_reason says why.

classmethod from_transport_model(model: AnalogIO) → AnalogIO[source]
Parameters:

model (AnalogIO)

Return type:

AnalogIO

classmethod from_a_transport_model(io_id: IOLabel | str, model: AnalogIOState) → AnalogIO[source]
Parameters:
  • io_id (IOLabel | str)

  • model (AnalogIOState)

Return type:

AnalogIO

to_transport_model() → AnalogIO[source]
Return type:

AnalogIO