next up previous contents index
Next: Event Building Up: Language Elements Previous: Flow Control   Contents   Index

Trigger Elements

For each hardware type (as defined by the compiler keyword sfi readout, camac readout,etc.) there is the possibility to enable triggers from multiple sources. For instance the SFI fastbus interface can accept triggers from a total of eight external sources (3 NIM inputs, 4 dECL inputs, and the TJNAF TS interface card). Initialization of trigger sources as well as associating a trigger routine with each of these sources should be done in the prestart routine. Subsequent enabling and disabling of the triggers will be handled for the user in the go, pause, and end routines. First the particular hardware type should be initialized where hardware_type = FASTBUS, SFI, VME, CAMAC, TEST, or EVENT:
init trig source hardware_type
Then the user must link a specific source type to a trigger and done routine:

link async trig source h_type s_type to <name> and <name>_done  
# or 
link sync trig source h_type s_type to <name> and <name>_done

The async or sync keywords indicate a interrupt or polled source respectively. The value of s_type is dependent on the hardware_type. A value of 1 for s_type is always valid and indicates the TS interface card for SFI, FASTBUS, and VME, a slot=1 LAM for CAMAC, internal triggers for TEST, and the Primary readout list output queue for the EVENT hardware type. Finally, $<name>$ refers to the name of the users trigger routine which should also be defined in the readout list. Specific physics event types can be enabled for specific source types. Physics event types take on values between 1-15. To enable a type ev_type for a source:

event type ev_type then read h_type s_type

next up previous contents index
Next: Event Building Up: Language Elements Previous: Flow Control   Contents   Index
Mohammad Ahmed 2003-07-23