07-31-2024 11:54 AM
I have a weird problem. In the first diagram snippet I am plotting data on an XY Graph. When I press stop the while loop the XY Graph clears even though probes and a second XY Graph (created for debugging purposes) show that there is still data - the arrays are not empty. I created a simple test VI to investigate the behaviour and the diagram is shown on the second snippet. In the test VI the data is retained and displayed on the graph when the loop stops. This is the behaviour I was expecting. What am I doing wrong in the first one?
Solved! Go to Solution.
07-31-2024 12:07 PM
It's hard to say, can you upload the code so we can see everything?
That local variable after probe 7 seems unnecessary, but I don't think it would cause the behavior seeing.
07-31-2024 12:19 PM - edited 07-31-2024 12:24 PM
Here's the VI. The local variable is just there for debug purposes. When you open it there will be a missing VI, Get_AIN_Data_JEJ. This just grabs single data points from a data acquisition device. You can replace it with a random number generator to get the VI to run.
07-31-2024 12:27 PM
07-31-2024 12:49 PM
It threw a whole bunch of warnings at me, so hopefully you will be able to open it.
07-31-2024 01:01 PM
When you click STOP the inside timed while loop will stop running. The outside while loop will continue running, which clears the graph data every iteration in the top left corner. Then when you press EXIT the outside loop will stop running.
Remove that local variable in the top left, or drag it outside the while loop, if you don't want to clear the data.
07-31-2024 01:01 PM
In the top left corner of the outer While loop, you are clearing the graph. When you press "Stop", that will stop the inner loop. That will then iterate the outer loop, which contains clearing of the graph. All you need to do is delete that code to clear the graph.
07-31-2024 01:01 PM
07-31-2024 01:06 PM
Ha! 3 answers that are all the same within a minute of each other. At least I know I'm not crazy about this fix.
07-31-2024 01:08 PM
It was an easy fix. I can't believe I didn't figure this out right away.