Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

IFR 2042 Driver is returning the wrong handle

I am trying to use the IFR 2042 signal generator driver downloaded from the NI website.  I can intialize the device, but the handle the intialize function returns is wrong.  I handle has the value of 2 after the intialize function.  If I try to call any other functions using that device later on, the program freezes since the handle to the device is wrong.   
0 Kudos
Message 1 of 3
(3,456 Views)

Hi Andrew!

We first need to find out the source of the problem.  Has this setup worked before or is this new?  If it's new, has the signal generator worked correctly for you in the past?  Since we know that there is communication, try communicating with your instrument in Measurement and Automation Explorer (MAX) (if you have an NI GPIB device).  If you haven't done this before, open MAX and find your gpib device in Devices and Interfaces.  Select it and scan for instruments.  Once you see the instrument, try right clicking and selecting "Communicate with Instrument."  Try to send it a command and see what you get back.  If it is correct, then there is something going wrong in the program itself.  That driver was developed for LabVIEW 7.0 (or 6.0) and sometimes there are conflicts if you use different versions, although most of the time, they work fine.  Are you using LabVIEW? If so, what version? You may have to dive into some of those subVIs to try to locate the source of the problem.  Using highlight execution and probes are great ways to find out where the problem lies.  I hope this helps, but let me know if you have any more questions!  Best of luck and have a great day!

Chris R.
Applications Engineer
National Instruments

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,436 Views)

If you are using LabVIEW plug&play driver, the driver handle must be a VISA handle, so the value '2' is very strange.  If you are using IVI-C driver, the driver handle is a true IVI session handle returned from IVI Shared Component, which is normally set to a value such as 1, 2, 3, etc...  so the value '2' is not so strange.  Assuming you are using IVI, however, the driver handle must be '1' when the first time you initialize the driver session.  The value '2' can be returned only if you call Init function twice without closing the first session for the handle '1'. 

Anyway, even if you obtained the handle value '2' from the IVI driver, the driver normally works fine without freeze.  I recommend to use the NI-SPY program to trace the command IOs during the Init call.  It may help to check what is happening.

0 Kudos
Message 3 of 3
(3,429 Views)