|
Program Components
The MIDAS system
is a group of programs that together provide a versatile
data acquisition system. Each program performs specific
tasks in the DAQ process. The specific role of each,
as well as their rough layout are covered below. Full
documentation for MIDAS can be found here.
All of the following applications (and their source code)
can be found on bragi in C:\DAQTPC.
feflash.exe
feflash.exe is the application responsible
for interfacing with the FlashADC cards via the Struck
SIS1100/3100 VME interface. It contains all code
responsible for initializing the Struck interface, communicating
with the FlashADCs, as well as taking all acquired data,
and handing it over to the rest of the MIDAS system.
MIDAS refers to all experiment hardware as equipment,
therefore, feflash is the frontend application that gathers
all data from the equipment and assembles it into an "event" which
is then sent to the "back-end" of the MIDAS system for
logging and analysis. Full documentation for the construction
of a frontend for MIDAS can be found here.
The following is a specific description of the various
functions as they pertain to bragi.
- INT frontend_init();
This function is run once only at the application
startup. It allows hardware checking, loading/setting
of global variables, hot-link settings to the
ODB etc. The initializing of the Struck
SIS1100/3100 is performed here.
- INT frontend_exit();
This function runs when the frontend is requested
to terminate.
- INT begin_of_run(INT run_number, char *error);
This function is called for every run start transition.
Allows the update of user parameters, load/setup/clear
hardware. At the exit of this function the system
should be prepared for an event, and the subsequent
data acquisition.
- INT end_of_run(INT run_number, char *error);
For every "stop run" transition this function is
called and provides opportunity to disable the
hardware.
- INT pause_run(INT run_number, char *error);
This function is called upon the "Pause" command.
It is not used in feflash, but must be implemented
anyway.
- INT resume_run(INT run_number, char *error);
This function is called upon the "Resume" command.
It is not used in feflash, but must be implemented
anyway.
- INT poll_event(INT source, INT count, BOOL test);
If the equipment is defined as an EQ_POLLED acquisition
type, the poll_event() will be called as often
as possible over the corresponding poll time
(currently 50ms) given by the polling equipment.
The function will read from the VME address defined
as the trigger base, in the current case it is
set as card 0 in crate 0. The external trigger
from the majority gate should be input on this
card.
- INT read_trigger_event(char *pevent, INT off);
The actual event readout function that reads all
data from the FlashADCs when a trigger has been
detected.
While acquisition is running, most CPU time will be spent
in feflash, polling the FlashADCs, waiting for an event
to happen. When an event does occur, the polling will
stop while the analyzer and logger perform their functions.
As soon the event information has been properly acquired,
the system will resume polling the hardware.
analyzer.exe
analyzer.exe is responsible for http://midas.triumf.ca/doc/html/analyzer_struct.html
To verify that everything is functioning properly, PAW
can be used to view data as it is being collected:
- Run pawNT.exe from c:\paw (or find PAW icon on
Desktop)
- For "Workstation type (?=HELP) =1: ", simply
press enter.
- Connect PAW to the online histograms by typing: global_s
onln
- To view pulses: exec plotro
Back |
|