Index: /trigger/CommSocket.py
===================================================================
--- /trigger/CommSocket.py	(revision 114)
+++ /trigger/CommSocket.py	(revision 115)
@@ -5,8 +5,4 @@
 
 """
-A basic, multiclient 'chat server' using Python's select module
-with interrupt handling.
-
-Entering any line of input at the terminal will exit the server.
 """
 
Index: /trigger/CommunicateWithVME.py
===================================================================
--- /trigger/CommunicateWithVME.py	(revision 114)
+++ /trigger/CommunicateWithVME.py	(revision 115)
@@ -15,4 +15,15 @@
 import _VME
 import time
+import datetime
+
+def GetStatus():
+    print "Trigger thresholds: ", GlobalVariables.TriggerThresholds
+    print "Hex Pattern: ", GlobalVariables.HexPattern
+    print "Majority Level: ",GlobalVariables.MajorityLevel
+
+
+
+
+
 def GetRate(module,channel):
     _VME.V560_Clear_Scales( module)
@@ -23,4 +34,6 @@
     return (endCounter-beginCounter)/2000.
 
+
+
 def GetRates(module):
     _VME.V560_Clear_Scales( module)
@@ -43,10 +56,11 @@
         #GlobalVariables.ServerMessage = str(beginCounter[i])
     #GlobalVariables.ServerMessage = "Evaluating rates..."
-    time.sleep(2)
+    time.sleep(1)
     for i in range(0,16):
         endCounter[i] = _VME. V560_Read_Counter( module,  i)
         #GlobalVariables.ServerMessage = str(endCounter[i])
-        rates[i+1] =(endCounter[i]-beginCounter[i])/2000.
+        rates[i+1] =(endCounter[i]-beginCounter[i])/1000.
     return rates
+
 
 class GimmeRates(threading.Thread):
@@ -64,6 +78,82 @@
             self.rates=newrates
 
+
+
+        
+class WriteOutput(threading.Thread):      #thread that writes the rates and threshold to a file.
+    rates=["rates",
+        0,0,0,0,
+           0,0,0,0,
+           0,0,0,0,
+           0,0,0,0]
+    interval = 2
+    filename = "test.txt"
+    #gimmeRates =GimmeRates()
+    gimmeRates=GimmeRates()
+    #File=open(filename,'a')
+    def __init__(self, filename="test.txt", interval = 10):
+        threading.Thread.__init__(self)
+        #self.OpenNewFile(filename)
+
+
+
+    def writeToFile(self):
+        File = open(self.filename,'a')
+        #print "writing", (GlobalVariables.Rates)
+        #year = datetime.date.today().year
+        #month = datetime.date.today().month
+        #day = datetime.date.today().day
+        year = time.localtime(time.time())[0]
+        month =time.localtime(time.time())[1]
+        day = time.localtime(time.time())[2]
+        hour = time.localtime(time.time())[3]
+        minute = time.localtime(time.time())[4]
+        seconds = time.localtime(time.time())[5]
+        ms = time.localtime(time.time())[6]
+        #date=str(year)
+        #if (hour>=12):
+        #    day = day+1
+
+        t = datetime.datetime.now()
+        EpochSeconds=int(time.mktime(t.timetuple()))
+
+        outstring = "Trigger " + " ThreshRate "+str(year) + " " + str(month) +" " + str(day) +" "+str(hour)+" " + str(minute) + " " + str(seconds)+ " "+str(ms)+" "+str(EpochSeconds)+" Thresh: "
+        File.write(outstring)
+        #print outstring
+        File.write(str(GlobalVariables.TriggerThresholds[0:]).strip('[]').replace(',', ''))
+        File.write(" rate: ")
+        GlobalVariables.Rates = self.gimmeRates.rates
+        File.write(str(GlobalVariables.Rates[0:]))#.strip('[]').replace(',', ''))
+        #print str(GlobalVariables.Rates[0:]).strip('[]').replace(',', ''))
+
+      
+        #print str(GlobalVariables.TriggerThresholds[0:]).strip('[]').replace(',', '')
+        #print "\n"
+        
+        File.write("\n")
+        File.close();
+
+
+
+    def run(self):
+        self.gimmeRates.start()
+        while(GlobalVariables.UserInput[1:]!="exit" and GlobalVariables.UserInput[1:] != "EXIT"):
+            time.sleep(0.001)
+            time.sleep(self.interval)
+            self.writeToFile() 
+
+
+
+
+
+
+
+        
+    
+
+
 class ParseUserInput(threading.Thread):
     gimmeRates=GimmeRates()
