You can create several single global VIs, each with one front panel object, or you can create one global VI with multiple front panel objects. A global VI with multiple objects is more efficient because you can group related variables together.
Complete the following steps to create a global VI with multiple front panel objects.
Select Functions»Structures»Global Variable and place a global variable on the block diagram.
Use the Operating tool or Positioning tool to double-click the global variable node to display the front panel of the global VI.
Place controls and indicators on this front panel the same way you do on a standard front panel.
Note LabVIEW uses owned labels to identify global variables, so label the front panel controls and indicators with descriptive owned labels.
Return to the global VI and save it as My Global.gbl. Close the global VI.
Return to the block diagram of the original VI and right-click the global variable node and select a front panel object from the Select Item shortcut menu. The shortcut menu lists all the front panel objects that have owned labels. You also can use the Operating tool or Labeling tool to click the global variable node and select the front panel object from the shortcut menu.
Complete the following steps to use this global variable in other VIs.
Select Functions»Select a VI. Navigate to the location you saved the global VI. Set Files of type to All Files so you can see files with a .gbl extension.
Place the global variable on the block diagram. By default, the global variable is associated with the first front panel object with an owned label you placed in the global VI.
Right-click the global variable node you placed on the block diagram and select a front panel object from the Select Item shortcut menu to associate the global variable with the data from another front panel object.
Note Use a global variable only when you cannot route a wire through multiple VIs to share data. For example, if a file path is changed in one VI and another VI must open that path, there might not be a logical way to wire the path through numerous calling VIs. Using a global variable to hold the path data might be the best choice.