Equipment Flags
Jump to navigation
Jump to search
Links
Equipment Flags
The following equipment flags (of the form EQ_xxx, defined in midas.h) are supported in the Equipment Type field in the EQUIPMENT structure of a frontend. The selected flag determines the Equipment Type.
EQ_PERIODIC
- Periodic Event Equipment Type
- In this equipment Type, no hardware requirement is necessary to trigger the readout function. Instead, the readout routine associated with this equipment is called periodically. The Period field in the equipment declaration is used in this case to specify the time interval between calls to the readout function.
EQ_POLLED
- Polling Event Equipment Type
- In this equipment Type, the name of the routine polling on a trigger source is "poll_event()". This routine must be provided in the Frontend user code by the user. As polling consists of checking a variable for a TRUE condition, if the loop count is infinite and the condition never becomes TRUE, the frontend would not be able to respond to any network commands. Therefore the loop count is determined when the frontend starts for the first time so that it returns after a given time-out if no event is available. This time-out is usually of the order of 500 milliseconds. The EQ_POLLED equipment type is mainly used for data acquisition based on a hardware condition becoming TRUE, at which time the readout routine associated with the equipment is called. See example.
EQ_INTERRUPT
- Interrupt Event Equipment Type
- This flag is similar to the EQ_POLLED mode, except a hardware interrupt is used to trigger the event rather than a polling loop. Instead of passing a pointer to the polling routine, in EQ_INTERRUPT mode a pointer to the interrupt configuration routine is passed to the system. Midas requires complete configuration and control of the interrupt source. This is provided by the interrupt configuration routine (called interrupt_configure()) that must be provided in the Frontend code by the user. When a valid interrupt is received, the readout routine associated with the equipment is called.
EQ_MULTITHREAD
- Multithread Event Readout Equipment Type
- This flag implements the multi-threading capability within the frontend code. The polling is performed within a separate thread and uses the "Midas Ring Buffer Functions" (rb_xxx in midas.c) for inter-thread communication. EQ_MULTITHREAD is similar to EQ_POLLED mode, except for the polling function which in the case of EQ_MULTITHREAD resides in a separate thread. This new type has been added to take advantage of the multi-core processor to free up CPU for tasks other than polling.
EQ_SLOW
- Slow Control Event Equipment Type
- This flag declares the equipment as a Slow Control Equipment (see Slow Control System). This will enable the call to the idle function part of the class driver. This flag also causes event data to be sent automatically to the /equipment/variables/ ODB subtree.
EQ_MANUAL_TRIG
- Manual triggered event Equipment Type
- This flag enables the equipment to be triggered by a remote procedure call (RPC). If EQ_MANUAL_TRIGGER is selected, the web interface will provide an extra button to trigger the equipment. The event may also be triggered by a client via RPC (see example).
EQ_EB
- Event Builder event Equipment Type
- This flag identifies the equipment as a fragment event and should be ORed with EQ_POLLED in order to be identified by the Event Builder.
EQ_FRAGMENTED
- Fragmented Event Equipment Type
- Flag enabled large events (beyond the Midas configuration limit) to be handled by the system (see WARNING below). This flag required that a valid max_event_size_frag variable was defined in the user Frontend code. The max_event_size variable was used as fragment size in this case. This option was meant to be used in experiments where the event rate was not an issue but the size of the data needed to be extremely large.
- WARNING
- This flag is obsolescent (not maintained). It was added for small memory cpus (e.g VxWorks PPC) to send very large events (beyond the Midas configuration limit) back to the host computer.
- With modern large-memory cpus (e.g. VMIC), instead of using this flag, the buffer sizes should be increased to accommodate a large event (see Event Buffer).
- The fragmented event mechanism is not to be confused with "event fragments" used by the Event Builder.
- WARNING