LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Anyone know why this VI wont work?

Error is -200278

 

<B> Attempted to Read Sample: </B> 1000

<B> Property: <B> RelativeTo

<B> Corresponding Value: <B> Current Read Position

<B> Property: <B>Offset

<B>Corresponding Value: <B> 0

<B> Task Name: </B> _unnamedTask<8>

 

USB-4431 DAQ is being used. I think it works with my USB 6009 DAQ though.

0 Kudos
Message 1 of 13
(418 Views)

Hi lorc,

 


@lorc34 wrote:

Error is -200278


Yes, we know…

 

Did you read the error description? You were to slow to read samples!

 

You implemented some operations in the loop that tend to get slower and slower as execution continues: building growing arrays (aka appending to this waveform) and displaying a growing waveform in a graph without proper decimation!

 

Suggestion:

  • Read a fixed amount of samples instead of "anything available".
  • Don't grow the waveform as large as possible.
  • Display only a reasonable number of samples in your graph… ("Reasonable" means about twice as many samples as your graph's width in pixels.)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 13
(412 Views)

Hi Gerd,

 

So I cant plot 10 hours of data on the waveform without the DAQ crashing?

 

I did have this working before.. but i lost the code

 

I need to get another USB 6009 to test with, the USB 4431 only lets you have a sample rate of 1 khz, USB 6009 goes to much slower sample rate.

0 Kudos
Message 3 of 13
(279 Views)

@lorc34 wrote:

 

I need to get another USB 6009 to test with, the USB 4431 only lets you have a sample rate of 1 khz, USB 6009 goes to much slower sample rate.


I'll trade you!  🤣

 

Your 4431 will work fine.  You just have to collect more points that you need, average them and then plot/save the averages along with a timestamp.  The problem you are facing is just caused by using up all the RAM in your PC.  Also keep in mind that you can't really see more datapoints in a graph than your PC monitor resolution allows.  If you need more than that, you have to store it in an array and plot just the part you are interested in.

 

Another issue with your method is that if the program glitches, or the PC crashes, you will lose your data.  It's always better to write every data point to a file (or database) as you collect them.  

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
Message 4 of 13
(263 Views)

Hi Nyquist,

 

I do write them to a file. 

 

Please see the full VI attached along with subVIs.

 

I appreciate your help and input. So I guess because the 4431 is acquiring so many samples per second, its overloading the PC when you plot all of that... that hasn't really happened to me before, but I wasnt using the same plotting technique of append waveform. I think I was averaging it to 10 per sec.

 

Anyway, I will be using a 6009. However I am trying to get a laptop working before I go and install it on site because the original laptop HDD died. And I lost my labview file, and I have had to rewrite part of it (the graphing) so thats why I am using the 4431 (dont have 6009 with me right now)

 

I am pretty sure this method works with the 6009 - i.e., writing all the data to a waveform graph. Perhaps that is because it is not too much data.

 

Unfortunately I can't rewrite my VI and test that it works without having the 6009. However can you tell me if you see any critical issues with my code (for example, a reason why it would give an error or crash), like if I just use the exact same with the 6009 (The DAQmx clock will be different - rate will be 10 and i wont specify no. samples)

 

Pretty much, if I had saved my original labview file from the now corrupted HDD laptop, I wouldve just smoothly installed labview on a new laptop and ran the VI. But I am trying to rewrite it without actually having the DAQ I am going to use.. so its kind of hard given the 4431 is very different and giving errors.

 

0 Kudos
Message 5 of 13
(255 Views)

Am I right in saying that I should only have 1920 points maximum on my graph, if my monitor resolution is 1920 x 1080?

 

Because as it stands, i have 10 points per second. Thats 36,000 per hour, and 360,000 after 10 hours. The program has to hold them 360,000 points each loop so I suppose thats too much and why its giving an error and freezing.

 

 

0 Kudos
Message 6 of 13
(210 Views)

@lorc34 wrote:

Am I right in saying that I should only have 1920 points maximum on my graph, if my monitor resolution is 1920 x 1080?

 

Because as it stands, i have 10 points per second. Thats 36,000 per hour, and 360,000 after 10 hours. The program has to hold them 360,000 points each loop so I suppose thats too much and why its giving an error and freezing.

 

 


Well, what's the use of plotting 150 points to the same pixel?

Keep the data in an array, but don't plot all of that data. If you e.g. grab 10 samples at a time (thus 1 sec 'tick'), add those 10 to the array, and add the average (or 1st) to a Plot array. With such a long time series you could easily plot 1 every 10sec.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 7 of 13
(204 Views)

I think the file is crashing or giving error due to the array too. Given that I write to a Csv file I can probably do without such a big waveform.

 

How does labview write 150 points to the same pixel? That's 15 seconds of data, does it display the middle point or something?

0 Kudos
Message 8 of 13
(197 Views)

Hi lorc,

 


@lorc34 wrote:

How does labview write 150 points to the same pixel? That's 15 seconds of data, does it display the middle point or something?


When you plot 1MSamples on a graph of only 1000 pixel width then for each pixel on the X axis you need to plot 1000 samples (simple math). It doesn't make sense to plot 1000 samples per X axis pixel…

 

LabVIEW will plot them all - it will not do any filtering for you like "display the middle point". That's up to you - as already suggested/recommendated in this thread!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 9 of 13
(185 Views)

I'm just wondering how it plots 1 million points over 1000 pixels. I.e. 1000 points per pixel. Is it not only possible to plot 1 point per pixel?

 

Regardless i will have to do some kind of data averaging for the plot, while writing the full data to csv file.

 

Its just if theres a spike in the level, it would be very high, but very low for the rest of the data, and so the average would be much lower than the spike was.

 

Anyway, that is fine, thank you I now understand why my program was overloading (too large of an array)

 

Thanks for the help!

0 Kudos
Message 10 of 13
(150 Views)