Agilent Technologies FS2010 Manual de servicio Pagina 148

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 396
  • Tabla de contenidos
  • SOLUCIÓN DE PROBLEMAS
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 147
140 Agilent Signal Generators Programming Guide
Programming Examples
LAN Programming Interface Examples
int main1()
{
SOCKET instSock;
long bufBytes;
char *charBuf = (char *) malloc(INPUT_BUF_SIZE);
/*********************************************/
/* open a socket connection to the instrument*/
/*********************************************/
#ifdef WINSOCK
if (init_winsock() != 0) {
exit(1);
}
#endif /* WINSOCK */
instSock = openSocket("xxxxxx", SCPI_PORT); /* Put your hostname here */
if (instSock == INVALID_SOCKET) {
fprintf(stderr, "Unable to open socket.\n");
return 1;
}
/* fprintf(stderr, "Socket opened.\n"); */
bufBytes = queryInstrument(instSock, "*IDN?\n", charBuf, INPUT_BUF_SIZE);
printf("ID: %s\n",charBuf);
commandInstrument(instSock, "FREQ 2.5 GHz\n");
printf("\n");
bufBytes = queryInstrument(instSock, "FREQ:CW?\n", charBuf, INPUT_BUF_SIZE);
printf("Frequency: %s\n",charBuf);
commandInstrument(instSock, "POW:AMPL -5 dBm\n");
bufBytes = queryInstrument(instSock, "POW:AMPL?\n", charBuf, INPUT_BUF_SIZE);
printf("Power Level: %s\n",charBuf);
printf("\n");
#ifdef WINSOCK
closesocket(instSock);
close_winsock();
#else
Vista de pagina 147
1 2 ... 143 144 145 146 147 148 149 150 151 152 153 ... 395 396

Comentarios a estos manuales

Sin comentarios