Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-488.2 .NET Library Does Not Recognize PCI-GPIB Card

Solved!
Go to solution

Hi,

 

I am upgrading an existing .NET/C# application to use the .NET libraries for NI-488.2 (version 13.0.45). Everything is working great as long as I am using USB GPIB adapters, but when I run my application on a machine that has a PCI GPIB board, the board is not detected.

 

In short, this code throws an exception when my PCI GPIB board is board number 0 (I also have a USB GPIB board at board number 1):

using NationalInstruments.NI4882;

 

var board = new Board(0); 

 

NI-MAX can see the board and allows me to talk to devices connected to it.

 

AlanDCordner_1-1691725419671.png

 

Is the .NET library not compatible with PCI and older GPIB boards?

 

0 Kudos
Message 1 of 2
(970 Views)
Solution
Accepted by topic author AlanDCordner

After further investigation, I discovered that this GPIB board detection process actually is successful with PCI-GPIB cards. Since my laptop is not able to accept a PCI card, I had to rely on someone at another physical location to help troubleshoot the issue.

The real issue turned out to be that invoking the FindListeners() method on the Board class instance throws an InvalidOperationException when there are no instruments connected to a GPIB board, regardless of whether it is a USB or PCI card. This was unexpected. I would have expected FindListeners() to simply return an empty list instead of throwing an exception. After changing my code to account for this, all is well.

Message 2 of 2
(882 Views)