<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://e-mode.phas.ubc.ca/mcewiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sysop</id>
	<title>MCEWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://e-mode.phas.ubc.ca/mcewiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sysop"/>
	<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php/Special:Contributions/Sysop"/>
	<updated>2026-05-09T22:57:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.16</generator>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_config_template_system&amp;diff=1614</id>
		<title>MCE config template system</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_config_template_system&amp;diff=1614"/>
		<updated>2008-03-06T11:01:59Z</updated>

		<summary type="html">&lt;p&gt;Sysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An important component of the current MCE configuration system is the &amp;quot;mce_config_template&amp;quot; file.  This file is a bash script that puts the MCE in some desired state, which usually means that it sets up the biases and locking points of the squids and series arrays to the values determined in the most recent auto-tuning.&lt;br /&gt;
&lt;br /&gt;
= General structure =&lt;br /&gt;
&lt;br /&gt;
In previous versions of MCE software, there was a template file called config_mce_auto_setup_&amp;lt;date&amp;gt;, with date of the form YYYYMMDD, that lived in the /data/cryo/&amp;lt;date&amp;gt; folder (which was linked to /data/cryo/current_data and was the destination for all MCE data files).  When the [[ Auto-tuning IDL code | auto-tune ]] was run, certain lines of the config script were updated to reflect the biases and locking points discovered by the auto-tune code.  The auto-tune code would then run the updated config script to load the values into the MCE in preparation for the next stage.&lt;br /&gt;
&lt;br /&gt;
In order to create a more flexible and robust system, the auto-tune programs no longer edit the config script directly.  Instead, there is configuration file, called &amp;quot;experiment.cfg&amp;quot;, where the auto-tune programs can read and write values.  A config script is then generated by running &amp;quot;mce_make_config&amp;quot;, which creates a config script based on the values in experiment.cfg.&lt;br /&gt;
&lt;br /&gt;
The auto-tune read and write is accomplished via IDL functions called &amp;quot;load_exp_params&amp;quot; and &amp;quot;save_exp_params&amp;quot;.  These functions are in &amp;quot;load_exp_params.pro&amp;quot;, which is automatically generated by the program [[ mas_param ]] based on a template for experiment.cfg.  They allow IDL to import settings from experiment.cfg as an IDL structure, manipulate them using normal IDL vector operations, and then save the structure data back to the file.&lt;br /&gt;
&lt;br /&gt;
The mce_make_config script constructs a config script by combining various pre-defined blocks of bash code with a block of bash variable declarations that is generated by [[ mas_param ]] from experiment.cfg.&lt;br /&gt;
&lt;br /&gt;
= experiment.cfg =&lt;br /&gt;
&lt;br /&gt;
The experiment.cfg file structure is that of libconfig (http://www.hyperrealm.com/libconfig/).  Here are some typical lines:&lt;br /&gt;
&lt;br /&gt;
 # output level and time interval for driving detectors normal.&lt;br /&gt;
 &lt;br /&gt;
 tes_bias_idle = [0, 0, 0];&lt;br /&gt;
 tes_bias_normal = [65000, 65000, 65000];&lt;br /&gt;
 tes_bias_normal_time = 0.1;&lt;br /&gt;
 &lt;br /&gt;
 # Note that each entry of flux_quanta_rc# is repeated 41 times and&lt;br /&gt;
 # written to 'rc# flux_quanta%'&lt;br /&gt;
 &lt;br /&gt;
 flux_quanta = [ 0, 0, 0, 0, 0, 0, 0, 0,&lt;br /&gt;
                 0, 0, 0, 0, 0, 0, 0, 0,&lt;br /&gt;
                 0, 0, 0, 0, 0, 0, 0, 0,&lt;br /&gt;
                 0, 0, 0, 0, 0, 0, 0, 0 ];&lt;br /&gt;
&lt;br /&gt;
Although libconfig permits complex nested data structures, experiment.cfg is restricted to root-level simple data types (strings, floats, integers, arrays of floats, and arrays of integers).&lt;br /&gt;
&lt;br /&gt;
Unfortunately, experiment.cfg contains values associate with&lt;br /&gt;
* very stable properties that define the hardware configuration (e.g. number of rows of squids and sync box presence/absence)&lt;br /&gt;
* properties that must be manipulated during auto-tuning but then should return to some experiment default (e.g. rc data_mode)&lt;br /&gt;
* settings that a user can manipulate to select different auto-tuning options (e.g. the list of rows for which to generate sq1 bias ramp plots)&lt;br /&gt;
* properties that are discovered or revised at various stages of the auto-tuning (e.g. the sq2 feedback lock points)&lt;br /&gt;
&lt;br /&gt;
This means that it is necessary to keep a few copies of experiment.cfg lying around to avoid corruption of certain properties.  In particular, at any time there will be:&lt;br /&gt;
* a pristine copy of experiment.cfg in $MAS_TEMPLATE; this will define preferred values for data mode, the hardware configuration, and the auto-tuning technique.  This will occasionally be updated, by hand, to select different tuning preferences.&lt;br /&gt;
* a working template copy, called experiment_template.cfg, in $MAS_DATA (/data/cryo/current_data), which becomes the starting point for auto-tuning.&lt;br /&gt;
* a target copy, in $MAS_DATA, which is actively edited by the auto-tuning programs as the auto-tune progresses.&lt;br /&gt;
&lt;br /&gt;
= Ok, I'll level with you =&lt;br /&gt;
&lt;br /&gt;
This is broken, because partial tunings (short=2) will trash experiment.cfg with experiment_template.cfg.  I think it can be fixed; we just have to separate &amp;quot;final settings&amp;quot; from &amp;quot;set this to this now&amp;quot; settings.&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_script&amp;diff=1613</id>
		<title>MCE script</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_script&amp;diff=1613"/>
		<updated>2008-03-06T10:21:24Z</updated>

		<summary type="html">&lt;p&gt;Sysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Auto-tuning system&lt;br /&gt;
** [[ Auto-tuning IDL code ]]&lt;br /&gt;
** [[ mce_config_template system ]]&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_script&amp;diff=1612</id>
		<title>MCE script</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MCE_script&amp;diff=1612"/>
		<updated>2008-03-06T10:21:07Z</updated>

		<summary type="html">&lt;p&gt;Sysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Auto-tuning system&lt;br /&gt;
** Auto-tuning IDL code&lt;br /&gt;
** mce_config_template system&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Sq1_servo_and_sq2_servo&amp;diff=1611</id>
		<title>Sq1 servo and sq2 servo</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Sq1_servo_and_sq2_servo&amp;diff=1611"/>
		<updated>2008-03-06T10:20:16Z</updated>

		<summary type="html">&lt;p&gt;Sysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Bug list ==&lt;br /&gt;
&lt;br /&gt;
* sq1servo and sq2servo may calculate out-of-range feedback values&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1610</id>
		<title>MAS</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1610"/>
		<updated>2008-03-06T10:19:50Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Usage ==&lt;br /&gt;
&lt;br /&gt;
* System applications&lt;br /&gt;
** [[mce_cmd]]&lt;br /&gt;
** [[mce_status]]&lt;br /&gt;
** [[maslog]]&lt;br /&gt;
** [[dsp_cmd]]&lt;br /&gt;
** [[ MAS Command line how-to ]]&lt;br /&gt;
&lt;br /&gt;
* Special applications&lt;br /&gt;
** [[ sq1_servo and sq2_servo ]]&lt;br /&gt;
** [[ mce_ramp ]]&lt;br /&gt;
** [[ psc_status ]]&lt;br /&gt;
&lt;br /&gt;
* Utilities&lt;br /&gt;
&lt;br /&gt;
* MAS configuration&lt;br /&gt;
** [[ MAS start/stop ]]&lt;br /&gt;
** [[ mce.cfg ]]&lt;br /&gt;
** [[ mas.cfg ]]&lt;br /&gt;
&lt;br /&gt;
* MAS file formats&lt;br /&gt;
** [[ Runfile format v2 ]]&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
* [[ MAS Bug List ]]&lt;br /&gt;
* [[ MAS to-do ]]&lt;br /&gt;
* [[ MAS feature requests ]]&lt;br /&gt;
&lt;br /&gt;
== Installation / configuration ==&lt;br /&gt;
&lt;br /&gt;
* [[ MAS PC requirements and initial setup | PC requirements and initial setup]]&lt;br /&gt;
* [[ MAS OS setup | OS setup]]&lt;br /&gt;
* [[ MAS kernel patch compilation | kernel patch compilation]]&lt;br /&gt;
* [[ MAS svn repository | SVN repository]]&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1609</id>
		<title>MAS</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1609"/>
		<updated>2008-03-06T10:19:33Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* Usage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Usage ==&lt;br /&gt;
&lt;br /&gt;
* System applications&lt;br /&gt;
** [[mce_cmd]]&lt;br /&gt;
** [[mce_status]]&lt;br /&gt;
** [[maslog]]&lt;br /&gt;
** [[dsp_cmd]]&lt;br /&gt;
** [[ MAS Command line how-to ]]&lt;br /&gt;
&lt;br /&gt;
* Special applications&lt;br /&gt;
** sq1_servo and sq2_servo&lt;br /&gt;
** mce_ramp&lt;br /&gt;
** psc_status&lt;br /&gt;
&lt;br /&gt;
* Utilities&lt;br /&gt;
&lt;br /&gt;
* MAS configuration&lt;br /&gt;
** [[ MAS start/stop ]]&lt;br /&gt;
** [[ mce.cfg ]]&lt;br /&gt;
** [[ mas.cfg ]]&lt;br /&gt;
&lt;br /&gt;
* MAS file formats&lt;br /&gt;
** [[ Runfile format v2 ]]&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
* [[ MAS Bug List ]]&lt;br /&gt;
* [[ MAS to-do ]]&lt;br /&gt;
* [[ MAS feature requests ]]&lt;br /&gt;
&lt;br /&gt;
== Installation / configuration ==&lt;br /&gt;
&lt;br /&gt;
* [[ MAS PC requirements and initial setup | PC requirements and initial setup]]&lt;br /&gt;
* [[ MAS OS setup | OS setup]]&lt;br /&gt;
* [[ MAS kernel patch compilation | kernel patch compilation]]&lt;br /&gt;
* [[ MAS svn repository | SVN repository]]&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1608</id>
		<title>Mce cmd</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1608"/>
		<updated>2008-03-06T10:17:48Z</updated>

		<summary type="html">&lt;p&gt;Sysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[ MAS | Return to MAS ]]&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
mce_cmd provides an interface between a Linux shell and the MCE.  The application can run interactively (accepting commands from a user and issuing responses to stdout), or can be used to execute scripts containing mce_cmd instructions.&lt;br /&gt;
&lt;br /&gt;
= Running mce_cmd =&lt;br /&gt;
&lt;br /&gt;
== Interactive mode ==&lt;br /&gt;
&lt;br /&gt;
When invoked with the '-i' option, mce_cmd can be used interactively.  A session command history (similar to the one in bash) can be accessed with the up and down arrow keys, and line editing is possible using emacs-based key-mappings.&lt;br /&gt;
 mce_cmd -i&lt;br /&gt;
&lt;br /&gt;
After displaying a version message, mce_cmd will be ready to accept input.  There is no user prompt.&lt;br /&gt;
&lt;br /&gt;
== Single command execution ==&lt;br /&gt;
&lt;br /&gt;
A single command can be issued using the '-x' option:&lt;br /&gt;
 mce_cmd -x rb cc fw_rev&lt;br /&gt;
The application will execute the command, display any output, and exit.  Currently, only single commands can be executed from the command line.&lt;br /&gt;
&lt;br /&gt;
== Script execution ==&lt;br /&gt;
&lt;br /&gt;
The '-f' option tell mce_cmd to read lines from the specified file and attempt to execute them.  The '-q' option suppresses unnecessary output.&lt;br /&gt;
 mce_cmd -q -f my_script.scr&lt;br /&gt;
&lt;br /&gt;
When redirecting commands to mce_cmd, the '-r' option should be used to disable the command history/line editing features of mce_cmd and decrease the execution time.&lt;br /&gt;
 cat my_script.scr | mce_cmd -q -r&lt;br /&gt;
&lt;br /&gt;
If a script command fails, mce_cmd will exit.  To suppress that behaviour (and continue attempting commands even after one of them has failed), pass the '-i' option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Commands =&lt;br /&gt;
&lt;br /&gt;
We can break the mce_cmd command set into three broad categories: MCE commands, data acquisition commands, and output formatting commands.&lt;br /&gt;
&lt;br /&gt;
== Special hardware commands ==&lt;br /&gt;
&lt;br /&gt;
=== MCE_RESET: reset the MCE using special character override ===&lt;br /&gt;
&lt;br /&gt;
The mce_reset command causes the PCI card to transmit a special character over the fibre-optic connection to the MCE.  This causes the MCE to reinitialize.  It is advisable to wait several microseconds following the mce_reset command before issuing other MCE commands.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 mce_reset&lt;br /&gt;
&lt;br /&gt;
=== DSP_RESET: reset the PCI card DSP firmware ===&lt;br /&gt;
&lt;br /&gt;
The dsp_reset command causes the PCI card to reset.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 dsp_reset&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MCE data block commands ==&lt;br /&gt;
&lt;br /&gt;
MCE configuration data is stored in blocks at certain card and parameter addresses (which we will call &amp;quot;block locations&amp;quot;).  A typical block address is&lt;br /&gt;
 rc2 flx_quanta4&lt;br /&gt;
This block consists of 41 32-bit words where the user writes the squid-1 flux quantum size for column 4 on readout card 2.&lt;br /&gt;
&lt;br /&gt;
The most basic data manipulation commands are RB (&amp;quot;read block&amp;quot;) and WB&lt;br /&gt;
(&amp;quot;write block&amp;quot;).  These commands read from or write to the entire range of&lt;br /&gt;
data at the block location, starting at the beginning of the block.&lt;br /&gt;
&lt;br /&gt;
The commands RRA (&amp;quot;read range&amp;quot;) and WRA (&amp;quot;write range&amp;quot;) can be used to&lt;br /&gt;
read or write particular subranges of the data in a block location.&lt;br /&gt;
&lt;br /&gt;
All read and write commands take a card (or [[ Virtual cards | virtual card ]]) name and a&lt;br /&gt;
parameter name as the first two arguments.  &lt;br /&gt;
&lt;br /&gt;
=== RB: read block ===&lt;br /&gt;
&lt;br /&gt;
The read block command returns the entire contents of a block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   1 : ok : 10 11 9 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WB: write block ===&lt;br /&gt;
&lt;br /&gt;
The write block command writes the given data to the specified block location.  If the number of data is smaller than block size, the remaining block elements will not be altered.  If the number of data is larger than the block size, the behaviour depends on the implementation of the block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wb rc1 adc_offset0 0 1 2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
=== RRA: read range ===&lt;br /&gt;
&lt;br /&gt;
The read range command returns &amp;lt;count&amp;gt; values from the block location, starting from the value at &amp;lt;start_index&amp;gt; (indexed from 0).&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; &amp;lt;count&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rra rc1 adc_offset0 2 4&lt;br /&gt;
 Line   1 : ok : 2 8 12 13&lt;br /&gt;
