I use the Agilent IO Libraries with .NET in building software for data acquisition and analysis. I've just run into a really weird problem with an E7405A Spectrum Analyser refusing to give me error details, when they are definitely there in the instrument. The sequence of events is:
1. Set up the instrument so that a suitable trace is visible. The software's objective is to get the analyser to find the peak(s) in the trace and collect the frequencies and amplitudes of those peaks, but I never know how many peaks there will be.
2. Command the instrument to set the marker to the highest peak. It does this part fine, and I can collect the data I need about the marker location.
3. Command the instrument to set the marker to the next-highest peak. It will do so if it can identify a peak. If it cannot, it will generate an error 202 "Peak Not Found" - this will appear on the analyser screen, and the details will also be put into its system error queue. So I thought all I had to do was query the error queue with a :SYST:ERR? command, and if it told me that no error was there then I would know I had a peak and could get its location and ask for the next one. If there was an error 202 there, then I had them all. Imagine my surprise when the analyser persistently returned "0, No Error" to my query, even when I could go to its front panel and view the error queue, and an error 202 was definitely in there! In fact, if I allowed my loop to continue, it could build up 6 or 8 errors in the queue, and it would still return No Error to my :SYST:ERR? query.
It is not just my software having the problem: if I go into the Interactive IO Utility that comes with the IO Libraries, it too gets a reply of No Error when I get it to send the :SYST:ERR? command to the analyser.
What am I missing here? I thought just reading the error message would be the easy part, but it has turned out to be a show-stopper. If anyone else has seen anything like this I'd be pleased to hear how (or if) it was solved.
The method that I've used to find a list of peak signals, is if the next peak command finds the same peak frequency as previously found, I know to jump out of the loop and collect the list. I don't base it on an error rather on the next peak command finds the same signal twice. You have to throw out the duplicates.