Table of Contents Previous Chapter Chapter 12: egevent - Event Generator Event

Chapter 12: egevent - Event Generator Event

Advanced Photon Source
Argonne National Laboratory

1. Introduction

The support for the global event system has been designed to allow an application developer to control the APS event generator and receiver boards. This is done by the use of four new record types: eg, egevent, er, erevent. These records are customized and are only supported by the device support modules for the APS event generator and receiver boards.

For more detailed information on the APS event generator and receiver records refer to Chapter 11 on page 69.

The Event Generator

The Event Generator is used to generate global event codes and send them out to one or more Event Receivers. A group of interconnected event generators and receivers is referred to as an `event circuit.' There may be more than one event generator on the same event circuit. And it is possible for a single IOC to be part of multiple event circuits.

EGEVENT Records

The egevent record is used in conjunction with an eg record in order to specify a single event that is to be placed into a sequence RAM. The event code and its time displacement from the trigger are specified in this record.

2. Field Summary

--------------------------------------------------------------
Field  Type       DCT  Initial  Access  Modify  Rec Proc   PP   
                                                Monitor         
--------------------------------------------------------------
OUT    OUTLINK    Yes  0        No      No      No         No   
ENM    LONG       Yes  0        Yes     Yes     No         Yes  
LEVT   LONG       No   0        Yes     No      No         Yes  
RAM    RECCHOICE  Yes  0        Yes     Yes     No         Yes  
LRAM   RECCHOICE  No   0        Yes     No      No         Yes  
DELY   FLOAT      Yes  0        Yes     Yes     No         Yes  
ADLY   FLOAT      No   0        Yes     No      No         No   
DPOS   LONG       No   0        Yes     No      No         No   
APOS   LONG       No   0        Yes     No      No         No   
LDLY   FLOAT      No   0        Yes     No      No         No   
UNIT   RECCHOICE  Yes  0        Yes     Yes     No         Yes  
VAL    CHAR       No   0        Yes     No      Yes        No   
ELN    NOACCESS   No   12       No      No      No         No   
SELF   NOACCESS   No   4        No      No      No         No   
--------------------------------------------------------------

3. Field Descriptions

------------------------------------------------------------------------------------------
Name  Summary             Description                                                       
------------------------------------------------------------------------------------------
OUT   Output Link         Used to specify what event generator link that this event is      
                          related to. Only the Card number is used                          
ENM   Event Number        The event number that is to be placed into the sequence           
                          RAM.                                                              
LEVT  Last Event Number                                                                     
RAM   Sequence RAM        Which RAM the event is to be placed into. (Ignored when           
      Specifier           the generator is in `Alternate' mode.)                            
LRAM  Last RAM                                                                              
DELY  Desired Delay       The desired time delay between the trigger that starts the        
                          RAM sequence and when this event should be sent. This             
                          field must be expressed in the units selected in the UNIT         
                          field described below.                                            
ADLY  Actual Delay        This is a read-only field that is set to the actual delay value   
                          after accounting for rounding caused by the clock                 
                          resolution as well as collisions that can occur if more than      
                          one event is placed into the same sequence RAM location.          
DPOS  Desired Position    This is a read-only field that represents desired position in     
                          the sequence RAM that the event should be placed. It is           
                          expressed in clock ticks.                                         
APOS  Actual Position     This is a read-only field that represents the actual position     
                          in the sequence RAM that the event is placed. It is               
                          expressed in clock ticks.                                         
LDLY  Last Desired Delay                                                                    
UNIT  Delay Specifier     The time units used to express the delay value in the DELY        
      Units               and ADLY fields.                                                  
VAL   Value Field         Not used.                                                         
ELN   List Node                                                                             
SELF  Self Pointer                                                                          
------------------------------------------------------------------------------------------

4. Record Processing

It is intended that egevent records be set to passive processing only. They are not altered by the device support code in response to being processed. Their purpose is only to specify the desired position and code of an event in a sequence RAM. The read-only fields will be updated as necessary when ever the sequence RAM is reloaded. To start things going, however, they should have their `process at init' flag set to YES.

Sequence RAMs are reloaded when ever any of the egevent records related to it has its DELY, ENM or UNIT values changed. It is not advisable to alter the UNIT field unless the associated sequence RAM mode is set to `Off'.

5. Device Support

The device support module for the event generator may be used by eg and egevent record types.

In order to configure the event generator device support, a call must be made to set the address for each of the event generator cards present in the IOC. This configuration call is as follows:

  EgConfigure(<card number>, <Base address in A16>)
The <card number> field may be 0-4 and is used to specify which card is to be configured. This is the card number that is referenced in the eg and egevent records when building the database. The <Base address in A16> field is a 16-bit number that represents the address of the card in the A16 memory space.

Database records that specify card numbers that are not configured will generate `bad field' errors when they are initialized by iocInit. And will then be ignored by the event generator device support if ever processed.

 
Table of Contents Next Chapter