&lt;br /&gt;
=== WRA: write range ===&lt;br /&gt;
&lt;br /&gt;
The write range command writes the given values into the block location, starting at &amp;lt;start_index&amp;gt; (indexed from 0).  Other block data (i.e. at indices lower than start_index) are not changed.  (This command is implemented as a read-update-write and will usually take twice as long to execute as a WB command.)&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wra rc1 adc_offset0 4 100 200&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 100 200 14 15&lt;br /&gt;
&lt;br /&gt;
== MCE data acquisition commands ==&lt;br /&gt;
&lt;br /&gt;
The acquisition of frame data is achieved by first configuring an output system (by specifying an output format, filename, and the target readout cards), and then by issuing ACQ_GO commands to acquire frames.&lt;br /&gt;
&lt;br /&gt;
This simplest example will acquire 1000 frames from rc2 into the file /data/cryo/current_data/test:&lt;br /&gt;
 acq_config /data/cryo/current_data/test rc2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 acq_go 1000&lt;br /&gt;
 Line   2 : ok&lt;br /&gt;
&lt;br /&gt;
The configuration commands have mnemonics that begin with &amp;quot;ACQ_CONFIG&amp;quot;.  They allow a small variety of output formats.&lt;br /&gt;
&lt;br /&gt;
=== acq_config : configure simple MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config command configures a single output file to receive MCE frames.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config test1.dat rc2&lt;br /&gt;
&lt;br /&gt;
=== acq_config_fs : configure file-sequenced MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config_fs command will result in the outputting of the frame data into a set of files whose filename contains an increasing index.  The output file is changed after &amp;lt;change_interval&amp;gt; frames.  The output files will be called &amp;lt;filename&amp;gt;.000, &amp;lt;filename&amp;gt;.001, etc.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config_fs &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt; &amp;lt;change_interval&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== acq_path : set the default path for data output ===&lt;br /&gt;
&lt;br /&gt;
The acq_path command sets the default output directory for frame data.  This path is only appled if the filenames given in acq_config_* do not specify a relative path.  The given path can be absolute, or relative to the mce_cmd's run-time working directory.  The default output location can also be specified using the '-o' command line option.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_path &amp;lt;path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_path /data/cryo/current_data&lt;br /&gt;
 acq_config test1 rc1&lt;br /&gt;
 acq_go 10&lt;br /&gt;
&lt;br /&gt;
=== acq_go : acquire frame data ===&lt;br /&gt;
&lt;br /&gt;
The acq_go command causes the MCE to begin acquiring data.  The frame data will be stored according to the most recent acq_config* command.  It is not usually necessary to reconfigure the output system (i.e. perform another acq_config) between acq_go commands.  The exception to this is that if the frame structure changes (i.e. &amp;quot;cc num_rows_reported&amp;quot; is altered), then acq_config should be issued again so that the acquisition system can determine the frame size. &lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_go &amp;lt;frame_count&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config tes_bias_ramp rc1&lt;br /&gt;
 wb tes bias 5 5 5&lt;br /&gt;
 acq_go 1&lt;br /&gt;
 wb tes bias 10 10 10&lt;br /&gt;
 acq_go 1&lt;br /&gt;
&lt;br /&gt;
= Output formatting =&lt;br /&gt;
&lt;br /&gt;
Normally, mce_cmd produces a line of output following each command. The output consists of two or three parts, separated by colons.  If in line prefix mode (which is the default) the output is:&lt;br /&gt;
 Line &amp;lt;line number&amp;gt;: &amp;lt;success&amp;gt; [: data ... ]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;success&amp;gt; indicator will be &amp;quot;ok&amp;quot; if the command succeeded, or &amp;quot;error&amp;quot; otherwise.  Successful commands may return data (for example, an RB command).  Failed commands will always return an error message as the data.&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked with prefixes turned off ('-p'), the output format is&lt;br /&gt;
 &amp;lt;success&amp;gt; [: data]&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked in quiet mode ('q'), then all command responses that have no output data are suppressed.  In quiet mode, &amp;quot;Line 12: ok&amp;quot; will not be displayed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
[[ MAS | Return to MAS ]]&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1607</id>
		<title>Mce cmd</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1607"/>
		<updated>2008-03-06T10:07:32Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* Output formatting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
mce_cmd provides an interface between a Linux shell and the MCE.  The application can run interactively (accepting commands from a user and issuing responses to stdout), or can be used to execute scripts containing mce_cmd instructions.&lt;br /&gt;
&lt;br /&gt;
= Running mce_cmd =&lt;br /&gt;
&lt;br /&gt;
== Interactive mode ==&lt;br /&gt;
&lt;br /&gt;
When invoked with the '-i' option, mce_cmd can be used interactively.  A session command history (similar to the one in bash) can be accessed with the up and down arrow keys, and line editing is possible using emacs-based key-mappings.&lt;br /&gt;
 mce_cmd -i&lt;br /&gt;
&lt;br /&gt;
After displaying a version message, mce_cmd will be ready to accept input.  There is no user prompt.&lt;br /&gt;
&lt;br /&gt;
== Single command execution ==&lt;br /&gt;
&lt;br /&gt;
A single command can be issued using the '-x' option:&lt;br /&gt;
 mce_cmd -x rb cc fw_rev&lt;br /&gt;
The application will execute the command, display any output, and exit.  Currently, only single commands can be executed from the command line.&lt;br /&gt;
&lt;br /&gt;
== Script execution ==&lt;br /&gt;
&lt;br /&gt;
The '-f' option tell mce_cmd to read lines from the specified file and attempt to execute them.  The '-q' option suppresses unnecessary output.&lt;br /&gt;
 mce_cmd -q -f my_script.scr&lt;br /&gt;
&lt;br /&gt;
When redirecting commands to mce_cmd, the '-r' option should be used to disable the command history/line editing features of mce_cmd and decrease the execution time.&lt;br /&gt;
 cat my_script.scr | mce_cmd -q -r&lt;br /&gt;
&lt;br /&gt;
If a script command fails, mce_cmd will exit.  To suppress that behaviour (and continue attempting commands even after one of them has failed), pass the '-i' option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Commands =&lt;br /&gt;
&lt;br /&gt;
We can break the mce_cmd command set into three broad categories: MCE commands, data acquisition commands, and output formatting commands.&lt;br /&gt;
&lt;br /&gt;
== Special hardware commands ==&lt;br /&gt;
&lt;br /&gt;
=== MCE_RESET: reset the MCE using special character override ===&lt;br /&gt;
&lt;br /&gt;
The mce_reset command causes the PCI card to transmit a special character over the fibre-optic connection to the MCE.  This causes the MCE to reinitialize.  It is advisable to wait several microseconds following the mce_reset command before issuing other MCE commands.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 mce_reset&lt;br /&gt;
&lt;br /&gt;
=== DSP_RESET: reset the PCI card DSP firmware ===&lt;br /&gt;
&lt;br /&gt;
The dsp_reset command causes the PCI card to reset.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 dsp_reset&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MCE data block commands ==&lt;br /&gt;
&lt;br /&gt;
MCE configuration data is stored in blocks at certain card and parameter addresses (which we will call &amp;quot;block locations&amp;quot;).  A typical block address is&lt;br /&gt;
 rc2 flx_quanta4&lt;br /&gt;
This block consists of 41 32-bit words where the user writes the squid-1 flux quantum size for column 4 on readout card 2.&lt;br /&gt;
&lt;br /&gt;
The most basic data manipulation commands are RB (&amp;quot;read block&amp;quot;) and WB&lt;br /&gt;
(&amp;quot;write block&amp;quot;).  These commands read from or write to the entire range of&lt;br /&gt;
data at the block location, starting at the beginning of the block.&lt;br /&gt;
&lt;br /&gt;
The commands RRA (&amp;quot;read range&amp;quot;) and WRA (&amp;quot;write range&amp;quot;) can be used to&lt;br /&gt;
read or write particular subranges of the data in a block location.&lt;br /&gt;
&lt;br /&gt;
All read and write commands take a card (or [[ Virtual cards | virtual card ]]) name and a&lt;br /&gt;
parameter name as the first two arguments.  &lt;br /&gt;
&lt;br /&gt;
=== RB: read block ===&lt;br /&gt;
&lt;br /&gt;
The read block command returns the entire contents of a block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   1 : ok : 10 11 9 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WB: write block ===&lt;br /&gt;
&lt;br /&gt;
The write block command writes the given data to the specified block location.  If the number of data is smaller than block size, the remaining block elements will not be altered.  If the number of data is larger than the block size, the behaviour depends on the implementation of the block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wb rc1 adc_offset0 0 1 2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
=== RRA: read range ===&lt;br /&gt;
&lt;br /&gt;
The read range command returns &amp;lt;count&amp;gt; values from the block location, starting from the value at &amp;lt;start_index&amp;gt; (indexed from 0).&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; &amp;lt;count&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rra rc1 adc_offset0 2 4&lt;br /&gt;
 Line   1 : ok : 2 8 12 13&lt;br /&gt;
&lt;br /&gt;
=== WRA: write range ===&lt;br /&gt;
&lt;br /&gt;
The write range command writes the given values into the block location, starting at &amp;lt;start_index&amp;gt; (indexed from 0).  Other block data (i.e. at indices lower than start_index) are not changed.  (This command is implemented as a read-update-write and will usually take twice as long to execute as a WB command.)&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wra rc1 adc_offset0 4 100 200&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 100 200 14 15&lt;br /&gt;
&lt;br /&gt;
== MCE data acquisition commands ==&lt;br /&gt;
&lt;br /&gt;
The acquisition of frame data is achieved by first configuring an output system (by specifying an output format, filename, and the target readout cards), and then by issuing ACQ_GO commands to acquire frames.&lt;br /&gt;
&lt;br /&gt;
This simplest example will acquire 1000 frames from rc2 into the file /data/cryo/current_data/test:&lt;br /&gt;
 acq_config /data/cryo/current_data/test rc2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 acq_go 1000&lt;br /&gt;
 Line   2 : ok&lt;br /&gt;
&lt;br /&gt;
The configuration commands have mnemonics that begin with &amp;quot;ACQ_CONFIG&amp;quot;.  They allow a small variety of output formats.&lt;br /&gt;
&lt;br /&gt;
=== acq_config : configure simple MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config command configures a single output file to receive MCE frames.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config test1.dat rc2&lt;br /&gt;
&lt;br /&gt;
=== acq_config_fs : configure file-sequenced MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config_fs command will result in the outputting of the frame data into a set of files whose filename contains an increasing index.  The output file is changed after &amp;lt;change_interval&amp;gt; frames.  The output files will be called &amp;lt;filename&amp;gt;.000, &amp;lt;filename&amp;gt;.001, etc.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config_fs &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt; &amp;lt;change_interval&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== acq_path : set the default path for data output ===&lt;br /&gt;
&lt;br /&gt;
The acq_path command sets the default output directory for frame data.  This path is only appled if the filenames given in acq_config_* do not specify a relative path.  The given path can be absolute, or relative to the mce_cmd's run-time working directory.  The default output location can also be specified using the '-o' command line option.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_path &amp;lt;path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_path /data/cryo/current_data&lt;br /&gt;
 acq_config test1 rc1&lt;br /&gt;
 acq_go 10&lt;br /&gt;
&lt;br /&gt;
=== acq_go : acquire frame data ===&lt;br /&gt;
&lt;br /&gt;
The acq_go command causes the MCE to begin acquiring data.  The frame data will be stored according to the most recent acq_config* command.  It is not usually necessary to reconfigure the output system (i.e. perform another acq_config) between acq_go commands.  The exception to this is that if the frame structure changes (i.e. &amp;quot;cc num_rows_reported&amp;quot; is altered), then acq_config should be issued again so that the acquisition system can determine the frame size. &lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_go &amp;lt;frame_count&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config tes_bias_ramp rc1&lt;br /&gt;
 wb tes bias 5 5 5&lt;br /&gt;
 acq_go 1&lt;br /&gt;
 wb tes bias 10 10 10&lt;br /&gt;
 acq_go 1&lt;br /&gt;
&lt;br /&gt;
= Output formatting =&lt;br /&gt;
&lt;br /&gt;
Normally, mce_cmd produces a line of output following each command. The output consists of two or three parts, separated by colons.  If in line prefix mode (which is the default) the output is:&lt;br /&gt;
 Line &amp;lt;line number&amp;gt;: &amp;lt;success&amp;gt; [: data ... ]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;success&amp;gt; indicator will be &amp;quot;ok&amp;quot; if the command succeeded, or &amp;quot;error&amp;quot; otherwise.  Successful commands may return data (for example, an RB command).  Failed commands will always return an error message as the data.&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked with prefixes turned off ('-p'), the output format is&lt;br /&gt;
 &amp;lt;success&amp;gt; [: data]&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked in quiet mode ('q'), then all command responses that have no output data are suppressed.  In quiet mode, &amp;quot;Line 12: ok&amp;quot; will not be displayed.&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1606</id>
		<title>Mce cmd</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1606"/>
		<updated>2008-03-06T09:16:49Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* Commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
mce_cmd provides an interface between a Linux shell and the MCE.  The application can run interactively (accepting commands from a user and issuing responses to stdout), or can be used to execute scripts containing mce_cmd instructions.&lt;br /&gt;
&lt;br /&gt;
= Running mce_cmd =&lt;br /&gt;
&lt;br /&gt;
== Interactive mode ==&lt;br /&gt;
&lt;br /&gt;
When invoked with the '-i' option, mce_cmd can be used interactively.  A session command history (similar to the one in bash) can be accessed with the up and down arrow keys, and line editing is possible using emacs-based key-mappings.&lt;br /&gt;
 mce_cmd -i&lt;br /&gt;
&lt;br /&gt;
After displaying a version message, mce_cmd will be ready to accept input.  There is no user prompt.&lt;br /&gt;
&lt;br /&gt;
== Single command execution ==&lt;br /&gt;
&lt;br /&gt;
A single command can be issued using the '-x' option:&lt;br /&gt;
 mce_cmd -x rb cc fw_rev&lt;br /&gt;
