Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Error opening device

I'm facing some peculiar problems while communicating with the devices using GPIB

I have developed two GUI's in VB 5.0 which tries to communicate with two instruments(DMM) simultaneously( need to say I'm trying to communicate with two instruments at a time). Both the GUI's works fine for 6 times. 7th time I don't know ,I get an error as " Unable to Open Device" . If I close the application and rerun ,it agian works fine for 6 times. 7th time again hangs .And, when i get error in one application , the other also stops . If I try running a single application , it works fine for 12 times, 13th time same problem. And one more, the application is not hanging at the same point. There are no loops in my program . System what I'm using is Dell PC PII
and 192MB RAM.

Please let me know the possible solutions for this and more over if I use two GPIB cards whether it's going to solve the problem.
0 Kudos
Message 1 of 5
(4,004 Views)
Open NI-Spy to capture the calls that your programs are making and post the captures. Make one a capture just one program running and the other a capture of both programs running.
NI Spy Tutorial
0 Kudos
Message 2 of 5
(4,004 Views)
Hi Ray,

Thanks for the reply.
As u said I tried capturing calls in NI-spy , but didnt' find anything that could solve my problem. After some 2900 calls (when running a single GUI) ibdev call fails . I'm sending a bmp file as an attachment which I captured after gettin the error. When I try runnning two GUIs the , error occurs somewhere near 1500 calls.

I probably feel this is an error related to memory addressing.
0 Kudos
Message 3 of 5
(4,004 Views)
You can only open up a finite number of handles in NI-488.2. It appears that you are calling ibdev mulitiple times to open up a handle. You have two options:
1) *BEST* option is to call ibdev one time, store the handle returned and use it in all subsequent calls. Once you are done with the handle, call ibonl to release it.
2) You can keep calling ibdev to get a new handle each time (which is inefficient), but you must call ibonl on the handle when done with it to put it back in the pool of available handles.
0 Kudos
Message 4 of 5
(4,004 Views)
First I want to thank GPIB guru for the last answer. I think it was the best solution I could have ever got .

Thanks Ray for your co-operation
0 Kudos
Message 5 of 5
(4,004 Views)