LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ViSA Read Error -1073807339 fixed using subVI, but why?

Solved!
Go to solution

Hello,

First, thanks to all who respond!

 

I am reading data from an Agilent MXA N9020A Signal Analyzer.  It is only successful if a subVI is used for the VISA Read; otherwise 'VISA Read Error -1073807339' rears its ugly little head.  The Agilent gives the equally heartwarming 'QUERY UNTERMINATED' message. 

 

The NI Knowledge Base article on Error -1073807339 talks about the necessity of terminating the command string correctly and says how to verify it by right-clicking the command string control on the front panel and changing the display to '\' Codes Display Mode.  I am calling the VISA Read VI in the block diagram; it doesn't appear to have a front panel command string control so I don't know how to apply this advice.

 

In any event, using a subVI to perform the VISA Read takes care of the problem but I have no idea why.  The image of the VI that does not work is 'Agilent MXA Sig Gen vi.png.'  Many thanks to Mike on the Agilent forum who supplied the workaround.

 

Nina

0 Kudos
Message 1 of 7
(5,148 Views)

The simple answer is that you are allowing more time for the read. You have that nice dialog box that waits for user interaction. This will delay your read until that completes. In the code that doesn't work you are giving the device a grand total of 1 msec to reply to the request. This is not enough time for it to respond. The dialog box prompt slows things down enough for the device to respond. BTW, a 1 msec timeout for the read is VERY short.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 7
(5,133 Views)

Hi Mark,

 

Thanks for your answer.  If I recall correctly, at one point, I used a wait VI with a 5 sec timeout (Timing subpalette) but it didn't help.  It was placed between the VISA WRITE (cmd: MMEMORY:STORE:SCREEN 'D:\TEST.PNG') and the VISA READ that reads and discards the '#' character in the .PNG file.  I think there was also an attempt to use the file dialog in the main VI as well, but the same -1073807339 error still occurred. 

 

Any suggestions?  It would probably be useful to attach the VIs that go with the above descriptions and I will do so today.

 

Nina Sweeney

0 Kudos
Message 3 of 7
(5,117 Views)

The VISA read has an input for the timeout. You currently have yours et to 1 msec. Even 5 msec is a short timeout when dealing with graphic images. Try using something that is longer. I imagine the delay introduced by your dialog box is on the order of several seconds if not longer.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 4 of 7
(5,105 Views)

I think you are confusing terminals there, Mark.

 

VISA read does not have a timeout terminal.  The timeout is configured by a VISA property node and was set at 10 seconds.  The 1 you are seeing is the bytes to read terminal.

 

But I do think there is somethng there with regard to the dialog box pausing things and giving time for a response to be returned.  My guess is that since they are potentially time consuming commands (dealing with images on the device), that 10 seconds is not long enough for the command to complete.  But 10 seconds plus some indeterminate amount of time for the user to manipulate the file dialog box might be enough time for the command to complete and a byte to be returned.

 

 

Message 5 of 7
(5,100 Views)

@Ravens Fan wrote:

I think you are confusing terminals there, Mark.

 

VISA read does not have a timeout terminal.  The timeout is configured by a VISA property node and was set at 10 seconds.  The 1 you are seeing is the bytes to read terminal.

 

But I do think there is somethng there with regard to the dialog box pausing things and giving time for a response to be returned.  My guess is that since they are potentially time consuming commands (dealing with images on the device), that 10 seconds is not long enough for the command to complete.  But 10 seconds plus some indeterminate amount of time for the user to manipulate the file dialog box might be enough time for the command to complete and a byte to be returned.

 

 


Good catch. I am more accustomed to the native TCP primatives which wire the timeout value in. My brain just went there instead of the VISA primatives. Anyway, I think it is simply a matter of adding more delay/extending the timeout to give the device enough time to respond.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 6 of 7
(5,098 Views)
Solution
Accepted by topic author Nina_S

Mark, Ravens Fan, and anyone else who is interested:

 

I found the error in Agilent MXA Sig Gen.vi.  There is a typo in one of the VISA WRITE commands.  Originally, it was

 

:MMEMORY:DATA:? 'D:\TEST.PNG'

 

It should be

 

:MMEMORY:DATA? 'D:\TEST.PNG'  (remove : before ?)

 

Your feedback was invaluable.  Thanks so much for your help and patience!

 

Nina

0 Kudos
Message 7 of 7
(5,067 Views)