Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

ibdev device value keeps incrementing (?) during subsequent calls, and fails on occasion

Solved!
Go to solution

Hey CraigByrd,

 

What NI hardware are you using? What driver and version do you have installed? What else does your application/code do other than calling ibdev subsequently?

David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
Message 2 of 6
(3,795 Views)
Solution
Accepted by topic author CraigByrd

Craig,

 

If you continue to open a device handle using ibdev, it will eventually run out of handles, as described in the KnowledgeBase article called Why Do I Get iberr EDVR(0) after UD1023.

 

There are a couple of solutions that are listed in the article. One solution is to call ibdev only once at the beginning of your application and use that given handle for the rest of the calls.

 

The other solution is to call ibonl(ud, 0) to close the handle when you are finished with it. This is common problem when you are in a loop that continually calls ibdev at the beginning of the loop but it does not call ibonl(ud, 0) at the end of the loop.

 

Hope this information helps.

 

gpibtester

Message 3 of 6
(3,784 Views)

Thank you, I appreciate the information.

 

0 Kudos
Message 4 of 6
(3,780 Views)

Thank you for your response.  Regarding ibdev(), I have moved the function call so as to only run it one time for the application, unless a gpib error requires any subsequent initialization.

 

0 Kudos
Message 5 of 6
(3,777 Views)

Craig,

 

I am glad to hear that the information helped you! 

 

Another good programming practice is to close the handle using ibonl(ud, 0) when your application exits.

 

Regards,

gpibtester

0 Kudos
Message 6 of 6
(3,759 Views)