#!/bin/bash
xterm -e 'echo "Enabling the MDC-LV-Relais. Wait 4 Seconds..."; sleep 4' &
-command_client.pl -e etraxp204 -c "/home/hadaq/bin/writetty.sh 'OWDS 0'"
+~/bin/command_client.pl -e etraxp204 -c "/home/hadaq/bin/writetty.sh 'OWDS 0'"
sleep 2
-command_client.pl -e etraxp204 -c "/home/hadaq/bin/writetty.sh 'OWDS 0'"
+~/bin/command_client.pl -e etraxp204 -c "/home/hadaq/bin/writetty.sh 'OWDS 0'"
sleep 2
-command_client.pl -e etraxp204 -c "/home/hadaq/bin/writetty.sh 'OWDS 0'"
+~/bin/command_client.pl -e etraxp204 -c "/home/hadaq/bin/writetty.sh 'OWDS 0'"
xterm -e 'echo "Now you should have 157 A and 151 A
on the +3V and -3V rails of the MDC LV (EPICS LV, crates.adl).
print "Checking for time-outs\n";
#Get timed out ports
my $t_timeout = trb_register_read(0xfffe, 0x8b);
-my $t_busy = trb_register_read(0xfe11, 0x80);
foreach my $h (keys %$t_timeout) {
if($h >= 0x1000 && $h < 0x2000 && $h%16) {
my $ports = ($t_timeout->{$h} >> 16) & 0x1fe;
system("trbcmd setbit 0x0003 0xa0c0 0x400");
usleep(30000);
print "Checking for busy MDC front-ends\n";
+my $t_busy = trb_register_read(0xfe11, 0x80);
foreach my $h (keys %$t_busy) {
my $ports = ($t_busy->{$h}) & 0x1fe;
if($ports) {
#load startup-settings
print("Loading configuration for OEP\n");
-system("ssh -X hadesdaq02 'cd /home/hadaq/trbsoft/daq/main/;./startup.pl -f ../mdc/startup.script -c 0 -m MDCnomasks -m MDCDATASET -m MDCindiv -m MDCreg0current -eb off'");
+#system("ssh -X lxhadeb06 'cd /home/hadaq/trbsoft/daq/main/;./startup.pl -f ../mdc/startup.script -c 0 -m MDCnomasks -m MDCDATASET -m MDCindiv -m MDCreg0current -eb off'");
+system("ssh -X lxhadesdaq 'cd /home/hadaq/trbsoft/daq/main/;./startup.pl -f ../mdc/startup.script -c 0 -m MDCnomasks -m MDCDATASET -m MDCindiv -m MDCreg0current -eb off'");
+
+
#Correct trigger number (get from CTS)
my $t_trignum = trb_register_read(0x0002, 01) or die;
trbcmd clearbit 0xfe4e 0xc800 0x00001000
#2us trigger window
-trbcmd w 0xfe48 0xc801 0x80f00000
-trbcmd w 0xfe4e 0xc801 0x80f00000
+trbcmd w 0xfe48 0xc801 0x800f0190
+trbcmd w 0xfe4e 0xc801 0x800f0190
#Data limit off
trbcmd w 0xfe48 0xc804 0x00000080
#Hodoscope inputs
-#trbcmd w 0x5010 0xc802 0xffffffff # disable channel 0-31
+ trbcmd w 0x5010 0xc802 0xffffffff # disable channel 0-31
trbcmd w 0x5010 0xc803 0x00000000 # disable channel 32-63
trbcmd w 0x5011 0xc802 0x00000000 # disable channel 0-31
trbcmd w 0x5011 0xc803 0x00000000 # disable channel 32-63
trbcmd w 0x5012 0xc802 0x00000000 # disable channel 0-31
trbcmd w 0x5012 0xc803 0x00000000 # disable channel 32-63
-#trbcmd w 0x5013 0xc802 0xffffffff # disable channel 0-31
+ trbcmd w 0x5013 0xc802 0xffffffff # disable channel 0-31
trbcmd w 0x5013 0xc803 0x00000000 # disable channel 32-63
#Start inputs
-#trbcmd w 0x5000 0xc802 0xffffffff # disable channel 0-31
+ trbcmd w 0x5000 0xc802 0xffff0000 # disable channel 0-31
trbcmd w 0x5000 0xc803 0x00000000 # disable channel 32-63
-#trbcmd w 0x5001 0xc802 0xffffffff # disable channel 0-31
+ trbcmd w 0x5001 0xc802 0x00000000 # disable channel 0-31
trbcmd w 0x5001 0xc803 0x00000000 # disable channel 32-63
-#trbcmd w 0x5002 0xc802 0xffffffff # disable channel 0-31
+ trbcmd w 0x5002 0xc802 0x00000000 # disable channel 0-31
trbcmd w 0x5002 0xc803 0x00000000 # disable channel 32-63
trbcmd w 0x5003 0xc802 0x00000000 # disable channel 0-31
trbcmd w 0x5003 0xc803 0x00000000 # disable channel 32-63
#Trigger Generator Settings
+#Replace with proper values
+trbcmd w 0x5000 0xcf00 0xff00
+trbcmd w 0x5001 0xcf00 0x0
+trbcmd w 0x5002 0xcf00 0x0
+trbcmd w 0x5003 0xcf00 0x0
+trbcmd w 0x8880 0xcf00 0x0111 #Forward to CTS via central FPGA
+#Connected to second Start input on CTS
+
+trbcmd w 0x5010 0xcf00 0xffff
+trbcmd w 0x5001 0xcf00 0x0000
+trbcmd w 0x5002 0xcf00 0x0000
+trbcmd w 0x5003 0xcf00 0xffff
+trbcmd w 0x8890 0xcf00 0x1001 #Forward to CTS via central FPGA
+
#Input Monitor Settings
+#Enable 16 inputs on all
+trbcmd w 0x5000 0xcf80 0xffff
+trbcmd w 0x5001 0xcf80 0xffff
+trbcmd w 0x5002 0xcf80 0xffff
+trbcmd w 0x5003 0xcf80 0x0000
+trbcmd w 0x5010 0xcf80 0xffff
+trbcmd w 0x5011 0xcf80 0x0000
+trbcmd w 0x5012 0xcf80 0x0000
+trbcmd w 0x5013 0xcf80 0xffff
exec_cmd{local} /home/hadaq/trbsoft/daqtools/tools/dac_program.pl ../start/ThreshPadiwaVeto.db
+exec_cmd{local} /home/hadaq/trbsoft/daqtools/tools/dac_program.pl ../start/ThreshNinoStart.db
+