Author Topic: GPIB library ni4882.dll function ibexpert?  (Read 540 times)

0 Members and 1 Guest are viewing this topic.

Offline alan.bainTopic starter

  • Regular Contributor
  • *
  • Posts: 93
  • Country: gb
GPIB library ni4882.dll function ibexpert?
« on: November 28, 2024, 09:26:13 pm »
The function ibexpert is defined in the header <ni4882.h> as

PORT unsigned int NI488CC ibexpert (int ud, int option, const void * Input, void * Output);

I cannot however seem to find any documentation for it, but I know that on using VISA viOpen it gets called with ud=-1, option=0xe and Input = Output = some memory buffer.

Does anyone know any more (or have a link) or is this a case for IDA ?

(It looks on very cursory inspection as if it ends up fairly quickly in a giant switch statement on "option").

Alan

 

Offline alan.bainTopic starter

  • Regular Contributor
  • *
  • Posts: 93
  • Country: gb
Re: GPIB library ni4882.dll function ibexpert?
« Reply #1 on: November 29, 2024, 11:42:35 pm »
Having found out a little more about the function I'd be very interested to see the results of ibexpert for options 10 and 11 on a real NI interface working with ni4882.dll. These return general info and controller into into the buffer Output. So e.g.

char buf1[2048];
char buf2[2048];
ibexpert(0, 10, NULL, buf1); // Returns the "configured interfaces"

DWORD boardId =0; // Valid number of a GPIB NI board
ibexpert(0, 11, &boardId , buf2);


If anyone had a working setup and could try the calls I'd be interested in what was in the buffers afterwards.  To the best of my knowledge they are read only calls.

 

Offline alan.bainTopic starter

  • Regular Contributor
  • *
  • Posts: 93
  • Country: gb
Re: GPIB library ni4882.dll function ibexpert?
« Reply #2 on: December 10, 2024, 10:03:01 pm »
For ibexpert call with option 10 turns out this returns an array of size 100 (decimal) DWORDs containing 1 if the ith interface is present and 0 if not.  Option 1 is harder to work out since it seems to involve a virtual function call and that needs a NI interface to actually do anything other than return an error.  So for those normal folk with one GPIB interface id 0 this returns 1 in first element of output and rest of bytes 0.



 

Offline Tony_G

  • Frequent Contributor
  • **
  • Posts: 967
  • Country: us
  • Checkout my old test gear channel (link in sig)
    • TGSoapbox
Re: GPIB library ni4882.dll function ibexpert?
« Reply #3 on: December 10, 2024, 10:58:30 pm »
I've never used the native API to talk to my adapter (I use the VISA.NET framework) but here is what I got from running:

Code: [Select]
   char buf1[2048];
   char buf2[2048];
   ibexpert(0, 10, NULL, buf1); // Returns the "configured interfaces"

   unsigned long boardId = 0; // Valid number of a GPIB NI board
   ibexpert(0, 11, &boardId, buf2);

buf1 returns exactly what you said and buf 2 returns:

Code: [Select]
+		buf2	0x00000075557be9d0 "NI GPIB-ENET/1000"	char[2048]

Which is the NI device I use to connect to my devices from my PC.

TonyG
 
The following users thanked this post: alan.bain

Offline alan.bainTopic starter

  • Regular Contributor
  • *
  • Posts: 93
  • Country: gb
Re: GPIB library ni4882.dll function ibexpert?
« Reply #4 on: December 16, 2024, 11:38:40 pm »
Thank you very much. This is indeed most helpful.  I've now been able to get my library to talk under VISA to a prologix interface.  Next steps require locating more GPIB cables !

char buf1[256];
int ret = ibexpert(0, 1, NULL, buf1);

This seems to return a DWORD of 0x5b but I'm not totally sure what it means.

char buf2[256];
ret = ibexpert(0, 6, NULL, buf2);

Genuinely curious...

Alan
 

Offline Tony_G

  • Frequent Contributor
  • **
  • Posts: 967
  • Country: us
  • Checkout my old test gear channel (link in sig)
    • TGSoapbox