+    writeOutput=WriteOutput()
     def Parse(self,Command):
         Command = Command[1:]
@@ -108,6 +198,6 @@
 
                 if(V560Command=="GetRates" or V560Command=="GR"):
-                    GlobalVariables.ServerMessage = "trying to get rates"
-                    time.sleep(0.01)
+                    #GlobalVariables.ServerMessage = "trying to get rates"
+                    #time.sleep(0.01)
                     try:
                         module = int(sCommand[2])
@@ -132,8 +222,14 @@
                     GlobalVariables.ServerMessage += "V812 SetHexPat <module#[1-10]> <HexPattern[0x0000-0xFFFF>\n"
                     GlobalVariables.ServerMessage += "V812 SetThresh <module#[1-10]> <channel#[0-15]> <thresh[0-255]>\n"
+                    GlobalVariables.ServerMessage += "V812 SetThreshDiff <module#[1-10]> <channel#[0-15]> <threshdiff[0-255]>\n"
                     GlobalVariables.ServerMessage += "V812 SetAllThresh <module#[1-10]>  <thresh[0-255]>\n"
+                    GlobalVariables.ServerMessage += "V812 SetAllThreshDiff <module#[1-10]>  <threshdiff[0-255]>\n"
                     GlobalVariables.ServerMessage += "V812 SetMajLevel <module#[1-10]> <MajLev[1-20]>\n"
                     GlobalVariables.ServerMessage += "V812 SetMajThresh <module#[1-10]> <MajThr[0-255]>\n"
                     GlobalVariables.ServerMessage += "V812 SetDeadTime <module#[1-10]> <Block [0-1]> <DeadTime[0-255]>\n"
+                    GlobalVariables.ServerMessage += "V812 SetOutputWidth <module#[1-10]> <Block [0-1]> <OutputWidth[0-255]>\n"
+                    GlobalVariables.ServerMessage += "V812 Status\n"
+                    GlobalVariables.ServerMessage += "V812 RateScan <module> <start> <step> <stop>\n"
+                    
                     time.sleep(0.05)
                 #set the hexpattern:
@@ -152,4 +248,5 @@
                             error_code=_VME.V812_Set_Pattern_Inhibit_Hex(module, hexpat)
                             GlobalVariables.ServerMessage = "success! "
+                            GlobalVariables.HexPattern =str(hex(hexpat))
                             time.sleep(0.05)
                             
@@ -163,5 +260,5 @@
                         time.sleep(0.05)
                 elif(V812Command=="SetAllThresh"):
-                    print "trying to set all the threshold:"
+                    print "trying to set the threshold:"
                     try:
                         module  = int(sCommand[2])
@@ -171,4 +268,5 @@
                             GlobalVariables.ServerMessage += "setting threshold of channel: "+str(channel)+ " in module "+str(module)+" to: "+str(thresh)+"\n"
                             GlobalVariables.ServerMessage += "success: "+str(_VME.V812_Set_Threshold(module, channel,  thresh))+"\n"
+                            GlobalVariables.TriggerThresholds[channel] = thresh
                         time.sleep(0.05)
                             
@@ -176,4 +274,40 @@
                     except:
                         print "Syntax error (SetAllThresh) "
