Quantcast
Channel: All LabVIEW posts
Viewing all articles
Browse latest Browse all 203972

Re: How do I create a start/stop button for each separate while loop within my program, when each of them does a different task?

$
0
0

Ok, so let me try break these down a bit:


 wrote:

1.I added the index Array block,

but, when I am running this VI , and Pressing the button to log data , Array size block is giving 50,000 samples(i have put 50k as rate and sample per channel in acquistion VI) beacuse of which select is not triggerd and i am not able to go to wait Event again.

 


The "Array Size" here is the size of a single dequeued element. So it doesn't accumulate over time, as you've already seen.

If what you want is to repeatedly dequeue until the combined amount of data is greater than some amount, I'd suggest using a Shift Register with that value (the total target) being set at the start of acquisition (and reset each time you want to get another block) and then subtracting the size of the current block from the shift register. Check if it is less than zero, in which case you've acquired more than that number of points.

Is that what you need?

 


 wrote:
3. even when I am reading the data from Reader stream from saving VI, and when Monitoring with indicator data Display is not constant it fliashes(Maybe beacuse of delay in getting the data)

I'm not exactly sure what you mean here. Do you mean "waveform graph 2"? Or "Current"? Or perhaps a different indicator?

WG2 will update once for each waveform, but the effect of the way it's structured will be to have most of them flicker through very quickly, then one remain on the graph until the next Dequeue operation, so it will effectively flicker every 500ms probably.

You might want to take a look at placing it outside of the For loop, and passing it an appropriate data format for multiple plots.

If you want them to append to each other, you'd need to use Shift Registers and the Append Waveform (inside the For loop is probably best to append) to store history, but beware that this will also increase your memory usage (because you'd never release previous data).

 

To store only a certain amount of history, you can search for information about "circular buffers", which essentially forget data once it is old (so for example, retain the last 5 dequeues, or the last 50, but not an infinite quantity). This allows you to know how much memory will be needed (if the dequeues are a constant length). If not, it at least bounds the quantity (and you could implement it in terms of points rather than dequeues to ensure a constant length memory buffer).


Viewing all articles
Browse latest Browse all 203972

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>