Re: GPIB library ni4882.dll function ibexpert?
« Reply #5 on: December 17, 2024, 03:45:08 pm »
Here is what I get from those, starting with the second one:

Code: [Select]
   char buf4[256];
   ret = ibexpert(0, 6, NULL, buf4);

This returns the NI Adapter serial number as ASCII in the buffer (my adapter serial number is 0174ACF1):

Code: [Select]
-		buf4	0x000000871b78f4d0 "0174ACF1"	char[0x00000100]
[0x00000000] 0x30 '0' char
[0x00000001] 0x31 '1' char
[0x00000002] 0x37 '7' char
[0x00000003] 0x34 '4' char
[0x00000004] 0x41 'A' char
[0x00000005] 0x43 'C' char
[0x00000006] 0x46 'F' char
[0x00000007] 0x31 '1' char
[0x00000008] 0x00 '\0' char
[0x00000009] 0xcc 'Ì' char
[0x0000000a] 0xcc 'Ì' char

The call:

Code: [Select]
   char buf3[256];
   int ret = ibexpert(0, 1, NULL, buf3);

returns:

Code: [Select]
-		buf3	0x000000871b78f390 "Ù"	char[0x00000100]
[0x00000000] 0xd9 'Ù' char
[0x00000001] 0x00 '\0' char
[0x00000002] 0x00 '\0' char
[0x00000003] 0x00 '\0' char
[0x00000004] 0xcc 'Ì' char
[0x00000005] 0xcc 'Ì' char

Which is a 4 byte return with the first byte as D9 - Sorry - No idea what that is.

TonyG
 
The following users thanked this post: alan.bain

Offline Tony_G

  • Frequent Contributor
  • **
  • Posts: 967
  • Country: us
  • Checkout my old test gear channel (link in sig)
    • TGSoapbox
Re: GPIB library ni4882.dll function ibexpert?
« Reply #6 on: December 17, 2024, 04:02:42 pm »
It just occurred to me that I have a genuine NI USB adapter on my voltage monitoring system (which is separate from the GPIB-ENET).

Code is:

Code: [Select]
   char buf1[2048];
   char buf2[2048];
   ibexpert(0, 10, NULL, buf1); // Returns the "configured interfaces"

   unsigned long boardId = 0; // Valid number of a GPIB NI board
   ibexpert(0, 11, &boardId, buf2);

   char buf3[256];
   int ret = ibexpert(0, 1, NULL, buf3);

   char buf4[256];
   ret = ibexpert(0, 6, NULL, buf4);

Results are:

Code: [Select]
+		buf1	0x0000005b025de370 "\x1"	char[2048]
+ buf2 0x0000005b025deb90 "NI GPIB-USB-HS" char[2048]
+ buf3 0x0000005b025df3d0 "Ö" char[256]
+ buf4 0x0000005b025df510 "01211837" char[256]

with that buf3 still being 4 bytes but now a D6:

Code: [Select]
-		buf3	0x0000005b025df3d0 "Ö"	char[0x00000100]
[0x00000000] 0xd6 'Ö' char
[0x00000001] 0x00 '\0' char
[0x00000002] 0x00 '\0' char
[0x00000003] 0x00 '\0' char
[0x00000004] 0xcc 'Ì' char

Still have no idea what it means though.

TonyG
 
The following users thanked this post: alan.bain

Offline alan.bainTopic starter

  • Regular Contributor
  • *
  • Posts: 93
  • Country: gb
Re: GPIB library ni4882.dll function ibexpert?
« Reply #7 on: December 17, 2024, 06:04:14 pm »
Well it solves the problem of the call 6 at least. All I could see was
vaPrint(Output, "%08X", *(_DWORD*)SomeData);

I've just got my drop in driver working with VISA talking to an old MI6960. 

An invalid response to the ibexpert 1 call gives a VI_ERROR_SYSTEM_ERROR

I did wonder if it was some kind of numerical board id to describe interface type.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf