Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa types not defined in visual basic net

I'm using Visual Basic .NET to program an NI USB-6008 device. The device comes with Visa32.dll library which is suppose to have the type definitions such as ViStatus, ViSession. When those definitions are typed into a VBNet module they give an error as being undefined.

I've added a reference to the visa library and the library shows up in Solution Explorer as "Visa" and in Object Browser as "Interop.Visa".

Why does VBNet give this error?

Thanks,

Steve
0 Kudos
Message 1 of 4
(4,479 Views)
Visa32.dll does contain those definitions in an embedded type library. Type libraries can contain functions that are defined on a module where the functions provide type information for DLL entry points. The problem, though, is that VB.NET uses tlbimp.exe to generate an interop assembly that contains .NET equivalents for the type definitions in the type library and tlbimp.exe does not support module functions.

Since you're using VB.NET, a better option would be to use the native .NET interface to the NI-VISA driver. For more information, see the Knowledge Base article "VISA and GPIB application development using C# or VB.NET".

- Elton
0 Kudos
Message 2 of 4
(4,475 Views)
I'm trying to talk to a USB-6008 with VB.net. I simply need to set analog out 0 to a voltage. That's it. Anyone have a simple example?
0 Kudos
Message 3 of 4
(4,464 Views)
-There aren't many text based DAQmx Base programs out there yet....Here is one I found. It is an analog output C# example.

-Alan A.
0 Kudos
Message 4 of 4
(4,450 Views)