The application will execute the command, display any output, and exit.  Currently, only single commands can be executed from the command line.&lt;br /&gt;
&lt;br /&gt;
== Script execution ==&lt;br /&gt;
&lt;br /&gt;
The '-f' option tell mce_cmd to read lines from the specified file and attempt to execute them.  The '-q' option suppresses unnecessary output.&lt;br /&gt;
 mce_cmd -q -f my_script.scr&lt;br /&gt;
&lt;br /&gt;
When redirecting commands to mce_cmd, the '-r' option should be used to disable the command history/line editing features of mce_cmd and decrease the execution time.&lt;br /&gt;
 cat my_script.scr | mce_cmd -q -r&lt;br /&gt;
&lt;br /&gt;
If a script command fails, mce_cmd will exit.  To suppress that behaviour (and continue attempting commands even after one of them has failed), pass the '-i' option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Commands =&lt;br /&gt;
&lt;br /&gt;
We can break the mce_cmd command set into three broad categories: MCE commands, data acquisition commands, and output formatting commands.&lt;br /&gt;
&lt;br /&gt;
== Special hardware commands ==&lt;br /&gt;
&lt;br /&gt;
=== MCE_RESET: reset the MCE using special character override ===&lt;br /&gt;
&lt;br /&gt;
The mce_reset command causes the PCI card to transmit a special character over the fibre-optic connection to the MCE.  This causes the MCE to reinitialize.  It is advisable to wait several microseconds following the mce_reset command before issuing other MCE commands.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 mce_reset&lt;br /&gt;
&lt;br /&gt;
=== DSP_RESET: reset the PCI card DSP firmware ===&lt;br /&gt;
&lt;br /&gt;
The dsp_reset command causes the PCI card to reset.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 dsp_reset&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== MCE data block commands ==&lt;br /&gt;
&lt;br /&gt;
MCE configuration data is stored in blocks at certain card and parameter addresses (which we will call &amp;quot;block locations&amp;quot;).  A typical block address is&lt;br /&gt;
 rc2 flx_quanta4&lt;br /&gt;
This block consists of 41 32-bit words where the user writes the squid-1 flux quantum size for column 4 on readout card 2.&lt;br /&gt;
&lt;br /&gt;
The most basic data manipulation commands are RB (&amp;quot;read block&amp;quot;) and WB&lt;br /&gt;
(&amp;quot;write block&amp;quot;).  These commands read from or write to the entire range of&lt;br /&gt;
data at the block location, starting at the beginning of the block.&lt;br /&gt;
&lt;br /&gt;
The commands RRA (&amp;quot;read range&amp;quot;) and WRA (&amp;quot;write range&amp;quot;) can be used to&lt;br /&gt;
read or write particular subranges of the data in a block location.&lt;br /&gt;
&lt;br /&gt;
All read and write commands take a card (or [[ Virtual cards | virtual card ]]) name and a&lt;br /&gt;
parameter name as the first two arguments.  &lt;br /&gt;
&lt;br /&gt;
=== RB: read block ===&lt;br /&gt;
&lt;br /&gt;
The read block command returns the entire contents of a block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   1 : ok : 10 11 9 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WB: write block ===&lt;br /&gt;
&lt;br /&gt;
The write block command writes the given data to the specified block location.  If the number of data is smaller than block size, the remaining block elements will not be altered.  If the number of data is larger than the block size, the behaviour depends on the implementation of the block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wb rc1 adc_offset0 0 1 2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
=== RRA: read range ===&lt;br /&gt;
&lt;br /&gt;
The read range command returns &amp;lt;count&amp;gt; values from the block location, starting from the value at &amp;lt;start_index&amp;gt; (indexed from 0).&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; &amp;lt;count&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rra rc1 adc_offset0 2 4&lt;br /&gt;
 Line   1 : ok : 2 8 12 13&lt;br /&gt;
&lt;br /&gt;
=== WRA: write range ===&lt;br /&gt;
&lt;br /&gt;
The write range command writes the given values into the block location, starting at &amp;lt;start_index&amp;gt; (indexed from 0).  Other block data (i.e. at indices lower than start_index) are not changed.  (This command is implemented as a read-update-write and will usually take twice as long to execute as a WB command.)&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wra rc1 adc_offset0 4 100 200&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 100 200 14 15&lt;br /&gt;
&lt;br /&gt;
== MCE data acquisition commands ==&lt;br /&gt;
&lt;br /&gt;
The acquisition of frame data is achieved by first configuring an output system (by specifying an output format, filename, and the target readout cards), and then by issuing ACQ_GO commands to acquire frames.&lt;br /&gt;
&lt;br /&gt;
This simplest example will acquire 1000 frames from rc2 into the file /data/cryo/current_data/test:&lt;br /&gt;
 acq_config /data/cryo/current_data/test rc2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 acq_go 1000&lt;br /&gt;
 Line   2 : ok&lt;br /&gt;
&lt;br /&gt;
The configuration commands have mnemonics that begin with &amp;quot;ACQ_CONFIG&amp;quot;.  They allow a small variety of output formats.&lt;br /&gt;
&lt;br /&gt;
=== acq_config : configure simple MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config command configures a single output file to receive MCE frames.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config test1.dat rc2&lt;br /&gt;
&lt;br /&gt;
=== acq_config_fs : configure file-sequenced MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config_fs command will result in the outputting of the frame data into a set of files whose filename contains an increasing index.  The output file is changed after &amp;lt;change_interval&amp;gt; frames.  The output files will be called &amp;lt;filename&amp;gt;.000, &amp;lt;filename&amp;gt;.001, etc.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config_fs &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt; &amp;lt;change_interval&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== acq_path : set the default path for data output ===&lt;br /&gt;
&lt;br /&gt;
The acq_path command sets the default output directory for frame data.  This path is only appled if the filenames given in acq_config_* do not specify a relative path.  The given path can be absolute, or relative to the mce_cmd's run-time working directory.  The default output location can also be specified using the '-o' command line option.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_path &amp;lt;path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_path /data/cryo/current_data&lt;br /&gt;
 acq_config test1 rc1&lt;br /&gt;
 acq_go 10&lt;br /&gt;
&lt;br /&gt;
=== acq_go : acquire frame data ===&lt;br /&gt;
&lt;br /&gt;
The acq_go command causes the MCE to begin acquiring data.  The frame data will be stored according to the most recent acq_config* command.  It is not usually necessary to reconfigure the output system (i.e. perform another acq_config) between acq_go commands.  The exception to this is that if the frame structure changes (i.e. &amp;quot;cc num_rows_reported&amp;quot; is altered), then acq_config should be issued again so that the acquisition system can determine the frame size. &lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_go &amp;lt;frame_count&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config tes_bias_ramp rc1&lt;br /&gt;
 wb tes bias 5 5 5&lt;br /&gt;
 acq_go 1&lt;br /&gt;
 wb tes bias 10 10 10&lt;br /&gt;
 acq_go 1&lt;br /&gt;
&lt;br /&gt;
= Output formatting =&lt;br /&gt;
&lt;br /&gt;
The output consists of two or three parts, separated by colons.  If in line prefix mode (which is the default) the output is:&lt;br /&gt;
 Line &amp;lt;line number&amp;gt;: &amp;lt;success&amp;gt; [: data ... ]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;success&amp;gt; indicator will be &amp;quot;ok&amp;quot; if the command succeeded, or &amp;quot;error&amp;quot; otherwise.  Successful commands may return data (for example, an RB command).  Failed commands will always return an error message as the data.&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked with prefixes turned off ('-p'), the output format is&lt;br /&gt;
 &amp;lt;success&amp;gt; [: data]&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked in quiet mode ('q'), then all command responses that have no output data are suppressed.  In quiet mode, &amp;quot;Line 12: ok&amp;quot; will not be displayed.&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1605</id>
		<title>Mce cmd</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1605"/>
		<updated>2008-03-06T09:12:39Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* Output formatting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
mce_cmd provides an interface between a Linux shell and the MCE.  The application can run interactively (accepting commands from a user and issuing responses to stdout), or can be used to execute scripts containing mce_cmd instructions.&lt;br /&gt;
&lt;br /&gt;
= Running mce_cmd =&lt;br /&gt;
&lt;br /&gt;
== Interactive mode ==&lt;br /&gt;
&lt;br /&gt;
When invoked with the '-i' option, mce_cmd can be used interactively.  A session command history (similar to the one in bash) can be accessed with the up and down arrow keys, and line editing is possible using emacs-based key-mappings.&lt;br /&gt;
 mce_cmd -i&lt;br /&gt;
&lt;br /&gt;
After displaying a version message, mce_cmd will be ready to accept input.  There is no user prompt.&lt;br /&gt;
&lt;br /&gt;
== Single command execution ==&lt;br /&gt;
&lt;br /&gt;
A single command can be issued using the '-x' option:&lt;br /&gt;
 mce_cmd -x rb cc fw_rev&lt;br /&gt;
The application will execute the command, display any output, and exit.  Currently, only single commands can be executed from the command line.&lt;br /&gt;
&lt;br /&gt;
== Script execution ==&lt;br /&gt;
&lt;br /&gt;
The '-f' option tell mce_cmd to read lines from the specified file and attempt to execute them.  The '-q' option suppresses unnecessary output.&lt;br /&gt;
 mce_cmd -q -f my_script.scr&lt;br /&gt;
&lt;br /&gt;
When redirecting commands to mce_cmd, the '-r' option should be used to disable the command history/line editing features of mce_cmd and decrease the execution time.&lt;br /&gt;
 cat my_script.scr | mce_cmd -q -r&lt;br /&gt;
&lt;br /&gt;
If a script command fails, mce_cmd will exit.  To suppress that behaviour (and continue attempting commands even after one of them has failed), pass the '-i' option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Commands =&lt;br /&gt;
&lt;br /&gt;
We can break the mce_cmd command set into three broad categories: MCE commands, data acquisition commands, and output formatting commands.&lt;br /&gt;
&lt;br /&gt;
== MCE data block commands ==&lt;br /&gt;
&lt;br /&gt;
MCE configuration data is stored in blocks at certain card and parameter addresses (which we will call &amp;quot;block locations&amp;quot;).  A typical block address is&lt;br /&gt;
 rc2 flx_quanta4&lt;br /&gt;
This block consists of 41 32-bit words where the user writes the squid-1 flux quantum size for column 4 on readout card 2.&lt;br /&gt;
&lt;br /&gt;
The most basic data manipulation commands are RB (&amp;quot;read block&amp;quot;) and WB&lt;br /&gt;
(&amp;quot;write block&amp;quot;).  These commands read from or write to the entire range of&lt;br /&gt;
data at the block location, starting at the beginning of the block.&lt;br /&gt;
&lt;br /&gt;
The commands RRA (&amp;quot;read range&amp;quot;) and WRA (&amp;quot;write range&amp;quot;) can be used to&lt;br /&gt;
read or write particular subranges of the data in a block location.&lt;br /&gt;
&lt;br /&gt;
All read and write commands take a card (or [[ Virtual cards | virtual card ]]) name and a&lt;br /&gt;
parameter name as the first two arguments.  &lt;br /&gt;
&lt;br /&gt;
=== RB: read block ===&lt;br /&gt;
&lt;br /&gt;
The read block command returns the entire contents of a block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   1 : ok : 10 11 9 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WB: write block ===&lt;br /&gt;
&lt;br /&gt;
The write block command writes the given data to the specified block location.  If the number of data is smaller than block size, the remaining block elements will not be altered.  If the number of data is larger than the block size, the behaviour depends on the implementation of the block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wb rc1 adc_offset0 0 1 2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
=== RRA: read range ===&lt;br /&gt;
&lt;br /&gt;
The read range command returns &amp;lt;count&amp;gt; values from the block location, starting from the value at &amp;lt;start_index&amp;gt; (indexed from 0).&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; &amp;lt;count&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rra rc1 adc_offset0 2 4&lt;br /&gt;
 Line   1 : ok : 2 8 12 13&lt;br /&gt;
&lt;br /&gt;
=== WRA: write range ===&lt;br /&gt;
&lt;br /&gt;
The write range command writes the given values into the block location, starting at &amp;lt;start_index&amp;gt; (indexed from 0).  Other block data (i.e. at indices lower than start_index) are not changed.  (This command is implemented as a read-update-write and will usually take twice as long to execute as a WB command.)&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wra rc1 adc_offset0 4 100 200&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 100 200 14 15&lt;br /&gt;
&lt;br /&gt;
== MCE data acquisition commands ==&lt;br /&gt;
&lt;br /&gt;
The acquisition of frame data is achieved by first configuring an output system (by specifying an output format, filename, and the target readout cards), and then by issuing ACQ_GO commands to acquire frames.&lt;br /&gt;
&lt;br /&gt;
This simplest example will acquire 1000 frames from rc2 into the file /data/cryo/current_data/test:&lt;br /&gt;
 acq_config /data/cryo/current_data/test rc2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 acq_go 1000&lt;br /&gt;
 Line   2 : ok&lt;br /&gt;
&lt;br /&gt;
The configuration commands have mnemonics that begin with &amp;quot;ACQ_CONFIG&amp;quot;.  They allow a small variety of output formats.&lt;br /&gt;
&lt;br /&gt;
=== acq_config : configure simple MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config command configures a single output file to receive MCE frames.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config test1.dat rc2&lt;br /&gt;
&lt;br /&gt;
=== acq_config_fs : configure file-sequenced MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config_fs command will result in the outputting of the frame data into a set of files whose filename contains an increasing index.  The output file is changed after &amp;lt;change_interval&amp;gt; frames.  The output files will be called &amp;lt;filename&amp;gt;.000, &amp;lt;filename&amp;gt;.001, etc.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config_fs &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt; &amp;lt;change_interval&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== acq_path : set the default path for data output ===&lt;br /&gt;
&lt;br /&gt;
The acq_path command sets the default output directory for frame data.  This path is only appled if the filenames given in acq_config_* do not specify a relative path.  The given path can be absolute, or relative to the mce_cmd's run-time working directory.  The default output location can also be specified using the '-o' command line option.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_path &amp;lt;path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_path /data/cryo/current_data&lt;br /&gt;
 acq_config test1 rc1&lt;br /&gt;
 acq_go 10&lt;br /&gt;
&lt;br /&gt;
=== acq_go : acquire frame data ===&lt;br /&gt;
&lt;br /&gt;
The acq_go command causes the MCE to begin acquiring data.  The frame data will be stored according to the most recent acq_config* command.  It is not usually necessary to reconfigure the output system (i.e. perform another acq_config) between acq_go commands.  The exception to this is that if the frame structure changes (i.e. &amp;quot;cc num_rows_reported&amp;quot; is altered), then acq_config should be issued again so that the acquisition system can determine the frame size. &lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_go &amp;lt;frame_count&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config tes_bias_ramp rc1&lt;br /&gt;
 wb tes bias 5 5 5&lt;br /&gt;
 acq_go 1&lt;br /&gt;
 wb tes bias 10 10 10&lt;br /&gt;
 acq_go 1&lt;br /&gt;
