07-04-2014 11:13 PM
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.
Solved! Go to Solution.
07-05-2014 12:07 AM
What is that VI's thumbnails??? Did you know about how to create and use Subvi's ???
07-05-2014 12:07 AM
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.
07-05-2014 12:40 AM
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.
07-05-2014 12:44 AM
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.
07-05-2014 12:48 AM
I already went home but I will try it tomorrow. Thanks! :]
07-05-2014 09:49 AM - edited 07-05-2014 09:58 AM
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...
07-05-2014 09:52 AM
I understand the issues of using Globals but I don't think for a chart it would be a potential threat.
07-05-2014 12:59 PM
@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.
07-05-2014 02:37 PM - edited 07-05-2014 02:59 PM
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* ...