LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What to use instead of xy graph?

Solved!
Go to solution

Hi there,

 

i am new to Lab view and have a bit of a problem to display data.

I want to display phase versus frequency.

 I want to add a new point to the graph in each iteration and want that the old datapoints are still displayed. All in all it should work like the example I attached.

 

But it would be nice that each time i stop the vi and start it again that the old data is not displayed anymore.

 

So how can i do this with the xy graph? IS there in an other way of doing it? I tried charts but i wasnt able to change the x scale to frequency.

 

Thanks a lot for your help.

0 Kudos
Message 1 of 9
(3,758 Views)

If you want voltage vs. frequency, you must use an XY graph.

 

I can't open your VI right now, but I would bet that if you are not getting the graph to clear each time you rerun the VI, you probably have an uninitialized shift register that is maintaining its data from the last time it ran.

0 Kudos
Message 2 of 9
(3,748 Views)

Raven's

 

Good guess. That is exactly the problem.

0 Kudos
Message 3 of 9
(3,740 Views)

You have some very quiestionable code constructs that make little sense. Since you are new to LabVIEW, here are a few hints at inprovements.

 

 

  • Your inner FOR loop makes no sense, because you just repeat the same random number N times.
  • Use built array instead of "insert into array" to append a point to an array.
  • Put the shift register in the while loop if you really want to keep all the data of the same run.
  • It simplifies things if you use complex data.
  • ...

 

0 Kudos
Message 4 of 9
(3,731 Views)

Hi

0 Kudos
Message 5 of 9
(3,722 Views)
0 Kudos
Message 6 of 9
(3,717 Views)

hi

 

oh there was a bit of text missing. One more try.

 

Thanks a lot for your comments and advices and for the fast reply.

 

I think its better to attach a .jpg so that you can see a part of my vi.. I wrote a few comments on it just to give an idea why i used these structures.

 

I tried the thing with the initialization but it wouldn't really work cause the data points get lost.

 

And I also tried to use the "built array' instead of the "append to array' but it came up with an error. It says that i try to connect two terminals with two different data types ( 1 D array and 2 D array). So what am i doing wrong?

 

Thanks a lot for your time

 

 

0 Kudos
Message 7 of 9
(3,714 Views)
Solution
Accepted by topic author Borsti

Did you look at my example?

 

You need to place the shift register in the outermost loop so it initializes only once. You FOR loop still makes absolutely no sense,

 

Alternatively, you can also use a globally initialized feedback node.

0 Kudos
Message 8 of 9
(3,700 Views)

Hi

 

yes i looked at it.

 

Thanks a lot for your help.

 

Have a nice day

0 Kudos
Message 9 of 9
(3,662 Views)