LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to detecting Timeout event in SubVI from Top Level VI

I have learned the exapmle in http://digital.ni.com/public.nsf/allkb/A882E27D1D7A949386256E0D0066B91A?OpenDocument and I am OK with detecting control panel action in SubVI from the top level VI, by use of dynamic event. 

 

 

However, I wish to add a Timeout event in the SubVI (e.g., to monitor some value every 1 second). But the "Dynamic event registration" does not support "Timeout event".

 

 

Anyone could show some example of how to add a "Timeout event" in the SubVI and still detect in the Top VI ?

 

Thank you!

 

 

0 Kudos
Message 1 of 5
(2,704 Views)

Short answer: no dircet way, in fact only in a very convoluted way.

Long answer: It seems to me that you are going down the wrong design for your application. Please step back and describe what you are going to do.

From what you describe, you will get an architecture which is highly coupled, low cohesion of the modules and it will hence become a nightmare for debugging and maintenance.

 

Maybe i am wrong with my valuation of your description, but i do discourage you to proceed in your approach.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(2,692 Views)

Hi, Norbert. I have attached a simple modified vi to show what I wish to do in the SubVI. 

 

The SubVI should respond to the "Switch" to give a dialogue, and respond to the "Stop" to stop the program (which is just the function as in http://digital.ni.com/public.nsf/allkb/A882E27D1D7A949386256E0D0066B91A?OpenDocument). 

 

However, I wish the SubVI do something every time slot (in this case, the numerical plus 1 every 0.5 s until 20, just for example). I hope this Timeout event be done in the SubVI (actually, what I wish to do in the Timeout event is related to other events and make the "Numerical" indicator respond in the Top level VI), but I could not detect the Timeout event  in Top level VI, by use of a dynamic event registration.

 

So do you have any idea here? And if possible, could you show me some examples?

 

Thank you!

 

 

0 Kudos
Message 3 of 5
(2,656 Views)

The attachment here is the event structure in SubVI and detect from Top level VI. Although the "Timeout event" acctually operates every 0.5 s, however, the "Numerical" indicator does not respond until the SubVI is finished. So is it possible to make the "Numerical" respond like it does in the SubVI?

Download All
0 Kudos
Message 4 of 5
(2,648 Views)

The update of "Numeric" in the main vi is for sure done only after subvi is finished (think DATAFLOW!).

The main question i struggle with: What is the use case for this approach? Sorry for being blind, but i see no one. Never ever.

 

That being said, you might want to study a producer/consumer architecture which would replace your whole main/subvi constellation.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 5
(2,627 Views)