12-02-2020 05:25 PM
Hi there,
I am fairly new to Labview and I hope you can help.
I am setting up a .vi to communicate with an instrument. The .vi is fairly simple: open VISA, write command, read buffer and close VISA. Screenshot attached below:
Unfortunately it gives this error:
Possible reason(s):
VISA: (Hex 0xBFFF0011) Insufficient location information or the device or resource is not present in the system.
I can communicate with the device without any issue through NI-MAX (see below) and using proprietary software.
Looking for solutions, I tested (unsuccessfully) all of the following suggestions:
- Added an alias in NI-MAX, and used the alias to select the VISA resource
- Added instrument properties before opening the VISA: this reads the right instrument and setting, so it seems that the device name is actually correct
- tested different protocol (TCP/IP, GPIB, Serial) - all gave the same error.
Finally, if I only open and then close the VISA (i.e. I remove the write/read blocks), I do not get any error.
Since I am fairly new in Labview, maybe there is something very basic that I am missing. I hope you can help.
Cheers,
Vale
12-03-2020 03:17 PM
Notice in the NI-Max window that the string terminates with a "\n" and in your program query you have it ending with "/n".
Change it to "\n" and see if that helps.
12-03-2020 03:21 PM
Hi there,
thanks for replying and for spotting the "\"
I took the screenshot after a long day of tests, and that was one of the last thing I tried without success. Both "\n" or "/n" do not work.
As an update, I contacted the manufacturer of the device to get an example .vi
Even using their example, I get the same error.
Thanks again for the help. Hope to solve it soon
Cheers,
Vale
12-03-2020 03:37 PM
In your vi front panel, hit the down arrow for you Visa Resource Name options and select the one available for your instrument. It could be that this instrument has an alias name that you set.
Usually for TCP connections, I would use the TCP primitives under the Data Communications => Protocols => TCP rather than the VISA Resources.
12-04-2020 05:10 AM
12-21-2020 08:07 AM
Hey, I am also facing a similar problem with my Instec mk 2000 temperature controller. Did you solve the problem ?
12-21-2020 11:09 AM
Hi there,
In my case, it turns out it was something to be fixed with the instrument provider. I was able to communicate with the instrument by taking the following steps:
- Using an actual ethernet port instead of the USB
- In NI MAX using a VISA driver that was provided by the supplier instead of using the NI one
Even with these two conditions, I was only able to connect using the SOCKET port instead of the instrument one (which is slower than the actual instrument port). For my case this was sufficient, as I was demoing the device and I just wanted to perform some tests.
If you are lucky enough that your problem is one of the most common one, there are a series of good posts on this forum on how to fix it (they did not work for me, but apparently nothing could in my specific case).
The first sanity check is: are you able to communicate to the instrument through NI MAX? I.e. send and receive messages through VISA protocol?
If yes, you could try rename the instrument and test again in labview by using the alias name you renamed the instrument with. This seemed to be the most effective fix when I read around the forum.
Sorry I could not help more.
Cheers
V
12-21-2020 11:12 AM - edited 12-21-2020 11:15 AM
@minions @albert.geven
Thank you both for the suggestions.
I tried using TCP primitives as well before posting on the forum and it did not work.
It turns out it was something to do with the instrument itself.
Even using a small labviews script provided by the supplier (where they handled the linefeed better than I did - as @albert.geven pointed out), it was not working.
Eventually we fixed it by using a different VISA handler.
Thanks again for the help,
Vale
12-22-2020 12:44 AM
Hello, thank you for the response. It is very help. I am still working on my issue and hope it will be resolved soon.
Best Regards and wishes for holidays...