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

Highlighted
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
(2,601 Views)
Highlighted

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
(2,575 Views)
Highlighted
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
(2,565 Views)
Highlighted

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
(2,544 Views)
Highlighted
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
(2,542 Views)
Highlighted

Hi NoAngel,

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

Best Regards,

YC

 

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

0 Kudos
Message 7 of 9
(2,344 Views)
Highlighted

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
(2,290 Views)
Highlighted
Thaks a lot, NIck. I'll try that.
0 Kudos
Message 9 of 9
(2,277 Views)