&lt;br /&gt;
= Output formatting =&lt;br /&gt;
&lt;br /&gt;
The output consists of two or three parts, separated by colons.  If in line prefix mode (which is the default) the output is:&lt;br /&gt;
 Line &amp;lt;line number&amp;gt;: &amp;lt;success&amp;gt; [: data ... ]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;success&amp;gt; indicator will be &amp;quot;ok&amp;quot; if the command succeeded, or &amp;quot;error&amp;quot; otherwise.  Successful commands may return data (for example, an RB command).  Failed commands will always return an error message as the data.&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked with prefixes turned off ('-p'), the output format is&lt;br /&gt;
 &amp;lt;success&amp;gt; [: data]&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked in quiet mode ('q'), then all command responses that have no output data are suppressed.  In quiet mode, &amp;quot;Line 12: ok&amp;quot; will not be displayed.&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1604</id>
		<title>Mce cmd</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1604"/>
		<updated>2008-03-06T09:12:20Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* Output formatting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
mce_cmd provides an interface between a Linux shell and the MCE.  The application can run interactively (accepting commands from a user and issuing responses to stdout), or can be used to execute scripts containing mce_cmd instructions.&lt;br /&gt;
&lt;br /&gt;
= Running mce_cmd =&lt;br /&gt;
&lt;br /&gt;
== Interactive mode ==&lt;br /&gt;
&lt;br /&gt;
When invoked with the '-i' option, mce_cmd can be used interactively.  A session command history (similar to the one in bash) can be accessed with the up and down arrow keys, and line editing is possible using emacs-based key-mappings.&lt;br /&gt;
 mce_cmd -i&lt;br /&gt;
&lt;br /&gt;
After displaying a version message, mce_cmd will be ready to accept input.  There is no user prompt.&lt;br /&gt;
&lt;br /&gt;
== Single command execution ==&lt;br /&gt;
&lt;br /&gt;
A single command can be issued using the '-x' option:&lt;br /&gt;
 mce_cmd -x rb cc fw_rev&lt;br /&gt;
The application will execute the command, display any output, and exit.  Currently, only single commands can be executed from the command line.&lt;br /&gt;
&lt;br /&gt;
== Script execution ==&lt;br /&gt;
&lt;br /&gt;
The '-f' option tell mce_cmd to read lines from the specified file and attempt to execute them.  The '-q' option suppresses unnecessary output.&lt;br /&gt;
 mce_cmd -q -f my_script.scr&lt;br /&gt;
&lt;br /&gt;
When redirecting commands to mce_cmd, the '-r' option should be used to disable the command history/line editing features of mce_cmd and decrease the execution time.&lt;br /&gt;
 cat my_script.scr | mce_cmd -q -r&lt;br /&gt;
&lt;br /&gt;
If a script command fails, mce_cmd will exit.  To suppress that behaviour (and continue attempting commands even after one of them has failed), pass the '-i' option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Commands =&lt;br /&gt;
&lt;br /&gt;
We can break the mce_cmd command set into three broad categories: MCE commands, data acquisition commands, and output formatting commands.&lt;br /&gt;
&lt;br /&gt;
== MCE data block commands ==&lt;br /&gt;
&lt;br /&gt;
MCE configuration data is stored in blocks at certain card and parameter addresses (which we will call &amp;quot;block locations&amp;quot;).  A typical block address is&lt;br /&gt;
 rc2 flx_quanta4&lt;br /&gt;
This block consists of 41 32-bit words where the user writes the squid-1 flux quantum size for column 4 on readout card 2.&lt;br /&gt;
&lt;br /&gt;
The most basic data manipulation commands are RB (&amp;quot;read block&amp;quot;) and WB&lt;br /&gt;
(&amp;quot;write block&amp;quot;).  These commands read from or write to the entire range of&lt;br /&gt;
data at the block location, starting at the beginning of the block.&lt;br /&gt;
&lt;br /&gt;
The commands RRA (&amp;quot;read range&amp;quot;) and WRA (&amp;quot;write range&amp;quot;) can be used to&lt;br /&gt;
read or write particular subranges of the data in a block location.&lt;br /&gt;
&lt;br /&gt;
All read and write commands take a card (or [[ Virtual cards | virtual card ]]) name and a&lt;br /&gt;
parameter name as the first two arguments.  &lt;br /&gt;
&lt;br /&gt;
=== RB: read block ===&lt;br /&gt;
&lt;br /&gt;
The read block command returns the entire contents of a block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   1 : ok : 10 11 9 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WB: write block ===&lt;br /&gt;
&lt;br /&gt;
The write block command writes the given data to the specified block location.  If the number of data is smaller than block size, the remaining block elements will not be altered.  If the number of data is larger than the block size, the behaviour depends on the implementation of the block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wb rc1 adc_offset0 0 1 2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
=== RRA: read range ===&lt;br /&gt;
&lt;br /&gt;
The read range command returns &amp;lt;count&amp;gt; values from the block location, starting from the value at &amp;lt;start_index&amp;gt; (indexed from 0).&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; &amp;lt;count&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rra rc1 adc_offset0 2 4&lt;br /&gt;
 Line   1 : ok : 2 8 12 13&lt;br /&gt;
&lt;br /&gt;
=== WRA: write range ===&lt;br /&gt;
&lt;br /&gt;
The write range command writes the given values into the block location, starting at &amp;lt;start_index&amp;gt; (indexed from 0).  Other block data (i.e. at indices lower than start_index) are not changed.  (This command is implemented as a read-update-write and will usually take twice as long to execute as a WB command.)&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wra rc1 adc_offset0 4 100 200&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 100 200 14 15&lt;br /&gt;
&lt;br /&gt;
== MCE data acquisition commands ==&lt;br /&gt;
&lt;br /&gt;
The acquisition of frame data is achieved by first configuring an output system (by specifying an output format, filename, and the target readout cards), and then by issuing ACQ_GO commands to acquire frames.&lt;br /&gt;
&lt;br /&gt;
This simplest example will acquire 1000 frames from rc2 into the file /data/cryo/current_data/test:&lt;br /&gt;
 acq_config /data/cryo/current_data/test rc2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 acq_go 1000&lt;br /&gt;
 Line   2 : ok&lt;br /&gt;
&lt;br /&gt;
The configuration commands have mnemonics that begin with &amp;quot;ACQ_CONFIG&amp;quot;.  They allow a small variety of output formats.&lt;br /&gt;
&lt;br /&gt;
=== acq_config : configure simple MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config command configures a single output file to receive MCE frames.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config test1.dat rc2&lt;br /&gt;
&lt;br /&gt;
=== acq_config_fs : configure file-sequenced MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config_fs command will result in the outputting of the frame data into a set of files whose filename contains an increasing index.  The output file is changed after &amp;lt;change_interval&amp;gt; frames.  The output files will be called &amp;lt;filename&amp;gt;.000, &amp;lt;filename&amp;gt;.001, etc.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config_fs &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt; &amp;lt;change_interval&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== acq_path : set the default path for data output ===&lt;br /&gt;
&lt;br /&gt;
The acq_path command sets the default output directory for frame data.  This path is only appled if the filenames given in acq_config_* do not specify a relative path.  The given path can be absolute, or relative to the mce_cmd's run-time working directory.  The default output location can also be specified using the '-o' command line option.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_path &amp;lt;path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_path /data/cryo/current_data&lt;br /&gt;
 acq_config test1 rc1&lt;br /&gt;
 acq_go 10&lt;br /&gt;
&lt;br /&gt;
=== acq_go : acquire frame data ===&lt;br /&gt;
&lt;br /&gt;
The acq_go command causes the MCE to begin acquiring data.  The frame data will be stored according to the most recent acq_config* command.  It is not usually necessary to reconfigure the output system (i.e. perform another acq_config) between acq_go commands.  The exception to this is that if the frame structure changes (i.e. &amp;quot;cc num_rows_reported&amp;quot; is altered), then acq_config should be issued again so that the acquisition system can determine the frame size. &lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_go &amp;lt;frame_count&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config tes_bias_ramp rc1&lt;br /&gt;
 wb tes bias 5 5 5&lt;br /&gt;
 acq_go 1&lt;br /&gt;
 wb tes bias 10 10 10&lt;br /&gt;
 acq_go 1&lt;br /&gt;
&lt;br /&gt;
= Output formatting =&lt;br /&gt;
&lt;br /&gt;
The output consists of two or three parts, separated by colons.  If in line prefix mode (which is the default) the output is:&lt;br /&gt;
 Line &amp;lt;line number&amp;gt;: &amp;lt;success&amp;gt; [: data ... ]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;success&amp;gt; indicator will be &amp;quot;ok&amp;quot; if the command succeeded, or &amp;quot;error&amp;quot; otherwise.  Successful commands may return data (for example, an RB command).  Failed commands will always return an error message as the data.&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked with prefixes turned off ('-p'), the output format is&lt;br /&gt;
 &amp;lt;success&amp;gt; [: auxiliary data]&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked in quiet mode ('q'), then all command responses that have no auxiliary data are suppressed.  In quiet mode, &amp;quot;Line 12: ok&amp;quot; will not be displayed.&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1603</id>
		<title>Mce cmd</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1603"/>
		<updated>2008-03-06T08:18:18Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* Overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
mce_cmd provides an interface between a Linux shell and the MCE.  The application can run interactively (accepting commands from a user and issuing responses to stdout), or can be used to execute scripts containing mce_cmd instructions.&lt;br /&gt;
&lt;br /&gt;
= Running mce_cmd =&lt;br /&gt;
&lt;br /&gt;
== Interactive mode ==&lt;br /&gt;
&lt;br /&gt;
When invoked with the '-i' option, mce_cmd can be used interactively.  A session command history (similar to the one in bash) can be accessed with the up and down arrow keys, and line editing is possible using emacs-based key-mappings.&lt;br /&gt;
 mce_cmd -i&lt;br /&gt;
&lt;br /&gt;
After displaying a version message, mce_cmd will be ready to accept input.  There is no user prompt.&lt;br /&gt;
&lt;br /&gt;
== Single command execution ==&lt;br /&gt;
&lt;br /&gt;
A single command can be issued using the '-x' option:&lt;br /&gt;
 mce_cmd -x rb cc fw_rev&lt;br /&gt;
The application will execute the command, display any output, and exit.  Currently, only single commands can be executed from the command line.&lt;br /&gt;
&lt;br /&gt;
== Script execution ==&lt;br /&gt;
&lt;br /&gt;
The '-f' option tell mce_cmd to read lines from the specified file and attempt to execute them.  The '-q' option suppresses unnecessary output.&lt;br /&gt;
 mce_cmd -q -f my_script.scr&lt;br /&gt;
&lt;br /&gt;
When redirecting commands to mce_cmd, the '-r' option should be used to disable the command history/line editing features of mce_cmd and decrease the execution time.&lt;br /&gt;
 cat my_script.scr | mce_cmd -q -r&lt;br /&gt;
&lt;br /&gt;
If a script command fails, mce_cmd will exit.  To suppress that behaviour (and continue attempting commands even after one of them has failed), pass the '-i' option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Commands =&lt;br /&gt;
&lt;br /&gt;
We can break the mce_cmd command set into three broad categories: MCE commands, data acquisition commands, and output formatting commands.&lt;br /&gt;
&lt;br /&gt;
== MCE data block commands ==&lt;br /&gt;
&lt;br /&gt;
MCE configuration data is stored in blocks at certain card and parameter addresses (which we will call &amp;quot;block locations&amp;quot;).  A typical block address is&lt;br /&gt;
 rc2 flx_quanta4&lt;br /&gt;
This block consists of 41 32-bit words where the user writes the squid-1 flux quantum size for column 4 on readout card 2.&lt;br /&gt;
&lt;br /&gt;
The most basic data manipulation commands are RB (&amp;quot;read block&amp;quot;) and WB&lt;br /&gt;
(&amp;quot;write block&amp;quot;).  These commands read from or write to the entire range of&lt;br /&gt;
data at the block location, starting at the beginning of the block.&lt;br /&gt;
&lt;br /&gt;
The commands RRA (&amp;quot;read range&amp;quot;) and WRA (&amp;quot;write range&amp;quot;) can be used to&lt;br /&gt;
read or write particular subranges of the data in a block location.&lt;br /&gt;
&lt;br /&gt;
All read and write commands take a card (or [[ Virtual cards | virtual card ]]) name and a&lt;br /&gt;
parameter name as the first two arguments.  &lt;br /&gt;
&lt;br /&gt;
=== RB: read block ===&lt;br /&gt;
&lt;br /&gt;
The read block command returns the entire contents of a block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   1 : ok : 10 11 9 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WB: write block ===&lt;br /&gt;
&lt;br /&gt;
The write block command writes the given data to the specified block location.  If the number of data is smaller than block size, the remaining block elements will not be altered.  If the number of data is larger than the block size, the behaviour depends on the implementation of the block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wb rc1 adc_offset0 0 1 2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
=== RRA: read range ===&lt;br /&gt;
&lt;br /&gt;
The read range command returns &amp;lt;count&amp;gt; values from the block location, starting from the value at &amp;lt;start_index&amp;gt; (indexed from 0).&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; &amp;lt;count&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rra rc1 adc_offset0 2 4&lt;br /&gt;
 Line   1 : ok : 2 8 12 13&lt;br /&gt;
&lt;br /&gt;
=== WRA: write range ===&lt;br /&gt;
&lt;br /&gt;
The write range command writes the given values into the block location, starting at &amp;lt;start_index&amp;gt; (indexed from 0).  Other block data (i.e. at indices lower than start_index) are not changed.  (This command is implemented as a read-update-write and will usually take twice as long to execute as a WB command.)&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wra rc1 adc_offset0 4 100 200&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 100 200 14 15&lt;br /&gt;
&lt;br /&gt;
== MCE data acquisition commands ==&lt;br /&gt;
&lt;br /&gt;
The acquisition of frame data is achieved by first configuring an output system (by specifying an output format, filename, and the target readout cards), and then by issuing ACQ_GO commands to acquire frames.&lt;br /&gt;
&lt;br /&gt;
This simplest example will acquire 1000 frames from rc2 into the file /data/cryo/current_data/test:&lt;br /&gt;
 acq_config /data/cryo/current_data/test rc2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 acq_go 1000&lt;br /&gt;
 Line   2 : ok&lt;br /&gt;
