Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Agilent 54621a driver produces "Query UNTERMINATED" warning on oscilloscope, and read timeout.

I am having some problems using the ag5462x.c with the ag54621a oscilloscope. I have narrowed
the problem down to the function ag5462x_FetchWaveformSafe.

When this function is executed, the oscilloscope display gives the message "Query UNTERMINATED," and after a long delay, the CVI gives me the warning message "NON-FATAL RUNTIME ERROR "ag5462x.c," line 4483, col 9 thread id 0x0000C7C Function viRead: (return value = -1073807339 [0xbfff0015]). Timeout expired before operation completed."

Obviously, there is some miscommunication with the oscilloscope. Looking at the code, the query in question appears to be,

:WAV:DATA?

which according the 54621a's programming manual, should illicit the response,

, ( for example, to transmit 2000 bytes of data the syntax would be #80002000<2000 bytes of data>.


After a step by step execution of the function in question in ag5462x.c, the query is successfully sent via a viWrite command. It the proceeds to viRead two bytes, the "#8", then viRead 8 bytes, "0001000" in my case. Then, upon execution of a viRead for 1000 bytes, the oscilloscope flashes the "Query UNTERMINATED" warning message, and after a considerable delay, this viRead function returns with the the "Timeout expired before operation completed" error. Apparently, the data returned in the 1000 byte array is indeed the data I expect from the oscilloscope despite these problems.

The timeout delay and error messages are unacceptable for the program I need to execute.

I have to consider that the problem is with the oscilloscope, since the ag5462x code appears to use the appropriate protocol. I need this "Query UNTERMINATED" problem to go away, but I am at a dead end.

Please help,
Paul
0 Kudos
Message 1 of 3
(6,211 Views)
It seems that I solved this problem. There are actually two occurences of "Query UNTERMINATED" problems in the ag5426x_example.c They are due to the following code segments:

viWrite (io, ":WAV:DATA?\n", 12, VI_NULL)
and
viWrite (io, "*ESR?\n", 7, VI_NULL)

When I change these to

viWrite (io, ":WAV:DATA?\n", 11, VI_NULL)
and
viWrite (io, "*ESR?\n", 6, VI_NULL),

the warning messages on the scope, and the timeout errors from the succeeding viRead()s stop occuring.

I guess that the ag54621a does not like nul terminated strings.
0 Kudos
Message 2 of 3
(6,201 Views)
I have posted on your original posting with a response to this question. I think the problem is that your instrument is taking the termination character in a wrong way or it expects a different termination like "\r" instead.
0 Kudos
Message 3 of 3
(6,181 Views)