+
+                elif(V812Command=="SetAllThreshDiff"):
+                    print "trying to set all the threshold (diff):"
+                    try:
+                        module      = int(sCommand[2])
+                        threshdiff  = int(sCommand[3])
+                        GlobalVariables.ServerMessage="Setting all thresholds (diff)...\n"
+                        for channel in range(0,16):
+                            GlobalVariables.ServerMessage += "increase threshold of channel: "+str(channel)+ " in module "+str(module)+" by: "+str(threshdiff)+"\n"
+                            GlobalVariables.ServerMessage += "success: "+str(_VME.V812_Set_Threshold(module, channel, GlobalVariables.TriggerThresholds[channel]+ threshdiff))+"\n"
+                            GlobalVariables.TriggerThresholds[channel]+= threshdiff
+                        time.sleep(0.05)
+                            
+                            
+                    except:
+                        print "Syntax error (SetAllThreshDiff) "
+
+                elif(V812Command=="SetThreshDiff"):
+                    GlobalVariables.ServerMessage = "trying to set the threshold:"
+                    time.sleep(0.05)
+                    try:
+                        module      = int(sCommand[2])
+                        channel     = int(sCommand[3])
+                        threshdiff  = int(sCommand[4])
+                        #print module, channel, threshdiff
+                        #print GlobalVariables.TriggerThresholds[channel]
+                        newthresh = GlobalVariables.TriggerThresholds[channel] + threshdiff
+                        #print newthresh
+                        GlobalVariables.ServerMessage = "increase threshold of channel: "+str(channel)+ " in module "+str(module)+" by: "+str(threshdiff)+"\n"
+                        GlobalVariables.ServerMessage += "success: "+str(_VME.V812_Set_Threshold(module, channel,newthresh))
+                        GlobalVariables.TriggerThresholds[channel] = newthresh
+                        time.sleep(0.05)
+                    except:
+                        GlobalVariables.ServerMessage = "Syntax error (SetThreshDiff) "
+                        time.sleep(0.05)
+            
                 elif(V812Command=="SetThresh"):
                     GlobalVariables.ServerMessage = "trying to set the threshold:"
@@ -185,4 +319,5 @@
                         GlobalVariables.ServerMessage = "setting threshold of channel: "+str(channel)+ " in module "+str(module)+" to: "+str(thresh)
                         GlobalVariables.ServerMessage += "success: "+str(_VME.V812_Set_Threshold(module, channel,  thresh))
+                        GlobalVariables.TriggerThresholds[channel] = thresh
                         time.sleep(0.05)
                     except:
@@ -197,4 +332,5 @@
                         GlobalVariables.ServerMessage = "setting maj. level of module "+str(module)+" to: "+str(level)
                         GlobalVariables.ServerMessage += "success: "+str(_VME.V812_Set_Majority_Level(module,level))
+                        GlobalVariables.MajorityLevel = level
                         time.sleep(0.05)
                     except:
@@ -216,5 +352,5 @@
 
                 elif(V812Command=="SetDeadTime"):
-                    GlobalVariables.ServerMessage = "trying to set the majority threshold:"
+                    GlobalVariables.ServerMessage = "trying to set deadtime threshold:"
                     time.sleep(0.05)
                     try:
@@ -226,23 +362,129 @@
                         time.sleep(0.05)
                     except:
