GPIB library ni4882.dll function ibexpert? - Page 1
Forum section: electronics / testgear

author: alan.bain
author_rank: Regular Contributor
timestamp: November 28, 2024, 09:26:13 pm
content: The function ibexpert is defined in the header <ni4882.h> asPORT 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

author: alan.bain
author_rank: Regular Contributor
timestamp: November 29, 2024, 11:42:35 pm
content: 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;char buf2;ibexpert(0, 10, NULL, buf1); // Returns the "configured interfaces"DWORD boardId =0; // Valid number of a GPIB NI boardibexpert(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.

author: alan.bain
author_rank: Regular Contributor
timestamp: December 10, 2024, 10:03:01 pm
content: 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.

author: Tony_G
author_rank: Super Contributor
timestamp: December 10, 2024, 10:58:30 pm
content: 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:char buf1;char buf2;ibexpert(0, 10, NULL, buf1); // Returns the "configured interfaces"unsigned long boardId = 0; // Valid number of a GPIB NI boardibexpert(0, 11, &boardId, buf2);buf1 returns exactly what you said and buf 2 returns:Code:+buf20x00000075557be9d0 "NI GPIB-ENET/1000"charWhich is the NI device I use to connect to my devices from my PC.TonyG

author: alan.bain
author_rank: Regular Contributor
timestamp: December 16, 2024, 11:38:40 pm
content: 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;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;ret = ibexpert(0, 6, NULL, buf2);Genuinely curious...Alan

author: Tony_G
author_rank: Super Contributor
timestamp: December 17, 2024, 03:45:08 pm
content: Here is what I get from those, starting with the second one:Code:char buf4;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:-buf40x000000871b78f4d0 "0174ACF1"char0x30 '0'char0x31 '1'char0x37 '7'char0x34 '4'char0x41 'A'char0x43 'C'char0x46 'F'char0x31 '1'char0x00 '\0'char0xcc 'Ì'char0xcc 'Ì'charThe call:Code:char buf3;int ret = ibexpert(0, 1, NULL, buf3);returns:Code:-buf30x000000871b78f390 "Ù"char0xd9 'Ù'char0x00 '\0'char0x00 '\0'char0x00 '\0'char0xcc 'Ì'char0xcc 'Ì'charWhich is a 4 byte return with the first byte as D9 - Sorry - No idea what that is.TonyG

author: Tony_G
author_rank: Super Contributor
timestamp: December 17, 2024, 04:02:42 pm
content: 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:char buf1;char buf2;ibexpert(0, 10, NULL, buf1); // Returns the "configured interfaces"unsigned long boardId = 0; // Valid number of a GPIB NI boardibexpert(0, 11, &boardId, buf2);char buf3;int ret = ibexpert(0, 1, NULL, buf3);char buf4;ret = ibexpert(0, 6, NULL, buf4);Results are:Code:+buf10x0000005b025de370 "\x1"char+buf20x0000005b025deb90 "NI GPIB-USB-HS"char+buf30x0000005b025df3d0 "Ö"char+buf40x0000005b025df510 "01211837"charwith that buf3 still being 4 bytes but now a D6:Code:-buf30x0000005b025df3d0 "Ö"char0xd6 'Ö'char0x00 '\0'char0x00 '\0'char0x00 '\0'char0xcc 'Ì'charStill have no idea what it means though.TonyG

author: alan.bain
author_rank: Regular Contributor
timestamp: December 17, 2024, 06:04:14 pm
content: Well it solves the problem of the call 6 at least. All I could see wasvaPrint(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_ERRORI did wonder if it was some kind of numerical board id to describe interface type.