Analog Port

Instances of port that represent analog input/output devices.

class pymoa.device.analog.AnalogChannel(name='', **kwargs)

Bases: pymoa.device.port.Channel

A abstract single channel analog device.

state = None

The state of the channel.

state is a NumericProperty and defaults to None.

await write_state(value: float, **kwargs)

A stub method defining the prototype for write_state() of derived classes.

Parameters
state: float, int

The value to set the state to.

Note

When called, it raises a NotImplementedError if not overwritten.

class pymoa.device.analog.AnalogPort(name='', **kwargs)

Bases: pymoa.device.port.Port

A abstract multi-channel analog device.

await write_state(channel: str, value: float, **kwargs)

A abstract method for setting the state. See ChannelBase for details.

Note

If supported, the method needs to be overwritten by a base class otherwise, it raises a NotImplementedError.

await write_states(**kwargs: float)

A stub method defining the prototype for write_state() of derived classes.

For devices that support it, the properties passed in one call can be set to the requested state simultaneously.

Method accepts property names and their values as keyword arguments, where each of the properties will be set to those values.

E.g.:

>>> port.write_state(voltage=1.6, amp=3.7)

Note

When called, it raises a NotImplementedError if not overwritten.

class pymoa.device.analog.RandomAnalogChannel(name='', **kwargs)

Bases: pymoa.device.analog.AnalogChannel

A channel that generates random analog values. Mainly useful as a testing device.

await read_state()

A abstract method causing a read of the state. This method should not return the state, but rather cause the device to read the state and update the appropriate instance property with the current state.

Note

If supported, the method needs to be overwritten by a base class otherwise, it raises a NotImplementedError.

await write_state(state: float, **kwargs)

A stub method defining the prototype for write_state() of derived classes.

Parameters
state: float, int

The value to set the state to.

Note

When called, it raises a NotImplementedError if not overwritten.

class pymoa.device.analog.RandomAnalogPort(name='', **kwargs)

Bases: pymoa.device.analog.AnalogPort

A port that generates random analog values. Mainly useful as a testing device.

await read_state()

A abstract method causing a read of the state. This method should not return the state, but rather cause the device to read the state and update the appropriate instance property with the current state.

Note

If supported, the method needs to be overwritten by a base class otherwise, it raises a NotImplementedError.

await write_states(**kwargs: float)

A stub method defining the prototype for write_state() of derived classes.

For devices that support it, the properties passed in one call can be set to the requested state simultaneously.

Method accepts property names and their values as keyword arguments, where each of the properties will be set to those values.

E.g.:

>>> port.write_state(voltage=1.6, amp=3.7)

Note

When called, it raises a NotImplementedError if not overwritten.