You can automatically create subVIs from the code in your main VI by selecting the code you want and then going to the Edit menu and selecting Create SubVI. Depending on how clean your wiring is, you may or may not need to modify the terminals that LabVIEW chooses to assign to the various inputs and outputs.
For user menus, open the Example Finder and do a search for menus on the search tab.
You can select the code in your current VI and then select Edit>>Create SubVI from the menu bar. LabVIEW will create a new VI for you which you can save and use as a subVI.
You can also create a customized menu bar for your application. Refer to "Chapter 16 Customizing VIs >> Customizing Menus" section of the LabVIEW User Manual.
Thx for your response... I already kwew about the subVI etc...
But what with front panel items?
Is it possible for exemple: you have a menu bar with 3 options: import, read and calculations.
With import there is a table and graph etc on the front panel,
with read there is gpib communication stuff on the front panel and
with calculations ther is another table and graph etc on the front panel.
So I want that when I invoke import from the menubar I see only the corresponding table and graph.
Afterwards if I invoke gpib, the table and graph has to disappear and the communication stuff has to be there in place... etc...
Is this possible ?
Here's a quick example. I moved the controls/indicators to different pages of a tab control. In each case, I wrote to the tab control's local variable to set the right page. Of course, with a tab control, you don't need menu options to swithc between pages but if you want to hide the tabs, then using the menu will make more sense. There's other ways to do this. Another way would be in each case statement to make all of the unwanted controls/indicators invisible. This is done with property nodes.
You should also look at using the event structure. There is a shipping example that uses events to handle menu selections. The event structure is a more effecient method of programming than the polling method you have in this example.