Example VIs

Contents

Create an Icon for Each VI that Identifies the Instrument and Conveys the Functionality of the VI

Provide examples with source code. Call user-accessible VIs to teach users how to control the instrument. Examples help users understand the recommended calling sequence necessary to perform instrument operations. If a simple example calls an excessive number of API VIs, the instrument driver might need a more appropriate level of granularity. The figures below show the front panel and block diagram of an instrument driver example VI.

Diagram - Example Block Diagram

Create Runnable Example VIs with Reasonable Default Values

Examples are self-contained and runnable VIs that perform complete operations. For example, a good example VI for a DMM configures, starts, and reads from the DMM. Include calls to the InitializeClose and Simple Error Handler in your examples. Also, example VIs help users establish communication with the instrument and learn how to programmatically control the instrument.

Do Not Wire Terminals to the Connector Pane of an Example VI. Do Not Design Example VIs to Be Used as SubVIs.

Example VIs are not part of the instrument driver API and, therefore, users should not use them as subVIs. Examples might change from one driver release to the next. If you wire the terminals to the connector pane, end users might use the example VI in their applications. A change to the example in a future release would break their application.

Create a Separate Example for Each Typical Instrument Use Case

Users expect most instrument drivers to include an example for each typical use case for an instrument. Including multiple examples benefits a wider range of customers.

Give the Example a Meaningful Name Do Not use the Word "Example" in the VI Name

Use names in the example VIs that describe the operation the VI performs, such as "Agilent 33XXX Series Generate Arbitrary Waveform" or "Tektronix PA1000 Acquire Harmonic Measurement".

Include Description and Tip Help for All Controls and Indicators

Recommended

To aid users in getting started with an example VI, include tip strips for the controls. Tip strips are brief descriptions that appear when users move cursors over a front panel object.

Include General Instructions for Using the Example VI and Other Important Information at the Top of the Front Panel of the Example VI

Recommended

Often, users start with an example when they first start using an instrument driver. Include important information about using the driver and the example on the front panel and in the Context Help of the example VI. Include information on supported instrument model(s), required bus configuration settings, and required instrument cabling and hardware setup. Include a sentence on the front panel that instructs users to refer to the Context Help for more information on using the instrument driver.

Include the Examples Folder in the Project (.lvproj), But Not in the Project Library (.lvlib)

The figure below shows how the Examples Folder (.lvproj) and other folders are organized in the Project Explorer

Example - Good Icon Images

Prepare the Example VIs you Create to Appear in the NI Example Finder

Recommended

Select Tools»Prepare Example VIs for NI Example Finder to prepare example VIs you create to appear in the NI Example Finder. Select Hardware Input and Output»Instrument Drivers»LabVIEW Plug and Play for the browse path. Select keywords to be associated with the driver. Keywords should include the following: the words "instrument" and "driver" the manufacturer's name, such as "Agilent" or "Mettler" and "Toledo" the supported instrument model and/or series name some type of product reference, such as "DMM," "analyzer," or "scope"Use the Build Data File tab to build the data (.bin3) file that stores the task-based browse paths, keywords, and other information about the example VIs you document. Include this newly created data (.bin3) file with your driver. Refer to the LabVIEW Help for more information about running this tool.

Was this information helpful?

Yes

No