LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PLEASE HELP ME, VISA read the oscilloscope waveform data, is a variable length string, how can I quickly read it out?

Solved!
Go to solution
As the title, I use the LAN port for oscilloscope communication, VISA read command to obtain waveform data, the data format is a string, because the data is positive or negative, the entire waveform data length varies between 100,000 and 110,000, often holding timeout failure. The tried methods are: 1. The attribute node of the length of the read buffer area used for serial communication is not reported to be faulty after the use of the LAN port; 2, set the loop repeat read, you can read the waveform, but it takes too long to display the waveform in real time, the following is the block diagram. Ask the gods, is there any way to quickly read the oscilloscope waveform data. My English is not good, this is translated by Google, please forgive me if there is something wrong.
0 Kudos
Message 1 of 8
(3,092 Views)

I would remove your read before the loop.  Inside the loop, read 4096 bytes each iteration.  If the number of bytes read is less than the 4096, it is fairly safe to assume the termination character was read, and you therefore have all of your data.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 8
(3,081 Views)

Thank you for your reply. If the number of bytes read is less than 4096, it will report a timeout failure. How should I set it so that I can read the termination character is quite safe?

0 Kudos
Message 3 of 8
(3,037 Views)

Hi Stone-AT,

 

I would follow crossrulz' suggestion to read (small) blocks of data inside the loop.

Combine this with a timeout value of 500ms (any reasonable value less than 1000ms)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 8
(3,032 Views)

Thanks to GerdW N's suggestion, your suggestion is very useful, but I have just started getting LABVIEW, and I can use the function to read the timeout value. Can you give detailed advice in this regard? Thank you very much, by the way, I used lv2014

0 Kudos
Message 5 of 8
(3,015 Views)

Hi Stone-AT,

 

I can use the function to read the timeout value.

I never mentioned to "read the timeout value"…

 

Can you give detailed advice in this regard? Thank you very much, by the way, I used lv2014

When you want help for your VI then you should attach your VI!

Until now all we got from you is an image, which is hard to debug with LabVIEW…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(2,997 Views)
Solution
Accepted by topic author STONE-AT

@STONE-AT wrote:

How should I set it so that I can read the termination character is quite safe?



GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 8
(2,995 Views)

First of all, GerdW is very sorry, I have no habit of adding VIs in the forums before, they are all added pictures, obviously this is my problem.
Second, I am very grateful to crossrulz, I can't wait to try your suggestion, but we are already at night, the oscilloscope is not around me, I have to wait until tomorrow.
Finally, I am very grateful to GerdW and crossrulz, I will tell you if there is good news. good night.

0 Kudos
Message 8 of 8
(2,983 Views)