Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

importing visa32.dll with C# dynamically and API definitions

I am developing an executable using C#.NET 2008. I have been using the complete NI-VISA 4.3 installation with .NET 2.0 support. I was able to get localmanager and open session to list the cards in the chassis. But, I have since found out that I would require a license for each set of software shipped if I were to include the NI drivers that I have been using for development. This is due to the fact that I would not know if the customer would have any other software/hardware that would be NI.
 
So, I  thought I might be able to perform the [DllImport("visa32.dll")] command above any functions that I would require from the visa library. Such as viOpenDefaultRM().
The question is: where do I find the definitions of the various functions inside the visa32.dll and the parameters required?
 
The only thing I need to do with VISA is locate the cards in the chassis and get their address, manufacturer and description. I use other drivers that actually talk with the instruments. My app is a layer above that, but I do need to find out the addresses of the cards to pass that info to the other drivers I am using.
 
Thanks for any help.
 
Derek
0 Kudos
Message 1 of 2
(6,902 Views)
Hello,
You will not be able to use the visa32.dll as National Instruments has wrapper classes to expose the functions of the dll.

In order to use the NI-VISA driver you must have a valid license to do so called the VISA Development License. Whether or not you need to explicitly purchase this depends on the Application Development Environment (ADE) you are using as well as the hardware you are using.

If you have purchased an NI ADE (such as LabVIEW or LabWindows/CVI) or you have purchased an NI device that uses VISA, then the VISA Deployment License is included and no extra steps are required to program with VISA. If you are not using an NI ADE or a piece of NI hardware that uses VISA, then you must purchase both the VISA software and the VISA Development License.

You may also be interesting in the articler found here.
Let us know if this helps.



Christian A
National Instruments
Applications Engineer
0 Kudos
Message 2 of 2
(6,872 Views)