08-22-2012 07:58 AM
Hey everyone,
I'm new to the forums, but I've been doing LabVIEW for almost a year now. I'm working on making my code much more streamlined, but I've run into a problem I can't seem to overcome.
Say I want to graph a numeric control. I update the numeric control to be 5 and the chart updates to 5. Every time my loop executes, the 5 is replotted. Easy to see that with fast loop updates, my FP will take way too much processing time. How do I pass the control to an array and only plot the array every, say, 10 While Loop iterations? I was thinking of using the "i" in the While Loop and a case structure (use Is Equal To? 10 as the True Case to update). This doesn't really seem to be the answer... Any help is appreciated.
Solved! Go to Solution.
08-22-2012 08:15 AM
Hi Mr. Bass,
Thank you for your post and welcome to the NI forums.
If you want to update every 10 iterations, for example, you can use LabVIEW's "Quotient and Remainder" function found in the Numeric palette - divide the iteration number by 10 and check the remainder, if it is equal to zero then you are on the 10th,20th,30th, etc. iteration. You can then use a case structure and write to your chart in the true case, with the condition being true if remainder is equal to zero.
Let me know how you get on with this method.
Thank you,
08-22-2012 08:22 AM - edited 08-22-2012 08:23 AM
I guess you are running loop without delay, if yes keep a delay of 10ms inside the loop this will slow down the chart update rate.
08-22-2012 11:15 AM
Thanks for the help. I tried this, but with waveform data (with timestamp) I only get every tenth point (or whatever size I'm using). The waveform chart just looks like a series of dots. I wanted to try to make an array of data and pass to a UI loop via functional global, but using a feedback node to continually populate the array leads to a huge array. What should I use in the DAQ loop and what should I use to retrieve the information in the UI loop? I'm trying Array Subset, but a 2D Waveform array doesn't get cut to a 1D Waveform array...
08-22-2012 11:51 AM
@Mr. Bass wrote:
Thanks for the help. I tried this, but with waveform data (with timestamp) I only get every tenth point (or whatever size I'm using). The waveform chart just looks like a series of dots. I wanted to try to make an array of data and pass to a UI loop via functional global, but using a feedback node to continually populate the array leads to a huge array. What should I use in the DAQ loop and what should I use to retrieve the information in the UI loop? I'm trying Array Subset, but a 2D Waveform array doesn't get cut to a 1D Waveform array...
It would be better if you can post the code ( in 2009 version ofcourse).
08-23-2012 09:09 AM
I would like post, but I have to do everything on an offline machine and it's a big pain to bring it over and upload an image (and my dev. computer is like 8 years old or more). bah. Thanks for the help.
08-23-2012 10:11 AM - edited 08-23-2012 10:16 AM
This is a bare-bones and simple way of doing what you suggest.