Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

I have a EDVR(0) queasion!

When my testing program ran 1024 times, there was a EDVR(0) error .
In NI SPY
Error : EDVR (6)
ibcntl -535560191(0xE0140001)

How can i resolve this error?
0 Kudos
Message 1 of 6
(3,919 Views)
Hi Yellowman,

This error can occur after a program has run many times if the handle to your device. Calls such as ibfind open a handle to the device, and the driver can only contain a certain number of handles. Here is a KB that goes into more detail on this subject:

Knowledge Base 2E09N4GU: My Program Fails with "EDVR" Error after 1000 Cycles

Hope this helps!

John M
Applications Engineer
0 Kudos
Message 2 of 6
(3,913 Views)
Sorry about the broken link--I should have tried it before I posted it. The information may be under review currently. The pertinent information is simply to ensure that the handle to the device is closed each loop iteration. The extra information simply goes into detail on why.
0 Kudos
Message 3 of 6
(3,912 Views)
In my testing environment, two instruments works in GPIB.
I used ibdev instead of ibfind because i was confused how to use ibfind in two instruments.
Do you have any idea to use ibfind?
0 Kudos
Message 4 of 6
(3,900 Views)
After my testing program worked 512 times with two instruments , it stoped and there was a EDVR(6) error message in NI SPY.
Every testing , it stoped in 512 times.

Thanks for your help!!
0 Kudos
Message 5 of 6
(3,898 Views)
Sorry for just mentioning ibfind earlier, because the same thing can occur using ibdev. When you use ibdev, it opens a handle to the device, or a device descriptor. From the NI-488.2 help file, you can use ibdev in C code like this:

ud = ibdev (BdIndx, pad, sad, tmo, eot, eos)

where the inputs are described as follows (they are all data type int):

BdIndx Index of the access board for the device
pad The primary GPIB address of the device
sad The secondary GPIB address of the device
tmo The I/O timeout value
eot EOI mode of the device
eos EOS character and modes

The output of the function, which I have labeled ud, is an integer which is the device descriptor. Every time ibdev (or ibfind) is called, it creates a new device descriptor as an output. If you run this in a loop, and never close the handle, it will keep creating new device descriptors and keep them all open, until the driver cannot handle any more. It looks like we're running into a limit at 1024.

To fix this, you need to discard the handle using ibonl. Simply call ibonl with your device descriptor and the value 0 as inputs. In this case:

ibonl (ud, 0)

This should keep the program from having too many device descriptors open at once.

John M
Applications Engineer
0 Kudos
Message 6 of 6
(3,886 Views)