EasyManua.ls Logo

Pendulum CNT-91 - Error Code

Default Icon
264 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
return((unsigned)Status);
}
#define WriteDev(Str) WriteDevice(Instr, Str, __LINE__)
#define ReadDev(Buf, BufLength, pActualLength) ReadDevice(Instr,
Buf, BufLength, pActualLength, __LINE__)
ViSession defaultRM, Instr;
void Quit()
{
(void)viClose(Instr);
(void)viClose(defaultRM);
_exit(0);
}
void QuitMsg(char *Str)
{
fprintf(stderr, Str);
Quit();
}
void ReportAndQuit()
{
char Buf[100];
ViUInt32 ReadLength;
int Error;
// Break the measurement.
(void)WriteDev("abort");
// Check if everything seems to have worked out OK.
printf("Error queue:\n");
do {
if (WriteDev("syst:err?") != VI_SUCCESS) {
QuitMsg("Failed to query error queue\n");
}
if (ReadDev(Buf, 100, &ReadLength) != VI_SUCCESS) {
QuitMsg("Failed to read error message\n");
}
Buf[ReadLength] = 0; // Null terminate.
if (sscanf(Buf, "%d", &Error) != 1) {
QuitMsg("Failed to scan error status number\n");
}
printf(Buf);
} while (Error != 0);
// Restore the instrument to a more front panel friendly
// state.
Programming Examples
4-14 Error Code

Table of Contents

Other manuals for Pendulum CNT-91

Related product manuals