LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass values from child vi to its parent while executing and how can they run without being affected by the time delays of each other?

Here is the file you attached, saved down to 8.0
Cory K
0 Kudos
Message 11 of 18
(1,161 Views)
And here are the VIs that Jeff attached, saved down to 8.0
Cory K
0 Kudos
Message 12 of 18
(1,156 Views)

Thank you very much.

Message Edited by nikosfs on 06-02-2009 10:04 AM
0 Kudos
Message 13 of 18
(1,153 Views)

You're welcome. I used to be stuck all the way back at 7.1, and had to ask people on the forums if they could convert VIs down for me, so I figured I should return the favor once I got 8.6 Smiley Wink

Message Edited by Cory K on 06-02-2009 10:09 AM
Cory K
0 Kudos
Message 14 of 18
(1,145 Views)

Dear Jeff and Cory K,

 

I think I want to achieve the same thing but I haven't managede to do it so far. I used the example with the caller & sub but i didn't work (most probably due to my bad use).

 

What I want to do exactly is that I am running a VI in which several subVI's are included. In one of the subVI's I acquire signal from two different sensors (force and position) and I want to be able to visualise this XY (X:position, Y:force) graph. There are multiple loops in there..

 

I am attaching pictures of both the VI and subVI.  I have marked with red lines the signal I want to acquire as well as the position of the subVI in the VI block diagram.

 

Thank you of your time! 

 

Kind,

Dimitris

Download All
0 Kudos
Message 15 of 18
(1,105 Views)

Well, the first thing I noticed is in you subVI, you are building an array in a strange way.

You have 2 For loops: the first iterates 20 times, the second iterates once.

When you pass data out of a For loop, it will automatically build itself into an array.

 

So you have one 1D array with 20 elements and another 1D array with 1 element.

You then build those two arrays together into a 2D array.

The 1D components arent the same dimension, so there wont be a Y for every X.

 

If you are planning on passing X and Y data to an XY graph this isnt correct.

You should bundle the X array with the Y array, instead of building a 2D array.

 

Also, what is the point of running a For loop only once?

Message Edited by Cory K on 06-25-2009 10:25 AM
Cory K
0 Kudos
Message 16 of 18
(1,097 Views)

Dear Cory K,

 

first of all thank you for your prompt reply! 

 

I apologize for my VI's and I know that sometimes they look weird. In the subVI or in the mainVI do you mean that I run the second For Loop only once? I may be mistaken but I think that the number of iterations of the second Loop in the subVI is 20 times + the number of iterations of the first Loop. I get your point with the different dimensions. 

In the main VI, however, there is a For Loop which is excecuted only once but I use it for some tests. The actual number in the final VI will be controlled by the user.

 

As far as what I want to achieve goes, let's say I want to graph in real time the values from the first For Loop of the subVI(those with the red line), in the front panel of the main VI. Then maybe I'll do a second graph for the second loop. Could you please point me to some useful examples for this case?

 

Thank you again!

 

Kind,

Dimitris 

0 Kudos
Message 17 of 18
(1,082 Views)

Hi,

 

Sounds like you might want to use a shared variable with a buffer. That way you can read it off and not worry (as much) about it getting overwritten before the second VI gets it.

Jeff | LabVIEW Software Engineer
0 Kudos
Message 18 of 18
(1,052 Views)