10-25-2011 03:52 AM
Hi,
I have some code which every 10'th minute request a measurement from an optical spectrum analyzer. This is done for 45 hours, but at a random time, typically after 4-7 hours I get the following Error code:
Error - 1073807339 occurred at VISA Read in Advantest - q8381 - ver3.vi
I have already changed all the delays between Write/Reads from 1,5 seconds to 30 seconds (see the attached picture)! So the Optical Spectrum Analyzer have plenty of time to write out the spectrum on the port.
The part of the LabVIEW code which handles the continous measurements, is the one at the very bottom (please see attached LabVIEW code)...
So how do I request a new run of the loop (measurement), when the Timeout error happens????
Thank you!
10-25-2011 02:42 PM
This might explain what is causing the error: http://digital.ni.com/public.nsf/allkb/874B379E24C0A0D686256FCF007A6EA0
it looks like you're trying to read 12x502 bytes. If they aren't all there, you'll get an error. Increasing the timeout won't help if the problem is not enough bytes.
The link suggests that you use "Bytes at Port" to figure out how many bytes to read, rather than just assuming that they will all be there. At the very least, it would be helpful to probe this value to find out if there is a difference between the number of bytes found and the number requested.
It's also possible that after 4-7 hours, your equipment has some sort of failure and you won't be able to read. In that case, you just want to clear the error (or ignore it), reset and keep going.
Also, you might find it helpful to clean up your diagram by switching your command strings to "\" Codes Display, and adding "\r\n" to the end of each command. This is the same as adding a carriage return/new line character. Then, you can delete all those extra 'Write CR/NL to VISA" commands.
10-25-2011 03:03 PM
Another suggestion would be to add a VISA Clear and VISA Flush Buffer as the first part of this section so that it resets every 10 minutes.
It doesn't explain where the error is coming from, but it might make it go away.
10-25-2011 06:31 PM
Also, you should really clean up the wiring. This isn't just for looks, either. This is analogous to using proper indents in a text-based language. It makes it much more readable. Whenever a wire runs behind an object, it is difficult to tell if it is actually wired to it or not. Wires that aren't lined up with their tunnels make it impossible to know where they are going. And crooked wires... well, okay, they're just ugly. 😉
10-26-2011 02:52 AM