pockey Posted January 26, 2007 Report Share Posted January 26, 2007 Hi, I need to integrate two VIs developed by two people. I need to show both the front panels to user. However, when I open one VI in another one, it is a icon and I could not show the two front panels together. I could only choose the "SubVI Node Setup" and to show the second VI during running. To exchange two front panels is troublesome... Is there a way to copy the whole VI(both front panel and diagram) to another VI? So it will look like a single VI. Well, I still have a problem to stop the two VI at the same time. Thanks! Quote Link to comment
Jeff Plotzke Posted January 26, 2007 Report Share Posted January 26, 2007 Pockey, If you want to have only one front panel shown to the user, can you either: -Copy and paste the entire front panel / block diagram from the SubVI to your main VI (There's no easier way that I know of other than 'Select All', 'Copy', 'Paste'. Your VI will get pretty ugly, though, since you now have two VIs in one. -Run your SubVI through a subpanel. With a subpanel, you can "run" another VI and show it's front panel as part of another. Instructions for that can be found here: http://zone.ni.com/reference/en-XX/help/37...el_in_subpanel/ That said, in either case you'll need to create a way to get both VIs to stop simultaneously. I'd probably create a notifier in the "main VI" which sends a notification when the stop button is pressed. Then, have your subVI listen to the notification in its idle case and have it stop on a notification. Let me know if you need more help. ~Jeff Quote Link to comment
pockey Posted January 30, 2007 Author Report Share Posted January 30, 2007 Thanks, Jeff Plotzke By just copy and paste: if I copy all the components of the front panel, I lost the connections of block diagram if I copy all the components of the block diagram, I could get the original connections, however, the front panel is too strange. The copied front panel is somewhere far away from the original one....It\'s a little bit troublesome, anyway, I\'ve got that. However, I did not know how to make the global \"Stop\" button, the structure of the VIs is shown as below: I want to try the method of SubPanel, however, I also come accross some problem: I want to make "Part 2" as the SubPanel... "Wire the path of the VI whose front panel you want to load to the vi path input of the Open VI Reference function." The above is from \"Loading a Front Panel in a Subpanel Control\" on NI Page, I did not know what is the \"path\"?? Is it the location of the VI in my computer? Such as: \"E:\\Pockey\\job6 - DSP\\SRF24-58RFMTester\\Meas_SINAD_rev1.0.vi\"?? So how could I combine the two VIs together? If I send the final VI to some other user in different folder location, will the program run correctly?? Quote Link to comment
Omar Mussa Posted January 30, 2007 Report Share Posted January 30, 2007 Your best bet is to look at the 'Producer-Consumer' template or one of the other parallel loop templates that ships with LabVIEW. That will give you some ideas on how to stop the second loop. There are many ways with pluses and minuses but the templates are a good starting place. Quote Link to comment
pockey Posted February 1, 2007 Author Report Share Posted February 1, 2007 Thank you, Omar Mussa I've known how to make a global button to stop the three parallel while loop, however, I still did not know how to implement the SubPanel solution. I place the "Current VI's path" and the VI I want to call is in the same folder as the main VI, so I just put the Sub VI's name in the path, however, the program says it could not find the VI I want to call..... Strange, or something wrong with my "path"??? Quote Link to comment
Jeff Plotzke Posted February 1, 2007 Report Share Posted February 1, 2007 I place the "Current VI's path" and the VI I want to call is in the same folder as the main VI, so I just put the Sub VI's name in the path, however, the program says it could not find the VI I want to call..... Can you post a screenshot of the code that you're trying for the subpanel? If you wire a path to the Open VI Reference VI, it will load the VI from the path you give. If you just give a VI file0name (with no absolute path), it will load from the current running VI's folder. For example, I just tested with the code attached. I have "C:\master.vi" running "C:\subVI.vi" in a subpanel. It works either with "C:\subVI.vi" or "subVI.vi" wired to Open VI Reference. (I made sure all VIs were out of memory before each test) As for distribution, you'll need to either make sure that if the user won't have the subpanel VI in the same folder, that your program accounts for this and asks the user to enter the location of the VI. That way, you can build the path to pass to 'Open VI Reference'. Quote Link to comment
pockey Posted February 1, 2007 Author Report Share Posted February 1, 2007 I tried again and this time it works! But could I make the scrollbar invisible? I've set the height and width to the same as the called VI, why there is still scrollbars?? Quote Link to comment
Jeff Plotzke Posted February 1, 2007 Report Share Posted February 1, 2007 But could I make the scrollbar invisible? I've set the height and width to the same as the called VI, why there is still scrollbars?? The subpanel uses the same properties set in the 'Window Appearance' VI Properties. So, in your subVI that you want in a subpanel, open up VI Properties -> Window Appearance -> Customize -> Uncheck 'Show Vertical/Horizontal Scroll Bars' Quote Link to comment
crelf Posted February 1, 2007 Report Share Posted February 1, 2007 The subpanel uses the same properties set in the 'Window Appearance' VI Properties. Right: the scroll bars aren't a property of the subpanel, they're a property of the subVIs that you're loading into the subpanel. Quote Link to comment
pockey Posted February 2, 2007 Author Report Share Posted February 2, 2007 Thanks all! I've got out of the scrollbar. 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.