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.
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.
01-31-2018 03:47 AM
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
01-31-2018 03:45 PM
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.
01-31-2018 04:31 PM
It would be helpful if you uploaded the code. The actual VIs, if possible.
02-01-2018 06:05 AM
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
02-01-2018 06:09 AM
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
02-01-2018 07:13 AM - edited 02-01-2018 07:20 AM
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.
02-01-2018 09:29 AM
@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.
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.
02-02-2018 11:54 AM
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