LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Updating outputs at a Vi from a subVI

Hi,

I have created a vi called WebLabDeusto.vi (attached)

When I created other vi (Example_weblab_deusto.vi) that calls WebLabDeusto.vi, I don't know why the outputs at Example_weblab_deusto.vi are not updated in real time (never are updated) with the responses generated by WebLabDeusto.vi

 

Any suggestion?

 

All the best

 

Download All
0 Kudos
Message 1 of 7
(3,268 Views)

Dataflow rule #2: The outputs of a function will not output until the entire function is complete.

 

So you have a loop that is always running inside of your subVI.  This simply does not allow the outputs to be ready for any calling VI simply because the subVI must complete first.

 

I would break up your code more.  You should have a VI for initializing your listener, another VI that does the read and reply of the data, and possibly another thta does the cleanup.  Then you can make it so you call the initialize and close outside of a loop with the third one inside of a loop that is constantly updating your GUI.  Note that the loop should be on the top level VI if you want the GUI to be updated.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(3,255 Views)

Thanks Crossruiz for your fast response!!

 

I understand what you explain but I have not a clear idea about how implement it. My main concern: will it be possible to have an only one vi that gathers all the funcions and provides the required response in each iteration?

 

Do you have any example?

 

Thanks again for your response!

 

 

0 Kudos
Message 3 of 7
(3,230 Views)

As Crossrulz notes, you can't pass outputs back to your caller as they are being generated.  However, you can have access to the inputs from your caller.  Consider the Time parameter, which is an indicator on Example.  If you pass a reference to Time as an input (Control) to WebLab, and used the Value property (inside WebLab) to update the Value in the Caller (Example), this might do what you want.  There may be overhead issues, but you would see changes as they occurred, without needing WebLab to exit ...

 

Bob Schor

0 Kudos
Message 4 of 7
(3,215 Views)

I am sorry, I don't understand what you suggest. 

Could you send me any example?

Thanks

0 Kudos
Message 5 of 7
(3,202 Views)

I could, but you would do much better to learn more about LabVIEW by taking the on-line tutorials, which will explain Data Flow, Controls and Indicators, uses of references, Property Nodes, and other such concepts.  Then you will be able to make good decisions for yourself and your projects.

 

Bob Schor

0 Kudos
Message 6 of 7
(3,192 Views)

@Bob_Schor wrote:

However, you can have access to the inputs from your caller.


I very highly advise against this.  Property Nodes are horribly slow and I have seen them bring a program to a crawl.

 

If you insist on trying to keep this VI alone, then you will want to make it parallel to your main loop.  You can use queues, notifiers, or user events to send the data from this loop to the main VI.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 7
(3,156 Views)