trbcmd w 0x8000 0x830d 0x1 # enable readout bit
#mac address of the EB
-#kp1pc105 00:1b:21:43:97:ea
-trbcmd w 0x8000 0x8100 0x214397ea # lower 4 bytes
-trbcmd w 0x8000 0x8101 0x001b # upper two bytes
+#mz-lab2 00:24:32:03:19:1a
+trbcmd w 0x8000 0x8100 0x3203191a # lower 4 bytes
+trbcmd w 0x8000 0x8101 0x0024 # upper two bytes
-trbcmd w 0x8000 0x8102 0xc0a80001 # destination IP-address: 192.168.0.1
+trbcmd w 0x8000 0x8102 0xc0a80002 # destination IP-address: 192.168.0.2 - mz-lab2
trbcmd w 0x8000 0x8103 0xc350 # destination port 50000
trbcmd w 0x8000 0x8104 0xdead0110 # source MAC-address
trbcmd w 0x8000 0x8105 0x001b # source MAC: upper bytes
trbcmd w 0x8001 0x830d 0x1 # enable readout bit
#mac address of the EB
-#kp1pc105 00:1b:21:43:97:ea
-trbcmd w 0x8001 0x8100 0x214397ea # lower 4 bytes
-trbcmd w 0x8001 0x8101 0x001b # upper two bytes
+#mz-lab2 00:24:32:03:19:1a
+trbcmd w 0x8001 0x8100 0x3203191a # lower 4 bytes
+trbcmd w 0x8001 0x8101 0x0024 # upper two bytes
-trbcmd w 0x8001 0x8102 0xc0a80001 # destination IP-address: 192.168.0.1
+
+trbcmd w 0x8001 0x8102 0xc0a80002 # destination IP-address: 192.168.0.2 - mz-lab2
trbcmd w 0x8001 0x8103 0xc352 # destination port 50002
# port 50001 is for debug messages from GbE
trbcmd w 0x8001 0x8104 0xdead0110 # source MAC-address
trbcmd w 0x8002 0x830d 0x1 # enable readout bit
#mac address of the EB
-#kp1pc105 00:1b:21:43:97:ea
-trbcmd w 0x8002 0x8100 0x214397ea # lower 4 bytes
-trbcmd w 0x8002 0x8101 0x001b # upper two bytes
+#mz-lab2 00:24:32:03:19:1a
+trbcmd w 0x8002 0x8100 0x3203191a # lower 4 bytes
+trbcmd w 0x8002 0x8101 0x0024 # upper two bytes
-trbcmd w 0x8002 0x8102 0xc0a80001 # destination IP-address: 192.168.0.1
+trbcmd w 0x8002 0x8102 0xc0a80002 # destination IP-address: 192.168.0.2 - mz-lab2
trbcmd w 0x8002 0x8103 0xc353 # destination port 50003
# port 50001 is for debug messages from GbE
trbcmd w 0x8002 0x8104 0xdead0110 # source MAC-address
trbcmd w 0x8003 0x830d 0x1 # enable readout bit
#mac address of the EB
-#kp1pc105 00:1b:21:43:97:ea
-trbcmd w 0x8003 0x8100 0x214397ea # lower 4 bytes
-trbcmd w 0x8003 0x8101 0x001b # upper two bytes
+#mz-lab2 00:24:32:03:19:1a
+trbcmd w 0x8003 0x8100 0x3203191a # lower 4 bytes
+trbcmd w 0x8003 0x8101 0x0024 # upper two bytes
-trbcmd w 0x8003 0x8102 0xc0a80001 # destination IP-address: 192.168.0.1
+trbcmd w 0x8003 0x8102 0xc0a80002 # destination IP-address: 192.168.0.2 - mz-lab2
trbcmd w 0x8003 0x8103 0xc354 # destination port 50004
# port 50001 is for debug messages from GbE
trbcmd w 0x8003 0x8104 0xdead0110 # source MAC-address
##################################################
-## Set addresses
+## System Reset
##################################################
-./merge_serial_address.pl ~/trbsoft/daqtools/base/serials_trb3.db ~/trbsoft/daqtools/base/addresses_trb3.db > /dev/null
+trbcmd reset
+
##################################################
-## System Reset
+## Set addresses
##################################################
-trbcmd reset
+./merge_serial_address.pl ~/trbsoft/daqtools/base/serials_trb3.db ~/trbsoft/daqtools/base/addresses_trb3.db > /dev/null
+
##################################################
## Configure GbE for DAQ
##################################################
## Configure TDCs
##################################################
+trbcmd clearbit 0xfe48 0xc800 0x00001000 ## Triggered mode
trbcmd setbit 0xfe48 0xc800 0x00001000 ## Triggerless mode
-#trbcmd clearbit 0xfe48 0xc800 0x00001000 ## Triggered mode
+
trbcmd w 0xfe48 0xc801 0x000f0005 ## trigger window enable & trigger window width
trbcmd w 0xfe48 0xc802 0x00000000 ## channel 01-31 enable
trbcmd w 0xfe48 0xc803 0x00000000 ## channel 32-63 enable
trbcmd w 0xfe48 0xc804 0x00000010 ## data transfer limit
+trbcmd w 0xc000 0xc802 0x00000003 ## Scintilator on
+
+trbcmd w 0xc00c 0xc802 0x00000000 ## padiwa 1 on
+trbcmd w 0xc00c 0xc803 0xffffffff ## padiwa 2 on
+trbcmd w 0xc00f 0xc802 0xffffffff ## padiwa 3 on
+trbcmd w 0xc00f 0xc803 0xffffffff ## padiwa 4 on
+
+
##################################################
## Other Settings
##################################################
-# Reset trigger logic - only a workaround for a bug
+
+# remove hub (port 2) from first trb3
+#trbcmd clearbit 0x8000 0xc0 0x4
+#trbcmd clearbit 0x8000 0xc1 0x4
+#trbcmd clearbit 0x8000 0xc3 0x4
+
+
+## Reset trigger logic - only a workaround for a bug
trbcmd w 0xffff 0x20 0x33
# timeouts
# pulser enable
#trbcmd setbit 0x8000 0xa101 0x2
trbcmd clearbit 0x8000 0xa101 0x2
+
+trbcmd setbit 0x8000 0xa101 0x40