Jump to content

opening another VI from one main VI


cocowk

Recommended Posts

Hi everybody!

I need to open another VI from my main application (in order to group settings and other parameters)..

To describe my application:

I want a main window composed with my main VI interface.

Before the user launches the tests (because my application consists in multiple tests), I want to open another window, which is another VI that contains all the parameters for the tests.

When the user closes it, I want to get all the settings to import them into my main VI.

Is it possible? Can someone help me?

Thanks in advance

Coco

Link to comment
Hi everybody!

I need to open another VI from my main application (in order to group settings and other parameters)..

To describe my application:

I want a main window composed with my main VI interface.

Before the user launches the tests (because my application consists in multiple tests), I want to open another window, which is another VI that contains all the parameters for the tests.

When the user closes it, I want to get all the settings to import them into my main VI.

Is it possible? Can someone help me?

Thanks in advance

Coco

You just need a VI that is a control wired to an indicator. The control can be of a cluster of controls, numerics, booleans, enums, and strings can be part of the cluster for various types of data. Place a while loop around the control and indicator and a stop boolean to stop the loop.

You put both the control and indicator into the connector pane.

Drop the new VI in the top level VI.

Wire the output indicator of the new VI to whatever will use the data, unbundle the cluster if you used that.

Now right-click on the icon for the new VI and choose sub vi node setup and choose to call open the front panel when the VI is called.

When you run the top level VI the sub VI front panel will come forward when data flow reaches it. The top level VI will wait until the sub VI returns data before procedding. You fill out the sub VI, press stop and the data is passed to the top level VI.

There are other levels of complication that cn be useful. YOu can initialize the data VI to always look the same when it is called. You can build into it an error cluster which provides an easy way to sequence the sub VI in the top level.

I will send you an example when I get to work.

Mike

Link to comment
thanks a lot for this help... I'm not sure to have understood all, but I'll come back here if it's necessary :P

Attached is a vi I use exactly as you describe.

At the point which the manual input is needed, I wire the output of this sub vi to the functions that use the information. Data flow proceeds to this point and the "Sub-VI Node Setup causes this VI front panel to appear. You can change the entries until you click the stop button, then the while loop stops and the information iis passed to the top level VI and it proceeds with its data flow as before.

Mike

Download File:post-48-1161694557.vi

Link to comment
  • 1 month later...
I Think you can also use the Global Variable to solve you problem! :yes:

Or, you can not use a Global Variable and thereby not pick up an extremely nasty habit. Global Variables are easy to write and painful to debug, especially if anything starts happening in parallel. Stretching just a bit for a slightly harder solution (functional globals, events, queues) will help you a lot when it is time to debug the problem.

Link to comment
Or, you can not use a Global Variable and thereby not pick up an extremely nasty habit. Global Variables are easy to write and painful to debug, especially if anything starts happening in parallel. Stretching just a bit for a slightly harder solution (functional globals, events, queues) will help you a lot when it is time to debug the problem.

Nothing wrong with a global variable if you are using it as a read only variable AFTER initialization where you write to it once!

Even a global used for data read from a daq device is no problem. You write to the global as the output from the daq read and read from

it during processing.

Properly used, globals can be very useful. :2cents:

Link to comment
Nothing wrong with a global variable if you are using it as a read only variable AFTER initialization where you write to it once!

I'm not so sure - especially due to the mutex grabbing, thread pausing and swapping, mutex releasing nature of the global variable.

Properly used, globals can be very useful.

Sure - as long as you know how to use them properly, and fully understand the negative consequences (which I'd suggest that very few people do).

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.