Application note: Using the CAENV977 as a trigger for the classic readout software. The classic readout skeleton supports the creation and registration of a user written trigger See http://docs.nscl.msu.edu/daq/appnotes/TriggerAppnote.txt For an application note that describes how to write and install these triggers. As of nslcdaq-8.1 a set of pre-written trigger/status classes using the CAENV977 I/O module have been provided. To use this trigger/busy edit skeleton.cpp as follows: Add the following header includes: #include "CTraditionalV977Trigger.h" #include "CTraditionalV977Busy.h" #include #include These define the classes that implement the trigger as well as the classes we need to interact with to establish the trigger. Add the following declarations at the global level (outside of any function bodies): extern StateMachine* gpStateMachine; static CTraditionalV977Trigger* pTrigger(0); static CTraditionalV977Busy* pBusy(0); These create pointers to an object we need to acdess to establish the triggers as well as pointers to the trigger objects themselves. Add the following code to initevt() (this code assumes the V977 is installed in VME crate 0 with a base address 0f 0xdddd0000). // If necessary create the trigger and busy: if(!pTrigger) { pTrigger = new CTraditionalV977Trigger(0xdddd0000); pBusy = new CTraditionalV977Busy(0xdddd0000); } // Register trigger and busy: Active* pActive = (Active*)gpStateMachine->GetCurrentStatePtr(); pActive->SetTrigger(pTrigger); pActive->SetBusy(pBusy); } The first segment of this code creates the trigger and busy objects if they have not yet been created. The second segment registers them, overriding the trigger and busy that get established when the run is started. The parameters on the constructors of the trigger and busy objects are the base address of the module. If the module is in a VME crate other than 0, you can add an additional parameter to specify the VME crate. For example; if the module were in VME crate 1 with a base address of 0xeeee0000 The section of code that reads: // If necessary create the trigger and busy: if(!pTrigger) { pTrigger = new CTraditionalV977Trigger(0xdddd0000); pBusy = new CTraditionalV977Busy(0xdddd0000); } Would be modified to read: // If necessary create the trigger and busy: if(!pTrigger) { pTrigger = new CTraditionalV977Trigger(0xdddd0000,1); pBusy = new CTraditionalV977Busy(0xdddd0000,1); } ============================= The trigger is made when any nonzero bit pattern is gated into the module (it's run in coincidence mode). Outputs are as follows: * Going ready is output 0 (Put this into the clear of your busy latch). * Going busy is output 1 (Or this and your trigger into the "set" of your busy latch).