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.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Importing Niglobal.bas and Vbib-32.bas to a Visual Basic 2005 project

I'm trying to communicate to a spectrum analyzer over the (NI 488) GPIB from Visual Basic 2005. I understand that I need to include the two .bas files in my project. I'm very new to Visual Basic. I added the two files to my project, but I keep getting compilation errors. Here are some of them: for Vbib-32.bas, I get the compilation errors: "Description expected" and it points me to Attribute VB_Name = "VBIB32" "'Option' statements must precede any declarations or 'Imports' statements." and it points to Option Explicit Each of the "Declare Function ibask32 Lib "Gpib-32.dll" Alias "ibask" (ByVal ud As Long, ByVal opt As Long, value As Long) As Long" lines gives me the following error: 'Statement is not valid in a namespace'. What am I missing here? Thanks!
0 Kudos
Message 1 of 6
(5,840 Views)
Hi Rej,

It looks like you are trying to use the VB6 file to program in .NET (Visual Basic 2005). Here is a KnowledgeBase article that talks about how to use .NET GPIB Language Interface.

Here is the download link for the 488.2 .NET API.

Hope that helps!
Rasheel
0 Kudos
Message 2 of 6
(5,805 Views)
Thanks Rasheel! I couldnt install the 488.2 .NET API. I keep getting the message "The >NET NI-488.2 API requires the .NET Framework version 1.1 to run and install properly. Get the .NET Framework at ...". I'm using Visual Studio 2005 and I have .NET framework SDK v.2.0. So I'm not sure why this message comes up.
0 Kudos
Message 3 of 6
(5,793 Views)
Hi Rej,

Oh okay. What version of NI-488.2 do you have installed? We have added support for .NET 2.0 in NI-488.2 v2.5. This can be found here.

Please refer to the attached diagram to see where you can add the option for .NET 2.0.
Rasheel
0 Kudos
Message 4 of 6
(5,776 Views)
Hi Rej,

Visual Studio 2005 only installs the .NET Framework 2.0 and thus if you tried to select the .NET Framework 1.1 installer tree item, our install would throw a message saying you need the 1.1 framework. In your case, since you are developing in Visual Studio 2005, you will be targeting version 2.0 of the .NET CLR. Thus you need 2.0 support so just as Rasheel said, you need to make sure that you select the .NET Framework 2.0 Support item in the installer tree. This will install the appropriate .NET assemblies, examples, and the appropriate documentation for the .NET API.

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 5 of 6
(5,750 Views)
Thanks guys! I moved to C as a quick fix for now 🙂
0 Kudos
Message 6 of 6
(5,732 Views)