Agilent Technologies FS2010 Guia do Utilizador Página 16

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 160
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 15
16 Agilent VISA User’s Guide
2 Building a VISA Application in Windows
Sample C/C++ Program Source Code
The source file idn.c follows. An explanation of the various
function calls in the sample is provided directly after the
program listing. If the program runs correctly and your PC
is connected to a 54622A oscilloscope, the following is an
example of the program output.
AGILENT TECHNOLOGIES,54622A,987654312,A.01.50
If the program does not run, see the Event Viewer for a list of
run- time errors.
/*idn.c
This example program queries a GPIB device for
an identification string and prints the
results. Note that you must change the address.
*/
#include <visa.h>
#include <stdio.h>
void main () {
ViSession defaultRM, vi;
char buf [256] = {0};
/* Open session to GPIB device at address 22 */
viOpenDefaultRM(&defaultRM);
viOpen(defaultRM,
"GPIB0::22::INSTR",VI_NULL,VI_NULL,
&vi);
/* Initialize device */
viPrintf(vi, "*RST\n");
/* Send an *IDN? string to the device */
viPrintf(vi, "*IDN?\n");
/* Read results */
viScanf(vi, "%t", buf);
/* Print results */
printf("Instrument identification string:
Vista de página 15
1 2 ... 11 12 13 14 15 16 17 18 19 20 21 ... 159 160

Comentários a estes Manuais

Sem comentários