Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a NI PCI-GPIB board from Visual C# 2005

Hi everyone,

I have a weird issue happening when trying to access a PCI GPIB board from Visual C# 2005.

I am using the "SampleReadWrite" program provided on the NI driver CD to explain what happens.

If I execute this program from the debug mode, and do step by step operations, everything runs well.

If I compile this program, and run it, I notice that when I click on the "open" button, it will take between 20s and 2 minutes for the "write" operation to be possible. And if I switch on the NI spy, nothing happens during this time. It seems the .NET runtime has trouble to create the "Device" object.
Maybe it is linked to the fact that the NI libraries seem to be designed for 1.1 .NET framework whereas Visual Studio 2005 is based on 2.0 .NET framework, so I need both 1.1 and 2.0 frameworks for my program using GPIB interface to be able to run.

Do you have any experience in this area? Any help would be greatly appreciated.

Best regards,

Stéphane
0 Kudos
Message 1 of 3
(3,411 Views)
Hi
i have tested the example you mention in Visual Studio 2005 and i have no problem.
Notice i have only one framework install in my computer.

Can you try upgrading your drivers?

kamal
NIF
0 Kudos
Message 2 of 3
(3,398 Views)

Stéphane -

The GPIB driver includes two .NET libraries, one for .NET Framework 1.1 and one for .NET Framework 2.0. I have attached a screenshot of what this looks like in the installer feature tree in the driver CD. If you have the GPIB CD, it should look similar.

If you are using Visual Studio 2005, I recommend that you use the .NET Framework 2.0 libraries.

That aside, the .NET Framework 2.0 can execute .NET Framework 1.1 assemblies just fine, so it is unlikely that this is the cause of the slowdown. I think you should look elsewhere for the cause. Does the slowdown occur only the first time you create the Device object? If so, can you create the Device object at startup and hold onto it throughout your program so that you take this performance hit only once? Have you tried to do a similar operation in the GPIB interactive control application or another such tool to see if this is just the time it takes to communicate with your device?

David Rohacek

National Instruments

Message Edited by drohacek on 08-02-2007 09:58 AM

0 Kudos
Message 3 of 3
(3,390 Views)