EasyManua.ls Logo

Pendulum CNT-91 - AM Signals

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...
// Find the instrument
if ( Args.bUSB )
{
// Look on USB for something made by Pendulum with model
// code 0x0091.
// For this sample program we'll just pick the first
// found, if any.
sprintf(Command, "USB?*INSTR{VI_ATTR_MANF_ID==0x14EB &&
VI_ATTR_MODEL_CODE==0x0091}");
}
else // GPIB
sprintf(Command, "GPIB::%d::INSTR", Args.nAddr);
Status = viFindRsrc(defaultRM, Command, &fList, &numInstrs,
Desc);
if (Status != VI_SUCCESS)
{
fprintf(stderr, "Didn't find instrument\n");
viClose(defaultRM);
return(-1);
}
// Open communication with the device.
if (viOpen(defaultRM, Desc, VI_NULL, VI_NULL, &Instr) !=
VI_SUCCESS)
QuitMsg("Couldn't open connection to the instrument\n");
// Set short timeout for message-based communication (1 s)
if (viSetAttribute(Instr, VI_ATTR_TMO_VALUE, 1000) !=
VI_SUCCESS)
QuitMsg("Failed to set timeout\n");
// Clear the instrument
if (viClear(Instr) != VI_SUCCESS)
QuitMsg("Couldn't clear the instrument\n");
// Check IDN.
if (WriteDev("*idn?") != VI_SUCCESS) Quit();
if (ReadDev(Buffer, BUFSIZE, &ReadLength) != VI_SUCCESS)
Quit();
Buffer[ReadLength] = 0; // Null terminate.
printf("%s\n", Buffer);
// Initialize the instrument.
printf("Testing %s with pacing: %g\n", Args.Func,
Args.Pacing);
printf("Press any key to cancel.\n");
fflush(stdout);
if (WriteDev("*cls;*rst") != VI_SUCCESS) Quit();
if (WriteDev("*ese 0;*sre 0") != VI_SUCCESS) Quit();
// Set Meas Func
Programming Examples
4-20 Error Code

Table of Contents

Other manuals for Pendulum CNT-91

Related product manuals