LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

show graph that is created in a subvi

Solved!
Go to solution
In a sub VI, I'm generating a graph from data collected .  This graph and data are within a while loop.  My main VI calls this sub vi and I would like to show my user the results of the graph during each update.  At first, I simply connected a terminal to the graph in the sub vi, and then created a graph indicator on the main vi.  But nothing shows up.  In the sub vi, I move the graph outside of the while loop and left the terminal connection.  Yet, this didn't work either.  Is what I'm wanting to do  impossible?

Thank you for your time and attention,
Ron
0 Kudos
Message 1 of 33
(11,261 Views)
Hello,

Please see this post on a similar topic:

http://forums.ni.com/ni/board/message?board.id=170&message.id=307884#M307884

I believe that it will answer your questions.

Cheers!
0 Kudos
Message 2 of 33
(11,255 Views)
Solution
Accepted by topic author mysticfree
Thanks!  That link is a good starting point although Dennis' examples had no documentation as to how everything is put together.   So to benefit anyone running into this same problem, here's what I discovered:

1) Starting with my sub vi, I created a control refnum to the waveform graph.  This was found by going to my sub vi's front panel controls menu and picking "modern" "refnum" "control refnum".  With that on my front panel, I then right clicked and selected "select vi server class" "generic" "gobject" "control" "wavegraph" "wavegraph"

2) Next, I created a property node inside of the while by going to my sub vi's block diagram functions menu, selecting "Programming" "application control" "property node"

3) I placed the refnum control outside of the while loop and connected it to the property node refnum terminal.  Selecting "value" in my property node, I connected that terminal to my waveform data line.

4) On the terminals of my icon (accessed on the front panel), I added an input terminal for the property node and an output for my waveform graph.

5) on my Main VI's front panel, I copied and pasted the graph indicator from my sub vi.  I then added my sub vi function to the Main VI's block diagram. 

6) Next, I created a VI server reference by selecting "Programming" "application control" "VI server reference".  Right clicked on the "Server Reference" and choose "Link to" "Pane" "Waveform plot"

7) Connected the "VI Server Reference" to the "property node" of my sub vi icon.  The graph terminal of the sub vi connected to the graph indicator.  Saved everything!  Tested.  All works well!


I hope this helps someone.



Message Edited by mysticfree on 03-15-2008 11:32 AM
Message 3 of 33
(11,237 Views)
>4) On the terminals of my icon (accessed on the front panel), I added an input terminal for the property node and an output for my waveform graph.
 
I'm not sure I understand this instruction. Do you mean a terminal connected to the Graph refnum? Otherwise, how can I connect a terminal to the property node?
 
0 Kudos
Message 4 of 33
(11,106 Views)
I believe what he meant in #4 is that you create a terminal for the control refnum (which is connected to the property node in the block diagram). Once you have created this terminal, you can wire to it from outside of that VI.
Eli S.
National Instruments
Applications Engineer
0 Kudos
Message 5 of 33
(11,081 Views)

Hello, Can someone explain a few things to me?

 

In part one were directed to "select vi server class -> generic -> gobject-> control-> wavegraph-> wavegraph". I don't have the following menu options at "...wavegraph->wavegraph". I have selections at that point for either "...Waveform Data" or "...GraphChart->waveform chart" or "...Graphchart->waveform graph -> wafeform Graph"

 

Which one is the intended target (I've tried them all.)?

 

Part 6 tells us to create a "VI server reference" is this reference to be created in the sub VI or the VI calling the sub VI?

 

Part 7 says ""Connected the "VI Server Reference" to the "property node" of my sub vi icon. "" Where does the VI server reference connect on the property node? If I understand correctly I'm attaching the waveform data to the value in on the property node. I should also have the waveform control refnum attached to the property node refnum in connection (unless I'm mistaken - Note: It won't hook up to the property nodes refnum out connection).

 

All I want to do is use data from a sub vi in a VI so that I can display a graph (waveform). I use labview 8.2. Thanks - Matt

 

0 Kudos
Message 6 of 33
(10,889 Views)

goatdemon wrote:

... All I want to do is use data from a sub vi in a VI so that I can display a graph (waveform). I use labview 8.2. Thanks - Matt


Are you familiar with sub-vi's?

Say your data is an array of DBL's. Make an indicator of this array on your front panel.

You can go to the front panel of the subVI, then right click the icon in the corner and select "show connector".

Click on one of the empty boxes on the right hand side, then click on your indicator.

 

Now when you use this subVI in another VI, the data from your array can be retrieved from the output terminal of that subVI.

 

Is this what you were talking about?

Cory K
0 Kudos
Message 7 of 33
(10,880 Views)

Thanks, that's more like what I wanted to do.

 

I've replaced the waveform graph in my sub VI with an array of doubles. I then hooked that array indicator up to a connector terminal. I assume that I am to connect the new sub VI terminal up to a waveform Graph in my VI, but when I do this I see nothing. I've also tried to use an array to see if any data is coming in, but it isn't. What am I doing wrong?

Thanks -Matt

0 Kudos
Message 8 of 33
(10,870 Views)
why don't you post your code? That would make stuff considerably  easier to fix.
0 Kudos
Message 9 of 33
(10,855 Views)

When you run the subVI by itself as a regular VI, is any data shown in the array?

If so, could you please show us your VI and subVI so we can see where the problem is?

Message Edited by Cory K on 02-05-2009 10:29 AM
Cory K
0 Kudos
Message 10 of 33
(10,839 Views)