Skip to content

RunScript commands

rfriedr1 edited this page Jan 3, 2018 · 24 revisions

The following run-script commands are available:

script control

Command Explanation
// Lines starting with "//" are comments and will be ignored
wait(seconds) pause script for the amount of seconds
message(text) Displays text in the message window (right hand corner of the main window)
message(clear) Clears the message window
alert(text) Displays a dialog with text and waits for confirmation
open_script(rel.path\scriptname) Opens a new script with name scriptname. The script must be in the base ScriptFolder “RunScripts”. If the script is in a subfolder inside of “RunScripts” add the relative path to the scriptname.

Example:
Open_script(test.txt) opens the script “test.txt” that is located in “RunScripts\test.txt”
Open_script(test\test.txt) opens the script “test.txt” that is located in “RunScripts\test\test.txt”
stop_and_wait(flagname) Creates a new flag or re-uses a flag named flagname and waits until the command “proceed(flagname)” is processed. If the command “proceed” was processed already, “stop_and_wait” proceeds immediately
stop_and_wait(flagname) Creates a new flag or re-uses a flag named flagname and waits until the command “proceed(flagname)” is processed. If the command “proceed” was processed already, “stop_and_wait” proceeds immediately
proceed(flagname) signals a “stop_and_wait” command to proceed. Flagname is the name of the flag
close_window Closes the current script window

switches

Command Explanation
open(switch_name) Opens switch named switch_name
close(switch_name) Closes switch named switch_name

temperature controller

Command Explanation
set_temp(name;temp;range) Sets the temperature of the controller name to temp and waits until the actual temperature is within range

plots and data evaluation

Command Explanation
plot_open(plot_name) Opens a new plot window named plot_name
plot_xlabel(plot_name; label) Sets the xlabel of the plot plot_name to label
plot_ylabel(plot_name;label) Sets the ylabel of the plot plot_name to label
plot_close(plot_name) Closes the new plot window named plot_name
plot_find_single_peak(plot_name; MFT_name; isotope_name(MFT); threshold) Finds the center of a single peak by using the data displayed in the plot plot_name. If a peak was found the result is written into the magfield table (MFT) named MFT_name using the isotope isotope_name. That isotope must already exist in given MFT. If the signal is below Threshold no peak centering will be performed
plot_find_double_peak(plot_name; MFT_name; isotope_name(MFT); threshold; offset) Finds the center of a double peak by using the data displayed in the plot plot_name. If a peak was found the result is written into the magfield table (MFT) named MFT_name using the isotope isotope_name. That isotope must already exist in given MFT. If the signal is below threshold no peak centering will be performed.
If only one peak is found offset is being used to calculate the peak position of the desired isotope, e.g. a value of -0.01 is equal to a peak that is 0.01 units below (lower mass) the found peak. Respectively, a positive number represents a peak that is above (higher mass) the found peak.
plot_fit_data(plot_name; fittype[linear, 2nd, 3rd]) Fits the data displayed in the plot plot_name. using fittype. Fitype can have the values: linear, 2nd or 3rd.
Linear = linear fit
2nd = polynomial fit 2nd order
3rd = polynomial fit 3rd order

storing analysis data

Command Explanation
analysis_session_new(AnalysisID; AnalysisName; AnalysisType) Creates a new AnalysisSession. AnalysisID can be used to identify the analysis (e.g. sample ID). AnalysisName can be used to store the name of the sample of standard. AnalysisType is used to identify the type of analysis (sample, air, blank, std,…).
If those parameters are not given, a dialog appears and asks for the parameters.
If a SampleList is used to automatically run samples those information are provided by the SampleList. The SampleList will overwrite any explicitly given parameter.
analysis_session_add_switch_counter(switch_name) The usage of all switches is monitored and counted. Using this command saves the counter of the given switch identified by switch_name.
analysis_session_add_standard_data(standard_name) Adds the standard information of the standard standard_name to the AnalysisSession that is being processed by the script (or subscript).
analysis_session_add_pipette_data(pipette_name; number_of_shots) Adds the pipette information of the pipette pipette_name to the AnalysisSession that is being processed by the script (or subscript)._ Number_of_shots_ is the number of used pipettes for this analysis
analysis_session_dump Writes all Analysis data into the textfile or database (depending on the settings). At this point only text files are supported.
analysis_session_close Closes the AnalysisSession and removes the AnalysisObject from Memory. Should be performed after data acquicition is finished to free up memory.

data acquisition

Command Explanation
set_time_zero(instrument) Sets the value “time zero” of the instrument. Time zero is typically used in spectrometers to mark the inlet of the gas. The command is ignored if the given instrument doesn’t support this function.
set_magnet(instrument; value) Sets the magnet of the instrument to value. The units of value are the units that the instrument used to control the magnet, e.g. Thermos Qtegra uses magnet voltage.
signal_vs_magnet(instrument; magnet_value; detector; integrtime; settling_time) -> plotname Sets the magnet of instrument to magnet_value, waits settling_time before starting the integration of the signal for integrtime. After that the measured signal of the detector is returned and plotted versus the magent_value in plot plot_name.
Qtegra supports only certain values of integrtime.
Magnet_value can be a number or a string the identifies an isotope in the magfield_table
signal_vs_time(instrument;magnet_value;detector(s);integrtime;settling_time) -> plotname(s) Sets the magnet of instrument to magnet_value, waits settling_time before starting the integration of the signal(s) for integrtime. After that the measured signal of the detector(s) is (are) returned and plotted versus time in plot(s) plot_name(s).
Qtegra supports only certain values of integrtime.
Magnet_value can be a number or a string the identifies an isotope in the magfield_table
Detector(s) and plot_name(s) can be a string lists = strings separated by comma
Make sure that the number of detectors and plot_names agree.

Example – single detector use
Use Qtegra to set the magnet to the magnet value of He3 (or 1.5 in the second example), use the H1_CDD detector with settling and integration times of 1 sec. Plot the result to the plot named “He3Plot”
signal_vs_time(Qtegra; He3; H1_CDD; 1, 1) -> He3Plot
signal_vs_time(Qtegra; 1.5; H1_CDD; 1, 1) -> He3Plot

Example – multi detector use
Use Qtegra to set the magnet to the magnet value of He3, use the H1_CDD and the H2 detectors with settling and integration times of 1 sec. Plot the result of the H1_CDD detector to the plot named “He3Plot” and the H2 detector to “He4Plot”
signal_vs_time(Qtegra; He3; H1_CDD, H2; 1, 1) -> He3Plot, He4Plot
protect_detector(instrument;detector;[0,1]) Protects (1) or unprotects (0) the detector of the instrument

Example:
protect_detector(qtegra,H1_CDD,1)
set_cupconfiguration(instrument;cupconfig_name;subcupconfig_name) Changes the cup and subcup configuration of the instrument. Make sure the cup and subcup configurations actually exsist!
set_detector_deflection(instrument;detector;voltage) Sets the voltage of the deflection of the detector
set_detector_supply(instrument;detector;voltage) Sets the supply voltage of the detector
systemdevice_vs_time(SystemDeviceName) -> plotname Returns the time and the value of SystemDevice (pressure sensor, temp sensor etc etc) and plots the data in a plot with the name plotname.
The data are stored during an analysis session and saved with the whole session.

A list of available SystemDevices is given in MSControl SystemDevice.ini

sample list

Command Explanation
SampleList_proceed If a SampleList is used to run multiple samples automatically, the sample list starts running the next sample when this command is processed. The command is being ignored if samples are run without a SampleList.

Clone this wiki locally