-                        GlobalVariables.ServerMessage = "Syntax error (SetMajThresh)"
-                        time.sleep(0.05)
-
+                        GlobalVariables.ServerMessage = "Syntax error (SetDeadTime)"
+                        time.sleep(0.05)
+                elif(V812Command=="SetOutputWidth"):
+                    GlobalVariables.ServerMessage = "trying to set output width "
+                    time.sleep(0.05)
+                    try:
+                        module  = int(sCommand[2])
+                        block  = int(sCommand[3])
+                        outputw= int(sCommand[4])
+                        GlobalVariables.ServerMessage = "setting output width of module "+str(module)+" block: "+str(block)+ " to: "+str(outputw)
+                        GlobalVariables.ServerMessage += "success: "+str(_VME.V812_Set_Output_Width(module, block, outputw))
+                        time.sleep(0.05)
+                    except:
+                        GlobalVariables.ServerMessage = "Syntax error (SetOutputTime)"
+                        time.sleep(0.05)
+                elif(V812Command=="Status"):
+                    GetStatus();
+
+                elif(V812Command=="RateScan"):
+                    GlobalVariables.ServerMessage = "trying to scan the rates "
+                    time.sleep(0.05)
+                    try:
+                        module = int(sCommand[2])
+                        start  = int(sCommand[3])
+                        step   = int(sCommand[4])
+                        stop   = int(sCommand[5])
+                        print module, start, step, stop
+                        self.RateScan(module, start, step, stop)
+
+
+                    except:
+                        GlobalVariables.ServerMessage = "Syntax error (RateScan)"
+                        time.sleep(0.05)
+                        
+
+
+                    
                 else:
                     GlobalVariables.ServerMessage = "Syntax Error (V812)"
                     time.sleep(0.05)
+                
                         
         except:
             GlobalVariables.ServerMessage = "syntax error"
             time.sleep(0.05)
-        #_VME.V812_Set_Threshold(1, 0,  255)
+    def RateScan(self,module, start, step, stop):
+        #print module, start, step,stop
+        #print "IN\n"
+        #First stop the automatic rate writeup
+        oldinterval = self.writeOutput.interval
+        self.writeOutput.interval=15
+        rates      =  ["rates",
+                   0,0,0,0,
+                   0,0,0,0,
+                   0,0,0,0,
+                   0,0,0,0]
+        print "rates:" ,rates
+        CurrentThresholds =[0,0,0,0,
+                   0,0,0,0,
+                   0,0,0,0,
+                   0,0,0,0]
+        for pix in range(0,16):
+            CurrentThresholds[pix] = GlobalVariables.TriggerThresholds[pix]
+        print "Threshs: ",CurrentThresholds,"\n"
+        NumberOfScanSteps = int((stop-start)/step) + 1
+        print "NumberOfScanSteps: ",  NumberOfScanSteps
+        for StepNumber in range(0,NumberOfScanSteps):
+            print "Step#" ,StepNumber
+            for pix in range(0,16):
+                #print (CurrentThresholds[pix] + start) + step*StepNumber
+                GlobalVariables.TriggerThresholds[pix] = (CurrentThresholds[pix] + start) + step*StepNumber
+                #print pix, GlobalVariables.TriggerThresholds[pix] 
+                _VME.V812_Set_Threshold(module, pix,   GlobalVariables.TriggerThresholds[pix])
+
+            time.sleep(2.1)
+            #print "Getting Rates: \n"
+            rates = self.gimmeRates.rates#GetRates(module);
+            self.writeOutput.writeToFile()
+            #print "Got rates..."
+            print  "Thresh: ",GlobalVariables.TriggerThresholds, " rates: ",rates    #_VME.V812_Set_Threshold(1, 0,  255)
+
+
+        self.writeOutput.interval = oldinterval
     
     def __init__(self):
+        #self.writeOutput.OpenNewFile("test.txt")
         threading.Thread.__init__(self)
     def run(self):
         self.gimmeRates.start()
+        
+        self.writeOutput.start()
         oldcommand=GlobalVariables.UserInput
         while(GlobalVariables.UserInput[1:]!="exit" and GlobalVariables.UserInput[1:] != "EXIT"):
             CommandToParse=GlobalVariables.UserInput
