06-09-2017 02:18 AM
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.
This is what I get on the XY chart:
This is not what I was expecting. I'll appreciate it if anyone could help out - thanks!
Solved! Go to Solution.
06-09-2017 03:02 AM
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.
06-09-2017 03:07 AM
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.
06-09-2017 03:28 AM
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.
06-09-2017 03:45 AM - edited 06-09-2017 03:49 AM
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)
06-09-2017 03:58 AM
Is this what you're looking for?
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.
06-09-2017 04:00 AM
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.
06-09-2017 04:07 AM
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.
06-09-2017 04:10 AM
@wentao_ji ... plz check your vi, it doesnt work! you made the same error as OP
06-09-2017 04:10 AM