My experiment setup with PyLECO #46
BenediktBurger
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As an example, how PyLECO can be used in an experimental environment, I describe my setup.
Maybe it gives some inspirations.
Infrastructure
Hardware
We're two projects in the lab, each with its own measurement computer (Windows).
These computers are connected to measurement devices and are the main terminal for researchers controlling the devices and collecting data.
We share some resources (Lasers) which are connected to a third computer.
All computers are connected via LAN.
Software
Each one of these three computers run a
Coordinator
, aproxy_server
, and aStarter
.We installed these three programs as windows services with the NSSM (non sucking service manager) in order to start them at computer startup without user interaction.
The Coordinators connect to each other in order to establish a LECO network.
Measurement Setup
For a measurement, we need to control devices (communicate with them and user interface) and to collect data.
Device Communication
For each device, there is a Starter script in a folder (see in this repo).
Some scripts just regularly read some value and publish them via the data protocol (without connection to the control protocol), other scripts use the
Actor
in order to be controllable.User Interface
The user interface is heavily based on the pyleco-extras repository.
Introduction
The
BaseMainWindow
offers a Qt Main Window with aListener
(frompyleco
), such that the program can send and read LECO messages and such that it can be controlled via LECO messages.With the
StarterGUI
we communicate with the Starter in order to see, which tasks are started and to start or stop them as required.Main Control Interface
The main control interface uses several directors (all using the communicator of the main window) to control the instruments:
Actor
s.As device interaction can take some time, this main control interface does use the asynchroneous capabilities of the
Director
: You can send a message via theasync
methods, which returns th conversation_id. Later you can read the response, whenever you which, or you can associate the response to the calling method after arrival.This main control window can also control the shared laser systems connected to the shared computer as if they were local.
Specialized Interfaces
The main control window does not have all the options for all the devices, lest the interface is cluttered.
We have some more specialized programs, for example a GUI controlling stepper motors, which offers finer control over the motors than the main control window.
Thanks to LECO, both programs can control and read the same stepper motor, because the communication is routed through the same Actor.
Other software elements control special measurement software and publish their data via the data protocol.
Maintenance
Recently I had to add another measurement device (on another computer) to the main control window which was quite simple:
Actor
running the device's driver),Director
to read that device.Regularly, I control some parts of the experiment from my office, as the control window can be run anywhere in the network, due to LECO communication.
Data Acquisition
We acquire our data with the
DataLoggerGUI
from pyleco extras, which is a GUI containing aDataLogger
from PyLECO internally.This DataLogger listens to data published via the data protocol and creates data points from it.
The GUI interface allows to see graphs of the collected data in real time (pyqtgraph) with dockable graphs.
The
DataLoggerViewer
uses the same interface to show the data of a file saved by the DataLogger.Measurement Workflow
Workflow for a typical measurement.
Preparation
Starter
which tasks to start. That ensures, that communication with all needed devices (via theirActor
s) is possible.Lasercommander
controlling the laser system and aDataLoggerGUI
from pyleco-extras for logging data.LogLogger
from pyleco-extras collects log entries from the different programs.Measurement
For a measurement, I use the Lasercommander or other specialized GUIs (for example one controlling stepper motors) to change parameters, while the DataLoggerGUI collects data.
Evaluation
The
DataLoggerViewer
(also from pyleco-extras) plots the data collected by the DataLogger.Specialized scripts allow custom evaluation (fitting functions to the data etc.).
Thanks
Thanks for reading.
If you have questions, don't hesitate to ask!
Beta Was this translation helpful? Give feedback.
All reactions