Re: [Daqpp-forum] scans
Brought to you by:
lacasta
From: Andrej S. <and...@ij...> - 2007-03-27 16:59:49
|
Hi, Carlos! I think I got the path/C-routine right and I created a real bare scan run manager which should do nothing (or crash immediately after initialization, I am not sure which) but should print that it was created= . But I get the following: <here I press Scan button> Current scan is not in the scan list ... this should not happen Current scan is not in the scan list ... this should not happen Creating a new RunManager: Active RMs: 0 ...is current one active ? no rm: 0x95930b0 Deleting current RunManager ...destroying DataRunManager main ...destroying RunManager main MsgManager: removing run manager main need to create a DataRunManager MsgManager: adding run manager main Active RMs: 0 is active ? no Registering to the new RunState Relevant code: ***********constructor**************** ScanRmanager::ScanRmanager(DAQpp::DAQid id) :Rmanager(id),_time(false),ipoint(-1),next_point(0) { std::cout<<"new ScanRmanager id=3D"<<id<<std::endl; } ***************hook******************* extern "C" { ScanRmanager *create_new_manager(){ //const std::string &s, const DAQpp::DAQid &id){ //if (s=3D=3D"ScanRunManager") return new ScanRmanager(DAQpp::DAQid(3001)); } } *****config****************************** <plugins> <plugin name=3D"SIS3300module" module=3D"SIS3300module"> <lib>/home/gamma/vmedaq/vmedaq-0.5.1-1/modules/SIS3300/libSIS3300.s= o</lib> <hook>create_SIS3300moduleConf</hook> </plugin> <plugin name=3D"SecondDetector" module=3D"SecondDetector"> <lib>/home/gamma/vmedaq/vmedaq-0.5.1-1/modules/SIS3300/libSIS3300.s= o</lib> <hook>create_SecondDetectorConf</hook> </plugin> <plugin name=3D"pmtUSB" module=3D"pmtUSB"> <lib>/home/gamma/vmedaq/vmedaq-0.5.1-1/modules/SIS3300/usb/libpmtUS= B.so</lib> <hook>create_pmtUSB</hook> </plugin> <!-- User defined run managers --> <run_managers> <scan> <lib>/home/gamma/vmedaq/vmedaq-0.5.1-1/scan_adacCalibration/libS= canRunManager.so</lib> <hook>create_new_manager</hook> </scan> </run_managers> </plugins> ********************************************** All ideas welcome. -Andrej > Hi andrej, > > >> - related to scan managers relation to data run manager: If the scan r= un >> manager is defined as below, is it created only when Scan is pressed o= n >> the VMEDAQ's front panel or is it the sole run manager and has to mana= ge >> normal data taking as well? >> > > The scan run manager will only be created when scan is enabled in the > scan dialog. Otherwise, you will use whatever you have defined in the > config file for the data run manager (The default is always > DataRunManager) > > >> - is Trigger() routine called at the begining of each event? Can it be >> understood as a StartOfEvent() pair to the EndOfEvent() routine? Shoul= d >> module->Trigger() call Start()? If not, is module->Start() called befo= re >> or after Triggger()? > > Yes, Trigger() is called at the beginning of each event. > Module->Start() is called at the beginning of a run, before calling > RunManager::Trigger(). You should not care about Start(). It will be > called somewhere else. The idea behind Trigger is that the RunManager > can simulate a trigger creation... Of course it can be used for any > other purpose... > > >> >> - does CheckEndOfRun() signal the DAQmanager to stop the run? > > Yes, when it returns true, the run will be stopped. > >> >> - I would make scan manager a child of Rmanager. Does that make sense? >> Am >> I correct in assuming that all data loging will be then handled by >> Rmanager and I should not bother by that? Would then the LogData butto= n >> on >> VMEDAQ's front panel determine whether we log data or not? (ie. pressi= ng >> scan after log data would store events taken during the scan in data >> files >> as given by preferences dialog?) > > I forgot to mention that in vmedaq, the RunManager objects should > derive from Rmanager, like the modules do from GenModule. Rmanager > will take care of most of the things (I hope) > > > To reduce "problems" just clone the current ScanRunManager and remove > references to PulseRunManager... > > Cheers, > > Carlos > > >> >> There might be more questions. Thanks. >> >> -Andrej >> >> >>> Hello Andrej, >>> >>> Yes, you can certainly use the vmedaq scans for that. However, as >>> usual, >>> it will require some work on your side. The idea is that you create a >>> new runmanager and load it with the configuration file (via one of >>> those >>> plugins) to be the one in charge of the scans. Say you create a run >>> manager that lives in the shared library libMyRunManager.so. Then in >>> the >>> config file, in the plugins section you write >>> >>> <plugins> >>> <plugin> ...whatever you might already have.. </plugin> >>> >>> <!-- User defined run managers --> >>> <run_managers> >>> <scan> >>> <lib>path_to_the_lib/libMyRunManager.so</lib> >>> <hook>create_scan_run_manager</hook> >>> </scan> >>> </run_managers> >>> >>> </plugins> >>> >>> That means that in your library there should be a static "C" function >>> called create_scan_run_manager (it can be any valid name for a >>> function) >>> that actually creates the run manager and returns a pointer to it. >>> >>> Now, user defined RunManagers are defined like user defined modules b= ut >>> are much easier, since you do not need to define GUIs, configurations >>> nor anything like that. Take a look at the example in making_a_modul= e. >>> >>> To create your RunManager, I would propose to take ScanRunManager in >>> the >>> daq folder and build from that. You will have to remove its >>> "relationship" with PulseRunManager, since you do not need that, and >>> any >>> call to methods to that class. Yes... I know that should be a "generi= c" >>> class, and I promise I'll try to make it in the next release. >>> >>> How the thing works... All the sugar is in ScanRunManager::Trigger. >>> There it determines if we should start a new point in the scan or not >>> and notifies to the modules. I guess that if you just need to move >>> axes, >>> the modules do not need to be notified, but who knows... This can be >>> done in 2 ways, either change every N events or change every N second= s. >>> Depending on the method, one uses an EventCtr instance or an EventTim= er >>> instance. This is done automatically, so I guess you only need to edi= t >>> the files to remove the dependencies with PulseGenerator and, in >>> Trigger, move your stuff whenever (*next_point)() is true. >>> >>> Hope that helps. >>> >>> Regards, >>> >>> Carlos >>> >>> On Mon, 2007-02-19 at 11:54 -0500, Andrej Studen wrote: >>>> Hi Carlos, everyone! >>>> >>>> I have a question. In what way is it possible to tamper with the sca= n >>>> modality of VMEDAQ? >>>> >>>> Let me illustrate. What I have here is a scintillator camera which >>>> needs >>>> to be recallibrated from time to time. To do that, we use a XY table >>>> and >>>> record N=3D3000 events at a set of different positions (PMT centers, >>>> orthogonal grids, etc.). I am tempted to use VMEdaq to do that. But = my >>>> user supplied scan routine should call external functions (move the >>>> motor, >>>> parse and analyze the data, move to next position) at each position.= I >>>> think it fits nicely into a scan philosophy. So, my question is: can= I >>>> do >>>> that and if I can, what guidelines should I follow. >>>> >>>> A happy monday to everyone >>>> >>>> Andrej >>>> >>>> >>>> --------------------------------------------------------------------= ----- >>>> Take Surveys. Earn Cash. Influence the Future of IT >>>> Join SourceForge.net's Techsay panel and you'll get the chance to >>>> share >>>> your >>>> opinions on IT & business topics through brief surveys-and earn cash >>>> http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&C= ID=3DDEVDEV >>>> _______________________________________________ >>>> Daqpp-forum mailing list >>>> Daq...@li... >>>> https://lists.sourceforge.net/lists/listinfo/daqpp-forum >>> -- >>> ___________________________________________________________________ >>> Carlos Lacasta >>> ^^^^^^^^^^^^^^^ >>> Inst. de Fisica Corpuscular (IFIC) >>> Edificio Institutos de Investigacion >>> P.O. Box 22085 >>> E-46071 VALENCIA >>> Spain >>> Tel.: +34 96 354 3490 >>> Fax.: +34 96 354 3488 >>> Car...@if... >>> ___________________________________________________________________ >>> >>> >> >> >> > > > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > > |