Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

See https://github.com/slac-lcls/lcls2/blob/master/psdaq/psdaq/seq/rixexample.sh (high level example for bursts and period patterns) and https://github.com/slac-lcls/lcls2/blob/master/psdaq/psdaq/seq/burst.py (lower-level python code for more complex patterns ).  See also Matt's exampledocumentation.

In this example the XPM is configured to insert event codes 272-287 into the timing stream.  Four event codes are generated by each sequence engine within the XPM.  The XPM has 4 sequence engines allowing 16 event codes total.

...

A current example for doing this is done by executing:

(first use Matt's high-level utility to generate two event codes that run at 10Hz and 100Hz (periods 91000 and 9100 respectively)

(ps-4.5.2426) bash-4.2$ python psdaq/psdaq/seq/seqprogram.py -h
usage: seqprogram.py [-h] [--engine ENGINE] seq pv

sequence pva programming

positional arguments:
  seq              sequence script
  pv               sequence engine pv; e.g. NEH:DAQ:XPM:0

optional arguments:
  -h, --help       show this help message and exit
  --engine ENGINE  sequence engine

(ps-4.5.24) bash-4.2$ python psdaq/psdaq/seq/seqprogram.py psdaq/psdaq/seq/33k_35k.py DAQ:NEH:XPM:6

...

drp-srcf-mon001:psana$ periodicgenerator -p 91000 9100 -s 0 0 -d '10Hz' '100Hz' >& 10hz_100hz.py

(now program sequence engine 0 and start it using the python code generated above. since we're programming engine 0, the first two event codes will be 272,273 according to the above table)

(this command must be executed on a node that can access the XPM PV's, e.g. drp-srcf-*)

(ps-4.5.26) drp-srcf-mon001:psana$ seqprogram --seq 0:10hz_100hz.py --pv DAQ:NEH:XPM:3 --start
** engine 0 fname 10hz_100hz.py **
descset  None
seqcodes {0: '10Hz', 1: '100Hz'}
Remove -1
idx 2
Removing seq 2
[10, 1, 5, 3, 0, 0, 0, 0, 2, 0, 6, 2048, 0, 0, 0, 3, 2, 1, 3, 3, 0, 0, 2, 0, 6, 908, 0, 0, 0, 1, 5, 2, 0, 0, 0, 0, 3, 2, 1, 0, 8, 0, 0, 2, 0, 6, 2048, 0, 0, 0, 3, 2, 6, 3, 3, 0, 0, 2, 0, 6, 908, 0, 0, 0, 1, 2, 0, 0, 0, 0, 0]
Confirmed ninstr 10
Sequence  found at index 2
desc ['10Hz', '100Hz', '', '', '', '', '', '', '', '', '', '', 'burst', '', '', '']
seqcodes_pv epics:nt/NTTable:1.0 
    string[] labels [EventCode, Description, Rate, Enabled]
    structure value
        int[] EventCode [272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287]
        string[] Description [10Hz, 100Hz, , , , , , , , , , , burst, , , ]
        int[] Rate [11,102,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
        byte[] Enabled [1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1]
    string descriptor 
    alarm_t alarm
        int severity 0
        int status 0
        string message 
    time_t timeStamp
        long secondsPastEpoch 1683163040
        int nanoseconds 339389440
        int userTag 0

(now query the xpm to see what is running in the 4 sequence engines, each having 4 event codes)

(ps-4.5.2426) bash-4.2$ drp-srcf-mon001:psana$ pvget DAQ:NEH:XPM:63:SEQCODES
DAQ:NEH:XPM:63:SEQCODES 2023-0105-19 1003 18:3517:2031.971 339    
EventCode  Description  RateDescription Rate Enabled
      272 "33kHz base" 33164       10Hz   10       1
      273 "35kHz base" 35715      100Hz  102       1
      274                0    0    1
      275                0        01
      276                0        00
      277                0        00
      278                0    0    0
      279                0        00
      280                0    0    0
      281                0    0    0
      282                0        00
      283                0        00
      284       burst    0          01
      285                0    0    1
      286                0        01
      287                  0 0       1
(ps-4.5.26) drp-srcf-mon001:psana$ 

Sequence Start/Stop

Some technical details from a discussion on March 23, 2023

...