&lt;br /&gt;
The configuration commands have mnemonics that begin with &amp;quot;ACQ_CONFIG&amp;quot;.  They allow a small variety of output formats.&lt;br /&gt;
&lt;br /&gt;
=== acq_config : configure simple MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config command configures a single output file to receive MCE frames.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config test1.dat rc2&lt;br /&gt;
&lt;br /&gt;
=== acq_config_fs : configure file-sequenced MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config_fs command will result in the outputting of the frame data into a set of files whose filename contains an increasing index.  The output file is changed after &amp;lt;change_interval&amp;gt; frames.  The output files will be called &amp;lt;filename&amp;gt;.000, &amp;lt;filename&amp;gt;.001, etc.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config_fs &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt; &amp;lt;change_interval&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== acq_path : set the default path for data output ===&lt;br /&gt;
&lt;br /&gt;
The acq_path command sets the default output directory for frame data.  This path is only appled if the filenames given in acq_config_* do not specify a relative path.  The given path can be absolute, or relative to the mce_cmd's run-time working directory.  The default output location can also be specified using the '-o' command line option.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_path &amp;lt;path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_path /data/cryo/current_data&lt;br /&gt;
 acq_config test1 rc1&lt;br /&gt;
 acq_go 10&lt;br /&gt;
&lt;br /&gt;
=== acq_go : acquire frame data ===&lt;br /&gt;
&lt;br /&gt;
The acq_go command causes the MCE to begin acquiring data.  The frame data will be stored according to the most recent acq_config* command.  It is not usually necessary to reconfigure the output system (i.e. perform another acq_config) between acq_go commands.  The exception to this is that if the frame structure changes (i.e. &amp;quot;cc num_rows_reported&amp;quot; is altered), then acq_config should be issued again so that the acquisition system can determine the frame size. &lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_go &amp;lt;frame_count&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config tes_bias_ramp rc1&lt;br /&gt;
 wb tes bias 5 5 5&lt;br /&gt;
 acq_go 1&lt;br /&gt;
 wb tes bias 10 10 10&lt;br /&gt;
 acq_go 1&lt;br /&gt;
&lt;br /&gt;
= Output formatting =&lt;br /&gt;
&lt;br /&gt;
The output consists of two or three parts, separated by colons.  If in line prefix mode (which is the default) the output is:&lt;br /&gt;
 Line &amp;lt;line number&amp;gt;: &amp;lt;success&amp;gt; [: auxiliary data]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;success&amp;gt; indicator will be &amp;quot;ok&amp;quot; if the command succeeded, or &amp;quot;error&amp;quot; otherwise.  Successful commands may return data (for example, an RB command).  Failed commands will always return an error message as the auxiliary data.&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked with prefixes turned off ('-p'), the output format is&lt;br /&gt;
 &amp;lt;success&amp;gt; [: auxiliary data]&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked in quiet mode ('q'), then all command responses that have no auxiliary data are suppressed.  In quiet mode, &amp;quot;Line 12: ok&amp;quot; will not be displayed.&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1602</id>
		<title>Mce cmd</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1602"/>
		<updated>2008-03-06T08:16:02Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* MCE data block commands */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
mce_cmd provides an interface between a linux shell and the MCE.  The application can run interactively (accepting commands from a user and issuing responses to standard out), or can be used to execute scripts containing mce_cmd instructions.&lt;br /&gt;
&lt;br /&gt;
= Running mce_cmd =&lt;br /&gt;
&lt;br /&gt;
== Interactive mode ==&lt;br /&gt;
&lt;br /&gt;
When invoked with the '-i' option, mce_cmd can be used interactively.  A session command history (similar to the one in bash) can be accessed with the up and down arrow keys, and line editing is possible using emacs-based key-mappings.&lt;br /&gt;
 mce_cmd -i&lt;br /&gt;
&lt;br /&gt;
After displaying a version message, mce_cmd will be ready to accept input.  There is no user prompt.&lt;br /&gt;
&lt;br /&gt;
== Single command execution ==&lt;br /&gt;
&lt;br /&gt;
A single command can be issued using the '-x' option:&lt;br /&gt;
 mce_cmd -x rb cc fw_rev&lt;br /&gt;
The application will execute the command, display any output, and exit.  Currently, only single commands can be executed from the command line.&lt;br /&gt;
&lt;br /&gt;
== Script execution ==&lt;br /&gt;
&lt;br /&gt;
The '-f' option tell mce_cmd to read lines from the specified file and attempt to execute them.  The '-q' option suppresses unnecessary output.&lt;br /&gt;
 mce_cmd -q -f my_script.scr&lt;br /&gt;
&lt;br /&gt;
When redirecting commands to mce_cmd, the '-r' option should be used to disable the command history/line editing features of mce_cmd and decrease the execution time.&lt;br /&gt;
 cat my_script.scr | mce_cmd -q -r&lt;br /&gt;
&lt;br /&gt;
If a script command fails, mce_cmd will exit.  To suppress that behaviour (and continue attempting commands even after one of them has failed), pass the '-i' option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Commands =&lt;br /&gt;
&lt;br /&gt;
We can break the mce_cmd command set into three broad categories: MCE commands, data acquisition commands, and output formatting commands.&lt;br /&gt;
&lt;br /&gt;
== MCE data block commands ==&lt;br /&gt;
&lt;br /&gt;
MCE configuration data is stored in blocks at certain card and parameter addresses (which we will call &amp;quot;block locations&amp;quot;).  A typical block address is&lt;br /&gt;
 rc2 flx_quanta4&lt;br /&gt;
This block consists of 41 32-bit words where the user writes the squid-1 flux quantum size for column 4 on readout card 2.&lt;br /&gt;
&lt;br /&gt;
The most basic data manipulation commands are RB (&amp;quot;read block&amp;quot;) and WB&lt;br /&gt;
(&amp;quot;write block&amp;quot;).  These commands read from or write to the entire range of&lt;br /&gt;
data at the block location, starting at the beginning of the block.&lt;br /&gt;
&lt;br /&gt;
The commands RRA (&amp;quot;read range&amp;quot;) and WRA (&amp;quot;write range&amp;quot;) can be used to&lt;br /&gt;
read or write particular subranges of the data in a block location.&lt;br /&gt;
&lt;br /&gt;
All read and write commands take a card (or [[ Virtual cards | virtual card ]]) name and a&lt;br /&gt;
parameter name as the first two arguments.  &lt;br /&gt;
&lt;br /&gt;
=== RB: read block ===&lt;br /&gt;
&lt;br /&gt;
The read block command returns the entire contents of a block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   1 : ok : 10 11 9 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WB: write block ===&lt;br /&gt;
&lt;br /&gt;
The write block command writes the given data to the specified block location.  If the number of data is smaller than block size, the remaining block elements will not be altered.  If the number of data is larger than the block size, the behaviour depends on the implementation of the block location.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wb rc1 adc_offset0 0 1 2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
=== RRA: read range ===&lt;br /&gt;
&lt;br /&gt;
The read range command returns &amp;lt;count&amp;gt; values from the block location, starting from the value at &amp;lt;start_index&amp;gt; (indexed from 0).&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; &amp;lt;count&amp;gt;&lt;br /&gt;
Example:&lt;br /&gt;
 rra rc1 adc_offset0 2 4&lt;br /&gt;
 Line   1 : ok : 2 8 12 13&lt;br /&gt;
&lt;br /&gt;
=== WRA: write range ===&lt;br /&gt;
&lt;br /&gt;
The write range command writes the given values into the block location, starting at &amp;lt;start_index&amp;gt; (indexed from 0).  Other block data (i.e. at indices lower than start_index) are not changed.  (This command is implemented as a read-update-write and will usually take twice as long to execute as a WB command.)&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
Example:&lt;br /&gt;
 wra rc1 adc_offset0 4 100 200&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 100 200 14 15&lt;br /&gt;
&lt;br /&gt;
== MCE data acquisition commands ==&lt;br /&gt;
&lt;br /&gt;
The acquisition of frame data is achieved by first configuring an output system (by specifying an output format, filename, and the target readout cards), and then by issuing ACQ_GO commands to acquire frames.&lt;br /&gt;
&lt;br /&gt;
This simplest example will acquire 1000 frames from rc2 into the file /data/cryo/current_data/test:&lt;br /&gt;
 acq_config /data/cryo/current_data/test rc2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 acq_go 1000&lt;br /&gt;
 Line   2 : ok&lt;br /&gt;
&lt;br /&gt;
The configuration commands have mnemonics that begin with &amp;quot;ACQ_CONFIG&amp;quot;.  They allow a small variety of output formats.&lt;br /&gt;
&lt;br /&gt;
=== acq_config : configure simple MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config command configures a single output file to receive MCE frames.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config test1.dat rc2&lt;br /&gt;
&lt;br /&gt;
=== acq_config_fs : configure file-sequenced MCE frame file ===&lt;br /&gt;
&lt;br /&gt;
The acq_config_fs command will result in the outputting of the frame data into a set of files whose filename contains an increasing index.  The output file is changed after &amp;lt;change_interval&amp;gt; frames.  The output files will be called &amp;lt;filename&amp;gt;.000, &amp;lt;filename&amp;gt;.001, etc.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_config_fs &amp;lt;filename&amp;gt; &amp;lt;readout_card&amp;gt; &amp;lt;change_interval&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== acq_path : set the default path for data output ===&lt;br /&gt;
&lt;br /&gt;
The acq_path command sets the default output directory for frame data.  This path is only appled if the filenames given in acq_config_* do not specify a relative path.  The given path can be absolute, or relative to the mce_cmd's run-time working directory.  The default output location can also be specified using the '-o' command line option.&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_path &amp;lt;path&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_path /data/cryo/current_data&lt;br /&gt;
 acq_config test1 rc1&lt;br /&gt;
 acq_go 10&lt;br /&gt;
&lt;br /&gt;
=== acq_go : acquire frame data ===&lt;br /&gt;
&lt;br /&gt;
The acq_go command causes the MCE to begin acquiring data.  The frame data will be stored according to the most recent acq_config* command.  It is not usually necessary to reconfigure the output system (i.e. perform another acq_config) between acq_go commands.  The exception to this is that if the frame structure changes (i.e. &amp;quot;cc num_rows_reported&amp;quot; is altered), then acq_config should be issued again so that the acquisition system can determine the frame size. &lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 acq_go &amp;lt;frame_count&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 acq_config tes_bias_ramp rc1&lt;br /&gt;
 wb tes bias 5 5 5&lt;br /&gt;
 acq_go 1&lt;br /&gt;
 wb tes bias 10 10 10&lt;br /&gt;
 acq_go 1&lt;br /&gt;
&lt;br /&gt;
= Output formatting =&lt;br /&gt;
&lt;br /&gt;
The output consists of two or three parts, separated by colons.  If in line prefix mode (which is the default) the output is:&lt;br /&gt;
 Line &amp;lt;line number&amp;gt;: &amp;lt;success&amp;gt; [: auxiliary data]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;success&amp;gt; indicator will be &amp;quot;ok&amp;quot; if the command succeeded, or &amp;quot;error&amp;quot; otherwise.  Successful commands may return data (for example, an RB command).  Failed commands will always return an error message as the auxiliary data.&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked with prefixes turned off ('-p'), the output format is&lt;br /&gt;
 &amp;lt;success&amp;gt; [: auxiliary data]&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked in quiet mode ('q'), then all command responses that have no auxiliary data are suppressed.  In quiet mode, &amp;quot;Line 12: ok&amp;quot; will not be displayed.&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1601</id>
		<title>Mce cmd</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1601"/>
		<updated>2008-03-06T07:51:50Z</updated>

		<summary type="html">&lt;p&gt;Sysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Overview =&lt;br /&gt;
&lt;br /&gt;
mce_cmd provides an interface between a linux shell and the MCE.  The application can run interactively (accepting commands from a user and issuing responses to standard out), or can be used to execute scripts containing mce_cmd instructions.&lt;br /&gt;
&lt;br /&gt;
= Running mce_cmd =&lt;br /&gt;
&lt;br /&gt;
== Interactive mode ==&lt;br /&gt;
&lt;br /&gt;
When invoked with the '-i' option, mce_cmd can be used interactively.  A session command history (similar to the one in bash) can be accessed with the up and down arrow keys, and line editing is possible using emacs-based key-mappings.&lt;br /&gt;
 mce_cmd -i&lt;br /&gt;
&lt;br /&gt;
After displaying a version message, mce_cmd will be ready to accept input.  There is no user prompt.&lt;br /&gt;
&lt;br /&gt;
== Single command execution ==&lt;br /&gt;
&lt;br /&gt;
A single command can be issued using the '-x' option:&lt;br /&gt;
 mce_cmd -x rb cc fw_rev&lt;br /&gt;
The application will execute the command, display any output, and exit.  Currently, only single commands can be executed from the command line.&lt;br /&gt;
&lt;br /&gt;
== Script execution ==&lt;br /&gt;
&lt;br /&gt;
The '-f' option tell mce_cmd to read lines from the specified file and attempt to execute them.  The '-q' option suppresses unnecessary output.&lt;br /&gt;
 mce_cmd -q -f my_script.scr&lt;br /&gt;
&lt;br /&gt;
When redirecting commands to mce_cmd, the '-r' option should be used to disable the command history/line editing features of mce_cmd and decrease the execution time.&lt;br /&gt;
 cat my_script.scr | mce_cmd -q -r&lt;br /&gt;
&lt;br /&gt;
If a script command fails, mce_cmd will exit.  To suppress that behaviour (and continue attempting commands even after one of them has failed), pass the '-i' option.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Commands =&lt;br /&gt;
&lt;br /&gt;
We can break the mce_cmd command set into three broad categories: MCE commands, data acquisition commands, and output formatting commands.&lt;br /&gt;
&lt;br /&gt;
== MCE data block commands ==&lt;br /&gt;
&lt;br /&gt;
MCE configuration data is stored in blocks at certain card and parameter addresses (which we will call &amp;quot;block locations&amp;quot;).  A typical block address is&lt;br /&gt;
 rc2 flx_quanta4&lt;br /&gt;
This block consists of 41 32-bit words where the user writes the squid-1 flux quantum size for column 4 on readout card 2.&lt;br /&gt;
&lt;br /&gt;
The most basic data manipulation commands are RB (&amp;quot;read block&amp;quot;) and WB&lt;br /&gt;
(&amp;quot;write block&amp;quot;).  These commands read from or write to the entire range of&lt;br /&gt;
data at the block location, starting at the beginning of the block.&lt;br /&gt;
&lt;br /&gt;
The commands RRA (&amp;quot;read range&amp;quot;) and WRA (&amp;quot;write range&amp;quot;) can be used to&lt;br /&gt;
read or write particular subranges of the data in a block location.&lt;br /&gt;
&lt;br /&gt;
All read and write commands take a card (or [[ Virtual cards | virtual card ]]) name and a&lt;br /&gt;
parameter name as the first two arguments.  &lt;br /&gt;
&lt;br /&gt;
=== RB: read block ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The read block command returns the entire contents of a block location.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   1 : ok : 10 11 9 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== WB: write block ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
&lt;br /&gt;
The write block command writes the given data to the specified block location.  If the number of data is smaller than block size, the remaining block elements will not be altered.  If the number of data is larger than the block size, the behaviour depends on the implementation of the block location.&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 wb rc1 adc_offset0 0 1 2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
=== RRA: read range ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 rra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; &amp;lt;count&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The read range command returns &amp;lt;count&amp;gt; values from the block location, starting from the value at &amp;lt;start_index&amp;gt; (indexed from 0).&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 rra rc1 adc_offset0 2 4&lt;br /&gt;
 Line   1 : ok : 2 8 12 13&lt;br /&gt;
&lt;br /&gt;
=== WRA: write range ===&lt;br /&gt;
&lt;br /&gt;
Syntax:&lt;br /&gt;
 wra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;start_index&amp;gt; [val0 val1 val2 ...]&lt;br /&gt;
&lt;br /&gt;
The write range command writes the given values into the block location, starting at &amp;lt;start_index&amp;gt; (indexed from 0).  Other block data (i.e. at indices lower than start_index) are not changed.  (This command is implemented as a read-update-write and will usually take twice as long to execute as a WB command.)&lt;br /&gt;
&lt;br /&gt;
Example:&lt;br /&gt;
 wra rc1 adc_offset0 4 100 200&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 100 200 14 15&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Output formatting =&lt;br /&gt;
&lt;br /&gt;
The output consists of two or three parts, separated by colons.  If in line prefix mode (which is the default) the output is:&lt;br /&gt;
 Line &amp;lt;line number&amp;gt;: &amp;lt;success&amp;gt; [: auxiliary data]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;success&amp;gt; indicator will be &amp;quot;ok&amp;quot; if the command succeeded, or &amp;quot;error&amp;quot; otherwise.  Successful commands may return data (for example, an RB command).  Failed commands will always return an error message as the auxiliary data.&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked with prefixes turned off ('-p'), the output format is&lt;br /&gt;
 &amp;lt;success&amp;gt; [: auxiliary data]&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked in quiet mode ('q'), then all command responses that have no auxiliary data are suppressed.  In quiet mode, &amp;quot;Line 12: ok&amp;quot; will not be displayed.&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1600</id>
		<title>MAS</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1600"/>
		<updated>2008-03-06T07:18:54Z</updated>

		<summary type="html">&lt;p&gt;Sysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Usage ==&lt;br /&gt;
