From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Close not working resulting in 1073807339 timeout error

Hello everyone,

I can't close the VISA port with a VISA Close command in Lab-view. I am building an application with a Stanford Research 7270 Lock - in amplifier connected via USB to the computer Lab-view 2016 on Win10. I have installed the support driver from the manufacturers website (http://www.ameteksi.com/products/software/labview-download-software/usb-driver-software) and the device shows up as expected in the device manager and NI MAX. Once when I open VISA and do read/write commands it works fine, but when I try to run VISA Close command it doesn't close the port and I cannot open it again or even read/write (I get an Error -1073807339 (timeout)). I have to restart the computer for lab-view to relinquish control of the port. Then I can open it again and use it. Is there a way to reset the port or force lab-view to relinquish control thereof?

I have seen multiple threads having this issue, mostly with USB applications, but none seem to work for me.

Best,
Toni

0 Kudos
Message 1 of 8
(2,857 Views)

Quote from website:

In general, we recommend that you install the SRUSB.SYS drivers except if you want to operate these instruments from LabVIEW via USB, in which case you should install the VISA drivers.


Shot in the dark....you said that you already installed the drivers but as stated, they aren't needed when using Labview.  Could the drivers be keeping the port open?  Try removing the drivers and then connect with Labview. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 8
(2,829 Views)

It would be helpful if you uploaded the code.  The actual VIs, if possible.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 8
(2,827 Views)

Hi,

thank you for your suggestion. I don't fully understand what you meant by that. If I uninstall the SR visa-usb driver then the device doesn't show up in labview or NI MAX and I can't communicate with it. The same is true also if I install the other SRUSB driver. I think it is possible that the driver keeps the port open, but I don't know how to work around it.

Best,
Toni

0 Kudos
Message 4 of 8
(2,807 Views)

Sure, the subVI has more functionalities, but it essentially comes down to the Open -> Initalize -> Close sequence of which the first two work, and thereafter I can't close the port with the Close command any more. Then all other commands end with an -1073807339 timeout error which I think I narrowed down to the port being occupied by something else (probably still by labview, or by the driver as was also suggested)

Best,
Toni

0 Kudos
Message 5 of 8
(2,804 Views)

I see two issues with your VI.

 

1.  The first, and I think the explanation for the problem you are seeing is that in the Close case, you close the port and then open it back up again.  So of course the port will be left open.

Never mind, my eyes tricked me.  I thought it was another Close Open combo rather than Close Close

 

2.  Is using a shift register on the error wire.  If you get an error, and don't do anything to handle it, it will persist into the next iteration of the loop and keep other code from running.  That may not be happening here because you are setup up as a FGV or action engine so the loop only iterates once, and the error input is wired, so the error won't persist in the shift register since the next time the subVI is run it will be whatever error is coming in through the connector panel.

 

I think #1 explains your port being left open.  I don't know what is causing your timeout error after that close attempt unless is is a remnant of an earlier VISA Read attempt.

0 Kudos
Message 6 of 8
(2,799 Views)

@tmark21 wrote:

Hi,

thank you for your suggestion. I don't fully understand what you meant by that. If I uninstall the SR visa-usb driver then the device doesn't show up in labview or NI MAX and I can't communicate with it. The same is true also if I install the other SRUSB driver. I think it is possible that the driver keeps the port open, but I don't know how to work around it.


Yeah when I reread my post, it doesn't make sense.  Smiley Frustrated  

My understanding of the comments on the website is that there are two versions of the driver. There is an SRUSB.sys driver and there is a VISA driver for Labview users.  I was trying to say that if you have both of these installed, there may be a possibility that both drivers are trying to access the port at the same time.  Try removing the SRUSB.sys driver and see if it works properly.  

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 7 of 8
(2,786 Views)

I only had one of them installed at the time. The first I had installed was the VISA one and that is the one I have the issue with. I tried at some point the other, but with that one I can't see the device in NI MAX. They were always installed individually.

Thanks for your help,
Toni

0 Kudos
Message 8 of 8
(2,765 Views)