05-29-2009 01:09 PM - edited 05-29-2009 01:14 PM
Hello,
I have 2 "vi" files in a project.
One is the 'parent' and it runs continuously in a while loop.
The other is the child 'vi' and it runs whenever is called from the parent vi.
First problem:
When the parent vi calls the child, it gives to it some values and when it finishes its execution, the child returns some other values to the parent.
But what if I want to get some values from the child while it is executing? I can't. I even used global variables to get the values instantly from the child vi, but these variables change their values, only after the execution of the child vi.
What should be the problem?
Second problem:
The child vi has some time delays, because it needs to wait for the response of some machines.
But these time delays affect the parent vi, in the way that a real-time graph pauses its execution.
How can they run in parallel without the parent having to wait for the child to finish its execution?
Thank you in advance.
05-29-2009 01:27 PM
Nikosfs,
What you are trying to do is possible. You can get the sub.vi to update the calling vi's graph by passing a referance to the graph into the subvi. I've attached an example.
In your application you suggest that the values in the sub vi really should be accessable by both in near real time. To get this use a functional global (or an action engine) there a tons of examples on the forum.
05-29-2009 01:53 PM
I found some examples, but I have the LabView version 8.2.1
How can I convert files of newer versions, in order to open them?
Thank you.
05-29-2009 01:56 PM
nikosfs wrote:I found some examples, but I have the LabView version 8.2.1
How can I convert files of newer versions, in order to open them?
You post them on the forums and nicely ask someone to convert them for you
05-29-2009 03:37 PM
Sorry,
I gotta get my NI rep to bring in the older LV versions but I haven't had the time here yet. Cory, are you set up for this?
05-29-2009 11:35 PM
05-30-2009 10:26 AM
05-30-2009 10:37 AM
Could you please post again the sub.vi and the caller.vi in previous version format? (8.2.1 and older).
I didn't succeed in passing a reference to the child vi. I can create it in the parent vi, but how can I pass it? I suppose that I have to create a similar object in the child vi, in order to connect the reference of the parent, with it. In my example, the object is a Waveform Chart.
Is it also possible to post an example of a Functional Variable?
I found one here: http://decibel.ni.com/content/docs/DOC-2143
If i understood, I have to use shift registers, which can change the value of a global variable instantly, and not have to wait till the end of the child's execution. Is it true?
But, my 'child vi' does not run in a loop, instead, it is executed only once, each time the parent calls it. It is only the parent that runs in a while loop.
I appreciate very much your help.
05-30-2009 10:43 AM
06-02-2009 09:43 AM