Quantcast
Channel: LabWindows/CVI topics
Viewing all articles
Browse latest Browse all 5339

CVI 2013 communication using Agilent IO and E5810A Lan to GPIB Gateway issues

$
0
0

Hi all NI CVI Wizards

I am using Agilent IO as my coms interface for GPIB and Lan communication.  I am trying to communicate w/ an RF source, addressed at GPIB0::19:INSTR.  I copied this example (idn.c) directly from the Agilent IO connection expert.  See below at bottom.

 

I ran it in Visual Sutdio 2010 and it worked fine.  I then ran it in NICVI 2013 and it fails intermittantly.  When stepping through it, gets through the viOpenDefaultRM( (&defaultRM); line but defaultRM is empty.  It then crashes on the viOpen(....) sometimes returning a dialog box with :

FATAL RUN-TIME ERROR

Unknown source position, thread id 0x000021AC

 

A non-debuggable thread caused a 'Unknown' fault at address

0x77C2000C

No source line information is available

 

 

Other times it passes and vi contains the address of the RF Source

GPIB0::19::INSTR.

 

Any ideas on why there is an intermitent behavior using CVI?  See program belw.

 

 

/*idn.c
  This example program queries a GPIB device for an identification string
  and prints the results. Note that you must change the address. */

#include <visa.h>
#include <stdio.h>

void main () {

  ViSession defaultRM, vi;
  char buf [256] = {0};
 

  /* Open session to GPIB device at address 19 */
  viOpenDefaultRM (&defaultRM);
  viOpen (defaultRM, "GPIB0::19::INSTR", VI_NULL,VI_NULL, &vi);

  /* Initialize device */
  viPrintf (vi, "*RST\n");

  /* Send an *IDN? string to the device */
  viPrintf (vi, "*IDN?\n");
 
  /* Read results */
  viScanf (vi, "%t", &buf);

  /* Print results */
  printf ("Instrument identification string: %s\n", buf);

  /* Close session */
  viClose (vi);
  viClose (defaultRM);
}

 

 

 

 


Viewing all articles
Browse latest Browse all 5339

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>