R-GPIB Commands Sample Program
{
printf("Error : %s\nibsta = 0x%x iber r = %d (%s)\n",
ErrorMsg, ibsta, iberr, ErrorMnemonic[iberr]);
if (ud != -1)
{
printf("Cleanup: Taking device offline\n");
ibonl(ud, 0);
}
exit(0);
}
int start_application( int scope )
{
char write_buffer[100];
char read_buffer[100];
char app_name[] = "\"USB2.0 Test Package\"\n";
int status, timer;
/* Start the TDSUSB2 application */
sprintf(write_buffer, "%s", "Application:activate \"USB2.0 Test Package\"");
status = ibwrt(scope, write_buffer, strlen(write_buffer));
if (ibsta & ERR)
{
GPIBCleanup(scope, "Unable to start the application");
return 0;
}
timer = 1;
while (1)
{
/* Check whether application has started */
sprintf(write_buffer, "%s", "Variable:value? \"application\"");
status = ibwrt(scope, write_buffer, strlen(write_buffer));
status = ibrd(scope, read_buffer, sizeof(read_buffer));
144 TDSUSB2 Universal Serial Bus Measurements Package