06-20-2017 11:41 PM
Solved! Go to Solution.
06-21-2017 12:21 AM
If you want to have two visible datasets, in which the most recent, and the previous dataset are visible, you can use a shift register and drag the shift register down on the left side of the loop, to add an additional handle. Then, they give you the most recent and 2nd most recent datasets.
On the right hand side, as output, wire your most recent dataset. Note that this doesn't look that impressive if your dataset is just incrementally building on previous data - then the points will overlap. Below is a snippet that shows what I mean, for different random datasets each second. Each plot is visible 3 times (in white, red then green by default)
06-21-2017 12:41 AM
But it overlaps the data everytime, But i dont need that. The data shouldn't be visible when next data arrives.
06-21-2017 12:48 AM
06-21-2017 12:56 AM
Is this related to your recent "blink" question?
You really need to first build a more solid foundation in LabVIEW programming in general. Try a few more tutorials, for example.
What's the purpose of he FOR loop? All that matters is the single result of the last iteration. If you would just delete the FOR loop completely, nothing would change.
What is the purpose of the flat sequence structure?
I assume you wrote the subVIs on the right. Wouldn't it make more sense if they would return the bundles directly?
It really makes little sense to attach a truncated picture. We cannot guess what else is there. Please either show the entire code or attach the VI.
It is confusing if you say "... 2 graphs in XY graph" You are probably talking about one graph with two plots. The wording is quite consistent in LabVIEW.
06-21-2017 12:58 AM
Sure,
In the above picture I have bundled the values as pH, Ts,Th etc.. so the bundled output I will be giving to Build array and giving it to XY graph. So I get the graph at every sec. What my need is to show the previous value and current value in the graph. Each second I need to display current value and previous value in the graph. But when I use Shift register the value keeps on accumulating in the graph. I dont need all those data to accumulate. I just need current data and previous data. Thanks.
06-21-2017 01:04 AM
@dhanushmh wrote:
But when I use Shift register the value keeps on accumulating in the graph. I dont need all those data to accumulate. I just need current data and previous data. Thanks.
Have you tried? The posted code will show the current plot and the two previous plots. If you only want to see the current and previous, resize the built array to two inputs and shrink the shift register on the left to only one. Nothing "keeps accumulating". Try once more!
06-21-2017 01:31 AM - edited 06-21-2017 01:33 AM
Neglect the first picture which I posted. I'm just checking with small program.
There are 5 graphs shown below. In which I have altered some of them to color change and all. Now One in Brown is a constant curve and I dont want to alter those. The line which is in red in color (graph 4 and 5), So these lines should leave the previous data and should produce current data too. Btw, I have found the better method to blink the datapoints. and in Graph 2, you can see the overlapping cause of shift register.
06-21-2017 03:05 AM
@dhanushmh wrote:
and in Graph 2, you can see the overlapping cause of shift register.
Because you are building the array forever. You are feeding all old and new graphs back into the shift register. Not only that, but you are also not initializing the shift register for some reason. Compare with the suggestion. This is different to the code shown you.
You need to build the current graph, feed only the new graph into the shift register. and then combine the old and new data for the graph.
(I would show you if you would attach your code. Why do you only paste images?)
... and your inner FOR loop still serves no purpose.
06-21-2017 03:06 AM