Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Found error in LangInt.dll for C#

There is an error in the LangInt.dll.

The command:

li.ibrd(ud, out response, 200);  //where response is a C# string

It works fine if you use a byte array, but if you use a string it will put garbage characters in your string after the read data.
To make sure it was an NI bug, I tried using the NI Spy and a hardware GPIB analyzer to inspect the actual read data. The actual data has no garbage characters in it, only the read data plus a terminator. When the ibrd C# function is executed, it is putting garbage in the response string after the terminator.

I also tried making sure the response string was cleared before executing the ibrd function. (C# strings are immutable though, that shouldn't be a problem)

There must be an error in the NI code where it is taking the raw read bytes and converting them into a string.

FYI - I am using the NationalInstruments.NI4882 dll now. I thought you guys would still like to know. This caused some confusion in the past.
0 Kudos
Message 1 of 3
(3,699 Views)
Hello Brians,
I will have to run some tests of my own and if I can replicate this issue I will file a corrective action report with R&D.
But I am glad you are using the NI4882.dll now as it offers more documentation as described here.
Christian A
National Instruments
Applications Engineer
0 Kudos
Message 2 of 3
(3,668 Views)
Hi. Thanks for taking a look at it.

By the way I am using .Net 2.0 with Visual Studio 2005 on a Win xp box.
0 Kudos
Message 3 of 3
(3,648 Views)