Skip to content

Sequencer.vi

Adam Deller edited this page Jun 13, 2016 · 53 revisions

A tool for conducting experimental series.


Overview

The basic premise of Sequencer.vi is to read sequence files (see below), which describe how experimental parameters should be changed during a measurement. The program ensures that the requested conditions (VARS) are met at the right time, and that any data acquisition software is informed of how to save data so that it can be mapped back to these conditions. It is effectively the conductor of the experiment and does not perform the actual hardware communication (which is delegated to VAR vi's). This modular approach makes extending control to new instruments relatively painless.

Sequence files

The sequence file (*.osq) provides a means to script a simple experiment, and contains all of the configurations of the experimental variables that should be set.

The osq files are stored as xml and contain an array called SEQs. Each of the elements of this array are called lines, and these lines are simply clusters with only two fields,

  • Comment (string). Does nothing but provide a way to add a comment to each line. The comment will be displayed by sequencer.vi as it is being run. The comment can be modified during the actual experiment to add information to the attribute record (e.g., "ignore this point - laser was blocked").
  • VAR Array (two column array of strings). The first column contains every VAR name relevant to a given experiment and the second column lists the corresponding values.

As an example, use Editor.vi to open and view the file ./Examples/example seqs.osq. This sequence contains just two lines, each with a single VAR called PAUSE, with a value set to 1000 then 2000.

Modder.vi is a program used to easily generate sequence files that cover large parameter spaces.

Running sequences

The execution of a sequence constitutes an experimental run, identified by the RID. The execution of each sequence line is identified by its sequence ID (SQUID), which iterates during the course of a run. Together the RID and SQUID are used to map data to VARS.

A sequence file is loaded into Sequencer.vi by entering its file path into SEQ File (*.osq) on the Run/Sequencer tab. Loading a file will automatically count the number of lines and will indicate the names and values of VARS in the series; this list is updated by pressing Refresh. Acquire sets the amount of time that data will be recorded for per line before proceeding to the next. Loops sets the number of times that the sequencer should loop over the whole series.

When Run is pressed a time-stamp is used to create the RID (%Y%m%d_%H%M%S). The sequencer then reads the XML and proceeds by demanding that the desired experimental conditions of the first line (SQUID = 1) are met, after-which it waits for the acquisition period to complete (Elapsed > Acquire), then it continues to the following line (SQUID = 2), and so forth until all lines have been run for all requested loops.

If Shuffle is selected then the lines are randomly reordered at the start of every loop, and successive loops will be ordered differently.

If SEQ File (*.osq) is empty, the sequencer will not attempt to set any VARS but will otherwise run as normal (this can be used if you just want to save data without setting anything, e.g., to monitor stability or to quickly record a few traces/ images).

The History tab contains a list of all sequence file names and the times they were run. You can cycle SEQ File (*.osq) over previously ran files by hovering over it and scrolling your mouse wheel (press Refresh to reload the sequence).

sequencer

Saving data

Data is saved to the directory listed in the in the Save Base array on the Settings tab of Sequencer.vi. If more than one base is listed the data will be duplicated.

For each run a HDF5 file ./[YYYY]/[MM]/[DD]/[RID]/[RID]_raw.h5 is created. The path is distributed by Sequencer.vi using the global variable H5. When a run is started it will raise a dialogue that allows the user to record information regarding the Author and Description. This information is saved as attributes of the file.

For each line of the sequence a group will be created in the HDF5 file, identified by the SQUID. The VAR values corresponding to the SQUID are saved as attributes of the group.

Measurements made during the SQUID acquisition period are saved inside of the SQUID group. Attributes can also be written to these datasets, e.g., to record camera settings. For further information see the data acquisition page.

To prevent read/ write conflicts data acquisition programs should acquire the semaphore hdf5 before opening the H5 file. If you want to open and view the acquired data (e.g., using HDFView) without aborting a run, use PAUSE located on the VARS tab. This will halt the run after setting the VARS but before starting the next acquisition period. No data is written to the file whilst PAUSE is pressed, therefore it should be safe to open the data file.

Clone this wiki locally