LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

graph data from inside a for loop of a subVI to the mainVI

Solved!
Go to solution

Dear all,

 

I have a subVI in a mainVI, among others. In my subVI I have a For Loop of 20 iterations and I acquire 2 signals at each iteration, which I plot in a XY plot.

What I want to achieve is to visualise the above two signals in the mainVI at each iteration of the subVI and not when the latter is finished. Is this feasible? 

 

Below I attach a very simplified example of the above case. I can also attach a copy of my specific VI but there are many subVI's in there.

 

I would really appreciate any help!

 

Best,

Dimitris

 

Download All
0 Kudos
Message 1 of 4
(2,669 Views)
Solution
Accepted by topic author dfelekis

Hi Dimitris,

 

Thanks for the post and I hope your well today.

 

You can achieve this by using a reference of the graph from the main VI, pass it to the subVI vi and use a property node to update the graphs value. 

 

I have attached an edit of your code to show this, labVIEW 8.6. 

 

graph.JPG

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Download All
Message 2 of 4
(2,665 Views)

Hi Dimitris,

 

you can use global variables also.

0 Kudos
Message 3 of 4
(2,657 Views)

Dear Hillman and Randij,

 

thank you for your prompt replies! 

 

To Randij,

thank you for the advice. I should also check global variables.

 

To Hillman,

I am fine, thank you for asking. I hope you are also well today.  Thank you a lot for the solution, it really worked. However I would also like to learn more about LV, so I have some questions for the VI's you attached.

1) What is the essence of "include data type" in the Refnum control?

2)In the main vi you use a delay, is there a reason to do that? I don't judge your code but i see it as an opportunity to learn new techniques.

 

 

Also, what I want to do is to have the subVI in a for loop. In our simple case, to repeat the sine function for N times.  So, I would like to ask if it is possible to graph in the same XY graph, of the main VI,the values of all the N iterations but not one over the other but with progress in time.

 

Additionally, is it feasible to add in the same XY graph, of the main VI,multiple plots? For instance, instead of the sine function in the subVI, I have a signal and in a next VI i calculate it's linear fit. So, I wonder if it's possible to plot the actual signal and after that to add in the same plot it's linear fit.

 

Sorry for asking too many things! I frankly appreciate your help!

 

Kind regards,

Dimitris Felekis

0 Kudos
Message 4 of 4
(2,645 Views)