From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
09-02-2015 06:39 AM
I want to obtain the max. value of a waveform from an old 54622A Agilent scope via GPIB.
The problem is that I consistently obtain a Visa Read error -1073807339 ("Timeout expired before operation completed") when running in real time, but NEVER in Highlight Execution mode.
The posts here suggests that timing may cause the Read to execute before the Write has been able to finish. So, I used a manually-controlled While Loop, Sequence Structure, and Waiting blocks to try and ultra-separate the Read and Write blocks from overlapping each other. But it still does not work!!
Any suggestions, please? (Thank you!)
If you happen to open the VI I attached, you will see that I am using a serial port. This is because I am using a Prologix USB-GPIB adaptor to interface with the scope (I don't have a NI USB-GPIB adaptor). I have successfully used this Prologix adaptor for over 2 years to communicate perfectly fine with an SR830 lock-in amplifier and several other devices, so I don't think that is the problem...
Solved! Go to Solution.
09-02-2015 06:44 AM
What you need is the Magical Delay Fairy!
09-02-2015 08:00 AM
Highlight execution intentionally slows down code so you can watch it executing. Which will of course interfere with any code that relies on timing such as instrument communication and timeout values.
09-02-2015 10:28 AM
There should be a query to see if the measurement is complete, at least there is on Tek Scopes. If one exists, you can poll to see when the measurement is ready, or you can use a SRQ.
A bet there is an example of this in the programming manual for the scope.
Cheers,
mcduff
09-02-2015 12:49 PM
What is your baud rate?
I see you have a timeout of 2 seconds set. You are trying to read 512 bytes. If your baud rate is 9600, that is about 1000 bytes per second. It would take about 1/2 second to read 512 bytes, plus whatever amount of time it takes for the device to prepare its response.
If your baud rate is lower such as 4800 or lower, I can easily see how it could take longer than 2 seconds to get a response.
09-02-2015 09:09 PM
Hello all,
Thanks for all the suggestions. Somehow the Magic Delay Fairy worked, but the delay time had to be set to 3.4 seconds!!! The baud rate is 9600. Would you have any suggestions to make the delay time less? The weird thing is, if I try to read fewer bytes (like 128), I have to actually wait LONGER...
Aaron
09-02-2015 09:28 PM
Ha..ha..ha.. you know what was creating the huge delay time? My horizontal timescale setting on the scope... set at 200ms/div, it would take a few seconds to complete one "dataset". Once I sped up the scope reading to 2 ms/div, I could read without using any delay VI blocks!
Such a silly mistake cost me 2 days of time...
09-02-2015 10:07 PM
There yoy go. it wasn't baud rate but the time it took for the device to respond.