Sequencer Page: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
<div style="column-count:4;-moz-column-count:4;-webkit-column-count:4">
{{Pagelinks}}
* [[Midas_documentation|Midas Documentation]]
 
* [[Feature_listing|Feature Listing]]
* [[Application_listing|Application Listing]]
* [[Online_Database|Online Database]]
</div>


= Links =
= Links =
Line 23: Line 19:


= Purpose =
= 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.
The purpose of the [[mhttpd]] Sequencer Web Page to provide a visual display for the [[Sequencer]]. Using the Sequencer Page, [[Sequencer|Sequencer scripts]] can be loaded, edited and run.




Line 33: Line 29:


= 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).  
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. 


== How to input and run a Sequencer Script ==
== How to input and run a Sequencer Script ==
Line 45: Line 41:
<li>Either</li>
<li>Either</li>
<ul>
<ul>
<li> press {{Button|name=Edit Script}}  and input a new test sequence (Figure 2).</li>
<li> press {{Button|name=Edit Script}}  and input a new test sequence (e.g. [[#Sequence File|test_seq.msl]]) as in Figure 2.</li>
<li> save the script by pressing {{Button|name=Save}}. You will be asked for a file name. </li>
<li> save the script by pressing {{Button|name=Save}}. You will be asked for a file name. </li>
</ul>
</ul>
Line 53: Line 49:
</ul>
</ul>
<br>
<br>
<li> Press {{Button|name=Start Script}} button to start the script. <br>
<li> Press {{Button|name=Start Script}} button to start the script. </li>
In this example, the script contains an error that prevents the script from running (Figure 4)</li>
<ul>
<li>You will be asked to input any required parameters (in this case the number of runs, see [[#Sequence File|test_seq.msl]]) as in Figure 4.</li>
<li>If [[#Edit-on-Sequence Parameters|edit-on-sequence parameters]] are defined, these will be displayed in addition to any required parameters (Figure 8)</li>
<li>In this example, the script contains an error that prevents the script from running (Figure 5)</li>
</ul>
<br>
<br>
<li> The script is edited by pressing  {{Button|name=Edit Script}}, and the error corrected.</li>
<li> The script is edited by pressing  {{Button|name=Edit Script}}, and the error corrected.</li>
<br>
<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 5).</li>
<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>
<br>
<li> The sequencer can be paused by pressing the  {{Button|name=Pause Script}} button (Figure 6).</li>
<li> The sequencer can be paused by pressing the  {{Button|name=Pause Script}} button (Figure 7).</li>
<br>
<br>
<li>The progress window will indicated when the sequencer is finished  (Figure 7).</li>
<li>The progress window will indicated when the sequencer is finished  (Figure 8).</li>
</ul>
</ul>


Line 70: Line 70:
File:sequencer_scripteditor.png|Figure 2: Editing a Sequencer script
File:sequencer_scripteditor.png|Figure 2: Editing a Sequencer script
File:sequencer_filelist.png|Figure 3: Select a Sequencer file
File:sequencer_filelist.png|Figure 3: Select a Sequencer file
File:sequencer_error.png|Figure 4: There is an error in the script
File:sequencer_startscript.png|Figure 4: Select a Sequencer file
File:sequencer_running.png|Figure 5: Sequencer is running
File:sequencer_error.png|Figure 5: There is an error in the script
File:sequencer_paused.png|Figure 6: Sequencer is paused
File:sequencer_running.png|Figure 6: Sequencer is running
File:sequencer_finished.png|Figure 7: Sequencer is finished
File:sequencer_paused.png|Figure 7: Sequencer is paused
File:sequencer_finished.png|Figure 8: Sequencer is finished
File:sequencer_onstart.png|Figure 9: Example of edit-on-sequence parameters
</gallery>
</gallery>
=== Sequence 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]].
<pre>
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
</pre>
== Edit-on-Sequence Parameters ==
Edit-on-sequence parameters are displayed for edit when a new "Sequence" is started (similar to the [[edit-on-start Parameters]] that appear when a Run is started). Edit-on-sequence parameters may be defined in [[/Experiment ODB tree]] in the optional  {{Odbpath|path=Edit on Sequence}} subdirectory in the same way that Edit-on-start parameters may be defined in the {{Odbpath|path=Edit on Start}} subdirectory.
Creating edit-on-sequence parameters is similar to creating [[Edit-on-start]] parameters.
An example of edit-on-sequence parameters defined in the {{Odbpath|path=/Experiment}} ODB tree are shown in this
[[/Experiment ODB tree|Examples|example]].
Edit-on-sequence parameters are displayed when the  {{Button|name=Start Script}} button is pressed. An example is shown in Figure 8 above.


[[Category: mhttpd]] [[Category: Sequencer]]
[[Category: mhttpd]] [[Category: Sequencer]]

Revision as of 16:54, 2 July 2015



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.

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.

How to input and run a Sequencer Script

See Sequencer Commands for the list of commands recognized by the Sequencer.

  • Press 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.
  • Note
    The directory path where the sequencer files will be saved is set by the ODB parameter /Sequencer/State/Path.
  • Either
    • press Edit Script and input a new test sequence (e.g. test_seq.msl) as in Figure 2.
    • save the script by pressing Save. You will be asked for a file name.
  • Or
    • load an existing script using Load Script as in Figure 3.


  • Press Start Script button to start the script.
    • You will be asked to input any required parameters (in this case the number of runs, see test_seq.msl) as in Figure 4.
    • If edit-on-sequence parameters are defined, these will be displayed in addition to any required parameters (Figure 8)
    • In this example, the script contains an error that prevents the script from running (Figure 5)


  • The script is edited by pressing Edit Script, and the error corrected.

  • Now the script will run when 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).

  • The sequencer can be paused by pressing the Pause Script button (Figure 7).

  • The progress window will indicated when the sequencer is finished (Figure 8).
Click on a thumbnail to enlarge


Sequence 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

Edit-on-Sequence Parameters

Edit-on-sequence parameters are displayed for edit when a new "Sequence" is started (similar to the edit-on-start Parameters that appear when a Run is started). Edit-on-sequence parameters may be defined in /Experiment ODB tree in the optional Edit on Sequence subdirectory in the same way that Edit-on-start parameters may be defined in the Edit on Start subdirectory.

Creating edit-on-sequence parameters is similar to creating Edit-on-start parameters.

An example of edit-on-sequence parameters defined in the /Experiment ODB tree are shown in this Examples|example.

Edit-on-sequence parameters are displayed when the Start Script button is pressed. An example is shown in Figure 8 above.