cocowk Posted October 24, 2006 Report Share Posted October 24, 2006 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 Quote Link to comment
mross Posted October 24, 2006 Report Share Posted October 24, 2006 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 Quote Link to comment
cocowk Posted October 24, 2006 Author Report Share Posted October 24, 2006 thanks a lot for this help... I'm not sure to have understood all, but I'll come back here if it's necessary Quote Link to comment
mross Posted October 24, 2006 Report Share Posted October 24, 2006 thanks a lot for this help... I'm not sure to have understood all, but I'll come back here if it's necessary 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 Quote Link to comment
Michael Aivaliotis Posted October 25, 2006 Report Share Posted October 25, 2006 Take a look at this example code I posted a while back: http://forums.lavag.org/index.php?s=&s...post&p=8956 Quote Link to comment
sand of time Posted December 12, 2006 Report Share Posted December 12, 2006 I Think you can also use the Global Variable to solve you problem! Quote Link to comment
Aristos Queue Posted December 12, 2006 Report Share Posted December 12, 2006 I Think you can also use the Global Variable to solve you problem! 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. Quote Link to comment
EJW Posted December 12, 2006 Report Share Posted December 12, 2006 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: Quote Link to comment
crelf Posted December 12, 2006 Report Share Posted December 12, 2006 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). Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.