LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dispplaying data on waveform graph inside/outside while loop

Solved!
Go to solution

 I am creating a vi using random number generator, inputting number into sin function(express>>arithmateic>>maths>>trig>>sine) and connecting output of sine function to waveforms. Waveform chart show no problem. When I replace waveform chart with graph, I get an error that type of source is differenct from type of sink. I then put waveform graph outside while loop hoping that tunnel would act as an array but still I get same error. I then put build array pallete between while loop border and waveform graph which is placed outside the while loop. I dont get error anymore but there is no data displayed on waveform graph. Theoretically, if I press stop I should see a distorted sine wave displayed on waveform graph but this doesn't seem to be the case. I wonder how to show the data on waveform graph in such cases!

Many thanks in advance for reading and help!

Cheers

0 Kudos
Message 1 of 4
(5,889 Views)
Solution
Accepted by topic author kwaris

You might want to first take some of the basic LabVIEW tutorials.

 

Since you have it working with a chart and that is the preferred method to display point by point data, I don't know why you are trying to use a graph. In any case, you cannot simply use a build array because that would just pass the result of the last iteration and all your graph will show is a single point. If you were to enable autoindexing, then you would get every value but not until the loop finishes. If you were to use a shift register and the build array, you could place the graph inside the loop but then you would face performance problems as the array would grow uncontrollably.

Message 2 of 4
(5,886 Views)

You mentioned that you tried to use the tunnel for the graph.  Did you enable indexing for the tunnel?  If not, you are only going to get one data point and not an array.  Attach your code if you would like me to look deeper.

 

Yik

------------------------------------------------------------------

Kudos and Accepted as Solution are welcome!
0 Kudos
Message 3 of 4
(5,883 Views)

Thanks mate, enabling indexing, running vi and stopping vi collected data for no. of iterations run and data was displayed on waveform graph. I even removed build array and there was no error as long as autoindexing was enabled hence proving the theory. This is great.

I understand that there's no point of connecting to waveform graph, I was only doing it to find differences between waveform graph and charts.

Thanks for help

 

0 Kudos
Message 4 of 4
(5,877 Views)