Programming Examples
40
Keysight InfiniiVision M9241/42/43A PXIe Oscilloscopes SCPI Programmer's Guide
1471
strcpy(message, command);
strcat(message, "\n");
iprintf(id, message);
check_instrument_errors();
}
/* Command with IEEE definite-length block.
* --------------------------------------------------------------- */
int do_command_ieeeblock(command, num_bytes)
char *command;
int num_bytes;
{
char message[80];
int data_length;
strcpy(message, command);
strcat(message, " #8%08d");
iprintf(id, message, num_bytes);
ifwrite(id, ieeeblock_data, num_bytes, 1, &data_length);
check_instrument_errors();
return(data_length);
}
/* Query for a string result.
* --------------------------------------------------------------- */
void do_query_string(query)
char *query;
{
char message[80];
strcpy(message, query);
strcat(message, "\n");
iprintf(id, message);
iscanf(id, "%t\n", str_result);
check_instrument_errors();
}
/* Query for a number result.
* --------------------------------------------------------------- */
void do_query_number(query)
char *query;
{
char message[80];
strcpy(message, query);
strcat(message, "\n");
iprintf(id, message);
iscanf(id, "%lf", &num_result);
check_instrument_errors();