Index: fact/tools/FAD/simple_daq/cmd_send.cpp
===================================================================
--- fact/tools/FAD/simple_daq/cmd_send.cpp	(revision 9839)
+++ fact/tools/FAD/simple_daq/cmd_send.cpp	(revision 9905)
@@ -2,5 +2,5 @@
 
 // Send commands to socket
-void cmd_send (char* Buffer, int Socket)
+void cmd_send (const char* Buffer, int Socket)
 {
 	int i;
@@ -38,5 +38,5 @@
 	}
 	
-    else if (strncmp (Buffer, "de\n", 2) == 0)
+    else if (strncmp (Buffer, "de\n", 3) == 0)
 	{
 		CMD_Buffer[0] = htons (CMD_DENABLE);
@@ -45,5 +45,35 @@
 	}
 	
-    else if (strncmp (Buffer, "dd\n", 2) == 0)
+    else if (strncmp (Buffer, "psup\n", 5) == 0)
+	{
+		CMD_Buffer[0] = htons (CMD_PS_DIRINC);
+		printf ("# increasing phase shift ->\n");
+		printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0]));
+	}
+	
+    else if (strncmp (Buffer, "psdn\n", 5) == 0)
+	{
+		CMD_Buffer[0] = htons (CMD_PS_DIRDEC);
+		printf ("# decreasing phase shift ->\n");
+		printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0]));
+	}
+	
+    else if (strncmp (Buffer, "psreset\n", 8) == 0)
+	{
+		CMD_Buffer[0] = htons (CMD_PS_RESET);
+		printf ("# resetting phase shift ->\n");
+		printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0]));
+	}
+
+    else if (strncmp (Buffer, "ps\n", 3) == 0)
+	{
+		CMD_Buffer[0] = htons (CMD_PS_DO);
+		printf ("# phase shifting once! ->\n");
+		printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0]));
+	}
+
+
+	
+    else if (strncmp (Buffer, "dd\n", 3) == 0)
 	{
 		CMD_Buffer[0] = htons (CMD_DDISABLE);
@@ -52,5 +82,5 @@
 	}
 	
-    else if (strncmp (Buffer, "dr\n", 2) == 0)
+    else if (strncmp (Buffer, "dr\n", 3) == 0)
 	{
 		CMD_Buffer[0] = htons (CMD_DWRITE_RUN);
@@ -59,5 +89,5 @@
 	}
 	
-    else if (strncmp (Buffer, "ds\n", 2) == 0)
+    else if (strncmp (Buffer, "ds\n", 3) == 0)
 	{
 		CMD_Buffer[0] = htons (CMD_DWRITE_STOP);
@@ -65,6 +95,18 @@
 		printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0]));
 	}
-	
-	else if (strncmp (Buffer, "sclkon\n", 6) == 0)
+
+	else if (strncmp (Buffer, "srclkon\n", 8) == 0)
+	{
+		CMD_Buffer[0] = htons (CMD_SRCLK_ON);
+		printf ("# DRS readoutclock SRCLK ENABLED ->\n");
+		printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0]));
+	}
+	else if (strncmp (Buffer, "srclkoff\n", 9) == 0)
+	{
+		CMD_Buffer[0] = htons (CMD_SRCLK_OFF);
+		printf ("# DRS readoutclock SRCLK DISABLED ->\n");
+		printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0]));
+	}	
+	else if (strncmp (Buffer, "sclkon\n", 7) == 0)
 	{
 		CMD_Buffer[0] = htons (CMD_SCLK_ON);
@@ -72,5 +114,5 @@
 		printf ("# 0x%.4X\n", ntohs (CMD_Buffer[0]));
 	}
-	else if (strncmp (Buffer, "sclkoff\n", 7) == 0)
+	else if (strncmp (Buffer, "sclkoff\n", 8) == 0)
 	{
 		CMD_Buffer[0] = htons (CMD_SCLK_OFF);
@@ -243,15 +285,30 @@
 	{
 		printf ("Commands:\n");
-		printf ("    r:          Start Run -- TODO\n");
-		printf ("    s:          Stop Run  -- TODO\n");
 		printf ("    t:          Single Trigger\n\n");
+		printf ("    tc:         Continuous Trigger\n");
+		printf ("    ts:         Stop Trigger\n");
+
+		printf ("\n");
+		printf ("    sclkon:     Switch SPI SLCK on\n");
+		printf ("    sclkoff:    Switch SPI SLCK off\n");
+
+		printf ("\n");
+		printf ("    srclkon:     Switch DRS SRLCK on\n");
+		printf ("    srclkoff:    Switch DRS SRLCK off\n");
+
+		printf ("\n");
+		printf ("    ps:         Phase shift ADCCLK against SRCLK - one step\n");
+		printf ("    psup:       'increse' phase shift - default\n");
+		printf ("    psdn:       'decrease' phase shift\n");
+		printf ("    psres:      reset phase shift\n");
+
+
+		printf ("\n");
 		printf ("    de:         DENABLE HIGH\n");
 		printf ("    dd:         DENABLE LOW\n");
 		printf ("    dr:         DWRITE HIGH\n");
 		printf ("    ds:         DWRITE LOW\n");
-		printf ("    sclkon:     Switch SPI SLCK on\n");
-		printf ("    sclkoff:    Switch SPI SLCK off\n");
-		printf ("    tc:         Continuous Trigger\n");
-		printf ("    ts:         Stop Trigger\n");
+
+		printf ("\n");
 		printf ("    sr NUM VAL: Set ROI NUM (0-35) to VAL (0-1024)\n");
 		printf ("    sra VAL:    Set all ROIs to VAL (0-1024)\n");
@@ -264,4 +321,6 @@
 		printf ("        sz:         Send 0x0000\n");
 		printf ("\n");
+		printf ("    r:          Start Run -- TODO\n");
+		printf ("    s:          Stop Run  -- TODO\n");
 
 		CMD_Num = 0;
