EasyManua.ls Logo

Keysight N9320B - Checking USB Connection

Keysight N9320B
176 pages
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...
47
Programming Example
Checking USB Connection
Checking USB Connection
Usually, using “*IDN?” verifies the data transferring between the
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;
}

Table of Contents

Other manuals for Keysight N9320B

Related product manuals