LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Displaying chart from one vi in another

Solved!
Go to solution

Hello. I have two vi's that each output a voltage vs temperature plot in real time as the data is generated. I made another vi that includes both of them and would like to have those plots displayed there instead. How do I do that? I tried making a connection from voltage vs temp graph to the two vi's' thumbnails and then connecting that to an empty voltage vs temp plot in the vi that I'm working on, but it got confused and said the connection doesn't know which way it's going.

0 Kudos
Message 1 of 21
(4,732 Views)

What is that VI's thumbnails??? Did you know about how to create and use Subvi's ??? 

0 Kudos
Message 2 of 21
(4,713 Views)

From where you are reading the data? You should try using the global variable inside a seperate VI where you want to display the chart.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 21
(4,712 Views)

Data is read off of two Agilent voltmeters and a Lakeshore temp controller.

How do you use a global veriable?

Right now the vi's just create a 2D array of V vs T and convert that into a plot.

0 Kudos
Message 4 of 21
(4,698 Views)
Solution
Accepted by topic author Solarmew

Simple way: Just create an indicator right before you write to the graph/chart. Double click the indicator and go to the front panel, copy the indicator and open a global variable and paste it. Now remove the indicator you created and use the Global variable to write, on the other VI use this global variable and read the data and wire it to the same type of Chart/graph, you are done.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 21
(4,694 Views)

I already went home but I will try it tomorrow. Thanks! :]

0 Kudos
Message 6 of 21
(4,690 Views)

The problem with this solution is that it requires you to modify two VIs that are already running, requires you to transfer data from one VI to another and raises the potential of memory issue through the use of globals. The best solution is to avoid all the problems by doing none of those things.

 

Subpanels allow you to insert the front panel of one VI into the front panel of another VI -- or in your case the front panel of 2 VIs into the front panel of another VI. It is very easy to do (there are great examples) and is the least invasive in terms of code modifications and causes no worries over data transfer (like memory usage, bandwidth, latency, etc) because you aren't transferring any data..

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 7 of 21
(4,656 Views)

I understand the issues of using Globals but I don't think for a chart it would be a potential threat.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 8 of 21
(4,653 Views)

@Solarmew wrote:

Hello. I have two vi's that each output a voltage vs temperature plot in real time as the data is generated. I made another vi that includes both of them and would like to have those plots displayed there instead. How do I do that? I tried making a connection from voltage vs temp graph to the two vi's' thumbnails and then connecting that to an empty voltage vs temp plot in the vi that I'm working on, but it got confused and said the connection doesn't know which way it's going.


You really need to show us some code. Are the two data source VIs synchrionized? Do you want all three charts to update at the same time?

How are the two source VIs called? (one call per point? each running independently?).

 

There are many potential solutions, but we definitely need more information to decide. Please attach a simplified version of your three VIs.

0 Kudos
Message 9 of 21
(4,635 Views)

I was gonna go get the code, but I'm locked out of my lab because the stoopid electronic lock is broken again and noone with an actual key is on campus to let me in -___- *headdoor* ... uuuuuuuurgh, this is so frustrating ......

 

The source VIs work like this. Temperature is varied between 300K and ~2.6K in some increments and every time it changes, the first source VI records voltage across the first sample and temperature and plots them against each other. The second source VI does the exact same thing, but for the second sample. (They're separate because one uses Keithley 6220 and the other Keitheley 2400. I guess I could've written them differently but I was working with the code that was already there before me and just didn't think about it...)

 

The main VI that I'm trying to get working just combines the two and lets the user pick whether to do a run on the first or second sample or both at the same time, and whether it's a cooling run (300-2.6), warming (2.6-300) or both back-to-back. So if the user picks to do a cooling run on the first sample, the VI will call the first source VI every time the temperature drops and the source VI will add a new point to the array and plot it, but because that plot isn't in the main VI, we don't see it.  I would like for plots from both source VIs to be visible in the main.

 

Sorry if this doesn't make sense and/or if it's a back asswards way of doing it +.+ ... I'm new to this >.> ...

I'll get the screen shots monday when someone is actually there to let me into the  friggin lab *sigh* ...

0 Kudos
Message 10 of 21
(4,624 Views)