+            #Filename to write:
+            #year = datetime.date.today().year
+            #month = datetime.date.today().month
+            #day = datetime.date.today().day
+            MyTime = time.time()
+            #print MyTime
+        
+           
+            hour = time.gmtime(MyTime)[3]
+            minute = time.gmtime(MyTime)[4]
+            #print hour, minute
+            if(hour>=13):
+                MyTime+=12*60*60
+
+            year = time.gmtime(MyTime)[0]
+            month =time.gmtime(MyTime)[1]
+            day = time.gmtime(MyTime)[2]
+            date=str(year)
+            #if (hour>=12):
+            #    day = day+1
+            
+            date+="%(month)02d" % {"month":month}
+            date+="%(day)02d" % {"day":day}
+            #date+="_"
+            #date+="%(hour)02d" % {"hour":hour}
+            #date+="%(minute)02d" % {"minute":minute}
+            self.writeOutput.filename="/ct3data/SlowData/Trigger_"+date+".slow"
+
+            
+            #self.writeOutput.filename = "/ct3data/SlowData/Trigger_"
+            #self.writeOutput.filename
             if(oldcommand!=CommandToParse):
                 self.Parse(CommandToParse)
Index: /trigger/GlobalVariables.py
===================================================================
--- /trigger/GlobalVariables.py	(revision 114)
+++ /trigger/GlobalVariables.py	(revision 115)
@@ -6,6 +6,16 @@
 #global UserInput
 UserInput =''
-Rates = [16]
+Rates =             [0,0,0,0,
+                     0,0,0,0,
+                     0,0,0,0,
+                     0,0,0,0]
+
 ServerMessage=''
 Flag=1
 counter = 0
+TriggerThresholds = [0,0,0,0,
+                     0,0,0,0,
+                     0,0,0,0,
+                     0,0,0,0]
+HexPattern = '0x0000'
+MajorityLevel = 0
Index: /trigger/ListenToArduino.py
===================================================================
--- /trigger/ListenToArduino.py	(revision 114)
+++ /trigger/ListenToArduino.py	(revision 115)
@@ -9,9 +9,15 @@
     month = datetime.date.today().month
     day = datetime.date.today().day
+    hour = time.localtime(time.time())[3]
+    minute = time.localtime(time.time())[4]
     date=str(year)
-    date+="0"
-    date+=str(month)
-    date+=str(day)
-    filename="Arduino_testing_"+date+".txt"
+    
+
+    date+="%(month)02d" % {"month":month}
+    date+="%(day)02d" % {"day":day}
+    date+="_"
+    date+="%(hour)02d" % {"hour":hour}
+    date+="%(minute)02d" % {"minute":minute}
+    filename="/ct3data/SlowData/Trigger_"+date+".slow"
     fileHandle = open ( filename, 'w' )
     fileHandle.close()
Index: /trigger/Main.py
===================================================================
--- /trigger/Main.py	(revision 114)
+++ /trigger/Main.py	(revision 115)
@@ -19,8 +19,17 @@
 import GlobalVariables
 import CommunicateWithVME
-import ListenToArduino
+import ReadTemperatures
 import time
 #connecting to the crates:
+print "\n\n\n"
+print "  ####################################"
+print "  #                                  #"
+print "  #      Trigger Control Program     #"
+print "  #      M. Rissi 2009               #"
+print "  #                                  #"
+print "  ####################################"
+print "\n\n\n"
 print "connecting to the crates..."
+
 _VME.VME_Open()
 _VME.V560_Open()
@@ -34,5 +43,5 @@
 
 GlobalVariables.UserInput = ''
-print "start the shell... "
+#print "start the shell... "
 inputShell= PythonShell.InputShell()
 #inputShell.daemon=True
@@ -40,15 +49,15 @@
 
 # start the server:
-print "start the server... "
+#print "start the server... "
 commServer = CommSocket.CommServer(3492,5)
 commServer.start()
 
-print "start the parser..."
+#print "start the parser..."
 parseUserInput= CommunicateWithVME.ParseUserInput()
 parseUserInput.start()
 
-print "listening to Arduino..."
-listenToArduino = ListenToArduino.ListenToArduino()
-listenToArduino.start()
+#print "listening to Arduino..."
+readTemperatures = ReadTemperatures.ReadTemperatures()
+readTemperatures.start()
 while(GlobalVariables.UserInput[1:]!="exit" and GlobalVariables.UserInput[1:] != "EXIT"):
     time.sleep(0.1)
