Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-VISA.NET MessageBasedSession Dispose Hangs SW

I am using NI-VISA.NET in Visual Studio 2008 with VB.NET.  My problem is I can open a MessageBasedSession and communicate with the test equipment but when I try to Dispose the MessageBased Session the software hangs.  I tried using the example program under DotNET3.5 SimpleReadWrite and I get the same result. 

 

Using the SimpleReadWrite program I Open and select a device then when I click Close the program hangs.  I tried a try catch in my program but the program hangs and I have no idea what the error is.  The last entry using NI IO Trace is "viInstallHandler..." with no errors.

 

I am using a NI GPIB ENET 100 controller.

 

The computer is running Windows 7 64 bit.

 

I have NI-VISA 5.2 installed.

 

I also have the Agilent IO Control installed which I need to run a program from Agilent.

 

Below is the MAX report for the computer:

MAX Summary

  • My System
    • Data Neighborhood
    • Devices and Interfaces
      • Network Devices
        • GPIB-ENET/100 "GPIB0"
          • 6032A "GPIB0::5::INSTR"
          • 34401A "GPIB0::22::INSTR"
      • NI USB-6509 "Dev1"
      • Serial & Parallel
        • COM1
        • COM3
        • LPT1
    • Scales
    • Software
      • LabVIEW Run-Time 2009 SP1
      • LabVIEW Run-Time 2010 SP1
      • LabVIEW Run-Time 2011 SP1 f2
      • LabVIEW Run-Time 8.2.1
      • LabWindows/CVI Run-Time 2010 SP1
      • Measurement & Automation Explorer 5.3.3
      • Measurement Studio for VS2008
        • DotNET
          • Common
          • Common (64-bit)
          • Gpib
          • Gpib (64-bit)
          • NationalInstruments.DAQmx
          • Visa
          • Visa (64-bit)
      • Measurement Studio for VS2010
        • DotNET
          • Common
          • Common (64-bit)
      • NI I/O Trace 3.0.2
      • NI PXI Platform Services 3.2
      • NI System Configuration 5.3.3
      • NI-488.2 3.1
      • NI-DAQmx ADE Support 9.6
      • NI-DAQmx Device Driver 9.6
      • NI-DAQmx MAX Configuration 9.6
      • NI-PAL 2.9
      • NI-Serial 3.9
      • NI-VISA 5.2
        • NiVisaServer.exe
        • NIvisaic.exe

NI-VISA Runtime 5.2

 

0 Kudos
Message 1 of 7
(6,922 Views)

I have more information about the problem.  If I uninstall "Agilent IO Libraries Suite 16.3" the MessageBasedSession Dispose no longer hangs the SW.

 

I need to have the "Agilent IO Libraries Suite 16.3" installed to run a Agilent program.  Any ideas on a workaround.

0 Kudos
Message 2 of 7
(6,913 Views)

I found a workaround for this problem.

 

In the Measurement & Automation Explorer (MAX) expand Software.

Click on NI-VISA 5.2 and select the tab "VISA Options" on the right pane at the bottom.

Select "Conflict Manager"

Under Installed VISA implementations: select and disable "Agilent Simulation VISA" and "Agilent VISA".

Save.

 

Preferred VISA: was already set to "National Instruments VISA"

 

Hopefully in the future this will not be necessary as I will need to enable these VISA implementations to run the Agilent program I have.

 

Hope this helps someone else.  I lost about 2.5 days of work due to this problem.

Message 3 of 7
(6,905 Views)

Hi, I'm having the same issue. I tried your latest workout around but with no luck. Have you found a real solution? 

 

Everything was working fine for me using the ni4882 .NET libraries but my end user has an Agilent usb-GPIB dongle rather than an NI and it doesn't work with the 4882 library. So I am going back and rewriting everything to work with the VisaNS libraries which have so far been unreliable and frustrating! 

 

Any help would be awesome. 

Thanks.

Douglas Sappet
Test Hardware Development Engineer
Allegro Microsystems Inc.
Manchester, NH
0 Kudos
Message 4 of 7
(6,346 Views)

I have not had any problems with reliability since I disabled the Agilent drivers but I am using a NI GPIB controller.  I have never used a Agilent GPIB controller though most of the equipment I control is Agilent.  About have of the equipment is GPIB and the other half is Ethernet controlled.  Using the message based sessions I can control the equipment either way.  Sorry I could not be any more helpful.

0 Kudos
Message 5 of 7
(6,343 Views)

Hi dsappet,

 

Are you using either the Agilent 82357A or 82357B USB-to-GPIB converter? If so, this KB should be helpful: http://digital.ni.com/public.nsf/allkb/F7C187DBF09EBE1186256F550065BD32?OpenDocument.

 

If you simply run VISA Test Panels from MAX (select the device and it should be an option at the top) and query the device with an identity command or some command the device recognizes, do you get a proper reply from the device? This would at least let us know whether commands can be sent from MAX to the device.

Rahul B.
0 Kudos
Message 6 of 7
(6,322 Views)

this solution worked for me... kudos

 

Re: NI-VISA.NET MessageBasedSession Dispose Hangs SW
 

I found a workaround for this problem.

 

In the Measurement & Automation Explorer (MAX) expand Software.

Click on NI-VISA 5.2 and select the tab "VISA Options" on the right pane at the bottom.

Select "Conflict Manager"

Under Installed VISA implementations: select and disable "Agilent Simulation VISA" and "Agilent VISA".

Save.

 

Preferred VISA: was already set to "National Instruments VISA"

 

Hopefully in the future this will not be necessary as I will need to enable these VISA implementations to run the Agilent program I have.

 

Hope this helps someone else.  I lost about 2.5 days of work due to this problem.

0 Kudos
Message 7 of 7
(6,142 Views)