LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine within application if VISA is installed

Looking for a way to determine from within my program if VISA is
installed so I may warn the user when they run the program (stand
alone executable built with application builder). Do something that
uses VISA (such as Find Resource) and look at its error cluster?
Would it be sufficient to simply see if the cluster's status is True,
or should a specific error such as -107380722 "Library Not Found" be
looked for ?

This application is for a classroom where users are not familiar with
LabVIEW and computers get re-built/OS re-installed occasionally and
VISA might not get re-installed when that happens.

Steve
0 Kudos
Message 1 of 10
(5,019 Views)
One of the easiest way to check if NI software is installed is to check the registry - I've attached a VI that will look for NI-Visa, and return an error (in the error cluster) if it's not found.

Like my Answer? Give it a Rating!

cheers,
Christopher

Christopher G. Relf
Certified LabVIEW Developer

Christopher.Relf@mBox.com.au
Int'l Voicemail & Fax: +61 2 8080 8132
Aust Voicemail & Fax: (02) 8080 8132

---
EULA
1) This is a private email, and although the views expressed within it may not be purely my own, unless specifically referenced I do not suggest they are necessarily associated with anyone else including, but not limited to, my employer(s).
2) This email has NOT been scanned for virii - attached file(s), if any, are provided as
is. By copying, detaching and/or opening attached files, you agree to indemnify the sender of such responsibility.
3) Because e-mail can be altered electronically, the integrity of this communication cannot be guaranteed.




Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
Message 2 of 10
(5,019 Views)
Thanks. Will NI-VISA for Windows 95/NT be the registry key for all operating systems ?

I tried using VISA Find Resources and Open. By themselves they do NOT return an error if VISA in not installed. However, if Find Resources "return count" value is wired to an indicator, it does then say there's an error. Similarily, if "resource name" returned by Open is wired to a string indicator, it also then says there is an error.
0 Kudos
Message 3 of 10
(5,019 Views)
No, "NI-VISA for Windows 95/NT" won't be the registry key for all operating systems - so you *really* want something OS independant? If not, what is the OS you are going to be using?




Copyright © 2004-2024 Christopher G. Relf. Some Rights Reserved. This posting is licensed under a Creative Commons Attribution 4.0 License.
0 Kudos
Message 4 of 10
(5,019 Views)
Windows OS version independent would be prefered. Running on 2000 now but may change to XP soon and then to whatever comes next. 2000 will be the minimum OS though (no 95/98/NT).
0 Kudos
Message 5 of 10
(5,019 Views)
Steve:

Looking at the registry key "NI-VISA for Windows 95/NT" will work on any Win32 system (for now). Realize that this is an NI-VISA specific key that could change at any time. Granted, we're not likely to, but still...

If you've already included this check, then realistically that ought to be good enough. Keep reading if you want to know why it might not be good enough.

Other reasons to not look there: 1) Since LabVIEW can work with any VISA implementation, not just NI's, this check would fail in that case. 2) That will not work on other OS's.

Your most robust bet is to look for that specific error code. LabVIEW will report that error on any OS if you make a VISA call and no VISA exists.

Dan Mondrik
Senior Software Engineer, NI-VISA
N
ational Instruments
0 Kudos
Message 6 of 10
(5,019 Views)
Dan,

What sepcific error code and how should I detect it ?

If I do nothing more than use VISA Find Resources with the input
resource name as ARSL1::INSTR, the value of Status in its output error
cluster is false when run as stand-alone executable on WIN2000 without
VISA installed. (LV 6.0.2, VISA 2.6). Only if I take the Find
Resources output value of its "count" and wire it to a front panel
indicator, then its error cluster's Status does return True.

Similar behavior for VISA Open. It's returned value of "resource
name" must be wired to front panel string indicator for its Status to
return True.

Steve

On Thu, 3 Oct 2002 11:55:37 -0500 (CDT), Dan Mondrik
wrote:

>Your most robust bet is to look for that specific error code. LabVIEW

>will report that error on any OS if you make a VISA call and no VISA
>exists.
0 Kudos
Message 7 of 10
(5,019 Views)
Steve:

I didn't realize at first that VISA Find Rsrc and VISA Open currently put different status codes into the error out cluster. That is a little bug in LabVIEW that we will fix in the next version. The correct error is 0xBFFF009E, library not found.

It sounds like you're averse to putting a hidden indicator on the front panel, so I've got an alternate workaround for you. Yes, it's still a workaround, but this will work now and in the future as well. You have to wire the output count of VISA Find Rsrc to *something*, not necessarily on the front panel. Just wire it to an empty 'for loop', and that will do the trick. The error cluster will contain 0xBFFF009E if VISA is not installed.

Hope that helps,
Dan Mondrik
0 Kudos
Message 8 of 10
(5,019 Views)
Dan,
I'm not against putting a hidden indicator on the front panel, though I welcome the solution that avoids not having to do it. I was mainly curious why this had to be done and why the differnet behavior when it is not done.

It's still not clear to me if the requirement of having to wire the output count of VISA Find Rsrc to something is an intentional design, or bug that will be fixed.

Thanks for your response,
Steve Parus
0 Kudos
Message 9 of 10
(5,019 Views)
Steve:

As to whether having to wire an output is intentional, well, I think the answer is yes. In some cases, LabVIEW chooses to optimize out certain VI's that do not have any output wires connected. This appears to be one of those cases.

Dan Mondrik
0 Kudos
Message 10 of 10
(5,019 Views)