Sequencer Page: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
mNo edit summary
 
(4 intermediate revisions by one other user not shown)
Line 14: Line 14:
;Note
;Note
:If the Sequencer button is not present on the Status Page, it may have been [[Status Page#page-switch-buttons|suppressed]].
:If the Sequencer button is not present on the Status Page, it may have been [[Status Page#page-switch-buttons|suppressed]].
;Note
: As of summer 2018, the sequencer runs as a separate process and must be started before running a sequence via the command '''msequencer'''.


= Features of the Sequencer Page =
= Features of the Sequencer Page =
The Sequencer Page takes its parameters from the [[/Sequencer ODB tree]]. Sequencer scripts can be loaded and run from the Sequencer Page. A visual editor is provided to edit scripts. A display is provided showing the progress of a running script, and the last few Midas messages are also shown (Figure 5). If [[Edit-on-Sequence Parameters]] are defined, these will be displayed when a sequence is started.
* The Sequencer Page takes its parameters from the [[/Sequencer ODB tree]].  
* Sequencer scripts can be loaded and run from the Sequencer Page.  
* A '''visual editor''' is provided to edit scripts.  
* If [[Edit-on-Sequence Parameters]] are defined, these will be displayed when a sequence is started. 
* A '''progress display''' is provided showing the progress of a running script, and the last few Midas messages are also shown (Figure 5).  
 
= How to input and run a Sequencer Script =
; Note
: A Sequencer Script is written using commands recognized by the Sequencer.''' See [[Sequencer|Sequencer Commands]] for the list of sequencer commands.
<ol>
<li>Press the {{Button|name=Sequencer}} on the [[Status Page]] to display the Sequencer Page.
: The first time the button is pressed, the Sequencer Page will appear as in Figure 1, where no load file has been specified.
<li>Load or create a script file
:  A new script file can be created by entering sequencer commands using the [[#Edit or Create a Sequencer Script|visual editor]] on the Sequencer Page, or an existing sequencer script file can be [[#Load an existing Sequencer Script|loaded]].  
<li> [[#Start a Sequencer Script|Start]] the sequencer script
</ol>
 


== How to input and run a Sequencer Script ==
== Create a Sequencer Script ==
See [[Sequencer|Sequencer Commands]] for the list of commands recognized by the Sequencer.  
A new sequencer script can be created using the visual editor by typing in [[Sequencer|Sequencer Commands]], or by pasting in an example file (e.g. [[#Sequencer test file]] or one of [[Sequencer#MSL Example|MSL Example file]] or [[Sequencer#XML Example|MSL Example file]] ) as in Figure 2.
 
The new script is then saved by pressing {{Button|name=Save}}. You will be asked for a file name.  


<ul>
<li>Press {{Button|name=Sequencer}} on [[Status Page]]. The first time the button is pressed, the Sequencer Page will appear as in Figure 1, where no load file has been specified.</li>
;Note
;Note
:The directory path where the sequencer files will be saved is set by the ODB parameter [[/Sequencer ODB tree#Path|/Sequencer/State/Path]].
:The directory path where the sequencer files will be saved is set by the ODB parameter [[/Sequencer ODB tree#Path|/Sequencer/State/Path]].


<li>Either</li>
 
<ul>
== Load an existing Sequencer Script ==
<li> press {{Button|name=Edit Script}}  and input a new test sequence (e.g. [[#Sequence File|test_seq.msl]]) as in Figure 2.</li>
An existing sequencer script file can be loaded using {{Button|name=Load Script}} as in Figure 3. If there is no existing file, use the  [[#Edit a Sequencer Script|visual editor]] to create one.
<li> save the script by pressing {{Button|name=Save}}. You will be asked for a file name. </li>
 
</ul>
;Note
<li>Or </li>
:The directory path where the sequencer looks for saved files is set by the ODB parameter [[/Sequencer ODB tree#Path|/Sequencer/State/Path]].
<ul>
 
<li>load an existing script using {{Button|name=Load Script}} as in Figure 3.</li>
== Edit a Sequencer Script ==
</ul>
A sequencer script can be edited on the Sequencer Page by pressing  {{Button|name=Edit Script}} (see Fugure 2). The '''visual editor''' allows changes to be made to the script.
The sequencer script must first be [[#Create a Sequencer Script|created]] or [[#Load an existing Sequencer Script|loaded]] from a file.
 
 
{|  style="text-align: left; width: 100%; background-color: rgb(255, 255, 255);" border="1" cellpadding="2" cellspacing="2"
|+ Table 1
|-
| rowspan="1"  style="background-color:lemonchiffon; font-weight:bold" | Figure 1:  Initial Sequencer page
| rowspan="1" style="background-color:lemonchiffon; font-weight:bold"  | Figure 2: Display and/or Edit a Sequencer script
| rowspan="1" style="background-color:lemonchiffon; font-weight:bold" |Figure 3: Select a Sequencer file
|-
| rowspan="1" | [[File:sequencer_noscript.png|Figure 1: Initial Sequencer page]]
| rowspan="3"| [[File:sequencer_scripteditor.png|500px|Figure 2: Editing a Sequencer script]]
| rowspan="3"| [[File:sequencer_filelist.png|Figure 3: Select a Sequencer file]]
|-
| rowspan="1"  style="background-color:lemonchiffon; font-weight:bold" | Figure 4: Start a Sequencer script
|-
| rowspan="1" | [[File:sequencer_startscript.png|Figure 4: Start a Sequencer script]]
|-
|}
 
== Start a Sequencer Script ==
After a sequencer script has been [[#Load a Sequencer Script|loaded]], start the script by pressing  
the {{Button|name=Start Script}} button.
 
If there are errors in the script that prevents the script from running, the line(s) in error will be highlighted (Figure 5).
In this case, [[#Edit a Sequencer Script|edit the script]] and fix the errors.
 
Once all errors are corrected and the script runs, the user will be asked to input any required parameters as in Figure 4 (in this case the number of runs, see [[#Sequencer test file|test_seq.msl]]). If [[Edit-on-Sequence Parameters]] are defined, these will be displayed in addition to any required parameters.  Note that [[Edit-on-start Parameters]] will not be displayed (parameters that change between runs should be set by the sequencer script).
 
When the sequencer is running, a '''visual status''' is displayed in the Progress window, and the '''current position''' in the sequence file is also highlighted (Figure 6).
The sequencer can be paused by pressing  {{Button|name=Pause Script}} (Figure 7).
<br>
<br>
<li> Press {{Button|name=Start Script}} button to start the script. </li>
The progress window will indicate when the sequencer is finished  (Figure 8).
<ul>
 
<li>You will be asked to input any required parameters as in Figure 4 (in this case the number of runs, see [[#Sequence File|test_seq.msl]]).</li>
<li>If [[Edit-on-Sequence Parameters]] are defined, these will be displayed in addition to any required parameters</li>
<li>In this example, the script contains an error that prevents the script from running (Figure 5)</li>
</ul>
<br>
<li> The script is edited by pressing  {{Button|name=Edit Script}}, and the error corrected.</li>
<br>
<li> Now the script will run when  {{Button|name=Start Script}}  is pressed. A visual status is displayed in the Progress window, and the current position in the sequence file is also highlighted (Figure 6).</li>
<br>
<li> The sequencer can be paused by pressing the  {{Button|name=Pause Script}} button (Figure 7).</li>
<br>
<li>The progress window will indicated when the sequencer is finished  (Figure 8).</li>
</ul>


;Click on a thumbnail to enlarge
{|  style="text-align: left; width: 100%; background-color: rgb(255, 255, 255);" border="1" cellpadding="2" cellspacing="2"
<gallery>
| rowspan="1"  style="background-color:lemonchiffon; font-weight:bold" | Figure 5: There is an error in the script
File:sequencer_noscript.png|Figure 1: Initial Sequencer page
| rowspan="1" style="background-color:lemonchiffon; font-weight:bold"  | Figure 6: Sequencer is running
File:sequencer_scripteditor.png|Figure 2: Editing a Sequencer script
|-
File:sequencer_filelist.png|Figure 3: Select a Sequencer file
| rowspan="1" | [[File:sequencer_error.png|500px|Figure 5: There is an error in the script]]
File:sequencer_startscript.png|Figure 4: Select a Sequencer file
| rowspan="1" | [[File:sequencer_running.png|500px|Figure 6: Sequencer is running]]
File:sequencer_error.png|Figure 5: There is an error in the script
|-
File:sequencer_running.png|Figure 6: Sequencer is running
|}
File:sequencer_paused.png|Figure 7: Sequencer is paused
File:sequencer_finished.png|Figure 8: Sequencer is finished
</gallery>


<br clear=all>
{| style="text-align: left; width: 100%; background-color: rgb(255, 255, 255);" border="1" cellpadding="2" cellspacing="2"
| rowspan="1" style="background-color:lemonchiffon; font-weight:bold" |  Figure 7: Sequencer is paused
| rowspan="1" style="background-color:lemonchiffon; font-weight:bold" |Figure 8: Sequencer is finished
|-
| rowspan="1" | [[File:sequencer_paused.png|500px|Figure 7: Sequencer is paused]]
| rowspan="1" | [[File:sequencer_finished.png|500px|thumb|Figure 8: Sequencer is finished]]
|-
|}
<br clear=all>


=== Sequence file  ===
= Sequencer test file  =
The following is the contents of the sequence file used for testing ''test_seq.msl'' in the example [[#How to input and run a Sequencer Script|above]].
The following is the contents of the sequence file used for testing ''test_seq.msl'' in the example [[#How to input and run a Sequencer Script|above]].
<pre>
<pre>
Line 83: Line 127:


[[Category: mhttpd Pages]] [[Category: Sequencer]]
[[Category: mhttpd Pages]] [[Category: Sequencer]]
{{Pagelinks}}

Latest revision as of 15:37, 5 March 2018



Links


Purpose

The purpose of the mhttpd Sequencer Web Page to provide a visual display for the Sequencer. Using the Sequencer Page, Sequencer scripts can be loaded, edited and run.


Access to the Sequencer Page

The Sequencer Page is displayed by clicking on Sequencer button on the mhttpd Status Page or other mhttpd web page.

Note
If the Sequencer button is not present on the Status Page, it may have been suppressed.
Note
As of summer 2018, the sequencer runs as a separate process and must be started before running a sequence via the command msequencer.

Features of the Sequencer Page

  • The Sequencer Page takes its parameters from the /Sequencer ODB tree.
  • Sequencer scripts can be loaded and run from the Sequencer Page.
  • A visual editor is provided to edit scripts.
  • If Edit-on-Sequence Parameters are defined, these will be displayed when a sequence is started.
  • A progress display is provided showing the progress of a running script, and the last few Midas messages are also shown (Figure 5).

How to input and run a Sequencer Script

Note
A Sequencer Script is written using commands recognized by the Sequencer. See Sequencer Commands for the list of sequencer commands.
  1. Press the Sequencer on the Status Page to display the Sequencer Page.
    The first time the button is pressed, the Sequencer Page will appear as in Figure 1, where no load file has been specified.
  2. Load or create a script file
    A new script file can be created by entering sequencer commands using the visual editor on the Sequencer Page, or an existing sequencer script file can be loaded.
  3. Start the sequencer script


Create a Sequencer Script

A new sequencer script can be created using the visual editor by typing in Sequencer Commands, or by pasting in an example file (e.g. #Sequencer test file or one of MSL Example file or MSL Example file ) as in Figure 2.

The new script is then saved by pressing Save. You will be asked for a file name.

Note
The directory path where the sequencer files will be saved is set by the ODB parameter /Sequencer/State/Path.


Load an existing Sequencer Script

An existing sequencer script file can be loaded using Load Script as in Figure 3. If there is no existing file, use the visual editor to create one.

Note
The directory path where the sequencer looks for saved files is set by the ODB parameter /Sequencer/State/Path.

Edit a Sequencer Script

A sequencer script can be edited on the Sequencer Page by pressing Edit Script (see Fugure 2). The visual editor allows changes to be made to the script. The sequencer script must first be created or loaded from a file.


Table 1
Figure 1: Initial Sequencer page Figure 2: Display and/or Edit a Sequencer script Figure 3: Select a Sequencer file
Figure 1: Initial Sequencer page Figure 2: Editing a Sequencer script Figure 3: Select a Sequencer file
Figure 4: Start a Sequencer script
Figure 4: Start a Sequencer script

Start a Sequencer Script

After a sequencer script has been loaded, start the script by pressing the Start Script button.

If there are errors in the script that prevents the script from running, the line(s) in error will be highlighted (Figure 5). In this case, edit the script and fix the errors.

Once all errors are corrected and the script runs, the user will be asked to input any required parameters as in Figure 4 (in this case the number of runs, see test_seq.msl). If Edit-on-Sequence Parameters are defined, these will be displayed in addition to any required parameters. Note that Edit-on-start Parameters will not be displayed (parameters that change between runs should be set by the sequencer script).

When the sequencer is running, a visual status is displayed in the Progress window, and the current position in the sequence file is also highlighted (Figure 6). The sequencer can be paused by pressing Pause Script (Figure 7).
The progress window will indicate when the sequencer is finished (Figure 8).


Figure 5: There is an error in the script Figure 6: Sequencer is running
Figure 5: There is an error in the script Figure 6: Sequencer is running


Figure 7: Sequencer is paused Figure 8: Sequencer is finished
Figure 7: Sequencer is paused
Figure 8: Sequencer is finished


Sequencer test file

The following is the contents of the sequence file used for testing test_seq.msl in the example above.

COMMENT "This is a MSL test file"
RUNDESCRIPTION "Test run"
PARAM runs

LOOP $runs
     TRANSITION START
     WAIT ODBvalue "/Equipment/FIFO_acq/Statistics/Events sent" >= 25
     TRANSITION STOP
     WAIT seconds 5
ENDLOOP