02-07-2019 02:19 PM
Hi.
A simple question for now…Why doesn’t the XY Graph draw a plot instead of just moving the “X” around in this attached file “Express graph test.vi”?
Solved! Go to Solution.
02-07-2019 02:31 PM - edited 02-07-2019 02:35 PM
Hi Tinsnips,
Why doesn’t the XY Graph draw a plot instead of just moving the “X” around in this attached file “Express graph test.vi”?
Because there is not even a XYGraph in your (rather empty) VI…
When the graph only shows a single point then most often the plot contains only one single point!
02-07-2019 02:52 PM - edited 02-08-2019 09:58 AM
You attached an empty VI, but if you are using the "build xy graph" express VI, ensure that "clear data on each call" is true if you just want to move a single point around. If not, all new data is appended to the current data forever.
02-08-2019 08:29 AM
Good heavens! My apologies. I'll retry and test it this time.
02-08-2019 08:33 AM
Ah, that's better. This time it's there...I just clicked on it myself.
Sorry guys. Anyway, back to the original question...
02-08-2019 09:58 AM - edited 02-08-2019 10:01 AM
As has been said, double-click the express VI and configure it to clear data on each call. Of course you don't really need all that. Just create a complex array with one point (see attached).
(Also, don't use "continuous run". You need to use a while loop and small wait)
02-08-2019 10:24 AM
Altenbach, I don't get it. Maybe I'm not even asking the question properly. In either case (clear data on each call, or complex array with one point), All I get on the XY Graph is a single dot. I need to plot a line that shows where the dot has been...like on the waveform chart next to it. Except unlike the chart's X-axis being time, I want the graph's X-axis to be controlled by the slide control.
You might say I'm trying to make a virtual Etch-A-Sketch.
02-08-2019 10:26 AM
BTW, thanks so far!
02-08-2019 10:33 AM - edited 02-08-2019 10:36 AM
If you uncheck "clear data on each call", your VI will work. The problem is with you use of "continuous run". That's a debugging tool, not a way to run a VI. The express VI resets the data on first call, and if you use "continuous run", it will reset with every restart. Simply place a loop around your own last code and things will work just fine.
("continuous run" is more like "re-run after completion". Sorry, it was not entirely clear if you want a history line or a point))
02-08-2019 10:39 AM
Of course if you just add a while loop, your plot will append gigabytes of data until you run out of memory if you would keep the code running forever.. A proper program would use a "value changed" event for the two slides and only update the graph if one of the slides is moved. Don't forget an event for the stop button.)