Index: fact/tools/FSC/simple_daq/simple_daq.cpp
===================================================================
--- fact/tools/FSC/simple_daq/simple_daq.cpp	(revision 10913)
+++ fact/tools/FSC/simple_daq/simple_daq.cpp	(revision 10918)
@@ -1,5 +1,5 @@
 /********************************************************************\
 
-  Read SOCKETS_PER_FAD Channels from FAD-Board
+  Read NUMBER_OF_SOCKETS Channels from FAD-Board
   Write Commands to Socket 0, Commands must be (n * 16) Bit long
   
@@ -31,5 +31,5 @@
 using namespace std;
 
-FSC_STATUS *answer;
+
 
 int main(int argc, char *argv[])
@@ -43,12 +43,13 @@
 	int max_fd = 0;
 	
-	FILE* outfile[SOCKETS_PER_FAD];
+	FILE* outfile[NUMBER_OF_SOCKETS];
 	char outfilename[PATH_MAX];
 
-	
-		SimpleDaqConfiguration *conf;
+	FSC_STATUS *answer;
+	
+	SimpleDaqConfiguration *conf;
 	// Get configuration file path from command line
 	// Get configurarion from configurationfile.
-	// such as FAD IP Adress
+	// such as IP Adress
 	if (argc > 1)
 	{
@@ -57,14 +58,19 @@
 		conf = getConfig(CONFIG_FILE_PATH);
 	}
+	if (conf == NULL) {
+		fprintf ( stderr, "Error: Config Error. \n");
+		exit_program (EXIT_FAILURE);
+	}
 	
 	// Open sockets
-	SocketDescriptor = OpenSockets(SOCKETS_PER_FAD);
+	SocketDescriptor = OpenSockets(NUMBER_OF_SOCKETS);
 	if (SocketDescriptor == NULL) {
+		fprintf(stderr, "Error: While opening sockets. \n");
 		exit_program (EXIT_FAILURE);
 	}
-	max_fd = GetMaxFileDescriptor(SOCKETS_PER_FAD, SocketDescriptor);
+	max_fd = GetMaxFileDescriptor(NUMBER_OF_SOCKETS, SocketDescriptor);
 	
 	// Connect to server
-	if( Connect2Server(	SocketDescriptor, SOCKETS_PER_FAD, FIRST_DAQPORT, conf->FADIPAddress, 1) != SOCKETS_PER_FAD) {
+	if( Connect2Server(	SocketDescriptor, NUMBER_OF_SOCKETS, FIRST_DAQPORT, conf->FADIPAddress, 1) != NUMBER_OF_SOCKETS) {
 			// Connect2Server prints some error messages in case of exceptions...
 			printf ("Error in Connect2Server()\n");
@@ -73,15 +79,15 @@
 
 	// Open files for output
-	for (int i = 0; i < SOCKETS_PER_FAD; i++)
+	for (int i = 0; i < NUMBER_OF_SOCKETS; i++)
 	{
 		sprintf (outfilename, "%s/%s-%d.%s", conf->outfilepath, conf->outfilename, i, conf->outfileext);
 		if ((outfile[i] = fopen (outfilename, "w")) == NULL)
 		{
-			printf ("Error: Could not open file %s\n", outfilename);
+			printf ("Error: Could not open output-file %s\n", outfilename);
 			exit_program (EXIT_FAILURE);
 		}
 	}
 	
-	//init_fad();
+
 	
 	//fad_firmware_revision = get_firmware_revision();	
@@ -94,6 +100,4 @@
 	signal (SIGINT, int_handler); // Cleanup after SIGINT (CTRL-C)
 
-//	init_fad();
-//	fflush (stdin);
 	// Main loop
 	while (true)
@@ -103,5 +107,5 @@
 		FD_ZERO (&ReadFileDescriptor);		
 		FD_SET(STDIN_FILENO, &ReadFileDescriptor);
-		for (int i = 0; i < SOCKETS_PER_FAD; i++)
+		for (int i = 0; i < NUMBER_OF_SOCKETS; i++)
 		{
 			FD_SET (SocketDescriptor[i], &ReadFileDescriptor);
@@ -118,9 +122,4 @@
  
 
-		// init board -- should be switchable 
-		// with a commandline switch, but ... 
-		// TODO
-
-
 		// Data from STDIN
 		if (FD_ISSET (STDIN_FILENO, &ReadFileDescriptor))
@@ -134,10 +133,10 @@
 		{
 			// Check all sockets
-			for (int i = 0; i < SOCKETS_PER_FAD; i++)
+			for (int i = 0; i < NUMBER_OF_SOCKETS; i++)
 			{
 				if (FD_ISSET (SocketDescriptor[i], &ReadFileDescriptor))
 				{ 
 					// Only for testing
-					memset (Buffer, 0xAA, sizeof (Buffer));
+					memset (Buffer, 0, sizeof (Buffer));
 					if ((read_return = read (SocketDescriptor[i], Buffer, MAX_COM_SIZE)) == 0)
 					{
@@ -149,4 +148,8 @@
 					{
 						printf ("Socket [%d]: Read %d Bytes\n", i, read_return);
+						printf ("\n\n%s\n", Buffer);
+						
+						//answer = Buffer;
+						
 						
 						
@@ -167,5 +170,5 @@
 {	
 	printf ("\nClosing Sockets...");
-	for (int i = 0; i < SOCKETS_PER_FAD; i++)
+	for (int i = 0; i < NUMBER_OF_SOCKETS; i++)
 	{
 		close (SocketDescriptor[i]);
@@ -192,4 +195,5 @@
 ConfigFile = fopen (path, "r");
 if (ConfigFile == NULL) {
+	fprintf ( stderr, "Error: Config Error. \n File not found %s", path);
 	return NULL;
 }
@@ -266,5 +270,5 @@
 unsigned short rev;
 
-max_fd = GetMaxFileDescriptor(SOCKETS_PER_FAD, SocketDescriptor);
+max_fd = GetMaxFileDescriptor(NUMBER_OF_SOCKETS, SocketDescriptor);
 
 	cmd_send ("sra 10\n", SocketDescriptor[0]);	
@@ -274,5 +278,5 @@
 
 		FD_ZERO (&ReadFileDescriptor);		
-		for (int i = 0; i < SOCKETS_PER_FAD; i++)
+		for (int i = 0; i < NUMBER_OF_SOCKETS; i++)
 		{
 			FD_SET (SocketDescriptor[i], &ReadFileDescriptor);
@@ -288,5 +292,5 @@
  
 			// Check all sockets
-			for (int i = 0; i < SOCKETS_PER_FAD; i++)
+			for (int i = 0; i < NUMBER_OF_SOCKETS; i++)
 			{
 				if (FD_ISSET (SocketDescriptor[i], &ReadFileDescriptor))
Index: fact/tools/FSC/simple_daq/simple_daq.h
===================================================================
--- fact/tools/FSC/simple_daq/simple_daq.h	(revision 10913)
+++ fact/tools/FSC/simple_daq/simple_daq.h	(revision 10918)
@@ -14,46 +14,12 @@
 #define IP_ADDR_LENGTH 16
 
-#define FIRST_DAQPORT 5000
-#define SOCKETS_PER_FAD 1
+#define FIRST_PORT 5000
+#define NUMBER_OF_SOCKETS 1
+#define CONFIG_FILE_PATH "./config.txt"
 
-// Commands for FAD
-#define CMD_Start 0xC000		// Start Run
-#define CMD_Stop 0x3000			// Stop Run
-#define CMD_Trigger 0xA000 		// single trigger
-#define CMD_DENABLE 0x0600      // DENABLE line HIGH
-#define CMD_DDISABLE 0x0700     // DENABLE line LOW
-#define CMD_DWRITE_RUN 0x0800   // DWRITE possibly HIGH
-#define CMD_DWRITE_STOP 0x0900  // DWRITE always LOW
-
-#define CMD_SCLK_ON 0x1000  
-#define CMD_SCLK_OFF 0x1100
-
-#define CMD_PS_DIRINC 0x1200
-#define CMD_PS_DIRDEC 0x1300
-#define CMD_PS_DO 0x1400
-#define CMD_PS_RESET 0x1700
+// Commands for Board
+// to be done
 
 
-#define CMD_SRCLK_ON 0x1500
-#define CMD_SRCLK_OFF 0x1600
-
-#define CMD_Trigger_C 0xB000 	// continous trigger
-#define CMD_Trigger_S 0x2000 	// stop continous trigger
-#define CMD_Read 0x0A00 		// read from Config-RAM
-#define CMD_Write 0x0500 		// write to Config-RAM
-
-// Addresses in FAD Config-RAM
-#define MAX_ADDR 0xFF // highest address in Config-RAM
-#define BADDR_ROI 0x00 // Baseaddress ROI-Values
-#define BADDR_DAC 0x24 // Baseaddress DAC-Values
-
-// Max-Values
-#define MAX_VAL 65535
-#define MAX_ROINUM 35
-#define MAX_ROIVAL 1024
-#define MAX_DACNUM 7
-#define MAX_DACVAL 65535
-
-#define CONFIG_FILE_PATH "config.txt"
 
 class SimpleDaqConfiguration {
