LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting an error when closing a VISA session

Solved!
Go to solution
I have a VI that uses VISA to talk to an instrument through aLAN/GPIB gateway.  It works fine when talking to my laser.  When I try to communicate with my OSA, all of the commands work, and I get the data, but I get an error message from the VISA Close.  The OSA is an older unit, but I thought that the VISA stuff was all internal to the PC and OS.  Any help or insight would be appreciated.
 
Jim
Jim

LV 2020
0 Kudos
Message 1 of 19
(5,907 Views)
It would help if you provided the error code that you're getting.

As for VISA, it's basically just a software layer between your application (in this case LabVIEW) and the specific driver for the bus that you're using (GPIB, Serial, TCP/IP, etc.). It doesn't really have anything to do with the OS.
0 Kudos
Message 2 of 19
(5,893 Views)
Sounds to me that you are getting the error before you VISA Close.  Ar you displaying the error in more than one place in your code?
 
Matt
Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 3 of 19
(5,890 Views)

Sorry for the missing info.

Error code:  –1073807338  

Which in NI help is indicated as:  VI_ERROR_CLOSING_FAILED  -   The VISA driver failed to properly close the session or object reference. This might be due to an error freeing internal or OS resources, a failed network connection, or a lower level driver or OS error.

 

Watching the VI execute in highlighted mode, there are no errors out of any of the VISA writes or reads before the Close.

 

Jim

Jim

LV 2020
0 Kudos
Message 4 of 19
(5,882 Views)
BTW - running LabVIEW 7.1 on XP Pro.

Message Edited by lmtis on 03-02-2006 07:52 AM

Jim

LV 2020
0 Kudos
Message 5 of 19
(5,889 Views)
Solution
Accepted by topic author lmtis

Hello,
What version of NI-VISA do you have?  There was a problem with the viClose on earlier versions of NI-VISA (before 3.1).  I suggest upgrading to the latest version (3.5) here.  If you don't already have the latest version, try it and see if it fixes the problem.

Chris R.
Applications Engineer
National Instruments

Chris R.
Applications Engineer
National Instruments
Message 6 of 19
(5,865 Views)

Chris,

How do I find out what version of VISA I have installed? 

 

Jim

Jim

LV 2020
0 Kudos
Message 7 of 19
(5,849 Views)

Hello,
You can go into Measurement and Automation Explorer from the start menu and expand the "Software" folder from the configuration tree.  Find NI-VISA and click on it.  The version number should then be displayed in the box on the right side.  Let me know if you have any trouble.

Chris R.

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 8 of 19
(5,840 Views)
Thank you Chris.  Upgrading VISA from 3.1 to 3.5 not only fixed the Close VISA problem, but also fixed NI Max.  It was rebooting my PC every time I ran it, but now it works fine.  Thanks for the advice.
 
Jim
Jim

LV 2020
0 Kudos
Message 9 of 19
(5,830 Views)

No problem!  I was happy to help!  Best of luck to you!

Chris R.
Applications Engineer
National Instruments

Chris R.
Applications Engineer
National Instruments
0 Kudos
Message 10 of 19
(5,826 Views)