LabVIEW's Help window is extremely useful when you need learn something in a hurry; most people come to depend on it for wiring their diagrama very good programming habit to develop. You can make your own application just as easy to learn by adding your own entries for the Help window, as well as links to a hypertext Help document. Three levels of customized help are available:
Providing customized help in the Tooltip format and Help window is fairly easy. We covered this briefly in Chapter 5, "Yet More Foundations." To do this, choose Description and Tip . . . from the pop-up menu of a control or indicator. Enter the tip and description in the dialog box, and click OK to save it. LabVIEW displays this description whenever you have the Help window open and move the cursor over the front panel object (see Figures 17.17 and 17.18). Figure 17.17. The Description and Tip dialog being used to edit the description and tool-tip for the alarm numeric controlFigure 17.18. The Context Help window showing the description of the alarm control as the mouse cursor is hovered over it
If you document all your front panel controls and indicators by including their descriptions, the end user can open the Help window and quickly peruse the meaning of your front panel objects. To provide a description for the whole VI, enter information in the text box that appears when you choose Documentation from the VI Properties... menu. These comments will show up in the Help window, along with the wiring diagram, whenever the cursor is positioned over the VI's icon in the block diagram of another VI or in the upper-right corner of the VI's own front panel or block diagram. It will also show up in the Help window when the user hovers over the VI in the Functions palette. You can also bring up, position, and close the Help window programmatically. Use the Control Help Window and the Get Help Window Status functions, available from the Help subpalette of the Programming>>Dialog & User Interface palette. Control Help Window (Programming>>Dialog & User Interface>>Help palette) controls the position and visibility of the Help window. The Boolean Show input closes or opens the Help window; the cluster input consists of two numerical indicators that determine the top and left pixel position of the window (see Figure 17.19). Figure 17.19. Control Help Window
Get Help Window Status (Programming>>Dialog & User Interface>>Help palette) returns the state and position of the Help window (see Figure 17.20). Figure 17.20. Get Help Window Status
The more advanced help method, calling a link to an external, or compiled, help file, (which is usually written in HTML or RTF) is more elaborate. However, these are the same professional help files you see in commercial applications, and are very useful for an application you plan to distribute. You can use the HTML or RTF files LabVIEW generates to create your own compiled help files. Complete the following steps to create a compiled help file:
To call these help files programmatically, you can use the remaining function in the Programming>>Dialog & User Interface>>Help subpalette. Control Online Help (Programming>>Dialog & User Interface>>Help palette) manipulates an external compiled help file. You can display the contents, the index, or jump to a specific part of the help file (see Figure 17.21). Figure 17.21. Control Online Help
You can also distribute help documentation as plain HTML files, either along with your application or on a web site at a specific URL. Use the Open URL in Browser.vi to open HTML files on disk by wiring a path data type to the URL input (this is a polymorphic VI that allows the URL to be passed as either a string or a path) or open a web page on the Internet by wiring a string containing the web page URL. Open URL in Browser.vi (Programming>>Dialog & User Interface>>Help palette) displays a URL or HTML file in the default web browser. If the URL or path you wire to this VI contains a space character, the VI encodes the space as %20 before displaying the URL or HTML file in the web browser (see Figure 17.22). Figure 17.22. Open URL in Browser.vi
|