Online documentationThis manual is also available in PDF format for offline viewing. Warning: Both this page and the offline manual are quite . . . incomplete. Table of ContentsIntroductionSpecial formattingFont type and color is used in this documentation to clarify and highlight some elements:
* These are a bit generic as jargon goes, so the highlighting is used to indicate the specific definition.
Neal Stephenson's writing notwithstanding, this approach seems preferable to making up words like wafflesnorker or spweeble mode to describe various aspects of the software.
ModesMezurit 2 starts in setup mode, which allows the user to configure DAQ and GPIB hardware and define virtual channels to be acquired and recorded. The terminal is works in setup mode, but is limited to certain functions. When switching to panel mode Mezurit 2 completes the parsing phase, during which it parses the channel definitions and generates a list of physical channels and gpib slots to be measured. The parsing phase occurs each time Mezurit 2 switches from setup mode to panel mode or between panels. The terminal is implemented as an instance of the Python interpreter running in a separate process from Mezurit 2 proper. Therefore, functions and variables defined in the terminal cannot be accessed by compute functions and vice versa. One advantage of this approach is that the terminal can hang, crash, or restart without affecting the time-sensitive data acquisition process. ThreadsMezurit 2 runs three threads in panel mode, not counting the terminal process:
Keyword definitions
ScopeComing soon . . . TriggersTriggers are used to promptly preform actions, defined by calls to trigger functions, in response to an arbitrary event, defined by a trigger test. For example, one could automatically start a scope scan when a +5V TTL sync signal is received. Triggers must be "armed" before they become active, either by clicking the "ARM" button or calling the arm_trigger() terminal function or the arm_trigger() trigger function. (The last method is useful for multi-stage events or to simply self-rearm.) To set up a trigger, first define a trigger test in an "IF:" entry box. A trigger test must be a boolean expression constructed from a subset of the channel functions (typically time() or ch()). Next, define one or more (max 8) trigger functions in the entry boxes immediately below (next to the button). Additional boxes can be made visible by clicking the "+" button. When the trigger is armed, this test expression will be evaluated every on every iteration of the DAQ loop. If and when it evaluates as True, Mezurit 2 will execute the trigger functions in order until one returns False or it reaches the end of the list. Note: To define a trigger which executes immediately upon arming, simply supply True as the test. Trigger functions are defined in /usr/lib/mezurit2/mezurit2compute.py. The standard trigger functions are documented here. While in principle is it possible to define new trigger functions in ~/.config/mezurit2/compute.py, this is not recommended because the trigger tool is designed to execute only one function per line. In addition, because trigger functions execute in the DAQ thread, any hangups or errors in a trigger function could negatively affect the data acquisition process. The preferred way to execute more complex operations during a trigger event is to send a signal using emit_signal() to be caught by a terminal script using catch_signal(). Example: Oscilloscope-like operation
Triggers can be also be started manually ("forced") by clicking the button or calling the force_trigger() terminal function or the force_trigger() trigger function. Plotting and buffer managementPopup menusComing soon . . . File chooserComing soon . . . TerminalThe terminal provides a Python-based interface to Mezurit 2. Almost all aspects of the GUI can be controlled from the terminal, plus several "hidden" features only accessible from the terminal. In addition, all settings can be queried and modified using the get_var() and set_var() commands. The "key=value" syntax for these two functions matches that used in Mezurit 2's configuration files. Example: Increase sweep rate by 10%
In the previous example, the user must know the variable name to be modified a priori, specifically the appropriate panel id and the sweep id. These values can also be queried using get_panel() and get_sweep_id(), and then formatted into a variable name as in the following example. Example: Easy variable name generation
The standard terminal commands are documented here. Additional features can be added to the terminal in two ways: user-defined terminal functions and "one-off" scripts: User-defined functionsNew functions definitions can be placed in ~/.config/mezurit2/terminal.py (or equivalent, see Installed files) building on the existing set of commands. Once the changes are made, simply restart the terminal process using either the quit() command or the "Terminal | Restart" menu option. This option works best when there is some degree of generality in the functions to be added so that it can be used for multiple measurements. Example: Function to repeat a megasweep at multiple temperatures (ver. 0.81+)
ScriptsAnother option is to place the desired commands in a custom script file, then run it via execfile(). The script will run in the current terminal as if a user had typed in each line directly. Note that, on its own, execfile() does not expand shortcuts such as ~ (relative paths are OK). Example: Parametric megasweep
One advantage of this approach is that a copy of the script can be saved along with each datfile as documentation. For example, the script used to record dev02_run03.dat could be saved alongside as dev02_run03_script.py. Another advantage is that the user does not have to remember what arguments to pass a custom function because every parameter must be mentioned explicitly in the script. SynchronizationWhile some scripts may perform a measurement by simply sending a continuous stream of commands, it is often necessary to wait for certain conditions before continuing to the next step. This can be accomplished using the catch_* commands: catch_sweep() for sweeps, catch_scan_start() and catch_scan_finish() for scope scans, and catch_signal() for triggers. Tip: Explicit synchronization is more reliable and precise than using xleep(). For example, while Mezurit 2 makes every effort to sweep at exactly the specified rate, jitter may creep in when starting and stopping due to synchronization between threads. Thus, waiting 1.0 seconds for a 1.0 second sweep could result in the script continuing on slightly "ahead of schedule." Warning/Tip: These functions do not return until the specified event has occurred. If that event is never going to happen, i.e. due to user error, simply use the "Terminal | Abort" feature to regain control of the terminal.
| Online manual |