Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Linux GPIB PCI 0.8.2 How do I get all resources released after C execution?

When using linux with a GPIB-PCI card I notice the ibdev returns a ud starting at 1000 and increasing for each insturment addressed. However, when the program is stopped and restarted the ibdev "remembers" the previous calls and the ud continues to increment. I am concerned that the linux driver is not releasing all resources when the C program stopps. I've tried an ibonl, but the behavior is the same. If I reboot linux the ud will start again at 1000. When I run a similar program in VB on windows the ud returned resets to the initial number and shows no evidence of "remembering" the previous calls.

Is there a command I need to execute at the termination of the C program in linux to rel
ease all resources in shared memory?
0 Kudos
Message 1 of 4
(3,731 Views)
Hello-

It's good practice to use ibonl(n,0) to close a session to GPIB. However, a version of the driver tested here yielded the same result even with ibonl. No problems were encountered even when the id went above 300000. Has this caused any problems?

Randy Solomonson
Application Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,731 Views)
The ud remembering the previous calls concerned me that there may be a memory leak. I also looped on the ibdev followed by an ibonl and monitored memory. After some 260,000 times there was no evidence of a memory leak, although the ud returned by ibdev did increment. I believe this may ultimately cause a problem if the ud overflowed the maximum allowed for an integer, but that is so large it is more likely the machine would be rebooted for some other reason before such an overflow. Thanks for your prompt response, and your confirmation of my observations.
0 Kudos
Message 3 of 4
(3,731 Views)
Sure thing. This issue has been reported to the developers of the driver.
0 Kudos
Message 4 of 4
(3,731 Views)