--- /dev/null
- <NumOutputs value="1"/>
+<?xml version="1.0"?>
+
+<!--
+This is example file how HADAQ event building should be configured in DABC.
+Event building process implemented in Combiner module of hadaq::CombinerModule class.
+Module can have several inputs, each with separate port number for receiving data
+from TRB boards. In each input port configuration only port number has meaning.
+First output of combiner module reserved for the connection to
+the optional MBS transmitter module. Second output can be use to store data in hld files.
+To enable storage, one should specify two output ports and correctly configure Output1 of combiner module.
+
+Optionally one can enable MBS transmitter module, which converts HLD to LMD format.
+To enable transmitter, one should specify auto="true" in configuration which says DABC
+to automatically create module when starting application.
+First output of the module reserved for stream server, second output can be used to
+store data in lmd files.
+
+-->
+
+<dabc version="2">
+ <Context host="localhost" name="EventBuilder">
+ <Run>
+ <lib value="libDabcMbs.so"/>
+ <lib value="libDabcHadaq.so"/>
+ <logfile value="hadaqevtbuild.log"/>
+ <loglimit value="1000000"/>
+ <!--affinity value="-1"/-->
+ </Run>
+
+ <MemoryPool name="Pool">
+ <BufferSize value="200000"/>
+ <NumBuffers value="1000"/>
+ </MemoryPool>
+
+ <Module name="Combiner" class="hadaq::CombinerModule">
+ <!-- these parameters will force to create inputs/oputputs of module -->
+ <NumInputs value="1"/>
- <OutputPort name="Output1" url="hld://dabc.hld?maxsize=30"/>
++ <NumOutputs value="2"/>
+
+ <InputPort name="Input0" url="hadaq://host:50000"/>
+ <InputPort name="Input1" url="hadaq://host:10102"/>
+ <InputPort name="Input2" url="hadaq://host:10103"/>
+ <InputPort name="Input3" url="hadaq://host:10104"/>
+ <InputPort name="Input4" url="hadaq://host:10105"/>
+
+ <InputPort name="Input*" queue="10">
+ <HadaqUdpBuffer value="200000"/>
+ <DoShmControl value="false"/>
+ <HadaqUdpMTU value="64512"/>
+ <FlushTimeout value="2.0"/>
+ </InputPort>
+
++ <OutputPort name="Output1" url="hld:///data.local2/dabc.hld?maxsize=500"/>
+
+ <DoShmControl value="false"/>
+ <FlushTimeout value="2.0"/>
+
+ <!-- take event sequence number from vulom/roc sync message at cts -->
+ <UseSyncSequenceNumber value="false"/>
+ <SyncSubeventId value="0x8000"/>
+ <SyncTriggerMask value="0x01"/>
+ <PrintSync value="false"/>
+ <FlushBySync value="false"/>
+
+ <!-- rate meters configuration -->
+ <HadaqData width="4" prec="2" low="0" up="10" debug="1"/>
+ <HadaqEvents width="5" prec="1" low="0" up="1000" debug="1"/>
+ <HadaqDroppedData width="5" prec="3" low="0" up="1" debug="1"/>
+ <HadaqLostEvents width="4" prec="2" low="0" up="100" debug="1"/>
+ </Module>
+
+ <Module name="OnlineServer" class="hadaq::MbsTransmitterModule" auto="true">
+ <NumInputs value="1"/>
+ <NumOutputs value="1"/>
+
+ <InputPort name="Input0" url="Combiner/Output0" queue="10"/>
+
+ <OutputPort name="Output0" url="mbs://Stream"/>
+ <OutputPort name="Output1" url="lmd://test.lmd?maxsize=30&log=2"/>
+
+ <!-- this is 32-bit MBS subevent id, which than can be seen in the analysis. Here procid=0x1f is configured -->
+ <SubeventFullId value="0x000001F"/>
+
+ <!-- If true, all events with the same SYNC number will be merged together into same MBS event -->
+ <DoMergeSyncedEvents value="true"/>
+
+ <TransmitData width="5" prec="3" low="0" up="50" debug="1"/>
+ <TransmitEvents width="4" prec="1" low="0" up="100" debug="1"/>
+ </Module>
+
+ </Context>
+
+ <!--Context name="*">
+ <Thread name="CombinerThrdInp" class="dabc::SocketThread" affinity="+0"/>
+ </Context-->
+
+</dabc>
--#!/bin/sh
++#!/bin/bash
# PATH should already be marked as exported...
#PATH=${HOME}/trbsoft/bin:${PATH}
#PATH=${HOME}/trbsoft/daqdata/bin:${PATH}
#PATH=${HOME}/trbsoft/trbnettools/bin:${PATH}
--export TRB3_SERVER=trb056
++export TRB3_SERVER=trb056:26000
++
++export TRBNETDPID=$(pgrep trbnetd)
++
++echo "trbnetd pid: $TRBNETDPID"
++
++if [[ -z "$TRBNETDPID" ]]
++then
++ ~/trbsoft/trbnettools/binlocal/trbnetd -i 56
++fi
++
++#export TRB3_SERVER=trb056
export DAQOPSERVER=localhost:56
++trbcmd i 0xffff
++
##################################################
## Set addresses
## Other Settings
##################################################
# Reset trigger logic - only a workaround for a bug
--trbcmd w 0xffff 0x20 0x33
++#trbcmd w 0xffff 0x20 0x33
# timeouts
trbcmd w 0xfffe 0xc5 0x800050ff
# pulser #1 to 1k Hz
--trbcmd w 0x8000 0xa137 0x0001869f
++trbcmd w 0x8000 0xa140 0x0001869f
# pulser enable
--#trbcmd setbit 0x8000 0xa101 0x2
--trbcmd clearbit 0x8000 0xa101 0x2
++trbcmd setbit 0x8000 0xa101 0x2
++#trbcmd clearbit 0x8000 0xa101 0x3