Specifications
University of Hertfordshire
48
     else 
     if (buf=="ID?"){ 
   system ("echo \"SEND 18 \'ID?\'\"| cat - > /dev/gpib0"); 
       printf("Identify HP8591 EM Spectrum Analyser \n"); 
       } 
       else { 
       spec[3]=buf; 
       system("echo  \"SEND  18  \'FA  %s  MZ;FB  %s  MZ;CF  %s  MZ;SP  %s  MZ;\'\"|  cat  -> 
/dev/gpib0\n",spec[0],spec[1],spec[2],spec[3]); 
       printf("To control  the HP8591  EM  Spectrum  Analyser  at FA: %s,  FB:  %s,  CF:  %s, SP: %s \n", 
spec[0],spec[1],spec[2],spec[3]); 
          system("echo \"RECIEVE 18\"| cat - > /dev/gpib0; read x< /dev/gpib0"); 
          result[]=$x;     
     } 
          //return result to the client 
          send(temp_sock_descriptor,result[], len,0); 
          printf("send results to client:%s\n", result[]); 
          close(temp_sock_descriptor); 
    } 










