10-24-2011 04:28 AM
Hi,
I am attempting to run an old Optical Spectrum Analyzer (Advantest -model Q8381) with labview. And the LabVIEW program I have written is working perfectly when taking single measurement of the Spectrum Analyzer.
But when I set LabVIEW to taking a measurement every 10'th minute, then I get the following error message (at a random time):
Error -1073807339 occurred at VISA Read in Advantest - q8381 - ver3.vi
Possible reason(s):
VISA: (Hex 0xBFFF0015) Timeout expired before operation completed.
I have changed the timeout for the Read in my LabVIEW program from 1,5 seconds to 30 seconds, and I still get the timeout at a random time.
My LabVIEW program have run perfectly for 3 hours, 6 hours and lately for 7 hours (taking measurements every 10'th minute) but then I get the Error (as mentioned above).
I think the problem is that LabVIEW reject the data from the Optical Spectrum Analyzer probably due to bit error etc.
So I would like to implement in the code a function which, request a new measurement everytime the timeout occurs.
But how can this be done easily?
FYI: I am using the GPIB to communicate to the Advantest Optical Spectrum Analyzer by a USB/GBIP controller (Agilent 82357A).
Any help will be greatly appreciated!
10-24-2011 04:37 AM
Hello Nicholai,
I have found a Knowledge Based Article that I think covers a very similar problem to what you are having. I have only had time to have a very brief look at your code but I think that you should try the possibles fixes that are covered in the article and if not let me know and I shall try to find other solutions.
Regards
10-24-2011 04:44 AM
You have some descriptions here about this error and have a look here to resolve your problem. http://digital.ni.com/public.nsf/allkb/874B379E24C0A0D686256FCF007A6EA0
Hope this will help you.
10-24-2011 05:54 AM
Hi,
Thank you for your reply!
I have already seen that article, and implemented the Timeout function (please see the attached picture - the blue box). Furthermore I have changed all the Delays in my code to 30 seconds delays (please see the attached picture - the red box), so Optical Spectrum Analyzer should have plenty of time to write the data to the port.
Since the Timeout happen at a random time, but the LabVIEW code works perfectly in the beginning, I think that the problem is that LabVIEW does not get the right amount of bits or that there is a parity check error or etc.
So how do I implement a function to request a new measurement, when the Timeout error happens?
FYI: It is the box at the bottom of the code that generates the continous measurements.
Thank you!
10-24-2011 05:56 AM
Hi,
Thank you for your reply!
I have already seen that article, and implemented the Timeout function (please see the attached picture - the blue box). Furthermore I have changed all the Delays in my code to 30 seconds delays (please see the attached picture - the red box), so Optical Spectrum Analyzer should have plenty of time to write the data to the port.
Since the Timeout happen at a random time, but the LabVIEW code works perfectly in the beginning, I think that the problem is that LabVIEW does not get the right amount of bits or that there is a parity check error or etc.
So how do I implement a function to request a new measurement, when the Timeout error happens?
FYI: It is the box at the bottom of the code that generates the continous measurements.
Thank you!
10-24-2011 05:56 AM
Hi,
Thank you for your reply!
I have already seen that article, and implemented the Timeout function (please see the attached picture - the blue box). Furthermore I have changed all the Delays in my code to 30 seconds delays (please see the attached picture - the red box), so Optical Spectrum Analyzer should have plenty of time to write the data to the port.
Since the Timeout happen at a random time, but the LabVIEW code works perfectly in the beginning, I think that the problem is that LabVIEW does not get the right amount of bits or that there is a parity check error or etc.
So how do I implement a function to request a new measurement, when the Timeout error happens?
FYI: It is the box at the bottom of the code that generates the continous measurements.
Thank you!
10-24-2011 06:11 AM
Why you have taken several writes and read VI which makes clumsy on first sight. If you want to write several commands to your device one by one, you can even use array constant and use the for loop to write one by one command and read the response from your device at the same time. This could be done very easy and can be good to look after that for this error. If you want to do this means, take array constant----> and pass it through for loop(with no count value and leave it alone).
Hoe this helps you.
10-24-2011 06:27 AM
Well, I agree that the code could be done a little better...
But, the code performs as it should and as long as I do not get the timeout error it works perfectly!
So all I need is to get rid of the Timeout error, and I do not think that your Array constant will do any help regarding that...
Further help will be very much appreciated...
10-24-2011 07:00 AM
As I noticed one more thing in your code that you are writing commands one by one to device and in between you are expecting to read some bytes and then code proceed again on writing and reading with some delay in between.
So, when ever you write some thing, A proper handshaking should be done to read the data without any loss and in order to succeed the operation we will give some delay time between the operation. As I noticed that, you have given the delay time only between some command writings and readings. It should be done for every write and read operation. So that's why, I have suggested the array constant and for loop way which can be easily wait for each write and read operation.
Otherwise, you just give a delay when ever you are reading the data for a specific write and check whether it works or not. Currently, Your are only using the delay for one write and read.
//Hope this helps you much better.
10-24-2011 07:04 AM
Okay... Now I understand you much better!
But that would take a long time to change since I am not very good at LabVIEW.
Instead, do you know a way to act in LabVIEW so I can request new measurement when the Timeout happens, instead of just getting the error message?