Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

our Tektronix power supplies stop responding to gpib commands from labwindows applications. Must restart program

Any idea as to why the instruments stop responding to basic gpib commands like setting up voltages, on/off etc.. No gpib error codes are reported. Only fix is to abort and re-start the program.
0 Kudos
Message 1 of 15
(3,990 Views)
I'm not really sure why this may be happening especially since you do not receive any errors. Could you create a NI Spy capture of this so we can take a closer look at what might be happening? The following like will show you how to create a NI Spy capture if you have never done this before.

Performing a Good NI-Spy Capture for Debugging/Troubleshooting

Shawn B.
National Instruments
Use NI products on Linux? Come join the NI Linux Users Community
Message 2 of 15
(3,973 Views)
ShawnB Thanks for response, I will set this up sometime thursday and report back. We have made some changes to our source file to use visession, and the problem still occurs, but it takes longer.
0 Kudos
Message 3 of 15
(3,965 Views)
Hi ShawnB. See attached nispy(saved as .txt) file. The error is obvious, but I still don't know what is causing it. Thanks for the Info regarding NIspy, it shows a lot. After problem occurs all calls to Power supplies are ignored. The problem with ch15 is known, and we will address it. Note, this is the original program that we had seen the problems often. Any suggestions?
0 Kudos
Message 4 of 15
(3,958 Views)
Tony,

Your NI Spy file is pretty interesting. I'm assuming the problem you are experiencing is shown on lines 2674-2704. What is interesting about this is that ibdev is returning EDVR. The NI-488.2 help file says that this error is returned when:

The board index passed to ibdev cannot be accessed. This error occurs when you try to access a board or device that is not installed or configured properly. Or, EDVR is also returned if there is an internal driver error.

I find this interesting because you can see from the NI Spy file that you were making calls to GPIB0 successfully before this error returned. That may mean that you are experiencing an internal driver error. What version of NI-488.2 do you have installed? I would recommend installing the latest version of the driver which can be downloaded here. Or reinstalling your driver if you already have the latest version. Let me know if that fixes the problem, and we can troubleshoot it further if it does not.

Shawn B.
National Instruments
Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 5 of 15
(3,950 Views)
Hi ShawnB, We have identified this to be a PC resource problem. We don't know why yet. The attached file is a source file we implemented to identify the type of Power supply we are using, and than send the correct instructions. While the program runs, it keeps grabbing more memroy space until it eventually crashes.
any ideas with our code?
0 Kudos
Message 6 of 15
(3,945 Views)
I looked at your code, and didn't notice anything that would indicate there is a memory leak. What is happening in your main() function? Maybe you can run through your code in a debugger and find where memory is being allocated but not destroyed to narrow is down a bit.

Shawn B.
National Instruments
Use NI products on Linux? Come join the NI Linux Users Community
0 Kudos
Message 7 of 15
(3,933 Views)
Hi ShawnB, I don't know how to do that. Any suggestions?
0 Kudos
Message 8 of 15
(3,927 Views)
From your NI-Spy capture, I can see that you're calling IBDEV over and over again...You call it 100 times in that spy capture, opening a new descriptor to an instrument each time. This is bad. You should reuse your unit descriptor, and you should only have to call IBDEV once per instrument. Alternately, you could close each descriptor after you're done using it with IBONL, but the root of your problem is that you open all these descriptors.

Hope this helps.

Scott B.
GPIB Software
National Instruments
0 Kudos
Message 9 of 15
(3,914 Views)
hanks, we have addressed the problem with ibdev calls. See attached nispy file. We still have a problem with resouce management. Something else continues to call for resources without releasing, until the program crashes.
0 Kudos
Message 10 of 15
(3,908 Views)