Index: /trigger/PythonShell.py
===================================================================
--- /trigger/PythonShell.py	(revision 114)
+++ /trigger/PythonShell.py	(revision 115)
@@ -38,5 +38,6 @@
                 #print "\n(SHELL) You entered:",GlobalVariables.ServerMessage
                 #sys.stdout.write( "SHELL2 >>>")
-                print GlobalVariables.ServerMessage
+                if GlobalVariables.ServerMessage[0]!="[":
+                    print GlobalVariables.ServerMessage
                 self.lastvar=GlobalVariables.ServerMessage
               
Index: /trigger/ReadTemperatures.py
===================================================================
--- /trigger/ReadTemperatures.py	(revision 115)
+++ /trigger/ReadTemperatures.py	(revision 115)
@@ -0,0 +1,33 @@
+import threading
+import GlobalVariables
+import serial
+import time
+import datetime
+class ReadTemperatures(threading.Thread):
+
+   
+
+    
+    def run(self):
+        time.sleep(0.01)
+        while(GlobalVariables.UserInput[1:]!="exit" and GlobalVariables.UserInput[1:] != "EXIT"):
+            filename="/ct3data/SlowData/CLIM_20090924.slow"
+            file = open(filename, 'r')
+            #ArduinoMessage = self.ser.readline()
+            Lines= file.readlines()
+            lastline=Lines[-1]
+            #print Lines[-1]
+            file.close()
+            
+            Message = lastline[lastline.find('['):]
+            GlobalVariables.ServerMessage   = Message
+            #print Message
+            time.sleep(5)
+
+
+
+
+            
+
+
+
Index: /trigger/StartTrigger.sh
===================================================================
--- /trigger/StartTrigger.sh	(revision 115)
+++ /trigger/StartTrigger.sh	(revision 115)
@@ -0,0 +1,2 @@
+#!/bin/sh
+./Main.py
Index: /trigger/VME.i
===================================================================
--- /trigger/VME.i	(revision 114)
+++ /trigger/VME.i	(revision 115)
@@ -29,5 +29,5 @@
 int V812_Set_Pattern_Inhibit(short module, char channel[16]); 
 int V812_Set_Pattern_Inhibit_Hex(short module, int  pattern);
-int V812_Set_Output_Width(short module, char channel_block, short width);
+int V812_Set_Output_Width(short module, short channel_block, short width);
 int V812_Set_Dead_Time(short module, short channel_block, short dead_time);
 int V812_Set_Majority_Level(short module, short majority_level);
Index: /trigger/VME_wrap.c
===================================================================
--- /trigger/VME_wrap.c	(revision 114)
+++ /trigger/VME_wrap.c	(revision 115)
@@ -1007,9 +1007,9 @@
     PyObject *resultobj;
     short arg1 ;
-    char arg2 ;
+    short arg2 ;
     short arg3 ;
     int result;
     
-    if(!PyArg_ParseTuple(args,(char *)"hch:V812_Set_Output_Width",&arg1,&arg2,&arg3)) goto fail;
+    if(!PyArg_ParseTuple(args,(char *)"hhh:V812_Set_Output_Width",&arg1,&arg2,&arg3)) goto fail;
     result = (int)V812_Set_Output_Width(arg1,arg2,arg3);
     
Index: /trigger/communication.py
===================================================================
--- /trigger/communication.py	(revision 114)
+++ /trigger/communication.py	(revision 115)
@@ -16,5 +16,5 @@
     value = str(len(buf))
     #size = struct.pack("i",value)
-    print "length: ",len(buf)
+    #rint "length: ",len(buf)
     #print "SIZE: ",repr(size)
     #channel.send(value)
Index: /trigger/gui/t72/humidity.cpp
===================================================================
--- /trigger/gui/t72/humidity.cpp	(revision 114)
+++ /trigger/gui/t72/humidity.cpp	(revision 115)
@@ -35,8 +35,8 @@
   val=vall;
   int bblue= (int)(((float)(val-MinVal)/(float)(MaxVal-MinVal))*255.);
