LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting/ Manipulating Data from subvi

Hi all, I know this is going to be very like a question I posted before, sorry, but here goes.

In my main VI I have a subVI taking readings from a tachometer and an LVDT. Using property nodes I can display the data from each sensor in the main front panel. The problem is I have to use this data in the form of calculations and to plot a graph. I tired using references again but I don't know to assign a refernece other than right-click>create>etc. I also tried wiring the original refernece to the necessary blocks but to no avail.

Is this the right train of thought or should I be looking at something different? I'm attaching my program (should be saved as version 7.0) and would greatly appreciate the help!!

Thanks,
Kyle

P.s. I'm using this program to acquire data through USB - 6009 with NI-DAQmx Base, don't know if you need to know that.
0 Kudos
Message 1 of 5
(2,714 Views)


@Kyle W wrote:
Hi all, I know this is going to be very like a question I posted before, sorry, but here goes.

In my main VI I have a subVI taking readings from a tachometer and an LVDT. Using property nodes I can display the data from each sensor in the main front panel. The problem is I have to use this data in the form of calculations and to plot a graph. I tired using references again but I don't know to assign a refernece other than right-click>create>etc. I also tried wiring the original refernece to the necessary blocks but to no avail.

Is this the right train of thought or should I be looking at something different? I'm attaching my program (should be saved as version 7.0) and would greatly appreciate the help!!

Thanks,
Kyle

P.s. I'm using this program to acquire data through USB - 6009 with NI-DAQmx Base, don't know if you need to know that.




If you open a SubVI and then right mouse click on the VI icon, you should be able to show the connector. You can modify this pattern to allow for extra locations. Create an indicator to your desired information (on the block diagram), this indicator will appear on the front panel. Then connect the front panel indicator to an open terminal on your connector (where the vi icon was). Then, relink your subvi to the main vi. Use this new connection to pass data along your main vi.

Some SubVi's (especially NI ones) won't let you modify unless you go into the vi properties (execution - reentrant execution.... i believe). Any modifications you make, i'd save as a seperate VI so you can keep the original NI ones around.

Hope this gives you a starting theory.

Sincerely,
ElSmitho
0 Kudos
Message 2 of 5
(2,703 Views)
Thanks for the reply however that's the approach I've been trying to take, while data does pass from one VI to another it is not continuous and this is why I'm using referencing for the main indicator.I need a continuous update of data from the subVI.

Kyle
0 Kudos
Message 3 of 5
(2,687 Views)
I've written a little VI to show you the difference. You must remember, that Labview uses information as it aquires it, and that SubVi's will run entirely.

One way to pass out your desired information at each calculation step inside a sub vi would be to not make it a sub vi 😉

Or pass it out in a matrix, then write a for loop to index through that matrix and use that number for your calculations?

On a side note, you're using indicators and then referencing them. Why not just make them controls?

If i still don't get what you're trying to accomplish, sorry.

Sincerely,
ElSmitho
0 Kudos
Message 4 of 5
(2,682 Views)
Thanks again for your help, I went on your try not using a subVI advice with a twist. I simply put all the Calculations etc inside the subVI and then referenced them like the other indicators. Worked a treat just have to get my calculations working now!!!

Thanks again
0 Kudos
Message 5 of 5
(2,675 Views)