LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why my XY chart does not work?

Solved!
Go to solution

I have the following diagram which is supposed to show two charts for the Sine functions (working) and also XY on another chart. The tunnels are indexing and the output goes through DDT as you can see.

VI

 

This is what I get on the XY chart:

XY graph

 

This is not what I was expecting. I'll appreciate it if anyone could help out - thanks!

0 Kudos
Message 1 of 24
(3,519 Views)

Are you trying to update the Waveform Charts and XY Graph at the same time? Or you want the XY Graph updated after the loop finishes? Your diagram will actually do neither of these because the loop will go on infinitely until you press the Abort Execution button to force the vi to stop, leaving the code after the loop never executed. You should put the code of updating the XY Graph inside the loop or use a boolean control to stop the loop, depending on what's the expected behavior.

0 Kudos
Message 2 of 24
(3,503 Views)

Even if you want to update them simultaneously, you should still add a boolean control to stop the loop. Clicking the stop button, then hitting Ctrl-Space will bring up Quick Drop, followed by (for 2016 or 2017) Ctrl-D placing a control.

 

Alternatively, drop a stop button control normally on the front panel and wire it on the block diagram.


GCentral
0 Kudos
Message 3 of 24
(3,501 Views)

I have made a correction and enhancement to the previous chart. Now the XY graph is inside the loop so it is being updated every second. I have also added a stop button to kill the program. Now the problem is due to the fact the XY is a graph and not a chart (I think) so it will display a point which in reality means it scales the axes every second. I need to use a chart, however I did not see an express VI chart.

Correction

0 Kudos
Message 4 of 24
(3,484 Views)

hi there!

screenshots are mostly useless 😉

plz either upload VIs or use a Snippet (Edit -> Create Snippet from selection)

 

 

regarding your code:

XY graphs need you to explicitly tell what are the values of the Y-axis and X-axis,

so inputting a sine as Y is not good.

please have a look at the help and the examples coming with labview (search for xy)  (Help -> Find Examples)


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 5 of 24
(3,472 Views)

Is this what you're looking for?

 

sine.png

 

Here we see the XY Graph taking an array of points (where a point is an X and a Y value) and the value from each iteration is added to the previous array.

 

If you want to use a chart, you need X to be continuously increasing. Here, X varies between -1 and +1, so you need to use a graph.


GCentral
0 Kudos
Message 6 of 24
(3,466 Views)

Wrote a quick demo for you. I guess this is what you are trying to do.

Don't know about others, but I don't use express VIs too much. They are more like black boxes if you don't know what's going on inside. Once you know what's going on and you want more from it, they are not quite useful and you will be writing it on your own anyway.

0 Kudos
Message 7 of 24
(3,464 Views)

I have searched the examples but none of them use XY graph. Is it even possible to chart in real time using this XY graph? I have managed to write data to this kind of chart but only when the loop was over.

0 Kudos
Message 8 of 24
(3,460 Views)

@wentao_ji ... plz check your vi, it doesnt work! you made the same error as OP


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 9 of 24
(3,456 Views)

See my snippet 😉

 

You can drag and drop it onto a blank block diagram. If you need an older version, I can backsave (but it looks like your VI was saved in 2016).


GCentral
0 Kudos
Message 10 of 24
(3,455 Views)