You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 22 Next »

Overview

Data Format

At each trigger, the UDP Encoder sends one header structure followed by up to eight channel structures.

See the definitions of encoder_header_t and encoder_channel_t in github: UdpEncoder.hh

Configuring the Timing System

On a DAQ Partition

tprtrig
You can get tprtrig to trigger the EVR on a DAQ partition like so:
    $ tprtrig -t a -c 0 -o 1 -d 2 -w 10 -p 4
programs EVR /dev/tpra (-t a) to generate a TTL trigger using logic channel 0 (-c 0) on output 0 (-o 1 [bit mask]) with delay of 2 119MHz clocks (-d 2) and width 10 119 MHz clocks (-w 10) for every L1Accept on partition 4 (-p 4). 

Standalone

tprtrig
Generate 1Hz triggers on output 0 with a width of 54 nanoseconds.

    $ tprtrig -t a -c 0 -o 1 -d 1 -w 10 -r 6

Testing

Monitoring UDP packets with netcat

-bash-4.2$ hostname
drp-neh-cmp015

-bash-4.2$ nc -lvu 192.168.0.8 5006
Ncat: Version 7.50 ( https://nmap.org/ncat )
Ncat: Listening on 192.168.0.8:5006
Ncat: Connection from 192.168.0.3.
'plc-tst-proto6w?
                 ?bdSimEncoder
(plc-tst-proto6Q?
                 ?zdSimEncoder
)plc-tst-proto6+g
                 ??dSimEncoder
*plc-tst-proto6
               ??dSimEncoder
+plc-tst-proto6
               ??dSimEncoder^C
-bash-4.2$

Updates to rix.cnf file

$ diff rix.cnf rix.cnf.ENCODER 
67a68,69
>  { host: 'drp-neh-ctl002', id:'tprtrig',     flags:'sp',                 cmd:'tprtrig -t a -c 0 -o 1 -d 2 -w 10'},
>  { host: 'drp-neh-cmp015', id:'encoder_0',   flags:'sxpu',               cmd:f'drp_udpencoder -l 0x8 -o {data_dir} -P {hutch} -d /dev/datadev_0 -C {collect_host}'},

Recording Experiment rixdaq18 Run 23

encoder_0 log file
rix-drp_udpencoder[70415]: <I> UDP receiver thread started
rix-drp_udpencoder[70415]: <I> setting lane 0
rix-drp_udpencoder[70415]: <I> PGPReader saw Configure transition @ 985133577.575584342 (0004674c799500)
rix-drp_udpencoder[70415]: <I> EbReceiver saw Configure transition @ 985133577.575584342 (0004674c799500)
rix-drp_udpencoder[70415]: <I> received key = beginrun
Opening file /ffb01/data/rix/rixdaq18/xtc/rixdaq18-r0023-s002-c000.xtc2
rix-drp_udpencoder[70415]: <I> Opening file '/ffb01/data/rix/rixdaq18/xtc/rixdaq18-r0023-s002-c000.xtc2'
rix-drp_udpencoder[70415]: <I> Opening file '/ffb01/data/rix/rixdaq18/xtc/smalldata/rixdaq18-r0023-s002-c000.smd.xtc2'
rix-drp_udpencoder[70415]: <I> PGPReader saw BeginRun transition @ 985133590.653839154 (0004674d32e3bd)
rix-drp_udpencoder[70415]: <I> EbReceiver saw BeginRun transition @ 985133590.653839154 (0004674d32e3bd)
rix-drp_udpencoder[70415]: <I> received key = beginstep
rix-drp_udpencoder[70415]: <I> PGPReader saw BeginStep transition @ 985133595.531025432 (0004674d77fa30)
rix-drp_udpencoder[70415]: <I> EbReceiver saw BeginStep transition @ 985133595.531025432 (0004674d77fa30)
rix-drp_udpencoder[70415]: <I> received key = enable
rix-drp_udpencoder[70415]: <I> PGPReader saw Enable transition @ 985133600.224320451 (0004674dba80e8)
rix-drp_udpencoder[70415]: <I> EbReceiver saw Enable transition @ 985133600.224320451 (0004674dba80e8)
rix-drp_udpencoder[70415]: <I> received key = disable
rix-drp_udpencoder[70415]: <I> PGPReader saw Disable transition @ 985133613.263120215 (0004674e7336db)
rix-drp_udpencoder[70415]: <I> EbReceiver saw Disable transition @ 985133613.263120215 (0004674e7336db)
rix-drp_udpencoder[70415]: <I> received key = endstep
rix-drp_udpencoder[70415]: <I> PGPReader saw EndStep transition @ 985133613.268625231 (0004674e734afa)
rix-drp_udpencoder[70415]: <I> EbReceiver saw EndStep transition @ 985133613.268625231 (0004674e734afa)
rix-drp_udpencoder[70415]: <I> received key = endrun
rix-drp_udpencoder[70415]: <I> PGPReader saw EndRun transition @ 985133613.326952707 (0004674e742027)
rix-drp_udpencoder[70415]: <I> EbReceiver saw EndRun transition @ 985133613.326952707 (0004674e742027)
rix-drp_udpencoder[70415]: <I> received key = unconfigure
rix-drp_udpencoder[70415]: <I> PGPReader saw Unconfigure transition @ 985133630.918879608 (0004674f6d5f9b)
rix-drp_udpencoder[70415]: <I> EbReceiver saw Unconfigure transition @ 985133630.918879608 (0004674f6d5f9b)

Recording Experiment rixdaq18 Run 27

This was the first recording of the encoder at 120Hz.


xtcreader output
$ xtcreader -d -w 1 -f /cds/data/psdm/rix/rixdaq18/xtc/rixdaq18-r0027-s000-c000.xtc2 | grep shape | head -16

'encoderValue' (shape: 1):  23563414
'timing' (shape: 1):  505870
'scale' (shape: 1):  6667
'mode' (shape: 1):  0
'error' (shape: 1):  0
'majorVersion' (shape: 1):  1
'minorVersion' (shape: 1):  0
'microVersion' (shape: 1):  0

'encoderValue' (shape: 1):  23563404
'timing' (shape: 1):  838450
'scale' (shape: 1):  6667
'mode' (shape: 1):  0
'error' (shape: 1):  0
'majorVersion' (shape: 1):  1
'minorVersion' (shape: 1):  0
'microVersion' (shape: 1):  0
  • No labels