Model for Devices
Module contents
Base DAQ
Base class for the DAQ objects. It keeps track of the functions that every new model should implement. This helps keeping the code organized and to maintain downstream compliancy.
Analog DAQ
Class for communicating with a real device. It implements the base for communicating with the device through a controller. The experiment in mind is measuring the I-V curve of a diode, adding the logic into a separate model for the experiment may seem redundant, but incredibly useful in bigger projects.
- class PFTL.model.analog_daq.AnalogDaq(port)[source]
Bases:
DAQBaseSimple model that reflects the logic of the MVC pattern. This model relies on the real controller for communicating with an Arduino based DAQ.
- Parameters:
port (str) – See
pftl_daq
- port
The port information
- Type:
str
- get_input_voltage(channel)[source]
Retrieve the voltage from the device
- Parameters:
channel (int) – Channel number
- Returns:
Quantity – The voltage read
Dummy DAQ model
Simulated device that allows to run the program without any DAQ card attached to the computer.
It returns random values for the methods that should read from the device.
- class PFTL.model.dummy_daq.DummyDaq(port)[source]
Bases:
DAQBase
- PFTL.model.dummy_daq.random() x in the interval [0, 1).