Equipment Flags: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Pagelinks}}
==== Links ====
==== Links ====
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3">
Line 8: Line 10:
'''<div id="Equipment Type"></div>'''
'''<div id="Equipment Type"></div>'''
==Equipment Flags==
==Equipment Flags==
The following equipment flags (of the form EQ_xxx) are supported in the Equipment [[Equipment List Parameters#Type|Type]] field in the EQUIPMENT structure of a frontend.
The following equipment flags (of the form EQ_xxx, defined in [http://ladd00.triumf.ca/~daqweb/doc/midas-devel/doc/html/midas_8h.html midas.h]) are supported in the Equipment [[Equipment List Parameters#Type|Type]] field in the EQUIPMENT structure of a frontend.
The selected flag determines the Equipment Type.
The selected flag determines the Equipment Type.


===EQ_PERIODIC ===
===EQ_PERIODIC ===
; Periodic Event [[#Equipment Flags|Equipment Type]]
; Periodic Event [[#Equipment Flags|Equipment Type]]
: In this equipment Type, no hardware requirement is necessary to @ref FE_tab_event_trigger "trigger" the readout function.  Instead, the [[Equipment List Parameters#Readout Routine|readout routine]] associated with this equipment is called periodically.The [[Equipment List Parameters#Period|Period]] field in the equipment declaration is used in this case to specify the time interval between calls to the readout function.
: In this equipment Type, no hardware requirement is necessary to trigger the readout function.  Instead, the [[Equipment List Parameters#Readout Routine|readout routine]] associated with this equipment is called periodically. The [[Equipment List Parameters#Period|Period]] field in the equipment declaration is used in this case to specify the time interval between calls to the readout function.


===EQ_POLLED===
===EQ_POLLED===
;Polling Event  [[#Equipment Flags|Equipment Type]]
;Polling Event  [[#Equipment Flags|Equipment Type]]
: In this equipment Type,  the name of the routine performing the @ref FE_tab_event_trigger "trigger" check function is @ref FE_poll_event "poll_event()". This routine must be provided in the frontend.c 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. <br> The EQ_POLLED equipment type is mainly used for data acquisition based on a hardware condition becoming TRUE, at which time the [[Equipment List Parameters#Readout Routine|readout routine]] associated with the equipment is called. See  @ref FE_poll_event "example".
: 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 [[Equipment List Parameters#Readout Routine|readout routine]] associated with the equipment is called. See  [[Frontend user code#Function poll_event| example]].




===EQ_INTERRUPT===
===EQ_INTERRUPT===
; Interrupt Event [[#Equipment Flags|Equipment Type]]
; Interrupt Event [[#Equipment Flags|Equipment Type]]
: This flag is similar to the [[#EQ_POLLED|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 an interrupt configuration routine called @ref  FE_interrupt_event "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.See  @ref FE_interrupt_event "example".
: This flag is similar to the [[#EQ_POLLED|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 [[Frontend user code#Function interrupt_configure|interrupt_configure()]]) that must be provided in the [[Frontend user code|Frontend code]] by the user. When a valid interrupt is received, the [[Frontend user code#Event Readout routine|readout routine]] associated with the equipment is called.






===EQ_MULTITHREAD===
=== EQ_MULTITHREAD ===
;Multithread Event Readout [[#Equipment Flags|Equipment Type]]
;Multithread Event Readout [[#Equipment Flags|Equipment Type]]
:This flag implements the multi-threading capability within the frontend code. The polling isperformed within a separate thread and uses the@ref rbfunctionc "Midas Ring Buffer Functions" (rb_xxx) for inter-thread communication.EQ_MULTITHREAD is similar to @ref FE_tbl_EqPolled "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.
: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 [http://ladd00.triumf.ca/~daqweb/doc/midas-devel/doc/html/midas_8c.html midas.c]) for inter-thread communication. EQ_MULTITHREAD is similar to [[#EQ_POLLED |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. This flag cannot be combined with EQ_PERIODIC or EQ_SLOW. Multi-threaded readout of slow control events is handled at the device driver level of slow control events.
 
 


=== EQ_SLOW===
=== EQ_SLOW===
; Slow Control Event [[#Equipment Flags|Equipment Type]]
; Slow Control Event [[#Equipment Flags|Equipment Type]]
: This flag declares the equipment as a Slow Control Equipment. 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 <span style="color: purple; font-style:italic;">/equipment/variables/</span> ODB tree.
: 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 <span style="color: purple; font-style:italic;">/equipment/variables/</span> ODB subtree.




Line 40: Line 40:
===EQ_MANUAL_TRIG===
===EQ_MANUAL_TRIG===
; Manual triggered event [[#Equipment Flags|Equipment Type]]
; Manual triggered event [[#Equipment Flags|Equipment Type]]
: This flag enables the equipment to be @ref FE_Manual_trig_mode "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. @ref FE_manual_trigger "See example."
: This flag enables the equipment to be [[Frontend user code#Manual Trigger|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 ([[Frontend user code#Manual Trigger|see example]]).




Line 47: Line 47:


;Event Builder event [[#Equipment Flags|Equipment Type]]
;Event Builder event [[#Equipment Flags|Equipment Type]]
: This flag identifies the equipment as a <b>fragment event</b>  and should be ORed with EQ_POLLED in order to be identified by the [[Event Builder]].  
: This flag identifies the equipment as a <b>fragment event</b>  and should be ORed with [[#EQ_POLLED|EQ_POLLED]] in order to be identified by the [[Event Builder]].  




Line 63: Line 63:
::* The fragmented event mechanism is '''not to be confused''' with "event fragments" used by the [[Event Builder]].
::* The fragmented event mechanism is '''not to be confused''' with "event fragments" used by the [[Event Builder]].
</div>
</div>
[[Category:Equipment]] [[Category:Event]] [[Category:Frontend]]

Latest revision as of 23:25, 16 May 2022


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. This flag cannot be combined with EQ_PERIODIC or EQ_SLOW. Multi-threaded readout of slow control events is handled at the device driver level of slow control events.

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.