
A-16
A2
status = viWrite (devSession, “R? 100,1”, 8, &length);
if (status != VI_SUCCESS)
{
printf (“Unable to send a temp query to %s\n”, argv[1]);
retval = 1;
break;
}
else
{
status = viRead (devSession, result, sizeof(result), &length);
if (status != VI_SUCCESS)
{
printf (“Error reading the temp query response from %s\n”, argv[1]);
retval = 1;
break;
}
else
{
// Null terminate the received string since he viRead does not
// auto-magically Null terminate the data. Note that this will
// not remove the \n if one is included in the result string.
result [length] = ‘\0’;
// If the result string contains a \n character, terminate the
// string at that point - replacing the \n with a Null.
cp = strchr (result, ‘\n’);
if (cp)
*cp = ‘\0’;
// Convert the response to a tempature
sscanf (result, “%d”, &temp);
printf (“Temp: %d.%d\r”, temp / 10, temp % 10);
// Now pause for 10 seconds
Sleep (10 * 1000);
}
}
}
}
// Close the Resource Manager now that we’re done with using VISA.
viClose (rmSession);
return (retval);
}
Figure A-5 Example VISA Program Cont'd
Содержание 9099
Страница 20: ...1 16 1 Figure 1 1 9009 Outline Dimensions ...
Страница 24: ...1 20 1 Figure 1 3 9099 Certificate of Compliance ...
Страница 54: ...3 8 3 Figure 3 1 Status Reporting Structure Flash Configuration Reset ...
Страница 94: ...3 48 3 This page left intentionally blank ...
Страница 100: ...4 4 6 This page is left intentionally blank ...
Страница 161: ...A 49 A4 Refer to the ErrorLogger utility for the error value definitions Error Meaning 0 No error ...