Programming Examples
41
Agilent InfiniiVision 4000 X-Series Oscilloscopes Programmer's Guide
1259
void do_query_numbers(query)
char *query;
{
char message[80];
strcpy(message, query);
strcat(message, "\n");
err = viPrintf(vi, message);
if (err != VI_SUCCESS) error_handler();
err = viScanf(vi, "%,10lf\n", dbl_results);
if (err != VI_SUCCESS) error_handler();
check_instrument_errors();
}
/* Query for an IEEE definite-length block result.
* --------------------------------------------------------------- */
int do_query_ieeeblock(query)
char *query;
{
char message[80];
int data_length;
strcpy(message, query);
strcat(message, "\n");
err = viPrintf(vi, message);
if (err != VI_SUCCESS) error_handler();
data_length = IEEEBLOCK_SPACE;
err = viScanf(vi, "%#b\n", &data_length, ieeeblock_data);
if (err != VI_SUCCESS) error_handler();
if (data_length == IEEEBLOCK_SPACE )
{
printf("IEEE block buffer full: ");
printf("May not have received all data.\n");
}
check_instrument_errors();
return(data_length);
}
/* Check for instrument errors.
* --------------------------------------------------------------- */
void check_instrument_errors()
{
char str_err_val[256] = {0};
char str_out[800] = "";
err = viQueryf(vi, ":SYSTem:ERRor?\n", "%t", str_err_val);
if (err != VI_SUCCESS) error_handler();
while(strncmp(str_err_val, "+0,No error", 3) != 0 )
{
strcat(str_out, ", ");
Summary of Contents for InfiniiVision 4000 X-Series
Page 1: ...s1 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide ...
Page 32: ...32 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide ...
Page 52: ...52 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 2 Setting Up ...
Page 66: ...66 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 3 Getting Started ...
Page 242: ...242 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 7 ACQuire Commands ...
Page 252: ...252 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 8 BUS n Commands ...
Page 300: ...300 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 12 DEMO Commands ...
Page 330: ...330 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 15 DVM Commands ...
Page 386: ...386 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 18 HARDcopy Commands ...
Page 484: ...484 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 21 MEASure Commands ...
Page 1098: ...1098 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 34 WGEN w Commands ...
Page 1174: ...1174 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide 37 Error Messages ...
Page 1352: ...1352 Agilent InfiniiVision 4000 X Series Oscilloscopes Programmer s Guide Index ...