Checking Usb Connection - Keysight N9320B Programmer's Manual

Spectrum analyzer
Hide thumbs Also See for N9320B:
Table of Contents

Advertisement

Checking USB Connection

"*IDN?"
Usually, using
controller PC and the instrument.
****************************************************
#include "visa.h"
#include <stdio.h>
#define BufferSize 128
static ViStatus status;
static ViSession defaultRM;
static ViSession inst_N9320B;
static ViUInt32 rcount;
static unsigned char buffer[BufferSize];
int main(void)
{
/* Connect N9320B and read its "IDN". */
status = viOpenDefaultRM (&defaultRM);
status = viOpen (defaultRM,
"USB0::2391::8472::0000000000::0::INSTR", VI_NULL,
VI_NULL, &inst_N9320B);
if (status != VI_SUCCESS)
return -1; //failed to connect N9320B/
/* Read "IDN" from N9320B" */
status = viWrite (inst_N9320B, "*RST\n",
StringLength("*RST\n"), &rcount);
status = viWrite (inst_N9320B, "*IDN?\n",
StringLength("*IDN?\n"), &rcount);
status = viRead (inst_N9320B, buffer, BufferSize,
&rcount);
/* Close connection to N9320B. */
status = viClose (inst_N9320B);
status = viClose (defaultRM); return 1;
}
Programming Example
Checking USB Connection
verifies the data transferring between the
47

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents