Aaron L Posted April 11, 2008 Report Posted April 11, 2008 Let's say I have two different while loops that I need to run. I want the numbers generated in while loop #1 to be shown on a waveform chart that updates during the loop. Then, when that loop is terminated, the code continues on via a flat sequence to another while loop, #2. I want to display the data from while loop #2 in the same waveform chart as while loop #1. Is this possible? My difficulty is I have 6 while loop sequences which need to execute sequentially. I only want to view the data in one waveform graph or chart that updates during each itteration of each sequentially executed while loop. Otherwise I have to have 6 waveform graphs to view the results for each while loops. I don't need to see the data in parallel since the operation is sequential anyway. Is this even possible since a chart doesn't seem to update unless it's inside a while loop? Quote
JDave Posted April 11, 2008 Report Posted April 11, 2008 Sounds like the really easy and fast answer is to just place a Local Variable of the chart indicator in the subsequent while loops. I believe you need to manually flush the History Buffer of the chart to clear the old data before plotting the new. David Quote
PaulG. Posted April 11, 2008 Report Posted April 11, 2008 I'm not quite sure I understand your architecture, but you can feed all your data into a single queue. Your display can be in a loop by itself, dequeuing the elements from the queue and displaying them. Quote
orko Posted April 11, 2008 Report Posted April 11, 2008 I totally concur with Paul's suggestion. One of the many benefits of using queues is that you can use a cluster with an enum and numeric inside of it as your data type for the queue. Then when you dequeue an element from it the enum would tell the loop that is operating on the chart what to do (clear the chart,add to chart, even change attributes of the chart if you want). Oh, and of course you can stop your chart loop with this mechanism as well when your main sequences are finished. Here's a very simplified example w/o error handling or deferred panel updates optimization: Download File:post-3266-1207858000.vi (LV8.2) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.