LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa Read tImeout error due to large data

Solved!
Go to solution

Hello!

I apologize if this has been discussed before, but I have searched in a lot of posts and haven't found a solution to my problem.

Essentially, I wrote a simple Labview Program to communicate with a Keysight inVision 3000Xseries labiew code (screenshot attached) and acquire averaged data. 

The code works very nicely when I use under 900 averages but when I increase the Averages I get a Visa read time out error, because the default time (2000 ms) Is not high enough. I tried to set it to 10000 ms, but it still doesn't work. Could anyone help me with this issue? Thank you so much!

(Any more details can be given if needed)

0 Kudos
Message 1 of 12
(4,039 Views)

Try to increase the VISA buffer

 

0 Kudos
Message 2 of 12
(4,018 Views)

Other issues with your VI.

 

1.  Use block diagram cleanup.  You have a lot of hidden wires, or ones that are bent in crazy ways.

2.  Although your For Loop runs 3 times, only the data in the last iteration gets saved.  Why?  You are opening and closing the file inside the loop.  They should probably be done outside of the loop.  As a result, when it reopens, and the file pointer is at the beginning by default, data is written from there, overwriting all of your previous data.

0 Kudos
Message 3 of 12
(3,989 Views)

Thank you both so much for your replies! As suggested I tried to adjust the VISA buffer - however, even if I leave the buffer input values as default (screenshot) I get an error message that the buffer mask is invald? I also tried all the other buffer masks (32, 48) but with no success. Any help would be highly appreciated 🙂

0 Kudos
Message 4 of 12
(3,963 Views)

It is difficult to debug a picture. If you could attach your VI (and subVIs) it would be helpful.

0 Kudos
Message 5 of 12
(3,942 Views)

Yes you are completely right, please find my VI attached. Thank you for your help!

0 Kudos
Message 6 of 12
(3,924 Views)

Can you zip the entire project and attach it? 

0 Kudos
Message 7 of 12
(3,913 Views)

Thank you for your efforts! My problem is whenever I try to zip the entire project it says 'Error 7 occured...' (screenshot attached). Any idea how to overcome this?

0 Kudos
Message 8 of 12
(3,900 Views)

Maybe you can explain what you are doing a bit better. Even though some VIs are missing it looks like you are doing some weird stuff.

  1. You initialize your scope, BUT, right after that you open the VISA reference again? Why? Shouldn't initialization open the VISA reference?
  2. After that you "Initiate" the scope. From the icon it looks like a start command since it has the "play" button on it.
  3. Then you set the REC: SETUP: START 3 command, which also looks like a start command. What does Initiate do?
  4. You then configure the scope, not sure what if it is set right. You have the Acquisition type set to Normal, the Acquisition Format to Real-time, and the Average count to 1000. Not sure if these settings are correct.
  5. Then you download Channel 4's data, create a time array and save the data after you enter a file name.
  6. Then you repeat 2 more times for the same channel. Do you have to repeat the configuration? Do you have to tell it to Start again?

I would try to do some like this:

  1. Initialization of Scope
  2. Configure the Channel the way you want, sampling rate, number of averages, etc.
  3. Tell the scope to start and add the *OPC command. (Operation complete query, look in your manual)
  4. When OPC triggers, tell scope to stop, download data.
  5. Repeat Steps 3-4 as many times as you need.
  6. Close scope reference and stop program.

mcduff

 

0 Kudos
Message 9 of 12
(3,886 Views)

Thank you so much for your reply! To answer some of your questions:

1.Yes, maybe the 'Visa open command is unneccessary, I just added it because in the Labview description how to adjust the Visa timeout it was added, as well. https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PAQKSA4&l=en-GB

2. Correct. 'Initiate' starts the measurement.

3. Essentially, the REC: SETUP: START 3 command recalls a specific setup in the oscilloscope with all the settings I need. Unfortunately, it is not possible to recall a setup which includes averages, this is why I included a 'configure acquisition field' afterwards where I can set the number of averages. The number of averages I need is 5000 but currently the maximum I can acquire is 900, after that I get a Visa timeout error.

4.The setting should be correct. I only adjust the number of averages. The constant 1 indicates that the oscilloscope is set to the averaging mode.

5. Correct.

6. Yes I have to repeat the measurment three times. However, you are right I don't need to repeat the averaging configuration three times, I could also place that outside the loop. 

 

In general, I have to say that (although I know it is not perfect) the code is perfectly working for averages under 900. Only when I increase the number, the timeout error appears. 

 

I attached the whole project without the problematic file which was causing the error - I hope that helps?

Okay, I will try to look into your suggestions. Thank you so much! If someone has anymore helpful input in the meanwhile, please let me know.

0 Kudos
Message 10 of 12
(3,857 Views)