10-16-2009 09:34 AM
Hi,
I had created a VI earlier using extremely unpopular programming techniques (overuse of local variables etc). Using this forum, I managed to redo it using producer/consumer loop, queues, clusters etc.
I have one problem though.- My grpahs seem to retain values from last time the VI was run. I think this is the case, because if I quit the VI adn restart again, there is no such issue.
But if I just stop the VI and re run it, the previsou data seems to be there.
The image on the left is the normal running. The one on the right shows that the graph is plotting peaks of the current signal but the signal on display is the previously acquired signal. The VI is behaving unexpectedly and runs normally if I close it each time.
I have on idea what is causing it. I am sure it is something straight forward, can someone point out please.
VI attached.
Thanks,
Jas
10-16-2009 12:28 PM
Are you using a chart? Charts have memory. If you are using a chart, try clearing its memory before entering your main program loop.
10-16-2009 12:29 PM
10-16-2009 03:43 PM
10-19-2009 10:20 AM
Yes, I have uninitialised shift registers holding the data.
It is as follows, would you suggest changing this
10-19-2009 10:27 AM
How bad!!
Sorry, they are intialised to a constant 0, I was thinking more like initilaising in terms of specifying array size and element values. Also. when plotting the graph, I am only sending teh daq values to the xy chart and plotting the peak locations and amplitudes on the same chart. The chart seems to remember the previous waveform / data but plots the current peaks
10-19-2009 10:32 AM - edited 10-19-2009 10:36 AM
Damn!! Gotcha!
It was the feedback node in the plot. Can't believe I did it.
That raises a question- How shall I rememer the data from one iteration to the other so that I can plot it on the graph. As mentioned above, charts remember data but I cannot plot peaks (x,y) on charts.
Any ideas please?
10-20-2009 04:02 AM
10-20-2009 06:09 AM