LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the serial number of NI GPIB board by CVI?

How can I get the serial number of NI GPIB board by LabWindows/CVI program ?
0 Kudos
Message 1 of 3
(2,862 Views)
Hi,
you need to make a call to the GPIB-32.DLL and obtains the board information using the undocumented IBDIAG call.
The prototype for IBDIAG is
long ibdiag(long ud, char *buff, long cnt);
and can be found in gpib.h in your cvi\include directory
where
ud = descriptor handle returned by call to ibfindA(CStr brdName);,
e.g. ud = ibfindA("GPIB0");
buffer is where the information is going to come out
cnt is the requested number of bytes of information (suggest 70+ to get all the info)
You then need to dive into the buffer to split out the relevant information - the version number is 4 characters long, and starts at 2 (from 0). The serial number starts at 60, then 59, then 58. The character value returned at each location (ASCII number) then needs converting
to a hex representation, e.g.

Fmt(serialnumber,"%x%x%x",buffer[60],buffer[59],buffer[58]);

You can run ibic and do the following two calls:

ibfind gpib0
ibdiag 500

This will show all information from the board. You can see the offset at which the specific information you need is present, and then parse it in the same way this VI does.

(info from http://zone.ni.com/devzone/explprog.nsf/6c163603265406328625682a006ed37d/36d8057972514d668625695e0059e646?OpenDocument)

Hope that helps

S.
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 3
(2,862 Views)
Well, I find here the needed functions, but a little complete example would help much more.

I tryed to use this functions in C# .NET, but It don't work until yet!
0 Kudos
Message 3 of 3
(2,862 Views)