&lt;br /&gt;
* System applications&lt;br /&gt;
** [[mce_cmd]]&lt;br /&gt;
** [[mce_status]]&lt;br /&gt;
** [[maslog]]&lt;br /&gt;
** [[dsp_cmd]]&lt;br /&gt;
** [[ MAS Command line how-to ]]&lt;br /&gt;
&lt;br /&gt;
* Utilities&lt;br /&gt;
&lt;br /&gt;
* MAS configuration&lt;br /&gt;
** [[ MAS start/stop ]]&lt;br /&gt;
** [[ mce.cfg ]]&lt;br /&gt;
** [[ mas.cfg ]]&lt;br /&gt;
&lt;br /&gt;
* MAS file formats&lt;br /&gt;
** [[ Runfile format v2 ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Development ==&lt;br /&gt;
&lt;br /&gt;
* [[ MAS Bug List ]]&lt;br /&gt;
* [[ MAS to-do ]]&lt;br /&gt;
* [[ MAS feature requests ]]&lt;br /&gt;
&lt;br /&gt;
== Installation / configuration ==&lt;br /&gt;
&lt;br /&gt;
* [[ MAS PC requirements and initial setup | PC requirements and initial setup]]&lt;br /&gt;
* [[ MAS OS setup | OS setup]]&lt;br /&gt;
* [[ MAS kernel patch compilation | kernel patch compilation]]&lt;br /&gt;
* [[ MAS svn repository | SVN repository]]&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1599</id>
		<title>Mce cmd</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Mce_cmd&amp;diff=1599"/>
		<updated>2008-03-06T07:11:29Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* Output formatting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Read and write commands =&lt;br /&gt;
&lt;br /&gt;
MCE configuration data is stored in blocks at certain card and&lt;br /&gt;
parameter addresses (which we will call &amp;quot;block locations&amp;quot;.  The data&lt;br /&gt;
block consists of one or more 32-bit words.&lt;br /&gt;
&lt;br /&gt;
The most basic data manipulation commands are RB (&amp;quot;read block&amp;quot;) and WB&lt;br /&gt;
(&amp;quot;write block&amp;quot;).  These commands read and write to the entire range of&lt;br /&gt;
data at the block location, starting at the beginning of the block.&lt;br /&gt;
&lt;br /&gt;
The commands RRA (&amp;quot;read range&amp;quot;) and WRA (&amp;quot;write range&amp;quot;) can be used to&lt;br /&gt;
read or write particular subranges of the data in a block location.&lt;br /&gt;
&lt;br /&gt;
All read and write commands take a card (or virtual card) name and a&lt;br /&gt;
parameter name as the first two arguments.  Physical cards are&lt;br /&gt;
associated with particular hardware elements in the system, for&lt;br /&gt;
example &amp;quot;cc&amp;quot; (clock card) and &amp;quot;rc2&amp;quot; (readout card).  Virtual cards are&lt;br /&gt;
used to group a set of hardware functions into a single name-space.&lt;br /&gt;
The data associated with a virtual card parameter may be shared across&lt;br /&gt;
multiple hardware cards.  Parameters accessible via virtual mappings&lt;br /&gt;
are also accessible via some set of hardware card addresses.&lt;br /&gt;
&lt;br /&gt;
== Syntax summary ==&lt;br /&gt;
&lt;br /&gt;
 rb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt;&lt;br /&gt;
 rra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;starting index&amp;gt; &amp;lt;count&amp;gt;&lt;br /&gt;
 wb  &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; [data, ...]&lt;br /&gt;
 wra &amp;lt;card&amp;gt; &amp;lt;param&amp;gt; &amp;lt;starting index&amp;gt; [data, ...]&lt;br /&gt;
&lt;br /&gt;
== RB command ==&lt;br /&gt;
&lt;br /&gt;
RB will return all data associated with the block location.&lt;br /&gt;
&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   1 : ok : 10 11 9 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
== RRA command ==&lt;br /&gt;
&lt;br /&gt;
The RRA command returns only the subset of the data that were&lt;br /&gt;
asked for.&lt;br /&gt;
&lt;br /&gt;
 rra rc1 adc_offset0 2 4&lt;br /&gt;
 Line   1 : ok : 9 8 12 13&lt;br /&gt;
&lt;br /&gt;
== WB command ==&lt;br /&gt;
&lt;br /&gt;
The WB command will update words in the block location.  If the number&lt;br /&gt;
of data words given as arguments to the WB command is smaller than the&lt;br /&gt;
natural size of the block location, only those first few data&lt;br /&gt;
locations will be updated.  e.g.,&lt;br /&gt;
&lt;br /&gt;
 wb rc1 adc_offset0 0 1 2&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 12 13 14 15&lt;br /&gt;
&lt;br /&gt;
== WRA command ==&lt;br /&gt;
&lt;br /&gt;
The WRA command updates words starting at the specified index.&lt;br /&gt;
&lt;br /&gt;
 wra rc1 adc_offset0 4 100 200&lt;br /&gt;
 Line   1 : ok&lt;br /&gt;
 rb rc1 adc_offset0&lt;br /&gt;
 Line   2 : ok :  0 1 2 8 100 200 14 15&lt;br /&gt;
Please note that WRA and RRA are not more efficient than WB and RB.&lt;br /&gt;
MAS translates WRA and RRA into the equivalent set of WB and RB&lt;br /&gt;
commands, and not the other way around.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Output formatting =&lt;br /&gt;
&lt;br /&gt;
The output consists of two or three parts, separated by colons.  If in line prefix mode (which is the default) the output is:&lt;br /&gt;
 Line &amp;lt;line number&amp;gt;: &amp;lt;success&amp;gt; [: auxiliary data]&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;success&amp;gt; indicator will be &amp;quot;ok&amp;quot; if the command succeeded, or &amp;quot;error&amp;quot; otherwise.  Successful commands may return data (for example, an RB command).  Failed commands will always return an error message as the auxiliary data.&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked with prefixes turned off ('-p'), the output format is&lt;br /&gt;
 &amp;lt;success&amp;gt; [: auxiliary data]&lt;br /&gt;
&lt;br /&gt;
If mce_cmd is invoked in quiet mode ('q'), then all command responses that have no auxiliary data are suppressed.  In quiet mode, &amp;quot;Line 12: ok&amp;quot; will not be displayed.&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Virtual_card&amp;diff=1598</id>
		<title>Virtual card</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Virtual_card&amp;diff=1598"/>
		<updated>2008-03-06T05:41:49Z</updated>

		<summary type="html">&lt;p&gt;Sysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
Unlike hardware (or &amp;quot;physical&amp;quot; cards), virtual cards are associated&lt;br /&gt;
with a certain function (such as a squid amplifier stage).  A single&lt;br /&gt;
virtual card, parameter address can span multiple physical cards.&lt;br /&gt;
&lt;br /&gt;
Currently, the virtual cards implemented in mas are:&lt;br /&gt;
&lt;br /&gt;
 sq1   First stage squid control (fb_const, bias, servo_mode)&lt;br /&gt;
 sq2   Second stage squid control (fb, bias)&lt;br /&gt;
 sa    Series array control (fb, bias, offset)&lt;br /&gt;
 tes   Detector and heater control (bias)&lt;br /&gt;
&lt;br /&gt;
Virtual cards are useful for two reasons.  The first is to provide the&lt;br /&gt;
user with a more intuitive mnemonic set.  The second is to provide a&lt;br /&gt;
layer of abstraction between function and hardware; this allows higher&lt;br /&gt;
level programs and scripts to be written that are independent of the&lt;br /&gt;
hardware configuration.&lt;br /&gt;
&lt;br /&gt;
Where possible, virtual card addresses should be used instead of&lt;br /&gt;
hardware card addresses.&lt;br /&gt;
&lt;br /&gt;
Many virtual card parameters are shared across multiple hardware cards&lt;br /&gt;
(usually, these are per-column parameters shared across all the&lt;br /&gt;
readout cards).  In this case, the virtual card data is assembled from&lt;br /&gt;
each readout card, starting with rc1.  For example, compare&lt;br /&gt;
&lt;br /&gt;
 rb rc1 sa_bias&lt;br /&gt;
 Line   1 : ok : 0 1 2 3 4 5 6 7&lt;br /&gt;
 rb rc2 sa_bias&lt;br /&gt;
 Line   2 : ok : 8 9 10 11 12 13 14 15&lt;br /&gt;
 rb rc3 sa_bias&lt;br /&gt;
 Line   3 : ok : 16 17 18 19 20 21 22 23&lt;br /&gt;
 rb rc4 sa_bias&lt;br /&gt;
 Line   4 : ok : 24 25 26 27 28 29 30 31&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 rb sa bias&lt;br /&gt;
 Line   5 : ok : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Support for virtual card addresses ==&lt;br /&gt;
&lt;br /&gt;
The virtual card abstraction layer is provided by mce_library.  The virtual cards are accessible to a scripting / interactive user through mce_cmd.&lt;br /&gt;
&lt;br /&gt;
Each subrack configuration has an associated mce.cfg file (which lives in /etc/mce/) which describes the hardware cards present in the system and the mapping from virtual addresses to hardware addresses.  (This file should not require regular editing!)&lt;br /&gt;
&lt;br /&gt;
== Sub-rack version and population variation ==&lt;br /&gt;
&lt;br /&gt;
Many virtual addresses possess (on a full sub-rack) 32 values, one for each column of a&lt;br /&gt;
squid array.  In v2 systems, which have at most 2 readout cards (and thus at most 16&lt;br /&gt;
columns of squids), such parameters will only return 16 values.  However, in systems with&lt;br /&gt;
empty readout card slots, virtual addresses will read out at full width (as if the rack was&lt;br /&gt;
completely populated), but with any missing readout cards' columns padded with zeros.&lt;br /&gt;
Writes to those missing columns will be ignored and not cause failures.&lt;br /&gt;
&lt;br /&gt;
This means that, for example, the 8  values of &amp;quot;rc2 sa_bias&amp;quot; always corresponds to the second set of 8 values in &amp;quot;sa bias&amp;quot; regardless of whether the system possesses rc1.  &lt;br /&gt;
&lt;br /&gt;
== Commanding virtual cards ==&lt;br /&gt;
&lt;br /&gt;
Only read and write commands are supported on virtual cards.  The RB,&lt;br /&gt;
WB, RRA, and WRA all have the natural behaviour when operating on&lt;br /&gt;
virtual cards.  For example, the following are equivalent:&lt;br /&gt;
&lt;br /&gt;
 rra bc3 bias 10 4&lt;br /&gt;
 rra sq2 bias 10 4&lt;br /&gt;
&lt;br /&gt;
For TES bias lines, the mapping will depend on the experiment's&lt;br /&gt;
needs.  By default, the parameter &amp;quot;tes bias&amp;quot; is a 3 word block that&lt;br /&gt;
maps to &amp;quot;bc1 bias&amp;quot;, &amp;quot;bc2 bias&amp;quot;, and &amp;quot;bc3 bias&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Detail of mappings ==&lt;br /&gt;
&lt;br /&gt;
To get a list of the mappings on your system, run&lt;br /&gt;
 mce_status -g&lt;br /&gt;
(When invoked with the '-g' option, mce_status will not issue MCE commands and no MCE or SDSU PCI card need be present.)&lt;br /&gt;
&lt;br /&gt;
For a description of the output formatting, see [[ mce_status ]].&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Virtual_card&amp;diff=1597</id>
		<title>Virtual card</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=Virtual_card&amp;diff=1597"/>
		<updated>2008-03-06T05:08:13Z</updated>

		<summary type="html">&lt;p&gt;Sysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Unlike hardware (or &amp;quot;physical&amp;quot; cards), virtual cards are associated&lt;br /&gt;
with a certain function (such as a squid amplifier stage).  A single&lt;br /&gt;
virtual card, parameter address can span multiple physical cards.&lt;br /&gt;
&lt;br /&gt;
Currently, the virtual cards implemented in mas are:&lt;br /&gt;
&lt;br /&gt;
 sq1   First stage squid control (fb_const, bias, servo_mode)&lt;br /&gt;
 sq2   Second stage squid control (fb, bias)&lt;br /&gt;
 sa    Series array control (fb, bias, offset)&lt;br /&gt;
 tes   Detector and heater control (bias)&lt;br /&gt;
&lt;br /&gt;
Virtual cards are useful for two reasons.  The first is to provide the&lt;br /&gt;
user with a more intuitive mnemonic set.  The second is to provide a&lt;br /&gt;
layer of abstraction between function and hardware; this allows higher&lt;br /&gt;
level programs and scripts to be written that are independent of the&lt;br /&gt;
hardware configuration.&lt;br /&gt;
&lt;br /&gt;
Where possible, virtual card addresses should be used instead of&lt;br /&gt;
hardware card addresses.&lt;br /&gt;
&lt;br /&gt;
== Reading and writing virtual cards ==&lt;br /&gt;
&lt;br /&gt;
Only read and write commands are supported on virtual cards.  The RB,&lt;br /&gt;
WB, RRA, and WRA all have the natural behaviour when operating on&lt;br /&gt;
virtual cards.  For example, the following are equivalent:&lt;br /&gt;
&lt;br /&gt;
 rra bc3 bias 10 4&lt;br /&gt;
 rra sq2 bias 10 4&lt;br /&gt;
&lt;br /&gt;
Many virtual card parameters are shared across multiple hardware cards&lt;br /&gt;
(usually, these are per-column parameters shared across all the&lt;br /&gt;
readout cards).  In this case, the virtual card data is assembled from&lt;br /&gt;
each readout card, starting with rc1.  For example, compare&lt;br /&gt;
 sq2   Second stage squid control (fb, bias)&lt;br /&gt;
 sa    Series array control (fb, bias, offset)&lt;br /&gt;
 tes   Detector and heater control (bias)&lt;br /&gt;
&lt;br /&gt;
Virtual cards are useful for two reasons.  The first is to provide the&lt;br /&gt;
user with a more intuitive mnemonic set.  The second is to provide a&lt;br /&gt;
layer of abstraction between function and hardware; this allows higher&lt;br /&gt;
level programs and scripts to be written that are independent of the&lt;br /&gt;
hardware configuration.&lt;br /&gt;
&lt;br /&gt;
Where possible, virtual card addresses should be used instead of&lt;br /&gt;
hardware card addresses.&lt;br /&gt;
&lt;br /&gt;
== Reading and writing virtual cards ==&lt;br /&gt;
&lt;br /&gt;
Only read and write commands are supported on virtual cards.  The RB,&lt;br /&gt;
WB, RRA, and WRA all have the natural behaviour when operating on&lt;br /&gt;
virtual cards.  For example, the following are equivalent:&lt;br /&gt;
&lt;br /&gt;
 rra bc3 bias 10 4&lt;br /&gt;
 rra sq2 bias 10 4&lt;br /&gt;
&lt;br /&gt;
Many virtual card parameters are shared across multiple hardware cards&lt;br /&gt;
(usually, these are per-column parameters shared across all the&lt;br /&gt;
readout cards).  In this case, the virtual card data is assembled from&lt;br /&gt;
each readout card, starting with rc1.  For example, compare&lt;br /&gt;
&lt;br /&gt;
 rb rc1 sa_bias&lt;br /&gt;
 Line   1 : ok : 0 1 2 3 4 5 6 7&lt;br /&gt;
 rb rc2 sa_bias&lt;br /&gt;
 Line   2 : ok : 8 9 10 11 12 13 14 15&lt;br /&gt;
 rb rc3 sa_bias&lt;br /&gt;
 Line   3 : ok : 16 17 18 19 20 21 22 23&lt;br /&gt;
 rb rc4 sa_bias&lt;br /&gt;
 Line   4 : ok : 24 25 26 27 28 29 30 31&lt;br /&gt;
&lt;br /&gt;
to&lt;br /&gt;
&lt;br /&gt;
 rb sa bias&lt;br /&gt;
 Line   5 : ok : 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31&lt;br /&gt;
&lt;br /&gt;
(In v2 systems, which can only hold 2 readout cards, such parameters&lt;br /&gt;
will only return 16 values.  In systems with empty readout card slots,&lt;br /&gt;
the data in virtual card parameters will be padded to account for the&lt;br /&gt;
missing cards.)&lt;br /&gt;
&lt;br /&gt;
For TES bias lines, the mapping will depend on the experiment's&lt;br /&gt;
needs.  By default, the parameter &amp;quot;tes bias&amp;quot; is a 3 word block that&lt;br /&gt;
maps to &amp;quot;bc1 bias&amp;quot;, &amp;quot;bc2 bias&amp;quot;, and &amp;quot;bc3 bias&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Detail of mappings ==&lt;br /&gt;
&lt;br /&gt;
To get a list of the mappings on your system, run mce_status with the&lt;br /&gt;
-g option.  (This does not require an MCE to be connected, and it will&lt;br /&gt;
not issue any MCE commands.)&lt;br /&gt;
&lt;br /&gt;
The output from &amp;quot;mce_status -g&amp;quot; is interpreted as follows...&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1591</id>
		<title>MAS</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1591"/>
		<updated>2008-03-05T22:42:07Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* Installation / configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[ MAS Overview ]]&lt;br /&gt;
&lt;br /&gt;
= Development =&lt;br /&gt;
&lt;br /&gt;
* [[ MAS Bug List ]]&lt;br /&gt;
* [[ MAS to-do ]]&lt;br /&gt;
* [[ MAS feature requests ]]&lt;br /&gt;
&lt;br /&gt;
= Installation / configuration =&lt;br /&gt;
&lt;br /&gt;
* [[ MAS PC requirements and initial setup | PC requirements and initial setup]]&lt;br /&gt;
* [[ MAS OS setup | OS setup]]&lt;br /&gt;
* [[ MAS kernel patch compilation | kernel patch compilation]]&lt;br /&gt;
* [[ MAS svn repository | SVN repository]]&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
&lt;br /&gt;
* [[ MAS start/stop ]]&lt;br /&gt;
* [[ MAS Command line how-to ]]&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_OS_setup&amp;diff=1589</id>
		<title>MAS OS setup</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_OS_setup&amp;diff=1589"/>
		<updated>2008-03-05T22:40:16Z</updated>

		<summary type="html">&lt;p&gt;Sysop: MAS installation notes moved to MAS OS setup&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Install additional ubuntu packages =&lt;br /&gt;
&lt;br /&gt;
== Disable CDROM seeking ==&lt;br /&gt;
&lt;br /&gt;
The package manager knows that you have the Ubuntu disk and will say things like&lt;br /&gt;
 Media change: please insert the disc labeled&lt;br /&gt;
 'Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)'&lt;br /&gt;
&lt;br /&gt;
To disable this (and download packages from the internet instead), open /etc/apt/sources.list and remove (comment) the line &lt;br /&gt;
 deb cdrom:[Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)]/ dapper main restricted&lt;br /&gt;
&lt;br /&gt;
and then do&lt;br /&gt;
 apt-get sudo update&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Install required packages ==&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install build-essential subversion emacs21 libreadline5-dev &lt;br /&gt;
&lt;br /&gt;
== Try to install packages that don't work properly (impossible) ==&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install gnome-gv&lt;br /&gt;
&lt;br /&gt;
== Install packages that you shouldn't even want to install (optional) ==&lt;br /&gt;
 sudo apt-get install tcsh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Download and install MAS kernel patch =&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
If you're not compiling the kernel from scratch, download the binary packages from UBC:&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/kernel-headers-2.6.15.7-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/kernel-image-2.6.15.7-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 wget http://e-mode.phas.ubc.ca/~mhasse/mce/extras.patch&lt;br /&gt;
&lt;br /&gt;
== Install ==&lt;br /&gt;
&lt;br /&gt;
Then, install the packages using dpkg:&lt;br /&gt;
 sudo dpkg -i kernel-headers-2.6.15.7-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
 sudo dpkg -i kernel-image-2.6.15.7-bigphys_10.00.Custom_i386.deb&lt;br /&gt;
The &amp;quot;image&amp;quot; file might complain about symbolic links, no big deal.&lt;br /&gt;
&lt;br /&gt;
== Patch ==&lt;br /&gt;
&lt;br /&gt;
This makes it possible to compile against the kernel package as though it had been locally compiled originally.&lt;br /&gt;
 cd /usr/src/kernel-headers-2.6.15.7-bigphys/&lt;br /&gt;
 sudo patch &amp;lt; ~/extras.patch&lt;br /&gt;
&lt;br /&gt;
== Boot menu ==&lt;br /&gt;
&lt;br /&gt;
Once you install the &amp;quot;image&amp;quot;, the kernel should show up in the boot loader (grub)'s kernel list.  It's probably a good idea to test it first before setting it as the default kernel (see next step).  Also *do not issue MCE or DSP commands until the acpi=off boot parameter has been configured!*&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Configure GRUB boot menu =&lt;br /&gt;
&lt;br /&gt;
As root (or using sudo), edit the file /boot/grub/menu.lst .  Go to the list of kernels, below the line &amp;quot;## ## End Default Options ##&amp;quot;, and find the kernel block with title &amp;quot;Ubuntu, kernel 2.6.15.7-bigphys&amp;quot;.  It should be the third block in the list, i.e. index 2.&lt;br /&gt;
&lt;br /&gt;
You must change the kernel line to turn &amp;quot;acpi=off&amp;quot;.  Almost all systems crash hard if you don't do this.&lt;br /&gt;
&lt;br /&gt;
 kernel          /vmlinuz-2.6.15.7-bigphys root=/dev/sda3 ro quiet splash acpi=off bigphysarea=8192&lt;br /&gt;
&lt;br /&gt;
Go back to the top of the file and set the value of the &amp;quot;default&amp;quot; option to 2 once you're ready to boot this kernel by default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= External libraries =&lt;br /&gt;
&lt;br /&gt;
MAS uses libconfig to manage its configuration files.  The webpage is here: [ http://www.hyperrealm.com/libconfig/ ].  To install libconfig run the following:&lt;br /&gt;
&lt;br /&gt;
  wget http://www.hyperrealm.com/libconfig/libconfig-1.2.1.tar.gz&lt;br /&gt;
  tar -xzf libconfig-1.2.1.tar.gz&lt;br /&gt;
  cd libconfig-1.2.1&lt;br /&gt;
  ./configure&lt;br /&gt;
  make&lt;br /&gt;
  sudo make install&lt;br /&gt;
&lt;br /&gt;
To make the system aware of this library, add &amp;quot;/usr/local/lib&amp;quot; to /etc/ld.so.conf and run &amp;quot;sudo ldconfig&amp;quot;.  i.e.&lt;br /&gt;
  echo /usr/local/lib | sudo tee /etc/ld.so.conf&lt;br /&gt;
  sudo ldconfig&lt;br /&gt;
&lt;br /&gt;
= Branching of MAS and mce_script =&lt;br /&gt;
&lt;br /&gt;
From a complete (or somewhat complete) mas source tree (i.e. the repository root) do:&lt;br /&gt;
&lt;br /&gt;
  svn copy trunk branch/new_project&lt;br /&gt;
  svn commit branch/new_project&lt;br /&gt;
&lt;br /&gt;
Then check out the appropriate branch (or the whole tree) on the new machine.&lt;br /&gt;
&lt;br /&gt;
= Download MAS =&lt;br /&gt;
&lt;br /&gt;
See the page on [[ MAS svn repository ]]&lt;br /&gt;
&lt;br /&gt;
= Build the driver =&lt;br /&gt;
&lt;br /&gt;
There are some compilation options that must be enabled before compiling the driver.  This is achieved by putting the definitions into a file Makefile.local in the &amp;quot;driver&amp;quot; folder.&lt;br /&gt;
&lt;br /&gt;
For a normal MAS install, with bigphysarea enabled, Makefile.local should contain only the line&lt;br /&gt;
 BIGPHYS = 1    # use bigphysarea for frame buffering&lt;br /&gt;
&lt;br /&gt;
Other options one can put in Makefile.local are&lt;br /&gt;
 FAKEMCE = 1    # enable software MCE emulator in driver&lt;br /&gt;
and&lt;br /&gt;
 REALTIME = 1   # use rtai interrupt handling&lt;br /&gt;
&lt;br /&gt;
Um, you probably shouldn't use these.  Just use BIGPHYS.&lt;br /&gt;
&lt;br /&gt;
Anyway, once Makefile.local is setup, type&lt;br /&gt;
 make clean; make&lt;br /&gt;
&lt;br /&gt;
From the driver folder we can test the driver:&lt;br /&gt;
 ./reload&lt;br /&gt;
 ./mknodes&lt;br /&gt;
&lt;br /&gt;
Note that since &amp;quot;reload&amp;quot; first unloads the driver if it is present, and then loads the driver from the current folder, it may report an &amp;quot;ERROR&amp;quot; message if the first step fails, even though the driver is successfully loaded.  The definitive way to check that the driver is loaded is&lt;br /&gt;
  cat /proc/mce_dsp&lt;br /&gt;
&lt;br /&gt;
If this file does not exist, the driver isn't loaded.  If the cat prints out a bunch of low-level driver information, you're in good shape.&lt;br /&gt;
&lt;br /&gt;
If you're satisfied that the driver works, install the driver with the command&lt;br /&gt;
&lt;br /&gt;
 sudo make install&lt;br /&gt;
&lt;br /&gt;
This should put mce_dsp.ko into /lib/modules/2.6.15.7-bigphys/kernel/drivers/misc/, and re-scan the module dependencies.  To get the driver to load on boot you must add manually the following lines to /etc/rc.local:&lt;br /&gt;
&lt;br /&gt;
 modprobe mce_dsp&lt;br /&gt;
 /home/mce/mas/driver/mknodes&lt;br /&gt;
 sudo -u mce /usr/mce/bin/maslog_server&lt;br /&gt;
&lt;br /&gt;
= Install MAS (double check)= &lt;br /&gt;
 cd /home/mce/mas and type&lt;br /&gt;
 make install &lt;br /&gt;
 (would this include servo programs??)&lt;br /&gt;
&lt;br /&gt;
= Folders =&lt;br /&gt;
&lt;br /&gt;
 sudo mkdir /data&lt;br /&gt;
 sudo chown mce:mce /data&lt;br /&gt;
 sudo chmod g+ws /data&lt;br /&gt;
&lt;br /&gt;
 mkdir /home/mce/tmp&lt;br /&gt;
 chmod g+ws /home/mce/tmp&lt;br /&gt;
&lt;br /&gt;
Folder permissions are annoying.  Basically, any place you're going to be creating files has to have the g+s bit set.  svn folders are particularly bad...&lt;br /&gt;
&lt;br /&gt;
 chmod g+ws /home/mce&lt;br /&gt;
 chmod g+ws /home/mce/script&lt;br /&gt;
 chmod g+ws /home&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_installation_notes&amp;diff=1590</id>
		<title>MAS installation notes</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_installation_notes&amp;diff=1590"/>
		<updated>2008-03-05T22:40:16Z</updated>

		<summary type="html">&lt;p&gt;Sysop: MAS installation notes moved to MAS OS setup&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[MAS OS setup]]&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1588</id>
		<title>MAS</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1588"/>
		<updated>2008-03-05T22:40:02Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* Installation / configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[ MAS Overview ]]&lt;br /&gt;
