Logger
The Logger module is a generic Module used for devices that read or log measurement values without actively applying or sweeping a value. It is designed for instruments such as power meters, multimeters, data loggers, and any other device where the primary task is to acquire and return data.
Unlike modules such as SMU or Signal that both set and read values, the Logger module focuses entirely on the readout side. It is commonly used as a child module in the Sequencer to monitor additional parameters alongside an active sweep performed by another module.
Overview
The Logger module is one of the generic Modules in SweepMe! — alongside Switch and Robot — that provide the possibility to generate GUI items dynamically. This means that each Logger driver can define its own set of parameters in the GUI, tailored to the specific instrument it controls.
Typical use cases for the Logger module include:
- Acquiring optical power from a power meter
- Logging humidity, pressure, or other environmental parameters
- Recording voltages or currents from a data acquisition device
- Reading mouse position or other system parameters (e.g. Logger-PC_Mouse)
Note that some physical quantities have their own dedicated module with additional functionality, for example Temperature. Use Logger for devices that do not fit any dedicated module.
A list of available Logger drivers can be found here: https://sweep-me.net/devices/
Parameter box
Unlike modules that apply values (such as SMU or Switch), the Logger module has no Sweep mode. Instead, each Logger driver defines its own individual parameters through a custom parameter box. These parameters configure how the instrument performs its readout — for example, selecting a channel, setting a measurement range, or choosing an averaging mode.
The parameter box is generated dynamically based on the keys the driver defines in set_GUIparameter(). Based on the type of the default value, the corresponding GUI element will be created automatically:
- A
strdefault creates a text input field - A
listdefault creates a ComboBox (dropdown) - A
booldefault creates a CheckBox - A
floatorintdefault creates a numeric input field
This allows each Logger driver to present exactly the configuration options needed for its instrument.
If you have made changes to the GUI in your driver and you want to update the parameter box, click on the Device/Driver selection dropdown which will renew the GUI.
Variables and units
Each Logger driver defines the measurement quantities it returns using the attributes self.variables and self.units. These are lists where each entry corresponds to one returned value. A power meter driver, for example, would define a single variable for optical power with the appropriate unit. A more complex instrument might return several values at once. A return value can also be a tuple or a list, for example when measuring multiple hardware-triggered points.
Additionally, self.plottype and self.savetype can be set as lists to control whether each variable can be plotted and/or saved to the output file. Each entry corresponds to the variable at the same index.
Driver programming
A Logger driver is a Python script called main.py that inherits from EmptyDevice. The driver name must follow the naming convention:
Logger-<Manufacturer>_<Model>
For example: Logger-Agilent_34970A or Logger-Arduino_DHTxx.
Key methods
The following methods are most relevant for Logger drivers:
| Method | Description |
|---|---|
update_gui_parameters() |
Returns a dictionary defining the parameter box elements and their default values or options. |
apply_gui_parameters(parameter) |
Receives a dictionary of the current parameter box selections. Use this to store user-selected settings. |
connect() |
Opens the connection to the instrument. |
disconnect() |
Closes the connection to the instrument. |
initialize() |
Configures the instrument at the start of a measurement. |
deinitialize() |
Resets the instrument configuration at the end of a measurement. |
configure() |
Called when the module becomes active in a branch. |
unconfigure() |
Called when the module is no longer active. |
measure() |
Triggers or performs the actual measurement. Store results in instance variables. |
call() |
Returns the measured values as a list matching the order of self.variables.
|
For a complete overview of all available methods and the order in which they are called, see Sequencer procedure and Driver Programming.
Typical usage in the Sequencer
The Logger module is most commonly used as a child module nested below an active sweep module. In this configuration, the Logger reads its values at each sweep point of the parent module.
Example: Optical power monitoring during a wavelength sweep
A typical use case is to monitor optical power while sweeping the wavelength with a Signal module:
Signal (Wavelength sweep) └── Logger (Power meter readout)
At every wavelength step, the Logger module reads the optical power, building up a spectral response curve.
Example: Multi-sensor logging
Multiple Logger modules can be placed in the same branch to read different sensors in parallel:
SMU (Voltage sweep)
└── Logger (Optical power)
└── Logger (Humidity)
See also
- Switch — Generic module for devices that set values
- Robot — Generic module for devices with multiple axes
- Temperature — Dedicated module for temperature controllers and sensors
- SMU — Module for source-measuring units
- Driver Programming — Guide for writing custom drivers
- Sequencer — Overview of the measurement sequencer
- Sequencer procedure — Detailed order of method calls