07-24-2014 12:41 AM
Hi,
I have a two subVI(Trail1 and Trail2) and one mani VI. i would like to show the front panel when its called(click event) and close afterwards if originally closed for these two subVI from mainVI. I selected the option in customize window apperance. so i used two button(switch1 and switch2) in mainVI. Trail1 subVI will show its front panel when i click switch1 button in the mainVI as like as switch2.
I would like to show their respective front panel simultaneously before finish the execution of subVI. I could not able to show the front panel of subvi whwn other one subvi before finish the execution from MainVI.
07-24-2014 01:13 AM
You must call the VI dyanmically and set the window appearance to be an Non-modal, so that you can access both the sub VI front panles parallely.
07-24-2014 02:19 AM - edited 07-24-2014 02:22 AM
The way you are calling the VI, the event frame cannot finish until the subVI is finished. Basic dataflow!
There are many solutions to this. (e.g. 1. start asynchronous call, 2. place each subVI in its own while loop and event structure, 3. anand's suggestion above, etc.)
(It does not make a lot of sense to have the "stop" control on a connector to the subVI. What dod you have in mind?)
07-25-2014 03:45 AM
07-25-2014 06:53 AM
Statically: simple, but you must sit there and wait for the subVI to complete before your main VI's thread can continue
Dynamically: you can call whatever VI is out there, as long as it follows your template. Super cool. Takes a little extra time to call since it needs to be loaded. You need to do some extra setup in the executable build to make sure those VIs are included. If setup correctly, you can have it run off on its own while the thread that called it can continue.
07-25-2014 03:53 PM
Crossrulz,
"Statically: simple, but you must sit there and wait for the subVI to complete before your main VI's thread can continue"
Not exactly that.
Run Vi method with Wait until done = false does not care what kind of reference it is.
You can run statically linked VI, continue main VI execution and use queue, events, etc to get data from referenced Vi when it finishes.
The difference is:
Statically
The vi is inserted into main vi when you put a Static VI reference node. During the build (into executable for example), the VI is already there, you do not include it manually.
Static is a little faster response: VI is a part of main VI, everything is loaded in the beginning, no need to load it in runtime.
Dynamically
The vi is inserted into main vi only when it runs Open VI reference. It is not included in executable: compiler does not care if there is anything on Open VI reference file path during building exe. Powers of dynamic control: During run-time you can close this VI, change path, insert a different VI with the same connector pane. Open any number of reentrant VIs, control them independently. Very powerfull tool.
07-26-2014 08:15 PM
@Alexander_Sobolev wrote:
Crossrulz,
"Statically: simple, but you must sit there and wait for the subVI to complete before your main VI's thread can continue"
Not exactly that.
Run Vi method with Wait until done = false does not care what kind of reference it is.
You can run statically linked VI, continue main VI execution and use queue, events, etc to get data from referenced Vi when it finishes.
The difference is:
Statically
The vi is inserted into main vi when you put a Static VI reference node. During the build (into executable for example), the VI is already there, you do not include it manually.
Static is a little faster response: VI is a part of main VI, everything is loaded in the beginning, no need to load it in runtime.
You are confused on terminology. What crossrulz said is absolutely correct. A statically linked VI is one you place on the block diagram and wire it into your program.
A VI that you run using VI Server is being called dynamically -- regardless of where you are the VI reference from.
Mike...
07-27-2014 02:51 PM
Mikeporter, thanks for explanation, my bad in terminology.
I think that kumuch is asking about static - dynamic VI referencing difference, not about static - dynamic linkage.
07-27-2014 03:05 PM