-
+  //int white = 255-bblue;
   //int bblue=255-(int)(((float)(val-MinVal)/(float)(MaxVal-MinVal))*255.);
   //printf("%i %i\n",rred,bblue);
-  bgColor->setRgb(0,0,bblue);
+  bgColor->setRgb(255,bblue,0);
    //QPalette::ColorRole
    QPalette *mypalette=new QPalette();
Index: /trigger/gui/t72/main.cpp
===================================================================
--- /trigger/gui/t72/main.cpp	(revision 114)
+++ /trigger/gui/t72/main.cpp	(revision 115)
@@ -213,5 +213,5 @@
      connect(timer, SIGNAL(timeout()),this , SLOT(updateRates()));
      
-     timer->start(7000);
+     timer->start(5000);
 
 
Index: /trigger/v560.c
===================================================================
--- /trigger/v560.c	(revision 114)
+++ /trigger/v560.c	(revision 115)
@@ -107,5 +107,5 @@
 			//if(v560_modules[i].registers->manufacturer_type==0x0818) {
 			if(v560_modules[i].registers->manufacturer_type==0x083A) {
-				printf("v560-module %i found at address 0x%08x:\n\tMaster mapping: %i\n\tVirtual address: 0x%08x\n\n",i+1,tmp_base_address,v560_modules[i].master_mapping,v560_modules[i].registers);
+			  //printf("v560-module %i found at address 0x%08x:\n\tMaster mapping: %i\n\tVirtual address: 0x%08x\n\n",i+1,tmp_base_address,v560_modules[i].master_mapping,v560_modules[i].registers);
 				v560_modules[i].present = 1;
 			}
Index: /trigger/v812.c
===================================================================
--- /trigger/v812.c	(revision 114)
+++ /trigger/v812.c	(revision 115)
@@ -54,5 +54,5 @@
 			//reading the hex address
 			if(!sscanf(&line[2],"%8x",&tmp_base_address)) {
-				printf("Reading input file v812_base.dat: non-comment line without address found. Please delete or comment this line.\n");
+			  printf("Reading input file v812_base.dat: non-comment line without address found. Please delete or comment this line.\n");
 			}
 			
@@ -81,5 +81,5 @@
 			
 			if(v812_modules[i].registers->manufacturer_type==0x0851) {
-				printf("v812-module %i found at address 0x%08x:\n\tMaster mapping: %i\n\tVirtual address: 0x%08x\n\n",i+1,tmp_base_address,v812_modules[i].master_mapping,v812_modules[i].registers);
+			  //printf("v812-module %i found at address 0x%08x:\n\tMaster mapping: %i\n\tVirtual address: 0x%08x\n\n",i+1,tmp_base_address,v812_modules[i].master_mapping,v812_modules[i].registers);
 				v812_modules[i].present = 1;
 			}
@@ -174,5 +174,5 @@
 //******************************************************************************
 
-int V812_Set_Output_Width(short module, char channel_block, short width)
+int V812_Set_Output_Width(short module, short channel_block, short width)
 {
 	//channel_block: 0 for ch0-ch7, 1 for ch8-ch15
@@ -271,5 +271,5 @@
 	for(i=0; i<NMAX_V812_MODULES; i++) {
 		if(v812_modules[i].present != 1) {
-			//printf("Module %i is not present.\n",i+1);
+			printf("Module %i is not present.\n",i+1);
 			continue;
 		}
Index: /trigger/v812.h
===================================================================
--- /trigger/v812.h	(revision 114)
+++ /trigger/v812.h	(revision 115)
@@ -60,5 +60,5 @@
 int V812_Set_Threshold(short module, short channel, short threshold);
 int V812_Set_Pattern_Inhibit(short module, char channel[16]);
-int V812_Set_Output_Width(short module, char channel_block, short width);
+int V812_Set_Output_Width(short module,short channel_block, short width);
 int V812_Set_Dead_Time(short module, short channel_block, short dead_time);
 int V812_Set_Majority_Level(short module, short majority_level);