&lt;br /&gt;
= Development =&lt;br /&gt;
&lt;br /&gt;
* [[ MAS Bug List ]]&lt;br /&gt;
* [[ MAS to-do ]]&lt;br /&gt;
* [[ MAS feature requests ]]&lt;br /&gt;
&lt;br /&gt;
= Installation / configuration =&lt;br /&gt;
&lt;br /&gt;
* [[ MAS PC requirements and initial setup ]]&lt;br /&gt;
* [[ MAS installation notes ]]&lt;br /&gt;
* [[ MAS OS configuration ]]&lt;br /&gt;
* [[ MAS svn repository ]]&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
&lt;br /&gt;
* [[ MAS start/stop ]]&lt;br /&gt;
* [[ MAS Command line how-to ]]&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_kernel_patch_compilation&amp;diff=1587</id>
		<title>MAS kernel patch compilation</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_kernel_patch_compilation&amp;diff=1587"/>
		<updated>2008-03-05T22:32:21Z</updated>

		<summary type="html">&lt;p&gt;Sysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This procedure is based on&lt;br /&gt;
&lt;br /&gt;
 http://www.howtoforge.com/kernel_compilation_ubuntu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Get linux sources ==&lt;br /&gt;
 &lt;br /&gt;
We use vanilla 2.6.15.7, vanilla, from kernel.org.&lt;br /&gt;
&lt;br /&gt;
== Get bigphys patch ==&lt;br /&gt;
&lt;br /&gt;
Patch is available here:&lt;br /&gt;
 http://e-mode.phas.ubc.ca/~mhasse/mce/bigphysarea-2.6.15.7.patch&lt;br /&gt;
&lt;br /&gt;
== Get kernel compilation packages ==&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install kernel-package libncurses5-dev fakeroot wget bzip2&lt;br /&gt;
 &lt;br /&gt;
== Make sure bash is your default shell ==&lt;br /&gt;
&lt;br /&gt;
 sudo rm /bin/sh&lt;br /&gt;
 sudo ln -s /bin/bash /bin/sh&lt;br /&gt;
&lt;br /&gt;
== Uncompress and patch ==&lt;br /&gt;
&lt;br /&gt;
 tar xjf linux-2.6.18.1.tar.bz2&lt;br /&gt;
 ln -s linux-2.6.18.1 linux&lt;br /&gt;
 cd /usr/src/linux&lt;br /&gt;
 &lt;br /&gt;
 bzip2 -dc /usr/src/patch-2.6.19-rc4.bz2 | patch -p1 --dry-run&lt;br /&gt;
 bzip2 -dc /usr/src/patch-2.6.19-rc4.bz2 | patch -p1 &lt;br /&gt;
 &lt;br /&gt;
== Configure and compile ==&lt;br /&gt;
&lt;br /&gt;
 cp /boot/config-`uname -r` ./.config&lt;br /&gt;
 make menuconfig&lt;br /&gt;
 &lt;br /&gt;
 make-kpkg clean&lt;br /&gt;
 sudo make-kpkg --initrd --append-to-version=-bigphys kernel_image kernel_headers&lt;br /&gt;
&lt;br /&gt;
(Can't use fakeroot in this last step, since the .deb are written to /usr/src.)&lt;br /&gt;
&lt;br /&gt;
== Binary kernel package installation ==&lt;br /&gt;
&lt;br /&gt;
See [[ MAS OS configuration ]].&lt;br /&gt;
&lt;br /&gt;
The .deb's that come out of the compilation above are incomplete, be we install them anyway.  They are missing arch/i386/Makefile.cpu, and Modules.symvers.  They might be missing other things too, but MAS really misses those ones.  These have been put into a patch; which must be applied at the end.&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_kernel_patch_compilation&amp;diff=1586</id>
		<title>MAS kernel patch compilation</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_kernel_patch_compilation&amp;diff=1586"/>
		<updated>2008-03-05T22:25:25Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* OS Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E-mail templates:&lt;br /&gt;
* [[ MAS OS Configuration email template ]]&lt;br /&gt;
* [[ MAS PC specifications email template ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OS Installation ==&lt;br /&gt;
&lt;br /&gt;
- Boot from the 6.06 LTS server disk&lt;br /&gt;
- Default install.  Reformat boot partition.  Make data partition!&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install build-essential subversion emacs21 finger&lt;br /&gt;
&lt;br /&gt;
== Sources list ==&lt;br /&gt;
&lt;br /&gt;
- If you get trouble from apt-get because it can't/won't read the Ubuntu disk, or you don't have it anymore, like this:&lt;br /&gt;
&lt;br /&gt;
 Media change: please insert the disc labeled&lt;br /&gt;
  'Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)'&lt;br /&gt;
&lt;br /&gt;
then remove (comment) the line &lt;br /&gt;
 deb cdrom:[Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)]/ dapper main restricted&lt;br /&gt;
from /etc/apt/sources.list and do&lt;br /&gt;
 apt-get sudo update&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel patch + compile ==&lt;br /&gt;
&lt;br /&gt;
- Get linux sources&lt;br /&gt;
- Apply bigphys patch (don't add the -bigphys in the Makefile, do it in the make-kpkg!)&lt;br /&gt;
- Follow the instructions here:&lt;br /&gt;
 http://www.howtoforge.com/kernel_compilation_ubuntu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo rm /bin/sh&lt;br /&gt;
 sudo ln -s /bin/bash /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install kernel-package libncurses5-dev fakeroot wget bzip2&lt;br /&gt;
 &lt;br /&gt;
 tar xjf linux-2.6.18.1.tar.bz2&lt;br /&gt;
 ln -s linux-2.6.18.1 linux&lt;br /&gt;
 cd /usr/src/linux&lt;br /&gt;
 &lt;br /&gt;
 bzip2 -dc /usr/src/patch-2.6.19-rc4.bz2 | patch -p1 --dry-run&lt;br /&gt;
 bzip2 -dc /usr/src/patch-2.6.19-rc4.bz2 | patch -p1 &lt;br /&gt;
 &lt;br /&gt;
 cp /boot/config-`uname -r` ./.config&lt;br /&gt;
 make menuconfig&lt;br /&gt;
 &lt;br /&gt;
 make-kpkg clean&lt;br /&gt;
 sudo make-kpkg --initrd --append-to-version=-bigphys kernel_image kernel_headers&lt;br /&gt;
&lt;br /&gt;
(Can't use fakeroot in this last step, since the .deb are written to /usr/src.)&lt;br /&gt;
&lt;br /&gt;
== Binary kernel package installation ==&lt;br /&gt;
&lt;br /&gt;
The .deb's that come out of the compilation above are incomplete, be we install them anyway.  They are missing arch/i386/Makefile.cpu, and Modules.symvers.  They might be missing other things too, but MAS really misses those ones.  These have been put into a patch; which must be applied at the end.&lt;br /&gt;
&lt;br /&gt;
The steps are:&lt;br /&gt;
&lt;br /&gt;
# Install the kernel packages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New boot options are: &amp;quot;bigphysarea=8192 acpi=off&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Without acpi=off, loading the DSP driver will crash the system really badly.  This has been observed in at least 2 machines.&lt;br /&gt;
&lt;br /&gt;
== After the new kernel ==&lt;br /&gt;
&lt;br /&gt;
For Ubuntu 6.06 LTS, add repository &amp;quot;Community maintained&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1585</id>
		<title>MAS</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1585"/>
		<updated>2008-03-05T22:21:16Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* Installation / configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[ MAS Overview ]]&lt;br /&gt;
&lt;br /&gt;
= Development =&lt;br /&gt;
&lt;br /&gt;
* [[ MAS Bug List ]]&lt;br /&gt;
* [[ MAS to-do ]]&lt;br /&gt;
* [[ MAS feature requests ]]&lt;br /&gt;
&lt;br /&gt;
= Installation / configuration =&lt;br /&gt;
&lt;br /&gt;
* [[ MAS PC requirements and initial setup ]]&lt;br /&gt;
* [[ MAS OS configuration ]]&lt;br /&gt;
* [[ MAS svn repository ]]&lt;br /&gt;
* [[ MAS installation notes ]]&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
&lt;br /&gt;
* [[ MAS start/stop ]]&lt;br /&gt;
* [[ MAS Command line how-to ]]&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_PC_requirements_and_initial_setup&amp;diff=1584</id>
		<title>MAS PC requirements and initial setup</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_PC_requirements_and_initial_setup&amp;diff=1584"/>
		<updated>2008-03-05T22:20:53Z</updated>

		<summary type="html">&lt;p&gt;Sysop: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E-mail templates for end users:&lt;br /&gt;
&lt;br /&gt;
* [[ MAS OS Configuration email template ]]&lt;br /&gt;
* [[ MAS PC specifications email template ]]&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1583</id>
		<title>MAS</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS&amp;diff=1583"/>
		<updated>2008-03-05T22:20:32Z</updated>

		<summary type="html">&lt;p&gt;Sysop: /* Installation / configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[ MAS Overview ]]&lt;br /&gt;
&lt;br /&gt;
= Development =&lt;br /&gt;
&lt;br /&gt;
* [[ MAS Bug List ]]&lt;br /&gt;
* [[ MAS to-do ]]&lt;br /&gt;
* [[ MAS feature requests ]]&lt;br /&gt;
&lt;br /&gt;
= Installation / configuration =&lt;br /&gt;
&lt;br /&gt;
* [[ MAS PC requirements and initial setup ]]&lt;br /&gt;
* [[ MAS svn repository ]]&lt;br /&gt;
* [[ MAS OS configuration ]]&lt;br /&gt;
* [[ MAS installation notes ]]&lt;br /&gt;
&lt;br /&gt;
= Usage =&lt;br /&gt;
&lt;br /&gt;
* [[ MAS start/stop ]]&lt;br /&gt;
* [[ MAS Command line how-to ]]&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_kernel_patch_compilation&amp;diff=1581</id>
		<title>MAS kernel patch compilation</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_kernel_patch_compilation&amp;diff=1581"/>
		<updated>2008-03-05T22:19:40Z</updated>

		<summary type="html">&lt;p&gt;Sysop: MAS OS configuration moved to MAS kernel patch compilation: reorganization of installation documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E-mail templates:&lt;br /&gt;
* [[ MAS OS Configuration email template ]]&lt;br /&gt;
* [[ MAS PC specifications email template ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OS Installation ==&lt;br /&gt;
&lt;br /&gt;
- Boot from the 6.06 LTS server disk&lt;br /&gt;
- Default install.  Reformat boot partition.  Make data partition!&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get update&lt;br /&gt;
 sudo apt-get install build-essential subversion emacs21&lt;br /&gt;
&lt;br /&gt;
== Sources list ==&lt;br /&gt;
&lt;br /&gt;
- If you get trouble from apt-get because it can't/won't read the Ubuntu disk, or you don't have it anymore, like this:&lt;br /&gt;
&lt;br /&gt;
 Media change: please insert the disc labeled&lt;br /&gt;
  'Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)'&lt;br /&gt;
&lt;br /&gt;
then remove (comment) the line &lt;br /&gt;
 deb cdrom:[Ubuntu-Server 6.06.1 _Dapper Drake_ - Release i386 (20060807.1)]/ dapper main restricted&lt;br /&gt;
from /etc/apt/sources.list and do&lt;br /&gt;
 apt-get sudo update&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Kernel patch + compile ==&lt;br /&gt;
&lt;br /&gt;
- Get linux sources&lt;br /&gt;
- Apply bigphys patch (don't add the -bigphys in the Makefile, do it in the make-kpkg!)&lt;br /&gt;
- Follow the instructions here:&lt;br /&gt;
 http://www.howtoforge.com/kernel_compilation_ubuntu&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 sudo rm /bin/sh&lt;br /&gt;
 sudo ln -s /bin/bash /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install kernel-package libncurses5-dev fakeroot wget bzip2&lt;br /&gt;
 &lt;br /&gt;
 tar xjf linux-2.6.18.1.tar.bz2&lt;br /&gt;
 ln -s linux-2.6.18.1 linux&lt;br /&gt;
 cd /usr/src/linux&lt;br /&gt;
 &lt;br /&gt;
 bzip2 -dc /usr/src/patch-2.6.19-rc4.bz2 | patch -p1 --dry-run&lt;br /&gt;
 bzip2 -dc /usr/src/patch-2.6.19-rc4.bz2 | patch -p1 &lt;br /&gt;
 &lt;br /&gt;
 cp /boot/config-`uname -r` ./.config&lt;br /&gt;
 make menuconfig&lt;br /&gt;
 &lt;br /&gt;
 make-kpkg clean&lt;br /&gt;
 sudo make-kpkg --initrd --append-to-version=-bigphys kernel_image kernel_headers&lt;br /&gt;
&lt;br /&gt;
(Can't use fakeroot in this last step, since the .deb are written to /usr/src.)&lt;br /&gt;
&lt;br /&gt;
== Binary kernel package installation ==&lt;br /&gt;
&lt;br /&gt;
The .deb's that come out of the compilation above are incomplete, be we install them anyway.  They are missing arch/i386/Makefile.cpu, and Modules.symvers.  They might be missing other things too, but MAS really misses those ones.  These have been put into a patch; which must be applied at the end.&lt;br /&gt;
&lt;br /&gt;
The steps are:&lt;br /&gt;
&lt;br /&gt;
# Install the kernel packages&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New boot options are: &amp;quot;bigphysarea=8192 acpi=off&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Without acpi=off, loading the DSP driver will crash the system really badly.  This has been observed in at least 2 machines.&lt;br /&gt;
&lt;br /&gt;
== After the new kernel ==&lt;br /&gt;
&lt;br /&gt;
For Ubuntu 6.06 LTS, add repository &amp;quot;Community maintained&amp;quot;.&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
	<entry>
		<id>https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_OS_configuration&amp;diff=1582</id>
		<title>MAS OS configuration</title>
		<link rel="alternate" type="text/html" href="https://e-mode.phas.ubc.ca/mcewiki/index.php?title=MAS_OS_configuration&amp;diff=1582"/>
		<updated>2008-03-05T22:19:40Z</updated>

		<summary type="html">&lt;p&gt;Sysop: MAS OS configuration moved to MAS kernel patch compilation: reorganization of installation documentation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[MAS kernel patch compilation]]&lt;/div&gt;</summary>
		<author><name>Sysop</name></author>
		
	</entry>
</feed>