Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Why does ibfind return a value of 0x4000?

When accessing my GPIB-ENET/100 using ibfind("gpib0") the value that comes back is 0x4000 or 16384 decimal. Other operations work fine if I use a board id of 0. However, if I use the returned value of 16384 nothing works. The ibfind command works just fine with our PCI based setup but fails with GPIB-ENET. Examining ibsta after the ibfind command returns a value of 0x0100. Running ibconf shows the device name to be gpib0 and there is an alias in the /etc/hosts file for gpib0.
I am using v1.4 of the driver software for Solaris.

Does a return value of 0x4000 have some meaning or should I be "masking" off part of the response to get the correct value?

Thanks,
0 Kudos
Message 1 of 4
(4,138 Views)
Hello,

Are you doing this in IBIC (interactive control) or in a programming language? What programming language are you using? Getting a unit descriptor back from IBFIND should indicate that you have a valid connection to the ENET box. The only processing that you should have to do on the return from IBFIND is to check and see if the value returned is -1, which would indicate an error. Your IBSTA seems to indicate that the operation completed successfully. You do not have to mask off anything from the ibfind return.

What is the next thing that you do with your UD? Do you call an IBWRT? What happens when you do that? What is the error and status that you get back?

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 4
(4,138 Views)
Scott,

I am using Java, actually a JNI (c-code), to communicate with the driver. If I simply execute a printf("%x\n",result), where result is the ud returned from ibfind, 4000 is printed out on the console.

The next command I use the ud for is ibconfig which passe and then SendIFC which fails. I would have to rerun the test without the hardcoded 0, which is the value I expect, to get you the exact error message. The other commands I am using are: ibtmo, Send and Receive. All these fail when using the ud returned from ibfind. However, if I use a value of 0 instead, I have no problems communicating with the devices out on the bus. As I mentioned before, using the driver for the PCI GPIB interface card on another machine with the same cod
e, works fine. It is only when I use the ENET-GPIB driver.

Attached is a file showing the output from the c code.
Since I wasn't sure if the string from Java was coming in properly, I repeated it ibfind as you can see on lines 03-06.

Paul
0 Kudos
Message 3 of 4
(4,138 Views)
Paul,

I understand your problem now. The issue is coming from the difference between a "board id" and a "unit descriptor". SendIFC requires a board ID, which is the something like 0, 1, 2, etc. This maps to the name that you have given the board in ibconf, such as GPIBx where x is the board ID.

When you want to do I/O on the bus or to a specific device, you have to open a unit descriptor ("handle") to a specific board ID. IBFIND("GPIB0") opens a unit descriptor so that you can pass that UD to ibwrt, ibrd, or ibconf. If you want to do a SendIFC, you have to send it the board ID rather than this UD.

See the 488.2 help for which functions require board ID's and which ones take unit descriptors. Hopefully this explanation helps you; le
t me know if you have further questions.

Scott B.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 4
(4,138 Views)