From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why doesn't a line plot here instead of just a single point?

Solved!
Go to solution

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”?

0 Kudos
Message 1 of 13
(2,651 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 13
(2,642 Views)

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.

0 Kudos
Message 3 of 13
(2,627 Views)

Good heavens! My apologies. I'll retry and test it this time.

0 Kudos
Message 4 of 13
(2,577 Views)

Ah, that's better. This time it's there...I just clicked on it myself.

 

Sorry guys. Anyway, back to the original question...

0 Kudos
Message 5 of 13
(2,576 Views)

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)

0 Kudos
Message 6 of 13
(2,564 Views)

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.

0 Kudos
Message 7 of 13
(2,555 Views)

BTW, thanks so far!

0 Kudos
Message 8 of 13
(2,554 Views)

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))

 

 

0 Kudos
Message 9 of 13
(2,552 Views)

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.)

0 Kudos
Message 10 of 13
(2,547 Views)