diff --git a/slsDetectorSoftware/eigerDetectorServer/9mhvserial_bf.c b/slsDetectorSoftware/eigerDetectorServer/9mhvserial_bf.c index 41f1760f2..0746c4ac1 100644 --- a/slsDetectorSoftware/eigerDetectorServer/9mhvserial_bf.c +++ b/slsDetectorSoftware/eigerDetectorServer/9mhvserial_bf.c @@ -95,6 +95,7 @@ int main(int argc, char* argv[]) { cprintf(RED,"Warning: Unable to open port %s\n", PORTNAME); return -1; } + cprintf(GREEN,"opened port at %s\n",PORTNAME); struct termios serial_conf; // reset structure @@ -132,33 +133,21 @@ int main(int argc, char* argv[]) { cprintf(GREEN,"Ready...\n"); - /* - int once = 1; - while(strcmp(buffer,"start")){ - if(once){ - once=0; - cprintf(MAGENTA,"in the loop, checking\n"); - } - memset(buffer,0,BUFFERSIZE); - n = read(fd,buffer,BUFFERSIZE); - //#ifdef VERBOSE - cprintf(BLUE,"Received %d Bytes\n", n); - //#endif - cprintf(BLUE,"Got message: %s\n",buffer); - } - cprintf(GREEN,"started\n"); - */ - - while(ret != GOODBYE){ memset(buffer,0,BUFFERSIZE); n = read(fd,buffer,BUFFERSIZE); #ifdef VERBOSE cprintf(BLUE,"Received %d Bytes\n", n); #endif - cprintf(BLUE,"Got message: %s\n",buffer); + cprintf(BLUE,"Got message: '%s'\n",buffer); switch(buffer[0]){ + case '\0': + cprintf(GREEN,"Got Start (Detector restart)\n"); + break; + case 's': + cprintf(GREEN,"Got Start \n"); + break; case 'p': if (!sscanf(&buffer[1],"%d",&ival)){ cprintf(RED,"Warning: cannot scan voltage value\n"); @@ -171,10 +160,10 @@ int main(int argc, char* argv[]) { strcpy(buffer,"fail "); else strcpy(buffer,"success "); - cprintf(GREEN,"%s\n",buffer); + cprintf(GREEN,"Sending: '%s'\n",buffer); n = write(fd, buffer, BUFFERSIZE); #ifdef VERBOSE - cprintf(BLUE,"Sent %d Bytes\n", n); + cprintf(GREEN,"Sent %d Bytes\n", n); #endif break; @@ -188,20 +177,21 @@ int main(int argc, char* argv[]) { else strcpy(buffer,"success "); n = write(fd, buffer, BUFFERSIZE); + cprintf(GREEN,"Sending: '%s'\n",buffer); #ifdef VERBOSE - cprintf(BLUE,"Sent %d Bytes\n", n); + cprintf(GREEN,"Sent %d Bytes\n", n); #endif //value memset(buffer,0,BUFFERSIZE); buffer[BUFFERSIZE-1] = '\n'; if(ival >= 0){ - cprintf(GREEN,"%d\n",ival); + cprintf(GREEN,"Sending: '%d'\n",ival); sprintf(buffer,"%d ",ival); n = write(fd, buffer, BUFFERSIZE); #ifdef VERBOSE - cprintf(BLUE,"Sent %d Bytes\n", n); + cprintf(GREEN,"Sent %d Bytes\n", n); #endif - }else cprintf(GREEN,"%s\n",buffer); + }else cprintf(RED,"%s\n",buffer); break; case 'e': @@ -209,7 +199,7 @@ int main(int argc, char* argv[]) { ret = GOODBYE; break; default: - printf("Unknown Command. buffer:[%s]\n",buffer); + cprintf(RED,"Unknown Command. buffer:'%s'\n",buffer); break; } } diff --git a/slsDetectorSoftware/eigerDetectorServer/FebControl.c b/slsDetectorSoftware/eigerDetectorServer/FebControl.c index 807bc3977..d7996ea6a 100644 --- a/slsDetectorSoftware/eigerDetectorServer/FebControl.c +++ b/slsDetectorSoftware/eigerDetectorServer/FebControl.c @@ -224,7 +224,7 @@ int Feb_Control_Init(int master, int top, int normal, int module_num){ int Feb_Control_OpenSerialCommunication(){ - cprintf(BG_BLUE,"opening serial communication of hv\n"); + cprintf(GREEN,"opening serial communication of hv\n"); //if(Feb_Control_hv_fd != -1) close(Feb_Control_hv_fd); Feb_Control_hv_fd = open(SPECIAL9M_HIGHVOLTAGE_PORT, O_RDWR | O_NOCTTY | O_SYNC); @@ -232,7 +232,7 @@ int Feb_Control_OpenSerialCommunication(){ cprintf(RED,"Warning: Unable to open port %s to set up high voltage serial communciation to the blackfin\n", SPECIAL9M_HIGHVOLTAGE_PORT); return 0; } - + cprintf(GREEN,"Serial Port opened at %s\n",SPECIAL9M_HIGHVOLTAGE_PORT); struct termios serial_conf; // reset structure memset (&serial_conf, 0, sizeof(serial_conf)); @@ -265,12 +265,15 @@ int Feb_Control_OpenSerialCommunication(){ memset(buffer,0,SPECIAL9M_HIGHVOLTAGE_BUFFERSIZE); buffer[SPECIAL9M_HIGHVOLTAGE_BUFFERSIZE-1] = '\n'; strcpy(buffer,"start"); + cprintf(GREEN,"sending start: '%s'\n",buffer); int n = write(Feb_Control_hv_fd, buffer, SPECIAL9M_HIGHVOLTAGE_BUFFERSIZE); if (n < 0) { cprintf(RED,"\nWarning: Error writing to i2c bus\n"); return 0; } - +#ifdef VERBOSE + cprintf(GREEN,"Sent: %d bytes\n",n); +#endif return 1; } @@ -629,13 +632,14 @@ int Feb_Control_SendHighVoltage(int dacvalue){ buffer[SPECIAL9M_HIGHVOLTAGE_BUFFERSIZE-1]='\n'; int n; sprintf(buffer,"p%d",dacvalue); + cprintf(GREEN,"Sending HV: '%s'\n",buffer); n = write(Feb_Control_hv_fd, buffer, SPECIAL9M_HIGHVOLTAGE_BUFFERSIZE); if (n < 0) { cprintf(RED,"\nWarning: Error writing to i2c bus\n"); return 0; } #ifdef VERBOSEI - cprintf(BLUE,"Sent %d Bytes\n", n); + cprintf(GREEN,"Sent %d Bytes\n", n); #endif //ok/fail memset(buffer,0,SPECIAL9M_HIGHVOLTAGE_BUFFERSIZE); @@ -646,8 +650,9 @@ int Feb_Control_SendHighVoltage(int dacvalue){ return 0; } #ifdef VERBOSEI - cprintf(BLUE,"Received %d Bytes\n", n); + cprintf(GREEN,"Received %d Bytes\n", n); #endif + cprintf(GREEN,"Received HV: '%s'\n",buffer); fflush(stdout); /*Feb_Control_CloseSerialCommunication();*/ if(buffer[0] != 's'){ @@ -715,13 +720,14 @@ int Feb_Control_ReceiveHighVoltage(unsigned int* value){ //request strcpy(buffer,"g "); + cprintf(GREEN,"\nSending HV: '%s'\n",buffer); n = write(Feb_Control_hv_fd, buffer, SPECIAL9M_HIGHVOLTAGE_BUFFERSIZE); if (n < 0) { cprintf(RED,"\nWarning: Error writing to i2c bus\n"); return 0; } #ifdef VERBOSEI - cprintf(BLUE,"Sent %d Bytes\n", n); + cprintf(GREEN,"Sent %d Bytes\n", n); #endif //ok/fail @@ -733,8 +739,9 @@ int Feb_Control_ReceiveHighVoltage(unsigned int* value){ return 0; } #ifdef VERBOSEI - cprintf(BLUE,"Received %d Bytes\n", n); + cprintf(GREEN,"Received %d Bytes\n", n); #endif + cprintf(GREEN,"Received HV: '%s'\n",buffer); if(buffer[0] != 's'){ cprintf(RED,"\nWarning: failed to read high voltage\n"); return 0; @@ -748,8 +755,9 @@ int Feb_Control_ReceiveHighVoltage(unsigned int* value){ return 0; } #ifdef VERBOSEI - cprintf(BLUE,"Received %d Bytes\n", n); + cprintf(GREEN,"Received %d Bytes\n", n); #endif + cprintf(GREEN,"Received HV: '%s'\n",buffer); /*Feb_Control_OpenSerialCommunication();*/ if (!sscanf(buffer,"%d",value)){ cprintf(RED,"\nWarning: failed to scan high voltage read\n"); diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.0.16.6 b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.0.16.7 similarity index 73% rename from slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.0.16.6 rename to slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.0.16.7 index 1d201568e..7aa847bf1 100755 Binary files a/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.0.16.6 and b/slsDetectorSoftware/eigerDetectorServer/bin/eigerDetectorServerv3.0.0.16.7 differ diff --git a/slsDetectorSoftware/eigerDetectorServer/bin/hv9m_blackfin_serverv3.0.0.1 b/slsDetectorSoftware/eigerDetectorServer/bin/hv9m_blackfin_serverv3.0.0.1 new file mode 100755 index 000000000..4ab730239 Binary files /dev/null and b/slsDetectorSoftware/eigerDetectorServer/bin/hv9m_blackfin_serverv3.0.0.1 differ diff --git a/slsDetectorSoftware/eigerDetectorServer/gitInfo.txt b/slsDetectorSoftware/eigerDetectorServer/gitInfo.txt index 5314965df..1c9d5a4d6 100644 --- a/slsDetectorSoftware/eigerDetectorServer/gitInfo.txt +++ b/slsDetectorSoftware/eigerDetectorServer/gitInfo.txt @@ -1,9 +1,9 @@ Path: slsDetectorsPackage/slsDetectorSoftware/eigerDetectorServer URL: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git Repository Root: origin git@git.psi.ch:sls_detectors_software/sls_detector_software.git -Repsitory UUID: 2dfbd9016b501eca6ee2c00a08e49a3f7e7990d8 -Revision: 296 +Repsitory UUID: 177efa2636a7cee812707537ad90489a61832942 +Revision: 299 Branch: 3.0-rc Last Changed Author: Dhanya_Maliakal -Last Changed Rev: 1457 -Last Changed Date: 2017-08-08 15:23:10.000000002 +0200 ./Makefile +Last Changed Rev: 1480 +Last Changed Date: 2017-08-17 09:06:21.000000002 +0200 ./Makefile diff --git a/slsDetectorSoftware/eigerDetectorServer/gitInfoEiger.h b/slsDetectorSoftware/eigerDetectorServer/gitInfoEiger.h index c01ec39e8..dec316953 100644 --- a/slsDetectorSoftware/eigerDetectorServer/gitInfoEiger.h +++ b/slsDetectorSoftware/eigerDetectorServer/gitInfoEiger.h @@ -1,11 +1,11 @@ //#define SVNPATH "" #define SVNURL "git@git.psi.ch:sls_detectors_software/sls_detector_software.git" //#define SVNREPPATH "" -#define SVNREPUUID "2dfbd9016b501eca6ee2c00a08e49a3f7e7990d8" -//#define SVNREV 0x1457 +#define SVNREPUUID "177efa2636a7cee812707537ad90489a61832942" +//#define SVNREV 0x1480 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "Dhanya_Maliakal" -#define SVNREV 0x1457 -#define SVNDATE 0x20170808 +#define SVNREV 0x1480 +#define SVNDATE 0x20170817 //