Home
        Programmer`s Manual PIXIE-4
         Contents
1.             download ENERGY RISETIME to the DSP  retval   Pixie User Par IO Channel Parameter Values                       23 PIXIE 4 Programmer   s Manual V1 41  O XIA 2007  All rights reserved                                ENERGY RIS  if  retval  lt  0              Error handling         ETIME          CHANNEL      direction  modnum     channum       Table 3 5 gives a complete description of all the global variables being used by the PIXIE 4    API     Table 3 5  Descriptions of Global Variables in PIXIE 4                                                                                                                                                                                                                                                                                                           System_Parameter_Names VO Type Unit Corresponding DSP Variables  NUMBER MODULES Read Write   N A N A  OFFLINE ANALYSIS Read Write   N A N A  C LIBRARY RELEASE Read only N A N A  C_LIBRARY BUILD Read only N A N A  SLOT_ WAVE Read Write   N A N A  Module Parameter_Names 1 O Type Unit Corresponding DSP Variables  MODULE NUMBER Read only N A MODNUM  MODULE CSRA Read Write   N A MODCSRA  MODULE CSRB Read Write   N A MODCSRB  MODULE FORMAT Read Write   N A MODFORMAT  MAX EVENTS Read Write N A MAXEVENTS  COINCIDENCE PATTERN Read Write   N A COINCPATTERN  ACTUAL COINCIDENCE WAIT   Read Write   N A COINCWAIT  MIN COINCIDENCE WAIT Read only N A COINCWAIT  SYNCH WAIT Read Write   N A SYNCH
2.           Error handling                  wait until run has ended  while    Pixie Acquire Data 0x4100  User Data           modnum              read out the list mode data and save it to a file   retval   Pixie Acquire Data 0x6100  User Data  DataFile  modnum     if  retval  lt  0                     Error handling       k      if k  gt  Nruns       break                   issue RESUME RUN command  retval   Pixie Acquire Data 0x2100  User Data           modnum    if  retval  lt  0                             Error handling          27 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     while  1         read out the MCA spectrum and put it to array User Data  retval   Pixie Acquire Data 0x9001  User Data           modnum    if  retval  lt  0          Error handling               To process the list mode data after it is saved to a file  the PIXIE 4 API provides several  utility routines to parse the list mode data and read out the waveform  energy of each  individual trace or PSA values  The code below shows how to read waveforms from a list  mode file     An Example Code Illustrating How to Parse List Mode Data    S32 retval    U8 direction  modnum  channum  i    U32 List _Data 2  MAX NUMBER OF MODULES      list mode trace information  char  DataFile     C   XIA  PIXIE4  PulseShape  Data bin      U32 totaltraces     total number of traces in the list mode data file  U32  traceposlen     point to positions of the traces in the file                   Ul6  
3.   All rights reserved     Table 3 2  File Names in All  Files                                               All Files File Name Note   All Files 0  C  XJA PIXIE4 Firmware syspixie_revB bin   Communication FPGA configurations   Rev  B    All Files 1  C  XTA PIXIE4 Firmware syspixie_revC bin   Communication FPGA configurations   Rev  C    All Files 2  C  XTA PIXIE4 Firmware pixie bin Signal processing FPGA configurations   All Files 3  CAXIAPIXIEADSPPXIcode bin DSP executable binary code   All Files 4  CAXIAPIXIEA Configuration default set Settings file   All Files 5  CAXIAPIXIEADSPPXIcode var File of DSP I O variable names   All Files 6  C  XJA PIXIE4 DSP PXIcode  st File of DSP memory variable names                The global variable array  System Parameter Values  also needs to be initialized before the API  functions are called to start the initialization  Table 3 3 lists those global variables     Table 3 3  Initialization of Module_Global_ Values                          Module Global Names   Module Global Values   Note   NUMBER MODULES   2 The total number of PIXIE 4 modules  SLOT _WAVE 0  3 Module 0 sits in slot 3   SLOT _WAVE 1  4 Module 1 sits in slot 4                   3 1 2 Boot PIXIE Modules    The boot procedure for PIXIE 4 modules includes the following steps  First  all the global  parameter names and boot file names should be downloaded by calling  Pixie Hand_Down_Names  Then function Pixie_User_Par_IO should be called to  initialize the global value array Sys
4.  1  N    0011    3  To accept this  event  bit 3 in MODULEPATTERN must be set  If all 16 bits are set  all  events are accepted     NNSHAREPATTERN  16 bit user defined number defining which event hit pattern sets    U00     XdatLength     USERIN     hit status to 1  which is then send to the neighboring modules if bit 8 in  MODCSRA is set  The bits are defined in the same way as in the  COINCPATTERN     Many unused  but reserved  data blocks have names of the structure Unn   Those unused data blocks which reside in the block of input parameters for    each channel are called UNUSEDA and UNUSEDB     Length of a data block to be downloaded from the host  Use XdatLength 0 as  the default value for normal operation     A block of 16 input variables used by user written DSP code     4 2 Channel variables    All channel 0 variables end with  0   channel 1 variables end with  1   etc  In the following  explanations the numerical suffix has been removed  Thus  e g   CHANCSRAO becomes    CHANCSRA     etc     CHANCSRA  The control and status register bits switch on off various aspects of the    PIXIE 4 operation  see the Channel CSRA Edit Panel reachable through the  Settings tab of the PIXIE 4 Viewer  In general  setting the bit activates the  option in question     36 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     Bit 0     Bit 1     Bit 2     Bit 3     Bit 4     Bit 5     Bit 6     Bit 7     Respond to group triggers only    Set this bit if you want to con
5.  16 bit words for     notifying the API the trace position and length information  Trace0    Ul6 malloc  traceposlen 1  2    if Trace0    NULL          Error handling               Trace0 0    traceposlen 0      position of the first trace  Trace0 1    traceposlen 1      length of the first trace          read out the first trace and put it into trace0  retval   Pixie Acquire Data 0x7003  trace0  DataFile  modnum     if  retval  lt  0         Error handling                  29 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     4 User Accessible Variables    User parameters are stored in the data memory space of the on board DSP  The organization  is that of a linear memory with 16 bit words  Subsequent memory locations are indicated by  increasing addresses  The data memory space  as seen by the host computer  starts at 0x4000     There are two sets of user accessible parameters  256 words in data memory are used to store  input parameters  These can and must be set properly by the user application  A second set of  160 words is used for results furnished by the PIXIE 4 module  These should not be  overwritten     As of this writing the start address for the input parameter block is InParAddr 0x4000 and  for the output parameter block it is OutParAddr 0x4100  i e  the two blocks are contiguous  in memory space  We provide an ASCII file named PXIcode var which contains in a 2   column format the offset and name of every user accessible variable  We sugge
6.  Handling   0 Success None    1 Null pointer for User Par Values   Check User Par Values   2 Invalid user parameter name Check User Par Name  3 Invalid user parameter type Check User Par Type   4 Invalid T O direction Check direction    5 Invalid Pixie module number Check ModNum    6 Invalid Pixie channel number Check ChanNum       Usage example    Ul6 direction  modnum  channum     S32 retval    direction   0     download  modnum   0     Module  0  channum   1     Channel  1                set module parameter COINCIDENCE PATTERN to OxFFFF  Module Parameter Values Coincidence Pattern Index  0xFFFF                                                        download COINCI DENCE PATTERN to the DSP  retval   Pixie User Par IO Module Parameter Values    COINCIDENCE PATTERN      MODULE     direction  modnum  channum       if  retval  lt  0           error handling                  set channel parameter ENERGY RISETIME to 6 0 us                         7 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved                       Channel Parameter Values  ENERGY RISETIME Index  6 0       download ENERGY RISETIME to DSP   retval   Pixi _User Par IO Channel Parameter Values     ENERGY RISETIME        CHANNEL     direction  modnum  channum                                                                   if  retval  lt  0         error handling            8 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     Pixie_Acquire_Data       Syntax  S32 Pixie 
7.  a data run  0x3000 stop a data run  0x4000 poll run status  0x5000 read histogram data and save it to a file  0x6000 read list mode buffer data and save it to a file  0x7000 offline list mode data parse routines  0x7001 parse list mode data file  9 PIXIE 4 Programmer   s Manual V1 41    O XIA 2007  All rights reserved     0x7002 locate traces    0x7003 read traces  0x7004 read energies  0x7005 read PSA values  0x7006 read extended PSA values  0x7007 locate events  0x7008 read event  0x8000 manually read MCA histogram from a MCA file  0x9000 external memory  EM  I O  0x9001 read histogram memory section of EM  0x9002 write to histogram memory section of EM  0x9003 read list mode memory section of EM  0x9004 write to list mode memory section of EM    User_data has the following format for the run types listed below   0x4  Get ADC traces  Length must be ADCTraceLen NumberOfChannels  i e  8192   4   32k   All array elements are return values   the Nth 8k of data are the ADC trace of channel N     0x7001  Parse list mode data file  Length must be 2  MaxNumModules  i e  16 or 34  All array elements are return values   User_data i    NumEvents of module i  User_data itMaxNumModules    TotalTraces of module I       0x7002  Locate Traces of all events  Length must be  TotalTraces of ModNum  3 NumberOfChannels  All array elements are return values   User_data i 3n   Location of channel n   s trace in file for event i  word number   User_data i 3n 1    length of channel n   s trace  Us
8.  and the  permissible use of resources     6 4 The interface    The interface consists of five routines and a number of global variables  Data exchange with  the host computer is achieved via two data arrays that are part of the I O parameter blocks  visible to the host     The total amount of memory available to the user comprises 2048 instructions and 1000 data  words     Host interface as supported by the PIXIE Viewer     UserIn  16  16 words of input data  UserOut 16  16 words of output data    Interface DSP routines     UserBegin    This routine is called after rebooting the DSP  Its purpose is to establish values for variables  that need to be known before the first run may start  Address pointers to data buffers  established by the user are an example  The host will need to know where to write essential  data to before starting a run     Since the DSP program comes up in a default state after rebooting UserBegin will always be  called  This is different for the routines listed below  which will only be called if for at least  one channel bit 0 of ChannelCSRB has been set     52 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     UserRunInit    This function is called at each run start  for new runs as well as for resumed runs  The  purpose is to precompute often needed variables and pointers here and make them available  to the routines that are being called on an event by event basis  The variables in question  would be those that depend on setti
9.  direction  modnum  channum     if  retval  lt  0          Error handling                  T        retval   Pixie User Par IO System Parameter Values   SLOT WAVE     SYSTEM   direction  modnum  channum     if  retval  lt  0         Error handling                     boot PIXIE 4 modules   retval   Pixie Boot _System 0x1F    if  retval  lt  0            Error handling                     set current module and channel number  Pixie Set Current ModChan 0  0         22 PIXIE 4 Programmer   s Manual V1 41  O XIA 2007  All rights reserved     3 2 Setting DSP variables    The host computer communicates with the DSP by setting and reading a set of variables  called DSP I O variables  These variables  totally 416 unsigned 16 bit integers  sit in the first  416 words of the data memory  The first 256 words  which store input variables  are both  readable and writeable  while the remaining 160 words  which store pointers to various data  buffers and run summary data  are only readable  The exact location of any particular  variable in the DSP code will vary from one code version to another  To facilitate writing  robust user code  we provide a reference table of variable names and addresses with each  DSP code version  Included with your software distribution is a file called PXIcode var  It  contains a two column list of variable names and their respective addresses  Thus you can  write your code such that it addresses the DSP variables by name  rather than by fixed  location     It 
10.  for the output data structure  If the bit is 1  up to six values are incorporated   overwriting the XIA PSA value  the USER PSA value  and the reserved word in the channel  header  If the run type compresses the standard nine channel header words  the number of  user return values is reduced accordingly  i e only 2 words are available in RunTask 0x102 or  0x202  and no words in RunTask 0x103 or 0x203      53 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     When entering UserChannel or UserEvent the address register 15 will point to the start of the  current event     Register usage     The user routines may use all computational registers without having to restore them   However  the secondary register set cannot be used  because the XIA interrupt routines use  these     The usage of the address registers I0  I7 and the associate registers M0  M7  and LO  L7 is  subject to restrictions  These are listed below for the various routines     The associate registers L M are preset and guaranteed as follows     LO  L7   0   MO   0  MI   1  M2  1    M4   0  M5   1  M6  1    M3 and M7 have no guaranteed values     UserBegin  UserRunInit  and UserRunFinish   No further restrictions  but user code must leave the associated registers listed above in  exactly this state when exiting                                   UserChannel    15 16 17 These registers may not even temporarily be overwritten  because there  L5 L6  are interrupt functions  which depend on the 
11.  never assume  to find any given buffer at a fixed address     Note that addresses in the DSP data memory fall into the range from 0x4000 to Ox7FFF  The  word length in data memory is 16 bit  If an address falls in the range from 0 to 0x3FFE  it  points to a location in program memory  Here the word lengths are 24 bits     USEROUT  16 words of user output data  which may be used by user written DSP code     AOUTBUFFER  Address of the list mode data buffer   LOUTBUFFER  Number of words in the list mode buffer     AECORR  unused  reserved  LECORR  unused  reserved     Formerly address and length of an array containing coefficients for energy  calculations  Now these coefficients are calculated in the DSP code from the  decay time     ATCORR  unused  reserved  LTCORR  unused  reserved    Formerly address and length of an array containing coefficients for  normalization and time of arrival corrections  Now these coefficients are  calculated in the DSP code from the decay time     HARDWAREID  ID of the hardware version   HARDVARIANT  Variant of the hardware   FIFOLENGTH  Length of the onboard FIFOs  measured in storage locations   FIPPIID  ID of the FiPPI FPGA configuration   FIPPIVARIANT  Variant of the FiPPI FPGA configuration    INTRFCID  ID of the system FPGA configuration  INTRFCVARIANT  Variant of the system FPGA configuration    DSPRELEASE  _ DSP software release number  DSPBUILD  DSP software build number    The following channel variables contain run statistics  Again the
12.  root results  MCAsum    Wave root results traceO  Wave root results tracel  Wave root results trace2  Wave root results trace3  Wave root results eventposlen  Wave root results eventwave    NewDataFolder o root user       Channel 0 histogram     Channel 1 histogram     Channel 2 histogram     Channel 3 histogram       Sum histogram       channel 0 list mode trace      channel 1 list mode trace      channel 2 list mode trace      channel 3 list mode trace      contains trace location  in list mode file      contains selected list mode event      create the folder for variables defined by user  Variable G root user UserVersion    the version of the user function calls defined by XIA  Variable G root user UserVariant    the variant of the code written by the user    57    PIXIE 4 Programmer   s Manual V1 41       XIA 2007  All rights reserved     
13.  the MCA run   retval   Pixie Acquire Data 0x3301  User Data           modnum     if  retval  lt  0                  Error handling            save MCA spectrum to a file   retval   Pixie Acquire Data 0x5301  User Data      C   XIA  Pixie4  MCA Data0001 bin     modnum      if  retval  lt  0                  Error handling            read out the MCA spectrum and put it to array User data  retval   Pixie Acquire Data 0x9001  User data           modnum     if  retval  lt  0                  Error handling         Note that in clover addback mode  the spectrum length is fixed to 16K for each channel plus  16K of addback spectrum  Therefore  the starting address ofthe MCA spectrum in the  external memory for Channel  0  1  2 and 3 will be 0x00000000  0x000040000  0x00008000   0x00010000  respectively  for the addback spectrum it is 0x00018000     3 3 2 Access list mode data    The list mode data in the linear output data buffer can be written in a number of formats   User code should access the three variables BUFHEADLEN  EVENTHEADLEN  and  CHANHEADLEN in the configuration file of a particular run to navigate through the data  set     There are two data buffers to choose from  the DSP   s local I O buffer  8K 16 bit words   and  section of the external memory  128K 32 bit words   The target data buffer is selected by  setting bit 1 in the variable MODCSRA     If the external buffer is chosen to hold the output data  the local buffer is transferred to the  external memory when it 
14.  variable names carry the  channel number as a suffix  For example the LIVETIME words for channel 2 are  LIVETIMEA2  LIVETIMEB2  LIVETIMEC2  Channel numbers run from 0 to 3     46 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     LIVETIMEA    LIVETIMEB    LIVETIMEC  Total live time as measured by the trigger filter FPGA of that channel  It  excludes times during which the FPGA was prevented from sending triggers  due to ongoing DSP data reads  or when the run was stopped  Convert the  three LiveTime words into a live time using the formula     LiveTime    LiveTimeA   6553612   LiveTimeB   65536   LiveTimeC     16 13 3ns    FASTPEAKSA  The number of events detected by the fast filter is   FASTPEAKSB  NumEvents   FASTPEAKSA 65536   FASTPEAKSB    ADCPERDACA  Gain variable   ADCPERDACB  Both words currently unused  but reserved    47 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     5 Control Tasks    The DSP can execute a number of control tasks  which are necessary to control hardware  blocks that are not directly accessible from the host computer  The most prominent tasks are  those to set the DACs  program the trigger filter FPGAs and read the histogram memory  The  following is a list of control tasks that will be of interest to the programmer     To start a control task  set RUNTASK 0 and choose a CONTROLTASK value from the list  below  Then start a run by setting bit 0 in the control and status register  CSR      Control task
15.  vas esac issue a odes caia 30  427    Channel variablesiisezssicasi ana a E Mantes E e E E EE RA 36  Control TasKS uu ds 48  Appendix A     User supplied DSP code     ooooonoocnnoccoocccoonnononconncconocono nono nconccconocananonnnos 51  Gedy troduction a A A A E E E AE E 51  6 2 The development environment tad rd da aia 51  6 3 Interfacing user code to XIA   s DSP COd6    oooooncccnococonncononononconncconocono nono cconccco nacion 51  6 4  o 8b    cee epee ee RO a eg Te ee E er eae ee 52  6 50  Debugging tools ana 55  Appendix B     User supplied Igor code       ooooocccnococonociconononconccconoconn nono cconccco no conc nnnnnno 55  TL  igor A A a E a rats us aoe a A E 55  T2 Teo User Panels iaaa a 56  Ea   Igor User VanablEsian cn 56  11 PIXIE 4 Programmer   s Manual V1 41    O XIA 2007  All rights reserved     1 Overview    This manual is divided into three major sections  The first section is a description of the  PIXIE 4 application program interface  API   Advanced users can build their own user  interface using these API functions  The second section is a reference guide to program the  PIXIE 4 modules using the PIXIE 4 API  This will be interesting to those users who want to  integrate the PIXIE 4 modules into their own data acquisition system  The third section  describes those user accessible variables that control the functions of the PIXIE 4 modules   Those advanced and curious users can use this section to better understand the operation of  the PIXIE 4  Addi
16. 8     Bit 9     Bit 10     Bit 11        Bit 2 Bit 15 Function       0 0 Triggers are distributed within module only  no connection to backplane       1 0 Module shares triggers using bussed wire OR line  In systems with less  than 8 modules and no PXI bridge boundaries  all modules sharing trigger  should be set this way       0 1 Module receives triggers from master trigger lines  but uses neighboring  lines to distribute triggers from right to left  In systems with more than 7  modules and orPXI bridge boundaries  all modules except the leftmost  should be set this way          1 1 Module puts own triggers and triggers received from right neighbor on  the master trigger lines and responds to triggers on master trigger line  In  systems with more than 7 modules and orPXI bridge boundaries  the  leftmost module should be set this way             If set  compute sum of channel energies for events with more hits in more than  one channel and put into addback spectrum    If set  spectra for individual channels contain only events with a single hit   Only effective if bit 3 is set also     If set  use signal on front panel input    DSP OUT     between channel 1 and 2   and distribute on backplane to all modules as Veto signal  GFLT   Note that  only one module may enable this options to avoid a conflict on the backplane     If set  send  hit status from left  AND  local hit status  to right neighbor  else  only send local hit status only  The hit status is    1        in each ev
17. Acquire Data     U16 Run_Type     Data acquisition run type   U32  User data     An unsigned 32 bit integer array containing the     data to be transferred   U8  file name     Name of the file used to store list mode or MCA     histogram data   U8 ModNum       The number of the Pixie module    Description    Use this function to acquire ADC traces  MCA histogram  or list mode data  The string  variable file_name needs to be specified when stopping a MCA run or list mode run in order  to save the data into a file  or when calling those special list mode runs to retrieve list mode  data from a saved list mode data file  In all other cases  file name can be specified as an  empty string  The unsigned 32 bit integer array User data is only used for acquiring ADC  traces  control task 0x4   reading out list mode data or MCA spectrum  In all other cases   User_data can be any unsigned integer array with arbitrary size  Make sure that User_data  has the correct size and data type before reading out ADC traces  list mode data  or MCA  spectrum     Parameter description    Run_Type is a 16 bit word whose lower 12 bit specifies the type of either data run or control  task run and upper 4 bit specifies actions  start stop poll  as described below     Lower 12 bit   0x100 0x101 0x102 0x103 list mode runs  0x200 0x201 0x202 0x203 fast list mode runs    0x301 MCA run  0x1   gt  0x15 control task runs  Upper 4 bit   0x0000 start a control task run  0x1000 start a new data run  0x2000 resume
18. NGTH  The rise time of the trigger filter depends on FastLength     FASTGAP     RiseTime   FastLength   13 3 ns    Note the constraint  FastLength  lt  32   The flat top of the trigger filter depends on FastGap   FlatTop   FastGap   13 3 ns     There is a constraint concerning the sum value of the two parameters   FastLength   FastGap  lt  32    PEAKSAMPLE  This variable determines at what time the value from the energy filter    PEAKSEP     will be sampled  Note that the following formulae depend on the filter range     Filter Range   0  PeakSample   max 0  SlowLength   Slow Gap     7   Filter Range   1  PeakSample   max 2  SlowLength   Slow Gap     4   Filter Range   2  PeakSample   SlowLength   Slow Gap     2   Filter Range  gt   3  PeakSample   SlowLength   Slow Gap     1       If the sampling point is chosen poorly  the resulting spectrum will show  energy resolutions of 10  and wider rather than the expected fraction of a  percent  For some parameter combinations PeakSample needs to be varied by  one or two units in either direction  due to the pipelined architecture of the  trigger filter FPGA     This value governs the minimum time separation between two pulses  Two  pulses that arrive within a time span shorter than determined by PeakSep will    be rejected as piled up     The recommended value is  PeakSep   PeakSample 5    39 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     If PeakSep gt 33  PeakSep PeakSample 1  Note the constraint  0  lt  
19. PeakSep   PeakSample  lt  7  FASTADCTHR  Reserved     FASTTHRESH  This is the trigger threshold used by the trigger filter FPGA  The value  relates to a trigger threshold through the formula     FASTTHRESH   TriggerThreshold   FASTLENGTH  The TriggerThreshold can be set on the Settings tab of the PIXIE 4 Viewer   MINWIDTH  Unused     MAXWIDTH  This value aids the pile up inspector  MaxWidth is the maximum duration   in sample clock ticks  13 3 ns   which the output from the fast filter may  spend over threshold  Pulses longer than that will be rejected as piled up  The  recommended setting is Max Width   FastLength   FastGap    SignalRiseTime 13 3 ns     Note the constraint Max Width  lt  256    Setting Maxwidth 0 switches this part of the pile up inspector off  Indeed it  is recommended to begin with MaxWidth 0  Once the other parameters have  been optimized  one can use the MaxWidth cut to improve the pile up  rejection at high count rates  Maxwidth should be tuned by observing the  main energy peak in the spectrum for fixed time intervals  Once the   Max Width cut is too tight there will be a loss of efficiency in the main peak   Setting Max Width to such a value that the efficiency loss in the main peak is  acceptable will give the best overall performance in terms of efficiency and  pile up rejection     PAFLENGTH  A FIFO control variable that needs to be written into the trigger  filter  FPGA  Using the programmable almost full register we can time the  waveform capturi
20. Programmer s Manual  Digital Gamma Finder  DGF     PIXIE 4    Version 1 41  February 2007    XIA LLC    31057 Genstar Road  Hayward  CA 94544 USA    Phone   510  401 5760  Fax   510  401 5761  http   www xia com       Disclaimer    Information furnished by XIA is believed to be accurate and reliable  However  XIA assumes  no responsibility for its use  or for any infringement of patents  or other rights of third parties   which may result from its use  No license is granted by implication or otherwise under the  patent rights of XIA  XIA reserves the right to change the DGF product  its documentation   and the supporting software without prior notice     Table of Contents    Nn       o O a a n a a e a A a a E cares 1  PAE A AR Dy sic egy asses tain scih tay ii 1  Pane  Hand Down Names O 3  Pixie BOSSA E 5  Pixie User Parla das 6  Pixie   Acquire Dita ao 9  Pixie  Set Current MA sa 15  A A E au saa bettas 16  Options for Compiling PIXIE4A APT ansia idea 19  Control PIXIE 4 Modules via CompactPCl  oooonoccnicccinccconccconoconcnonnnconccconocanononncconncnnns 20  A O A genau E E E A E N 20  3 1 1 Initialize Global Variables UNS ld oasis 20  3 1 2 Boot PIXIE Modules e a a Ra 21  3 20 Setting DSP variabl  s it aaa 23  3 3 Access spectrum memory or list mode data    ooooonnccnnccinccconcnconncconoconn nono nonnncconacnnns 25  3 3 1 Access spectrum MEMO iS 25  3 3 2 Access  list mode datdie adas 26  User Accessible Variables NA aii A A a a aeons 30  4 1    DMI parameters aiem een e
21. Trace0     point to the first trace in the file  direction   0     download   modnum   0     Module  0   channum   0     Channel  0       start a general list mode run   retval   Pixie Acquire Data 0x1100  List Data           modnum    if  retval  lt  0                   Error handling            wait until run has ended  while    Pixie Acquire Data 0x4100  List Data           modnum              read out the list mode data and save it to a file   retval   Pixie Acquire Data 0x6100  List Data  DataFile  modnum     if  retval  lt  0                  Error handling               parse list mode file   retval   Pixie Acquire Data 0x7001  List Data  DataFile  modnum     if  retval  lt  0                Error handling            totaltraces   0        28 PIXIE 4 Programmer   s Manual V1 41  O XIA 2007  All rights reserved     for  i 0  i lt MAX NUMBER _OF MODULES  i                sum the total number of traces for all modules  totaltraces    List Data i  MAX NUMBER OF MODULES                       allocate memory to hold the starting address  trace length  and     energy of each trace  therefore  3 32 bit words are needed for each     trace         traceposlen    U32 malloc totaltraces 3 NUMBER OF CHANNELS     if  traceposlen    NULL          Error handling                  locate traces in the data file  retval   Pixie Acquire Data 0x7002  traceposlen  DataFile  modnum     if  retval  lt  0          Error handling                  allocate memory to hold the first trace  2 extra
22. WAIT  IN SYNCH Read Write   N A INSYNCH  RUN TYPE Write only N A RUNTASK  FILTER RANGE Read Write N A FILTERRANGE  BUFFER HEAD LENGTH Read only N A BUFHEADLEN  EVENT HEAD LENGTH Read only N A EVENTHEADLEN  CHANNEL HEAD LENGTH Read only N A CHANHEADLEN  OUTPUT BUFFER LENGTH Read only N A LOUTBUFFER  NUMBER EVENTS Read only N A NUMEVENTSA  NUMEVENTSB  RUN_TIME Read only s RUNTIMEA  RUNTIMEB   RUNTIMEC  BOARD VERSION Read only N A N A  SERIAL NUMBER Read only N A N A  Channel Parameter _ Names I O Type   Unit Corresponding DSP Variables  CHANNEL CSRA Read Write   N A CHANCSRA  CHANNEL CSRB Read Write   N A CHANCSRB  ENERGY RISETIME Read Write us SLOWLENGTH  ENERGY FLATTOP Read Write us SLOWGAP  TRIGGER RISETIME Read Write us FASTLENGTH  TRIGGER FLATTOP Read Write us FASTGAP  TRIGGER THRESHOLD Read Write   N A FASTTHRESH  VGAIN Read Write   V V GAINDAC  24 PIXIE 4 Programmer   s Manual V1 41       XIA 2007  All rights reserved                                                                                                     VOFFSET Read Write V TRACKDAC   TRACE LENGTH Read Write   us TRACELENGTH   TRACE DELAY Read Write us TRIGGERDELAY   PSA START Read Write   us PSAOFFSET   PSA END Read Write us PSALENGTH   EMIN Read Write N A ENERGYLOW   BINFACTOR Read Write   N A LOG2EBIN   TAU Read Write us PREAMPTAUA  PREAMPTAUB   BLCUT Read Write N A BLCUT   XDT Read Write N A XWAIT   BASELINE PERCENT Read Write N A BASELINEPERCENT   CFD THRESHOLD Read Write N A CFDTHR   INTEGRATOR Read Wr
23. _Acquire_Data  By setting different run types  it can be used to start  stop or poll a  data acquisition run  list mode run  MCA run  or special task runs like acquiring ADC  traces   It can also be used to retrieve list mode or histogram data from the Pixie modules     After checking the quality of a MCA spectrum  a Pixie user may decide to change one or  more settings like energy filter rise time or flat top  The function used to change Pixie  settings is Pixie User_Par_IO  This function converts a user parameter like energy filter  rise time in us into a number understood by the Pixie hardware or vice versa     Another function  Pixie_Buffer_IO  is used to read data from DSP   s internal memory to the  host or write data from the host into the internal memory  This is useful for diagnosing Pixie    1 PIXIE 4 Programmer   s Manual V1 41  O XIA 2007  All rights reserved     modules by looking at their internal memory values  The other usage of this function is to  read  save  copy or extract Pixie   s configurations though its settings files     In a multi module Pixie 4 system  it is essential for the host to know which module or  channel it is communicating to  The function Pixie _Set_Current_ModChan is used to set    the current module and channel     The detailed description of each function is given below     2 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     Pixie_Hand_Down_Names       Syntax   S32 Pixie Hand Down Names    U8  Names       An ar
24. anel input    DSP OUT    to the Status backplane  line   Note that Status is defined as active low  so a logic 1  3 3V  at the front  panel corresponds to a logic 1  OV  on the Status line   Since Status is a wire   OR line  more than one module may enable this option at the same time  It  also can enabled at the same time as the Veto option if necessary     If set  the front panel input    DSP out    is connected as an input to the    Status     line on the backplane  The Status line is set up as a wire OR  so more than one  module can enable this option     Controls sharing of triggers over backplane  See bit 2     Execute user code routines programmed in user dsp     Reserved for user code     MODFORMAT  List mode data format descriptor  Currently it is not in use     CHANNUM  The chosen channel number of a Pixie module  Mainly used by the host to set  the designated channel     RUNTASK  This variable tells the Pixie 4 what kind of run to start in response to a run  start request  Nine run tasks are currently supported                                                  RunTask Mode Trace CHANHEADLEN  Capture   0 Slow control run N A N A  256  0x100    Standard list mode Yes 9  257  0x101    Compressed list mode Yes 9  258  0x102    Compressed list mode Yes 4  259  0x103    Compressed list mode Yes 2  512  0x200    Standard fast list mode No 9  513  0x201    Compressed fast list mode   No 9  514  0x202    Compressed fast list mode   No 4  515  0x203    Compressed fast list mo
25. arameters  Bit 4  Apply DSP parameters  call Set_ DACs and Program _FIPPI     Under most of the circumstances  all the above tasks should be executed to initialize the Pixie  modules  i e  the Boot_Pattern should be Ox1F     Return values                                                 Value   Description Error Handling   0 Success None    1 Unable to scan crate slots Check PXI slot map    2 Unable to read communication FPGA configuration  Rev  B    Check comFPGA file    3 Unable to read communication FPGA configuration  Rev  C    Check comFPGA file    4 Unable to read signal processing FPGA configuration Check SPFPGA file    5 Unable to read DSP executable code Check DSP code file    6 Unable to read DSP parameter values Check DSP parameter file   7 Unable to initialize DSP parameter names Check DSP  var file    8 Failed to boot all modules present in the system Check Pixie modules       Usage example  S32 intval        retval   Pixie Boot System 0x1F    if ret  lt  0           error handling         5 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     Pixie User Par_lO             Syntax  S32 Pixie User Par IO     double  User Par Values     A double precision array containing the     user parameters to be transferred   U8  User Par Name     A string variable indicating which user     parameter is being transferred   U8  User Par Type     A string variable indicating which type     of user parameters is being transferred   Ul6 Direction     1 0 direct
26. contents of these registers   M0 M1 M2 M4 M5 M6   10 11 13 14 These registers may be altered  but must be restored on exit   L0 L1 L2 L3 L4 L7   I2 These registers may be altered and need not be restored   M3 M7   UserEvent    15 16 17 These registers may not even temporarily be overwritten  because there  L5 L6  are interrupt functions  which depend on the contents of these registers   M0 M1 M2 M4 M5 M6   14 These registers may be altered  but must be restored on exit   L0 L1 L2 L3 L4 L7   10 11 12 13 These registers may be altered and need not be restored   M3 M7          54 PIXIE 4 Programmer   s Manual V1 41  O XIA 2007  All rights reserved           6 5 Debugging tools    Besides the debugging tools that are accessible through the PIXIE 4 Viewer  it is also  possible to download data into the PIXIE data buffers and call the event processing routine   This allows for an in situ test of the newly written code and allows exploring the valid  parameter space systematically or through a Monte Carlo from the host computer  For this to  work the module has to halt the background activity of continuous base line measuring  Next   data have to be downloaded and the event processing started  When done the host can read  the results from the known address     The process is fairly simple  The host writes the length of the data block that is to be  downloaded into the variable XDATLENGTH  Then the data are written to the linear output  buffer  the address and length of which are giv
27. d I O type Check type             Usage example  S32 retval     U8 type     modnum   0     direction  modnum        Module number       Download DSP parameters to the current Pixie module  DSP Values is a       pointer pointing to the DSP parameters  no need to specify file name       here   direction   0     Write  type   0     DSP I O values    direction        retval   Pixie Buffer IO DSP Values     type     if  retval  lt  0                  Read          Error handling             wi      modnum       DSP memory values from the current PIXIE module  Memory Values       is a pointer pointing to the memory block  no need to specify file     name Here   direction   1     Read  type   1     DSP memory values  retval   Pixie Buffer IO Memory Values  type  direction          modnum     17 PIXIE 4 Programmer   s Manual V1 41       XIA 2007  All rights reserved        if  retval  lt  0         Error handling               18 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     Options for Compiling PIXIE 4 API    Pixie 4 API can be compiled as either a WaveMetrics Igor XOP file which is currently used  by the Pixie 4 Viewer  a dynamic link library  DLL  or static library  The two latter options  can be used by advanced users to integrate Pixie modules into their own data acquisition    systems     The following table summarizes the required files for these options     Table 2 3  Options for compiling the PIXIE 4 C Driver                             Compilati
28. de   No 2  769  0x301    MCA mode No N A       32    PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved        RunTask 0 is used to request slow control tasks  These include programming  the trigger filter FPGAs  setting the DACs in the system  transfers to from the  external memory  and calibration tasks     RunTask 256  0x100  requests a standard list mode run  In this run type all  bells and whistles are available  The scope of event processing includes  computing energies to 16 bit accuracy  and performing pulse shape analyses  for improved energy resolution and better time of arrival measurements  Nine  words of results  including time of arrival  energy  XIA pulse shape analysis   user pulse shape analysis  etc  are written into the I O buffer for each channel   Level 1 buffer is not used in this RunTask     RunTask 257  0x101  requests a compressed list mode run  Both Level 1  buffer and I O buffer are used in this RunTask  but no traces are written into  the I O buffer  Nine words of results  including time of arrival  energy  XIA  pulse shape analysis  user pulse shape analysis  etc  are written into the I O  buffer for each channel     RunTask 258  0x102  requests a compressed list mode run  The only  difference between RunTask 258 and 257 is that in RunTask 258  only four  words of results  time of arrival  energy  XIA pulse shape analysis  user pulse  shape analysis  are written into the I O buffer for each channel     RunTask 259  0x103  reques
29. ecuted  It is used to  communicate addresses and lengths of buffers  local to the user code  to the host  The host  finds this information in the USEROUT 16  buffer described in the main section of this  document  The calling of UserBegin is not maskable  All other functions that are part of the  user interface will be called only if bit 0 of MODCSRB is set at the time     51 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     When a run starts  the DSP executes a run start initialization during which it will call  UserRunInit  It may be used to prepare data for the event procesing routines     When events are processed by the DSP code it may call user code in two different instances   Events are processed one channel at the time  For each channel with data  UserChannel is  called at the end of the processing  but before the energy is histogrammed  UserChannel has  access to the energy  the acquired wave form  the trace  and is permitted one return value   This is the routine in which custom pulse shape analysis will be performed     After the entire event  consisting of data from one to four channels  has been processed the  function UserEvent may be called  It may be used in applications in which data have to be  correlated across channels     At the end of a run the closing routine may call UserRunFinish  typically for updating  statistics and similar run end tasks     The above mentioned routines are described below  including the interface variables
30. eeds to have the  complete file path     ModNum is the number of the module addressed  counting from 0 to  number of  modules   1   If ModNum     number of modules   all modules are addressed in a for loop   however this option is not valid for all RunTypes     Return values    Return values depend on the run type     Run type   0x0000       11 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved                                Value   Description Error Handling  0 Success None    0x1 Invalid Pixie module number Check ModNum   0x2   Failure to adjust offsets Reboot the module   0x3   Failure to acquire ADC traces Reboot the module   0x4 Failure to start the control task run   Reboot the module       Run type   0x1000                         Value   Description Error Handling  0x10 Success None    0x11   Invalid Pixie module number   Check ModNum   0x12   Failure to start the data run Reboot the module             Run type   0x2000                         Value   Description Error Handling  0x20 Success None    0x21   Invalid Pixie module number   Check ModNum   0x22   Failure to resume the data run   Reboot the module          Run type   0x3000                         Value   Description Error Handling  0x30 Success None    0x31   Invalid Pixie module number   Check ModNum   0x32   Failure to end the run Reboot the module          Run type   0x4000                                                                   Value Description Error Handling   0 No run is 
31. en entries the DAC value is incremented in steps of 32     An examination of the results will reveal a linearly rising or falling  response of the ADC to the DAC increments  The slope depends on    48 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     ControlTask 4     ControlTask 5     ControlTask 6     the trigger polarity setting  1 e   bit 5 of the channel control and status  register A  ChanCSRA   For very low and very big DAC values the  ADC will be driven out of range and an unpredictable  but constant  response is seen  From the sloped parts a user program can find the  DAC value that is necessary for a desired ADC offset  It is  recommended  that for unipolar signals an ADC offset of 1638 units is  chosen  For bipolar signals  like the induced waveforms from a  segmented detector  the ADC offset would be 8192 units  1 e   midway  between 0 and 16384     A user program would use the result from the calibration task to find   set and program the correct offset DAC values     Since the offset measurement has to take the preamplifier offset into  account  this measurement must be made with the preamplifier  connected to the PIXIE 4 input  The control task makes 16  measurements at each DAC step and uses the last computed DC offset  value to enter into the data buffer  Due to electronic noise  it may  occasionally happen that none of the sixteen attempts at a base line  measurement is successful  in which case a zero is returned  The user  software 
32. en in the variables AOUTBUFFER and  LOUTBUFFER  Next the user starts a data run  and reads the results after the run has ended     7 Appendix B     User supplied Igor code    Starting in version 1 38  Igor contains a number of user procedures that are called at certain  points in the operation  These user procedures are contained in a separate Igor procedure file     user ipf    that is automatically loaded when opening the Pixie Viewer  Pixie4 pxp   By  default  the user procedures do nothing  but they can be edited to perform custom functions   It is recommended that the modified procedures be    saved as    a new procedure file   user XXX ipf and the generic user ipf be removed     killed     from the main  pxp file     7 1 Igor User Procedures    The Igor user procedures called from the current version of the main code are listed below     Function User_Globals     This function is called from InitGlobals  It can be used to define and create global specific  for the user procedures    By default it creates a user variable    UserVariant    which can be used to track and identify  different user procedure code variants  Variant numbers 0x7FFF are reserved for user code  written by XIA     Function User_StartRun     This function is called at end of Pixie_StartRun  which is executed at beginning of a data  acquisition run  for runs with polling time gt 0  It can be used to set up customized runs  i e   initialize parameters etc     Function User_NewFileDuringRun     When Ig
33. ent     if a  module   s hit pattern matches the NNSHAREPATTERN defined by the user     If set  send  hit status from right  AND  local hit status  to left neighbor  else  only send local hit status only  The hit status is    1        in each event     if a  module   s hit pattern matches the NNSHAREPATTERN defined by the user     If set  perform module coincidence test during event acquisition    If set  and bit 8 set also   send a logic 1 to left neighbor if the channel hit  pattern matches the NNSHAREPATTERN and send a logic 0 if it does not  match  If bit 9 is not set  but bit 8 is set  always send a logic 0     If set  and bit 8 set also   send a logic 1 to right neighbor if the channel hit  pattern matches the NNSHAREPATTERN and send a logic 0 if it does not  match  If bit 10 is not set  but bit 8 is set  always send a logic 0     If set  and bit 8 set also   contribute a logic 1 to the Status backplane line if  the channel hit pattern matches the NNSHAREPATTERN  The backplane line  functions as a wire OR line  it is logic 1 if any module contributes a 1     31 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved        Bit 12     Bit 13     Bit 14     Bit 15     MODCSRB   Bit 0     Bits 1 15     If set  and bit 8 set also   contribute a logic 1 to the Token backplane line if  the channel hit pattern matches the NNSHAREPATTERN  The backplane line  functions as a wire OR line  it is logic 1 if any module contributes a 1     If set  contribute the front p
34. ent i  User_data i 8n 6    Unused3 word of channel n for event i  User_data i 8n 7    RealTimeHi word of channel n for event i          0x7007  Locate all events  Length must be  NumEvents of ModNum  3  All array elements are return values   User_data 1 3    Location of event i in file  word number   User_data 1 3 1    Location of buffer header start for event i in file  User_data 1 3 2    Length of event i  event header  channel header  traces        0x7008  Read one event  Length must be  length of selected event    7  36   this is longer than actually used  but ensures enough room for channel headers in all runtypes   First 3 elements are input values   User_data 0    Location of selected event in file  word number   User_data 1    Location of buffer header start for selected event in file  User_data 2    Length of selected event    The remaining array elements are return values   User_data 3    6  are the tracelengths of channel 0 3  User_data 7    6 BHL  contain the buffer header corresponding to the selected event  User_data 7 BHL    6 BHL EHL  contain the event header  User_data 7 BHL ELH    6 BHL EHL 4 CHL  are the channel headers for  channel 0 3  always 9 words per channel header  but in compressed runtypes  some entries are be invalid  User_data 7 BHL EHL 4 CHL      contain the traces of channel 0 3   followed by some undefined values  use tracelength to parse traces                    file_name is a string variable which specifies the name of the output file  It n
35. er_data 1 3n 2    energy for channel n          0x7003  Read Traces of one event  Length must be  NumberOfChannels 2 combined tracelength of channels   First  NumberOfChannels 2  elements are input values   User_data 2n    Location of channel n   s data in file for selected event  word number   User_data 2n 1   length of channel n   s trace       The remaining array elements are return values   User_data 8        Trace data of channel 0 followed by channels 1 2  and 3     0x7004  Read Energies of all events  Length must be  NumEvents of ModNum   NumberOfChannels    All array elements are return values   User_data 1 4 n    energy of channel n for event i       0x7005  Read PSA values of all events  Length must be  NumEvents of ModNum 2   NumberOfChannels    All array elements are return values           10 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     User_data i 2n   XIAPSA word of channel n for event i  User_data i 2n 1    UserPSA word of channel n for event i    0x7006  Read extended PSA values of all events   Length must be  NumEvents of ModNum 8   NumberOfChannels     All array elements are return values   User_data i 8n   timestamp word of channel n for event i  User_data i 8n 1    energy word of channel n for event i  User_data i 8n 2    XIAPSA word of channel n for event i  User_data 1 8n 3    UserPSA word of channel n for event i  User_data 1 8n 4    Unused  word of channel n for event i  User_data 1 8n 5    Unused2 word of channel n for ev
36. f URETVAL  Depending on the run type   this allows for 6  2 or 0 user return values in the channel header    Bit2  15  are reserved  Set to 0  Bits 2 and 3 are used in MPI custom code     The following two data words are used to set the on board DACs for this channel  Once a  new variable has been written to DSP memory the DACs have to be reprogrammed by  starting a run with RunTask 0 and ControlTask 0    GAINDAC  Reserved and not supported     TRACKDAC  This DAC determines the DC offset voltage  The offset can be calculated  using the following formula     Offset  V    2 5     32768   TRACKDAC    32768   SGA  The index of the relay combinations of the switchable gain amplifier     DIGGAIN  The digital gain factor for compensating the difference between the user   desired voltage gain and the SGA gain     UNUSEDAO or UNUSEDA1  Reserved     The following block of data contains trigger filter FPGA data  Once a new variable has been  written to DSP memory it has to be activated by starting a run with RunTask 0  Set DACs     38 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     and ControlTask 5  Program FiPPI      SLOWLENGTH  The rise time of the energy filter depends on SlowLength     RiseTime   SlowLength   2 FilterRange   13 3 ns    SLOWGAP  The flat top of the energy filter depends on SlowGap     FlatTop   SlowGap   2 FilterRange   13 3 ns   There is a constraint concerning the sum value of the two parameters     SlowLength   SlowGap  lt  127    FASTLE
37. follows    For a given dt  in us   calculate the integer intdt   dt 0 0133   If intdt gt 13  XAVG   floor  65536   intdt 3  5      If intdt lt  13  XAVG   65535     UNUSEDBO0 or UNUSEDBI  Reserved     CFDREG     Reserved for FPGA based constant fraction discriminator     LOG2BWEIGHT  The PIXIE measures baselines continuously and effectively extracts    DC offsets from these measurements  The DC offset value is needed to apply  a correction to the computed energies  To reduce the noise contribution from  this correction baseline samples are averaged in a geometric weight scheme   The averaging depends on Log2Bweight     DC_avg   DC    DC_avg DC    22LOG2BWEIGHT    DC is the latest measurement and DC_avg is the average that is continuously  being updated  At the beginning  and at the resuming  of a run  DC_avg is  seeded with the first available DC measurement     As before  the DSP ensures that LOG2BWEIGHT will be negative  The noise  contribution from the DC offset correction falls with increased averaging    The standard deviation of DC_avg falls in proportion to  sqrt 2   LOG2BWEIGHT      When using a BLCUT value from a noise measurement  cf control task 6  the  PIXIE will internally adjust the effective Log2Bweight for best energy  resolution  up to the maximum value given by LOG2BWEIGHT  Hence  the  Log2Bweight setting should be chosen at low count rates  dead time  lt  10     Best energy resolutions are typically obtained at values of  3 to  4  and this    43 PIXIE 4 Pro
38. grammer   s Manual V1 41     XIA 2007  All rights reserved     parameter does not need to be adjusted afterwards     PREAMPTAUA  High word of the preamplifier exponential decay time   PREAMPTAUB  Low word of the above   The two variables are used to store the preamplifier decay time  The time Tt is  measured in us  The two words are computed as follows     PREAMPTAUA   floor t    PREAMPTAUB   65536    t   PreampTauA   To recover t use    t   PREAMPTAUA   PREAMPTAUB   65536    This ends the block of channel input data  Note that there are four equivalent blocks of input  channel data  one for each PIXIE 4 input channel     We now show the output variables  again beginning with module variables and continuing  afterwards with the channel variables  The output data block begins at the address 0x4100   Note  however  that this address could change  The output data block comprises of 160  words  1 block of 32 is reserved for module data  4 blocks of 32 words each hold channel  data     REALTIMEA    REALTIMEB    REALTIMEC  The 48 bit real time clock  A B C are the high  middle and low word   respectively  The clock is zeroed on power up  and in response to a synch  interrupt when InSynch was set to 0 prior to the run start  This requires the  Busy  Synch loop to be closed  see the discussion above     RealTime   RealTimeA   655362   RealTimeB   65536   RealTimeC     13 3ns    RUNTIMEA    RUNTIMEB    RUNTIMEC  The 48 bit run time clock  A B C words are as for the RealTime clock  Thi
39. hape analysis  user pulse  shape analysis  are written into the I O buffer for each channel     RunTask 515  0x203  requests a compressed fast list mode run  The only  difference between RunTask 515 and 513 is that in RunTask 515  only two  words of results  time of arrival and energy  are written into the I O buffer for  each channel     RunTask 769  0x301  requests a MCA run  The raw data stream is always  sent to the level 1 buffer  independent of MODCSRA  The data gathering  interrupt routine fills that buffer with raw data  while the event processing  routine removes events after processing  If the interrupt routine finds the  level 1 buffer to be full  it will ignore events until there is room again in the  buffer  The run will not abort due to buffer full condition  This run type does  not write data to the I O buffer  The module variable MAXEVENTS should  be set to zero  to avoid early run termination due to a MAXEVENTS   exceeded condition     The RunTask can be chosen as the run type in the Run tab of the PIXIE 4  Viewer     CONTROLTASK  Use this variable to select a control task  Consult the control tasks  section of this manual for detailed information  The control task will be  launched when you issue a run start command with RUNTASK 0     MAXEVENTS  The module ends its run when this number of events has been acquired  In  PIXIE 4 Viewer  MAXEVENTS is automatically calculated when a run mode  is chosen from the run type pulldown menu  The calculation is based on 
40. has been filled  Then the run resumes automatically  without  interference from the host  until 32 local buffers have been transferred  The data can then be  read from external memory in a fast block read starting from location 0x00020000     If the local buffer is chosen  the run stops when the local buffer is filled  The data has to be  read out from local memory     26 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     With any data buffer  you can do any number of runs in a row  The first run would be started  as a NEW run  This clears all histograms and run statistics in the memory  Once the data has  been read out  you can RESUME running  Each RESUME run will acquire another either 32  or 1 8K buffers of data  depending on which buffer has been chosen  In a RESUME run the  histogram memory is kept intact and you can accumulate spectra over many runs  The  example code shown below illustrates this     An Example Code Illustrating How to Access List Mode Data    S32 retval    U8 direction  modnum  channum    U32 User Data 131072      an array for holding the MCA spectrum data of     4 channels   U16 k  Nruns    char  DataFile     C   XIA  PIXIE4  PulseShape  Data bin          direction   0     download   modnum   0     Module  0   channum   0     Channel  0   Nruns   10     10 repeated list mode runs  k   0     initialize counter       start a general list mode run  retval   Pixie Acquire Data 0x1100  User Data           modnum     if  retval  lt  0
41. hown in Table 2 1     Table 2 1  The Combination of User_Par_Name and User_Par_Values        User Par Values             User_Par_ Type                            Name Size Data Type  SYSTEM System Parameter_Values   64 Double precision  MODULE Module Parameter_Values   64x7 Double precision  CHANNEL Channel Parameter Values   64x7x4   Double precision          6 PIXIE 4 Programmer   s Manual V1 41  O XIA 2007  All rights reserved     The way to fill the Channel_Parameter_Values array 1s to fill the channel first then the module   For instance  first 64 values are stored in the array for channel 0  and then repeat this for  other three channels  After that  64x4 values have been filled for module 0  Then repeat this  for the remaining modules  For the Module_Parameter_Values array  first store 64 values for  module 0  and then repeat this for the other modules     User Par Name is the name of the variable which is to be transferred  It is one element of  either System Parameter Names  or Module_Parameter_Names  or  Channel Parameter_Names   direction indicates the transfer direction of parameters    0   download  write  parameters from the user interface to the API    1   upload  read  parameters from the API to the user interface     ModNum is the number of the Pixie module being communicated to     ChanNum is the channel number of the Pixie module being communicated to     Return values                                                                Value   Description Error
42. in progress N A   1 Run is in progress N A   CSR value   When run type   0x40FF N A    0x41 Invalid Pixie module number   Check ModNum  Run type   0x5000   Value   Description Error Handling   0x50   Success None    0x51   Failure to save histogram data to a file   Check the file name  Run type   0x6000   Value   Description Error Handling   0x60   Success None    0x61   Failure to save list mode data to a file   Check the file name                Run type   0x7000       12             PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved                                                  Value   Description Error Handling   0x70 Success None    0x71   Failure to parse the list mode data file   Check list mode data file   0x72   Failure to locate list mode traces Check list mode data file   0x73   Failure to read list mode traces Check list mode data file   0x74   Failure to read event energies Check list mode data file   0x75   Failure to read PSA values Check list mode data file   0x76   Failure to read extended PSA values Check list mode data file   0x77   Failure to locate events Check list mode data file   0x78   Failure to read events Check list mode data file   0x79   Invalid list mode parse analysis request   Check run type       Run type   0x8000          Value   Description Error Handling  0x80   Success None   0x81   Failure to read out MCA spectrum from the file   Check the MCA data file                         Run type   0x9000          Value   Desc
43. ion  read or write    US ModNum     Number of the module to work on   U8 ChaNum       Channel number of the Pixie module          Description    Use this function to transfer user parameters between the user interface  the API and DSP   s  I O memory  Some of these parameters  User Par Type      SYSTEM     are applicable to all  Pixie modules in the system  like the total number of Pixie modules in the system  Other  parameters  User Par Type      MODULE     are applicable to a whole Pixie module   independent of its four channels   e g  coincidence pattern  Module CSRA  etc  The final set  of parameters  User Par Type      CHANNEL     are applicable to each individual channel in a  Pixie module  e g  energy filter settings or voltage gain  etc  For those parameters which  need to be transferred to or from DSP   s internal memory  other parameters such as number  of modules are only used by the API   this function will call another function UA_PAR IO  which first converts these parameters into numbers that are recognized by both the DSP and  the API then performs the transfer              Parameter description    User_Par Values is a double precision array containing the parameters to be transferred   Depending on another input parameter User Par Type  different User Par Values array  should be used  Totally three User_Par_Values arrays should be defined and all of them are  one dimensional arrays  The corresponding relationship between User Par Values and  User Par Type is s
44. ite N A FTPWIDTH   LIVE_TIME Read only s LIVETIMEA  LIVETIMEB   LIVETIMEC   INPUT _COUNT_ RATE Read only cps FASTPEAKSA  FASTPEAKSB   FASTPEAKSC  LIVETIMEA   LIVETIMEB  LIVETIMEC   FAST PEAKS Read only N A FASTPEAKSA  FASTPEAKSB   FASTPEAKSC       3 3 Access spectrum memory or list mode data    3 3 1 Access spectrum memory    The MCA spectrum memory is fixed to 32K words  32 bits per word  per channel  residing  in the external memory  Therefore  the starting address of the MCA spectrum in the external  memory for Channel  0  1  2 and 3 will be 0x00000000  0x000080000  0x00010000   0x00018000  respectively  The reading out of the spectrum memory to the host is through the  PCI burst read at rates over 100 Mbytes s  The spectrum memory is accessible even when a  data acquisition run is in progress  The following code is an example of how to start a MCA  run and read out the MCA spectrum after the run is finished     An Example Code Illustrating How to Access MCA Spectrum Memory    S32 retval     U8 direction  modnum     channum        U32 User Data 131072      an array for holding the MCA spectrum data of     4 channels    direction   0     download  modnum   0     Module  0  channum   0     Channel  0       start a MCA run   retval   Pixie Acquire Data 0x1301  User Data           modnum     if  retval  lt  0             Error handling             25 PIXIE 4 Programmer   s Manual V1 41  O XIA 2007  All rights reserved             wait for 30 seconds  Sleep  30000          stop
45. la     B1   BIL B1H 65536  20 11 ERRANGES    BO   BOL B0H 65536   200 TP RRANCE S   TAU PreampTauA PreampTauB 65536  Baseline B 1 B0 exp    0 0133  SlowLength SlowGap  2  TRANGE  TAU        Baseline values can then be statistically analyzed to determine the  standard deviation associated with the averaged baseline value and to  set the BLCUT    BLCUT should be about 3 times the standard deviation  Baseline  values can also be plotted against time stamp or ADC value to explore  the detector performance  BLCUT should be set to zero while running  ControlTask 6     reserved    50 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     6 Appendix A     User supplied DSP code  6 1 Introduction    It is possible for users to enhance the capabilities of the PIXIE 4 by adding their own DSP  code  XIA provides an interface on the DSP level and has built support for this into the  PIXIE 4 Viewer  The following sections describe the interfaces and support features     6 2 The development environment    For the DSP code development  XIA uses and recommends version 5 or 6 of the assembler  and linker distributed by Analog Devices  Both versions are in use at XIA and work fine     It may be inconvenient  but is unavoidable to program the ADSP 2185 on board processor in  assembler rather than in a higher level programming language like C  We found that code  generated by the C compiler is bloated and consequently runs very slow  As the main piece  of the code could not be 
46. les are driven by a common clock  When InSynch is 1  the module  assumes it is in synch with the other modules and no particular action is taken  at run start  If this variable is 0  then all system timers are cleared at the  beginning of the next data acquisition run  RunTask gt 0   The timers are reset  when the entire system actually starts the run  After run start  InSynch is  automatically set to 1     A 4 word data block that is used to specify command options     Set this variable to 1 to resume a data run  otherwise  set it to 0   Set to 2 before stopping a list mode run prematurely     35 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     FILTERRANGE  The energy filter range downloaded from the host to the DSP  It sets the    number of ADC samples  2 FILTERRANGE  to be averaged before entering  the filtering logic  The currently supported filer range in the signal processing  FPGA includes 1  2  3  4  5 and 6     MODULEPATTERN  16 bit user defined number controlling which combination of    neighbor lines and backplane status lines are acceptable to record an event   Active only if bit 8 in MODCSRA is set     The bits in MODULEPATTERN correspond to the status of the neighbor and  backplane lines in a similar way as the COINCPATTERN relates to the  channel hit pattern  The four status lines  Token  Status  Right  Left  form a  number N from 0 to 16  A line combination is acceptable if bit N is set     For example  if both neighbor lines are logic
47. lowing variables affect internal MCA histogramming of the PIXIE 4 module     ENERGYLOW  Start energy histogram at ENERGYLOW  Only applies to list mode runs     LOG2EBIN  This variable controls the binning of the histogram  Energy values are    CFDTHR     PSAOFFSET     calculated to 16 bits precision  The LSB corresponds to 1 4  of a 14 bit  ADC  The PIXIEs  however  do not have enough histogram memory  available to record 64k spectra  nor would this always be desirable  The user  is therefore free to choose a lower cutoff for the spectrum  EnergyLow  and  control the binning  Observe the following formula to find to which MCA bin  a value of Energy will contribute     MCAbin    Energy EnergyLow    2 Log2Ebin   As can be seen  Log2Ebin should be a negative number to achieve the correct  behaviour  At run start the DSP program ensures that Log2Ebin is indeed  negative by replacing the stored value by  abs Log2Ebin      The histogramming routine of the DSP takes care of spectrum overflows and  underflows     This sets the threshold of the software constant fraction discriminator  The  threshold fraction  f  is encoded as Round f 65536   with 0 lt f lt 1     PSALENGTH  When recording traces and requiring any pulse shape analysis by the DSP     these two parameters govern the range over which the analysis will be  applied  The analysis begins at a point PSAOFFSET sampling clock ticks  into the trace  and is applied over a piece of the trace with a total length of  PSALENGTH clock 
48. modules in a Pixie system  e g  number of Pixie modules in the chassis  etc   System Parameter Names currently can hold 64 names  If less than 64 names are  needed  which is the current case   the remaining names should be defined as empty  strings  A detailed description of System_Parameter_Names is given in Table 3 5     3  MODULE  This indicates we are downloading Module Parameter Names   Module Parameter Names are those global variables that are applicable to each  individual module  e g  module number  module CSR  coincidence pattern  and run  type  etc  Module Parameter Names can currently hold 64 names  If less than 64  names are needed  which is the current case   the remaining names should be defined  as empty strings  A detailed description of Module Parameter Names is given in  Table 3 5     3 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     4  CHANNEL  This indicates we are downloading Channel Parameter Names   Channel Parameter Names are those global variables that are applicable to  individual channels of the Pixie modules  e g  channel CSR  filter rise time  filter flat  top  voltage gain  and DC offset  etc  Channel_Parameter_Names currently can hold  64 names  If less than 64 names are needed  which is the current case   the remaining  names should be defined as empty strings  A detailed description of  Channel Parameter Names is given in Table 3 5     Return values       Value    Description    Error Handling       0    Success    No
49. must be able to cope with an occasional deviation from the  expected straight line     On exit  the task restores the offset DAC values to the values they had  on entry     Untriggered Traces   This task provides ADC values measured on all four channels and  gives the user an idea of what the noise and the DC levels in the  system are  This function samples 8192 ADC words for the channel  specified in CHANNUM  The XWAIT variable determines the time  between successive ADC samples  samples are XWAIT   13 3ns  apart   In the PIXIE 4 Viewer XWAIT can be adjusted through the dT  variable in the Oscilloscope panel  The results are written to the 8192  words long I O buffer  Use this function to check if the offset  adjustment was successful     From the PIXIE 4 Viewer this function is available through the  Oscilloscope Panel  Hit the Refresh button to start four consecutive  runs with ControlTask 4 in the selected module  one for each channel     ProgramFiPPI  This task writes all relevant data to the FiPPI control registers     Measure Baselines  This routine is used to collect baseline values  Currently  DSP collects    49 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     ControlTask 9  23     six words  BOL  BOH  B1L  B1H  time stamp  and ADC value  for  each baseline  1365 baselines are collected until the 8192 word I O  buffer is almost completely filled  The host computer can then read  the I O buffer and calculate the baseline according to the formu
50. n at the end of the coincidence window suppress further hits  reporting by late channels     In the PIXIE 4 Viewer this bit is set or cleared in line 1 of the Channel CSRA  Edit Panel  The line has the title  Measure individual live time   Make sure it  is unchecked  so the DSP globally controls FPGA triggering and live time  measurements     When acquiring long waveforms it may be necessary to delay DSP data  reading to ensure that the FIFOs will contain valid data  Secondly  when  using a filter range of 6 in the FPGA  the minimum value for COINCWAIT is  larger than 1 in all circumstances  Use the following formula to determine  COINCWAIT     COINCWAIT   Max PeakSep 2   FilterRange eno ch3      Min PeakSep 2   FilterRange  cho ch3    Choose COINCWAIT big enough such that the requirements of all channels  in the module are met     SYNCHWAIT  Controls run start behavior  When set to 0 the module simply starts or    INSYNCH     HOSTIO     RESUME     resumes a run in response to the corresponding request  When set to 1  one or  multi modules will run synchronously through the backplane  This kind of set  up in connection with SyncWait 1 will ensure that the last module ready to  actually begin data taking will start the run in all modules  And the first  module to end the run will stop the run in all modules  This way it never  happens that a multi Pixie system is only partially active     InSynch is an input output variable  It is used in multi Pixie systems in which  the modu
51. ne           1       Invalid name       Check the second parameter Name          Usage example    S32 retval           download system parameter names  define System Parameter Names first  retval   Pixie Hand Down Names  System Parameter Names   SYSTEM      if  retval  lt  0           error handling                     download module parameter names  define Module Parameter Names first  retval   Pixi _Hand_Down_Names  Module Parameter Names   MODULE      if retval  lt  0           error handling                     download channel parameter names  define Channel Parameter Names     first  retval   Pixi _Hand_Down_Names  Channel Parameter Names   CHANNEL      if  retval  lt  0           error handling                  download boot file names  define All Files first  retval   Pixi _Hand_Down_Names  All Files   ALL FILES     if  retval  lt  0           error handling                        4 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     Pixie_Boot_System       Syntax    S32 Pixie Boot System    U16 Boot Pattern      The Pixie 4 boot pattern    Description    Use this function to boot all Pixie modules in the system  Before booting the modules  it  scans all PXI crate slots and finds the address for each slot where a Pixie module is installed     Parameter description    Boot_Pattern is a bit mask used to control the boot pattern of Pixie modules   Bit 0  Boot communication FPGA  Bit 1  Boot signal processing FPGA  Bit 2  Boot DSP  Bit 3  Load DSP p
52. ng thus that by the time the DSP is triggered at the end of  the pile up inspection period the data of interest have percolated through to the  begin of the FIFO and are available for read out without delay     The acquired waveform will start rising from the baseline at a time delay after  the beginning of the trace  This delay is a quantity that the user will want to  set  In the PIXIE 4 Viewer it is called TraceDelay  measured in  microseconds  and is available through the Settings tab     The recommended setting for PafLength is     40 PIXIE 4 Programmer   s Manual V1 41  O XIA 2007  All rights reserved     PafLength   TriggerDelay   TraceDelay 13 3ns  Note the constraint  PafLength  lt  4092     Note that PAFLength should be adjusted only in multiples of 4  as the  hardware ignores the lower two bits of this value     TRIGGERDELAY  This is a partner variable to PafLength  For all filter ranges   TriggerDelay    PeakSep  1  2 FilterRange     Note that TriggerDelay should be adjusted only in multiples of 4  as the  hardware ignores the lower two bits of this value  For MCA runs without  taking traces   trace length 0   TriggerDelay should be 1     RESETDELAY  This variable controls the restarting of the FIFO after it was halted to read  the waveform  When triggers are distributed across channels and modules  a  halted FIFO is automatically restarted if the trigger filter FPGA does not  receive the distributed event trigger within RESETDELAY 13 3ns clock ticks  after the in
53. ngs that may change in between runs     UserChannel    This function is called for every event and every PIXIE 4 channel for which data are reported  and for which bit 0 of the channel CSR_B  ChannelCSRB variable  has been set  It is called  after all regular event processing for this channel has finished  but before the energy has been  histogrammed     UserEvent   This function is called after all event processing for this particular event has finished  It may  be used as an event finish routine  or for purposes where the event as a whole is to be  examined     UserRunFinish   This routine is called after the run has ended  but before the host computer is notified of that  fact  Its purpose is to update run summary information     Global variables     UserIn 16  16 words of input data  also visible to host  UserQut 16  16 words of output data  also visible to host    When entering UserChannel the following globals have been set by the DSP     Atstart Address of 1st word of the ADC trace  Tlen Length of the ADC trace   Energy Pulse height of the event   ChanNum Current channel number   RUNTASK RUNTASK of the current run   EOL lagging Energy filter  low word   E0H lagging Energy filter  high word   EIL leading Energy filter  low word   E1H leading Energy filter  high word    Your return value is UretVal  It is an array of 6 words  If bit 1 of ChanCSRB is 0  only the  first word is incorporated into the output data stream by the main code  See Tables 2 to 6 in  the user manual
54. obal variable arrays  we also need to define three global name arrays   System Prameter_ Names  Module Parameter Names and Channel Parameter Names   respectively  Table 3 1 lists the names contained in each of these name arrays  The order of  placing these names into the name array is not important since the API uses search functions  to locate each name at run time     Table 3 1  Contents of Global Name Arrays        Array Names       System Parameter Names   NUMBER_MODULES  OFFLINE_ANALYSIS   C_LIBRARY RELEASE  C_LIBRARY_BUILD  SLOT WAVE       Module Parameter Names   MODULE NUMBER  MODULE CSRA  MODULE_CSRB    7 7 MODULE FORMAT  MAX EVENTS  COINCIDENCE PATTERN   ACTUAL COINCIDENCE WAIT  MIN COINCIDENCE WAIT   SYNCH_WAIT  IN SYNCH  RUN_TYPE  FILTER RANGE   BUFFER HEAD LENGTH  EVENT HEAD LENGTH   CHANNEL HEAD LENGTH  OUTPUT BUFFER LENGTH   NUMBER EVENTS  RUN_TIME  BOARD VERSION    SERIAL NUMBER       Channel Parameter Names   CHANNEL_CSRA  CHANNEL CSRB  ENERGY_RISETIME    E   ENERGY FLATTOP  TRIGGER _RISETIME  TRIGGER FLATTOP   TRIGGER_THRESHOLD  VGAIN  VOFFSET  TRACE LENGTH   TRACE DELAY  PSA_START  PSA_END  EMIN  BINFACTOR  TAU   BLCUT  XDT  BASELINE PERCENT  CFD_THRESHOLD   INTEGRATOR  LIVE_TIME  INPUT _COUNT_ RATE  FAST PEAKS                Additionally  a string array All Files containing the file names for the initialization is also  needed  Table 3 2 lists the file names needed to initialize the PIXIE 4 modules        20 PIXIE 4 Programmer   s Manual V1 41     XIA 2007
55. odules present in the system     3  Copy parameters from one module to others or extracts parameters from a settings file  and applies to the selected modules     Parameter description    Values is an unsigned 16 bit integer array used for data transfer between the user interface  and Pixie modules  type specifies the I O type  direction indicates the data flow direction   The string variable file name contains the name of settings files  Different combinations of  the three parameters   Values  type  direction     designate different I O operations as listed in                                           Table 2 2   Table 2 2  Different I O operations using function Pixie_Buffer_IO   Type   Direction Values T O Operation  0 0 DSP 1 0 variable values Write DSP I O aus values to modules  1 Read DSP I O variable values from modules  1 0    Values to be written Write to certain locations of the data memory  1 All DSP variable values Read all DSP variable values from modules  0 Save current settings in all modules to a file  2 1 N A    Read settings from a file and apply to all  modules in the system  0 Values 0      source module Extract settings from a file and apply to  number  Values 1      source selected modules  3 channel number  Values 2       1 copy extract pattern bit mask  Copy settings from a source module to  Values 3   Values 4         destination modules  destination channel pattern  4 N A      Values 0      address  Values 1      Specify the location and number of w
56. on Required Files  Option C source files C header files Library files  boot h  defs h  globals h   a dynamic link sharedfiles h  utilities h  PciApi h  Lak  library  DIE    POOR Stone  PciRegs h  Plx h  PlxApi h  5 PIS DRIN  or static library Deo e values    PlxDefinitionsCheck h  PlxError h  Beno  PlxTypes h  Reg9054 h  Besa ope boot h  defs h  globals h   pixie  gt  uitst pe ace  ess vas  Ivor XOP di face  gt    utilities h  PciApi h  PciRegs h  PIxApi lib   8 PR P Plx h  PIxApi h  PIxApi dll  ada   PlxDefinitionsCheck h  PlxError h   i PlxTypes h  Reg9054 h       The Igor XOP option also needs the following files in the Igor XOP Library provided by    WaveMetrics     IgorXOP h  VCExtralncludes h  Xop h  XOPResources h  XOPStandardHeaders h   XOPSupport h  XOPSupportWin h  XOPWinMacSupport h  XOPSupport x86 lib   and IGOR lib     19    PIXIE 4 Programmer   s Manual V1 41    O XIA 2007  All rights reserved        3 Control PIXIE 4 Modules via CompactPCl  3 1 Initializing    We describe here how to initialize PIXIE 4 modules in a PXI chassis using the functions  described in Section 2  As an example  we assume two PIXIE 4 modules     resided in slot  3  and  4  respectively  Users are also encouraged to read the sample C code shipped with the  API     3 1 1 Initialize Global Variables    As discussed in Section 2  we assume that three global variable arrays have been defined   System_Parameter_Values  Module _Parameter_ Values and Channel_Parameter_Values  For  these three gl
57. or is set to store output data in new files every N spills or seconds  this function is  called at the end of making the new files  after the run has resumed  It can be used to process  output data automatically during these multi file runs  However  it will interfere with the    55 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     polling routine  so the time to execute User_NewFileDuringRun should be less than the  polling time     Function User_StopRun     This function is called at the end of the run  By default it calls another function to duplicate  the output data displayed in the standard Igor graphs and panels into a data folder called     root results     It can be used to process output data    Function User_ChangeChannelModule    This function is called when changing Module Number or Channel Number  By default it  calls a function to update the variables in the User Control panel     Function User_ReadEvent    This function is called when changing event number in list mode trace display or digital filter  display  By default it duplicates traces and list mode data into the    results    data folder    Function User_TraceDataFile    This function is called when changing the file name in list mode trace display     7 2 Igor User Panels    The Igor user panels defined in the current version of the user code are listed below     Window User_Control     this is the main user control panel  listing DSP input and output variables and showing  seve
58. ords to be                   16    PIXIE 4 Programmer   s Manual V1 41  O XIA 2007  All rights reserved                       length written into the data memory        Special care should be taken for this I O operation since mistakenly writing to some locations of the  data memory will cause the system to crash  The Type 4 I O operation should be called first to specify  the location and the number of words to be written before calling this one  If necessary  please contact       XIA for assistance      Any unsigned 16 bit integer array could be used here   Direction can be either 0 or 1 and it has no effect on the operation     Return values                                                 Value   Description Error Handling  0 Success None    1 Failure to set DACs after writing DSP parameters Reboot the module   2 Failure to program Fippi after writing DSP parameters Reboot the module   3 Failure to set DACs after loading DSP parameters Reboot the module   4 Failure to program Fippi after loading DSP parameters Reboot the module   5 Can t open settings file for loading Check the file name   6 Can t open settings file for reading Check the file name    l  Can t open settings file to extract settings Check the file name   8 Failure to set DACs after copying or extracting settings Reboot the module   9 Failure to program Fippi after copying or extracting settings   Reboot the module   10 Invalid module number Check ModNum   11 Invalid I O direction Check direction    12 Invali
59. ral action buttons  This panel can be modified to set user variables and control user  procedures     Window User_Version ctrIName    This panels displays the version and variants of the user code   UserVersion    the version of the user function calls defined by XIA  UserVariant    the variant of the code written by the user  USEROUT 0     the version of the DSP code written by the user    7 3 Igor User Variables    The main Igor code defines the global variables and waves below for use in user procedures   The user code can modify these values without interfering with the main code   An exception  is the    UserVersion     which should not be modified  but used to ensure the user code is  compatible with the main code     NewDataFolder o root results    the Igor data folder where results for user are stored    56 PIXIE 4 Programmer   s Manual V1 41  O XIA 2007  All rights reserved     Variable G root results RunTime  Variable G root results EventRate  Variable G root results  NumEvents  Wave root results ChannelLiveTime       Run Time from run statistics panel       Event rate from run statistics panel     Total number of events       Channel live time    Wave root results  ChannelInputCountRate    Channel input count rate     Start time from run statistics panel     Stop time run statistics panel    String G root results StartTime  String G root results StopTime    Wave root results  MCAch0  Wave root results MCAch1  Wave root results MCAch2  Wave root results MCAch3  Wave
60. ray containing the names to be downloaded  U8  Name       A string indicating the type of names  file or       variable names  to be downloaded    Description    Use this function to download the file or variable names from the host user interface to the  Pixie 4 API  The API needs these file names so that it can read the Pixie hardware  configurations from the files stored in the host computer and download these configurations  to the Pixie  The variable names are used by the API to obtain the indices of the DSP  variables when the API converts user variable values into DSP variable values or vice versa     Parameter description    Names is a two dimensional string array containing either the file names or the variable  names  The API will know which type of names is being downloaded by checking the other  parameter Name    1  ALL_FILES  This indicates we are downloading boot files names  In this case   Names is a string array which has N BOOT FILES elements  Currently  N_BOOT FILES is defined as 7  The elements of Names are the names of  communication FPGA files  Revision B and Revision C  respectively   signal  processing FPGA file  DSP executable code binary file  DSP I O parameter values  file  DSP code I O variable names file  and DSP code memory variable names file   All file names should contain the complete path name     2  SYSTEM  This indicates we are downloading System Parameter Names   System_Parameter Names are those global variables that are applicable to all  
61. ription Error Handling  0x90   Success None    0x91   Failure to read out MCA section of external memory   Reboot the module   0x92   Failure to write to MCA section of external memory   Reboot the module   0x93   Failure to read out LM section of external memory   Reboot the module   0x94   Failure to write to LM section of external memory   Reboot the module   0x95   Invalid external memory I O request Check the run type                                     Usage example    S32 retval   U16 RunType   U32 dummy 2         U8 ModNum    RunType   0x1100     start a new list mode run  ModNum   0    retval   Pixie Acquire Data RunType  dummy           ModNum     if retval    0x10             Error handling               wait until the run has ended  RunType   0x4100   while    Pixie Acquire Data RunType  dummy           ModNum              Read out the list mode data from all Pixie modules and save to a file  RunType   0x6100     13 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved        retval   Pixie Acquire Data RunType  dummy      C  XIA Pixie4 PulseShape Listdata0001 bin     ModNum      if retval    0x60           Error handling               Read out the histogram data from all Pixie modules and save to a file   RunType   0x5100    retval   Pixie Acquire Data RunType  dummy      C  XIA Pixie4 MCA Histdata0001 bin     ModNum      if  retval    0x50           Error handling                  14 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights re
62. s  time counter is active only while a data acquisition run is in progress   Comparing the run time with the real time allows judging the overhead due to  data readout   Compute the run time using the following formula     RunTime   RunTimeA   6553612   RunTimeB   65536   RunTimeC     13 3ns    GSLTTIMEA   GSLTTIMEB     44 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     GSLTTIMEC  Unused     NUMEVENTSA   NUMEVENTSB  Number of valid events serviced by the DSP   Again the high word carries the suffix A and the low word the suffix B     DSPERROR  This variable reports error conditions     0  NOERROR   no error    1  RUNTYPEERROR   unsupported RunType    2  RAMPDACERROR   Baseline measurement failed    SYNCHDONE  This variable can be set to 1 to force the DSP out of an infinite loop caused  by a malfunctioning Busy Synch loop  when a run start request was issued  with SYNCHWAIT 1     BUFHEADLEN  At the beginning of each run the DSP writes a buffer header to the list  mode data buffer  BufHeadLen is the length of that header  Currently   BUFHEADLEN is 6  but this value should not be hardcoded  it should be read  from the DSP to ensure upgrade compatibility     EVENTHEADLEN  For each event in the list mode buffer  or the level 1 buffer  there is an  event header containing time and hit pattern information  EventHeadLen is  the length of that header  Currently  EVENTHEADLEN is 3  but this value  should not be hardcoded  it should be read from the DSP to ens
63. s by inverting them immediately after entering the  FPGA     GFLT    Set this bit if you want to validate or veto events using the PXI backplane   When the bit is cleared  the GFLT input is ignored  When set  the event is  accepted only if validated  To be validated  the GFLT input must be a logic 0  no later than an energy filter rise time after the signal arrival  and must remain  at logic 0 level until a rise time   flat top after signal arrival     Histogram energies   Set this bit to histogram energies from this channel in the on board MCA  memory     37 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     Bit 8  Reserved     Set to 0   Bit 9  Reserved   Bit 10  Compute constant fraction timing     This pulse shape analysis computes the time of arrival for the signal from the  recorded waveform  The result is stated in units of 1 256  of a sampling  period  13 3 ns   Time zero is the start of the waveform     Bit 11  13  Reserved     Bit 14  Estimate energy if channel not hit   If set  the DSP reads out energy filter values and computes the pulse height for  a channel that is not hit  for example when    read always    in group trigger  mode  If not set  the energy will be reported as zero if the channel is not    hit       Bit 15  Reserved     CHANCSRB  Control and status register B    Bit 0  If set  call user written DSP code    Bit 1  If set  all words in the channel header except Ndata  trigtime and energy will  be overwritten with the contents o
64. s respond within a few hundred nanoseconds by setting the RUNACTIVE bit    13  in the CSR  The host can poll the CSR and watch for the RUNACTIVE bit to be  deasserted  All control tasks indicate task completion by clearing this bit     Execution times vary considerably from task to task  ranging from under a microsecond to 10  seconds  Hence  polling the CSR is the most effective way to check for completion of a  control task     Control Task 0  SetDACs  Write the GAINDAC and TRACKDAC values of all channels into the  respective DACs  Reprogramming the DACs is required to make  effective changes in the values of the variables GAINDAC  0   3    TRACKDAC  0   3      Control Task 1  Connect inputs  Close the input relay to connect the PIXIE electronics to the input  connector    Control Task 2  Disconnect inputs    Open the input relay to disconnect the PIXIE electronics from the  input connector     Control Task 3  Ramp offset DAC  This is used for calibrating the offset DAC  For each channel the  offset DAC is incremented in 2048 equal size steps  At each DAC  setting the DC offset is determined and written into the list mode  buffer  At the end of the task the list mode buffer holds the following  data  Its 8192 words are divided up equally amongst the four  channels  Data for channel 0 occupy the lowest 2048 words  followed  by data for channel 1  etc  The first entry for each channel s data block  is for a DAC value of 0  the last entry is for a DAC value of 65504  In  betwe
65. served     Pixie_Set_Current_ModChan       Syntax  S32 Pixie Set Current ModChan    U8 Module     Module number to be set  U8 Channel      Channel number to be set    Description    Use this function to set the current module number and channel number     Parameter description    Module specifies the current module to be set  Module should be in the range of 0 to  MAX NUMBER OF MODULES  currently MAX NUMBER OF MODULES is set to  7      Channel specifies the current channel to be set  Channel should be in the range of 0 to  NUMBER OF CHANNELS   1  currently NUMBER OF CHANNELS is set to 4      Return values                            Value   Description Error Handling  0 Success None    1 Invalid module number   Check Module    2 Invalid channel number   Check Channel       Usage example       Set current module to 1 and current channel to 3  Pixie Set Current ModChan 1  3      15 PIXIE 4 Programmer   s Manual V1 41  O XIA 2007  All rights reserved     Pixie_Buffer_lO       Syntax    S32 Pixie Buffer IO       An unsigned 16 bit integer array containing the     data to be transferred    U l6  Values     U8  U8  U8  U8    Description    Use this function to     type     Data transfer type  direction     Data transfer direction   file name     File name   ModNum       Module number    1  Download or upload DSP parameters between the user interface and the Pixie modules   2  Save DSP parameters into a settings file or load DSP parameters from a settings file    and applies to all m
66. should come as no surprise that many of the DSP variables have meaningful values and  ranges depending on the values of other variables  A complete description of all  interdependencies can be found in Section 4  All of these interdependencies have been taken  care of by the PIXIE 4 API  So instead of directly setting DSP variables  users only need to  set the values of those global variables defined in Table 3 1  The API will then convert these  values into corresponding DSP variable values and download them into the DSP data  memory  On the other hand  if users want to read out the data memory  the API will first  convert these DSP values into the global variable values  The code shown below is an  example of setting DSP variables through the API     An Example Code Illustrating How to Set DSP Variables through the API    S32 retval   U8 direction  modnum  channum     direction   0     download  modnum   0     Module  0  channum   0     Channel  0                         set COINCIDENCE PATTERN to OxFFFF  Module Parameter Values COINCIDENCE PATTERN Index    OXxFFFF                       download COINCIDENCE PATTERN to the DSP  retval   Pixie User Par IO Module Parameter Values      COINCIDENCE PATTERN    MODULE   direction  modnum  channum     if  retval  lt  0                                                   Error handling                     set ENERGY RISETIME to 6 0 ys  Channel Parameter Values ENERGY RISETIME Index    6 0                                               
67. st that user  code use this information to create a name address lookup table  rather than relying on the  parameters retaining their address offsets with respect to the start address     The input parameter block is partitioned into 5 subunits  The first contains 64 data that  pertain to the PIXIE 4 as a whole  It is followed by four blocks of 48 words  which describe  the settings of the four channels    Below we describe the module and channel parameters in turn  Where appropriate  we show    how a variable can be viewed using the PIXIE Viewer     4 1 Module parameters    MODNUM  Logical number of the module  This number will be written into the header of  the list mode buffer to aid offline event reconstruction     MODCSRA  The Module Control and Status Register A    Bit 0  If set  timestamps are latched by local triggers  not by the  last  group trigger   This preserves trigger timing information for runs without waveform  acquisition   Bit 1  If set  DSP acquires 32 data buffers in each list mode run and stores the data    in external memory  If not set  only one buffer is acquired and the data is kept  in local memory     Bit 2  Bits 2 and 15 control trigger distribution over the backplane  If neither bit 2 or  bit 15 are set  triggers are distributed only between channels of this module   Otherwise  triggers are distributed as follows     30 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     Bit 3     Bit 4     Bit 5     Bit 6     Bit 7     Bit 
68. tem Parameter Values  Finally  function  Pixie_Boot_System should be called to boot the modules  The following code is an example  showing how to boot the PIXIE 4 modules using the API functions     An Example Code Illustrating How to Boot PIXIE 4 Modules    S32 retval   U8 direction  modnum  channum        initialize system parameter values  System Parameter Values  NUMBER MODULES Index    2                                               System Parameter Values OFFLINE ANALYSIS Index  O   System Parameter Values SLOT WAVE Index    3   System Parameter Values SLOT WAVE Index 1    4   retval   Pixi _Hand_Down_Names  System Parameter Names   SYSTEM      if  retval  lt  0          Error handling     retval   Pixie Hand Down Names  Module Parameter Names   MODULE      if  retval  lt  0    21 PIXIE 4 Programmer   s Manual V1 41       XIA 2007  All rights reserved             Error handling                  retval   Pixi _Hand Down Names  Channel Parameter Names   CHANNEL      if  retval  lt  0          Error handling                  retval   Pixie Hand Down Names  All Files   ALL FILES     if  retval  lt  0          Error handling            direction   0     download  modnum   0     Module  0  channum   0     Channel  0             retval   Pixie User Par IO System Parameter Values   NUMBER MODULES     SYSTEM   direction  modnum  channum     if  retval  lt  0         Error handling                  retval   Pixie User Par IO System Parameter Values    OFFLINE ANALYSIS    SYSTEM  
69. ternal event trigger  The default value written by the PIXIE  module should not be changed by the user     FTPWIDTH  Unused   This completes the list of values that control the trigger filter FPGAs     The following input parameters are used by the DSP program  They become active as soon as  the first data taking run has been started  Only then will the output parameters reflect the  changes made to the set of input parameters     TRACELENGTH  This tells the DSP how many words of trace data to read  The action  taken depends on FIFOlength   which is 1024  If TraceLength  lt  FIFOlength   the DSP will read from the FIFO  In that case individual samples are 13 3 ns  apart  If FIFOlength  lt   TraceLength  the PIXIE 4 code will force the  TraceLength to be equal to FIFOlength     XWAIT  Extra wait states  This parameter controls how many extra clock cycles the  DSP waits when reading waveform data in real time rather than out of a FIFO  memory  This occurs when acquiring data in list mode and asking for trace  lengths longer than FIFOlength  The time between recorded samples is    AT    3 XWAIT  13 3ns     XWAIT is used differently when acquiring untriggered traces in a control run  with ControlTask 4  In this case  the time between recorded samples is    41 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     AT  4 13 3ns if XWAIT  lt   4   XWAIT 13 3ns 114  lt  XWAIT  lt   12    3   XWAIT   13 3ns if XWAIT  gt  13  XWAIT has to be multiple of 5     The fol
70. the  trace lengths set by the user  Set MaxEvents 0 if you want to switch off this  feature  e g   when logging spectra  done automatically in an MCA mode run      COINCPATTERN  When a PIXIE 4 is operated on its own  the user can request that  certain coincidence anticoincidence patterns are found for the event to be  accepted  With four channels there are 16 different hit patterns  and each can  be individually selected or marked for rejection by setting the appropriate bit  in the COINCPATTERN mask     Consider the 4 bit hit pattern 1010  The two 1 s indicate that channel 3  MSB   and channel   have reported a hit  Channels 2 and 0 did not  The 4 bit word  reads as 10 decimal   If this hit pattern qualifies as an acceptable event  set bit  10 in the COINCPATTERN to 1  The 16 bit in COINCPATTERN cover all  combinations  Setting COINCPATTERN to OxFFFF causes the Pixie 4 to  accept any hit pattern as valid     In the PIXIE 4 Viewer this variable can be set in the Coincidence Pattern Edit  Panel reachable through the Settings tab by clicking on Edit next to the Coinc     34 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     Pattern entry     COINCWAIT  Duration of the coincidence time window in clock ticks  each clock tick    spans 13 3 ns   The actual coincidence window is 26 6 ns wider than the  value determined by COINCWAIT  For this feature to work  bit no  1 of the  ChannelCSRA of the involved channels should be cleared  This ensures that  the DSP ca
71. ticks     INTEGRATOR  This variable controls the energy reconstruction in the DSP     BLCUT     INTEGRATOR    0  normal trapezoidal filtering  INTEGRATOR    1  use gap sum only  good for scintillator signals  INTEGRATOR    2  ignore gap sum  pulse height leading sum        trailing sum  good for step like pulses   INTEGRATOR    3 4 5  same as 1  but multiply energy by 2  4  or8     This variable sets the cutoff value for baselines in baseline measurements  If  BLCUT is not set to zero  the DSP checks continuously each baseline value to    42 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     see if it is outside of the limit set by BLCUT  If the baseline value is within  the limit  it will be used to calculate the average baseline value  Otherwise  it  will be discarded  Set BLCUT to zero to not check baselines  therefore reduce  processing time     ControlTask 6 can be used to measure baselines  Host computer can then  histogram these baseline values and determine the appropriate value for  BLCUT for each channel according to the standard deviation SIGMA for the  averaged baseline value  BLCUT could be set to be three times SIGMA     BASELINEPERCENT  This variable sets the DC offset level in terms of the percentage    XAVG     of the ADC range     Only used in Controltask 4 for reading untriggered traces  XAVG stores the  weight in the geometric weight averaging scheme to remove higher frequency  signal and noise components  The value is calculated as 
72. tionally  this manual also includes instructions on how to write User DSP  code     2 PIXIE 4 API    The PIXIE 4 API consists of a set of C functions for building various coincidence data  acquisition applications  It can be used to configure Pixie 4 modules  make MCA or list  mode runs and retrieve data from the Pixie modules  The API can be compiled as a  WaveMetrics Igor XOP file which is currently used by the Pixie 4 Viewer  a dynamic link  library  DLL  or static library to be used in customized user interfaces or applications  In  order to better illustrate the usage of these functions  an overview of the operation of Pixie 4  is given below and the usage of these functions is mentioned wherever appropriate     At first the PIXIE 4 API needs to be initialized  This is a process in which the names of  system configuration files and variables are downloaded to the API  The function  Pixie_Hand_Down_Names is used to achieve this     The second step is to boot the Pixie modules  It involves initializing each PXI slot where a  Pixie module is installed  downloading all FPGA configurations and booting the digital  signal processor  DSP   It concludes with downloading all DSP parameters  the instrument  settings  and commanding the DSP to program the FPGAs and the on board digital to analog  converters  DACs   All this has been encapsulated in a single function Pixie_Boot_System     Now  the instrument is ready for data acquisition  The function used for this purpose is  Pixie
73. trol the waveform acquisition for non triggering  channels by a triggering master channel  For this option to work properly  choose one channel as the master and have its Trigger Enable bit set  All  dependent channels should have their Trigger_Enable bit cleared  Set bit 0 in  all slave channels  You should also set it the master channel to ensure equal  time of arrivals for the fast trigger signal  which is used to halt the FIFOs     Note  To distribute group triggers between modules  bit 2 in the variable  MODCSRA has to be set as well     Measure individual live time    Keep this bit cleared when operating with master and slave channels  or when  making coincidence measurements using single modules  Set this bit when  measuring independent spectra  i e   when list mode data are not required     Good channel   Only channels marked as good will contribute to spectra and list mode data     Read always   Channels marked as such will contribute to list mode data  even if they did not  report a hit  This is most useful when acquiring induced signal waveforms on  spectator electrodes  i e   electrodes that did not collect any net charge  but  only saw a transient induced signal     Enable trigger   Set this bit for channels that are supposed to contribute to an event trigger     Trigger positive    Set this bit to trigger on a positive slope  clear it for triggering on a negative  slope  The trigger filter FPGA can only handle positive signals  The PIXIE  handles negative signal
74. ts a compressed list mode run  The only  difference between RunTask 259 and 257 is that in RunTask 259  only two  words of results  time of arrival and energy  are written into the I O buffer for  each channel     RunTask 512  0x200  employs the same internal data format as RunTask 256   but omits buffer full checks and trace capture  The run is stopped when the  required number of events  MaxEvents  has been acquired  This run type uses  the shortest possible interrupt routine for raw data gathering  Hence  it allows  for the shortest time between two logged events  For best results the channel  variables PAFLength and TriggerDelay should be set to 1 for all channels  involved  Level 1 buffer is not used in this run type  Nine words of results   including time of arrival  energy  XIA pulse shape analysis  user pulse shape  analysis  etc  are written into the I O buffer for each channel     RunTask 513  0x201  requests a compressed fast list mode run without trace  capture  Both Level 1 buffer and I O buffer are used in this RunTask  Nine  words of results  including time of arrival  energy  XIA pulse shape analysis   user pulse shape analysis  etc  are written into the I O buffer for each channel     RunTask 514  0x202  requests a compressed fast list mode run  The only  difference between RunTask 514 and 513 is that in RunTask 514  only four    33 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     words of results  time of arrival  energy  XIA pulse s
75. ure upgrade  compatibility     CHANHEADLEN  For each channel that has been read  there is a channel header  containing energy and auxiliary information  ChanHeadLen is the length of  this header  CHANHEADLEN varies between 2 and 9 words depending on  the run type  see RUNTASK      The event and channel header lengths plus the requested trace lengths  determine the maximum logically possible event size  The maximum event  size is the sum of EventHeadLen and the ChannelHeadLengths plus the  TraceLengths for all channels marked as good  i e  which have bit 2 in the  ChanCSRA set  Example  With all four channels marked as good and required  trace lengths of 1000  i e  13 3us  the maximum event size will be    MaxEventSize   EventHeadLen   4  ChanHeadLen   1000     4039    In the last line typical values for EventHeadLen  3  and ChanHeadLen  9   were substituted  BufHeadLen equals 6  Thus there is room for at least 2  events in the list mode data buffer  which is 8192 words long  But there is not  enough room in the level 1 buffer  which contains only 2048 words     45 PIXIE 4 Programmer   s Manual V1 41     XIA 2007  All rights reserved     Below follow the addresses and lengths of a number of data buffers used by the DSP  program  The addresses are generated by the assembler linker when creating the executable   On power up the DSP code makes these values accessible to the user  Note that the addresses  will typically change with every new compilation  Therefore your code should
76. written in C at all  we did not burden our design by trying to be  compatible with the C compiler  Hence  using the C compiler is currently not an option     With the general software distribution we provide working executables and support files  To  support user DSP programming we provide files containing pre assembled forms of XIA   s  DSP code  together with a source code file that has templates for the user functions  The user  templates have to be converted by the assembler and the whole project is brought together by  the linker  XIA provides a link and a make file to assist the process     In the PIXIE 4 Viewer we provide powerful diagnostic tools to aid code developing and a  data interface to exchange data between the host and the user code  The PIXIE 4 Viewer can   at any time  examine the complete memory content of the DSP and call any variable from  any code section by name  A particularly useful added feature is the capability to download  data in native format into the DSP and pretend that they were just acquired  The event  processing routine  which calls the user code  is then activated and processes the data  This  in situ code testing allows the most control in the debugging process and is more powerful  than having to rely on real signal sources     6 3 Interfacing user code to XIA   s DSP code    When the DSP is booted it launches a general initialization routine to reach a known  and  useful  state  As part of this process a routine called UserBegin is ex
    
Download Pdf Manuals
 
 
    
Related Search
    
Related Contents
PageWriter Trim I, II, III, Rx Cardiograph Service Manual, Edition 4  Philips ProScreen PXG30 LCD Projector  IBM 00NA261 hard disk drive  FT - Phobi Fénox VR 04.2014  JhonBEAN タイヤヤチェンジャー  Sensor Flo-Dar™  Comrac COMTVA124 Plasma Wall Mount Bracket    Daily care and Maintenance - mimaki engineering co., ltd.  MH-X25 LED Spot cabeza móvil manual de instrucciones    Copyright © All rights reserved. 
   Failed to retrieve file