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: 

.NET Framework 2.0 Languages Support for VB 2005 Express

Hi,
 
Can anyone give me advise on the following issue?
 
I am using VB2005 Express and try to install the NI488.2 ver 2.4 for my GPIB-USB-HS. However, I cannot found the .NET Framework 2.0 Language Support in the installation option, just only the NET Framework 1.1 Language Support. Can I use this 1.1 Language Support? I doubt with this because VB2005 Express is using .NET Framework 2.0.
 
Best Regars,
 
YC
0 Kudos
Message 1 of 9
(4,186 Views)

Hey YC,

Do you happen to have the device driver CD? I think you should be able to find the 2.0 support that you need if you install the drivers from the device driver CD, instead of the drivers from online.

Regards,

Nick D.

0 Kudos
Message 2 of 9
(4,160 Views)
I'm time to time using Visual Studio 2005 Express Edition(C++). There's no problems with using NI488.2 .NET classes in my applications. Probably they were written for .NET 1.1, but also working under .NET 2.0 without problems. Just using NationalInstruments.NI4882.dll from \Program Files\National Instruments\MeasurementStudioVS2003\DotNET\Assemblies\Current.

For example:

using namespace System;
using namespace System::Threading;
using namespace NationalInstruments::NI4882;

#define Sleep(t) Thread::Sleep(t)

void GPIBOpen(Device^ dev,int addr);
void GPIBWrite(Device^ dev,String^ s);
String^ GPIBRead(Device^ dev);

int main()
{
//Open GPIB
Device^ id;

GPIBOpen(id,1);

//Write to GPIB
GPIBWrite(id,"test");

//Read from GPIB
Console::WriteLine("Read from GPIB: \""+GPIBRead(id)+"\"");

return 0;
//GPIB is closed automatically, when program is exiting
}

void GPIBOpen(Device^ dev,int addr)
{
try
{
dev=gcnew Device(0,addr);
dev->Clear();
}
catch(Exception ^e)
{
Console::WriteLine(e->Message);
Console::ReadKey();
Environment::Exit(-1);
}
}

void GPIBWrite(Device^ dev,String^ s)
{
try
{
dev->Write(s);
}
catch(Exception ^e)
{
Console::WriteLine(e->Message);
Console::ReadKey();
Environment::Exit(-1);
}
Sleep(30);
}

String^ GPIBRead(Device^ dev)
{
try
{
return dev->ReadString();
}
catch(Exception ^e)
{
Console::WriteLine(e->Message);
Console::ReadKey();
Environment::Exit(-1);
}
return String::Empty;
}

It's compiling successfully even with /clr:safe key.
I not tested it thoroughly, so use at Your own risk.
--
Best Regards,
NoAngel
0 Kudos
Message 3 of 9
(4,150 Views)

Hi NoAngel,

Thankyou for your advise. I will test the compatibility of it.

One thing I have noted is that the help function of the Measurement Studio cannot be integrated into the VS2005's IDE as like that in VS2003 edition.

Best Regards

YC

PS. I install the device driver from the CD and cannot found the 2.0 Languages Support.

 

 

 

 

0 Kudos
Message 4 of 9
(4,129 Views)
Yes, I had the same problem. Help 2.0 is not integrating with Visual Studio 2005 Express Edition. But we can use third-party tool to view help, Help 2.0 custom Viewer:

http://frogleg.mvps.org/helptechnologies/mshelp2/h2viewer.zip

Try to download it, use "File->Open name space...", select NI... namespace.
--
Best Regards,
NoAngel
0 Kudos
Message 5 of 9
(4,127 Views)

Hi NoAngel,

Thankyou very much for your informantion. I have got it!

Best Regards,

YC

 

0 Kudos
Message 6 of 9
(4,122 Views)
I'm very interested in this post. Can anyobody attach some Visual Basic 2005 express example??
Thanks.

0 Kudos
Message 7 of 9
(3,929 Views)

Hey Baguel,

Have you tried implementing the same strategy as above, but using the folder:

\Program Files\National Instruments\MeasurementStudioVS2005\DotNET\Assemblies\Current.

Regards,

Nick D.

0 Kudos
Message 8 of 9
(3,875 Views)
Thaks a lot, NIck. I'll try that.
0 Kudos
Message 9 of 9
(3,862 Views)