For example, for a ring or labeled slide with options for volts, ohms, or amperes, use a name like Measurement Units rather than V/O/A or Mode.
Once you selected a Boolean to represent a two-state control, assign a control name as well as the Boolean state labels. Below are good and bad choices for Boolean control names and associated selection labels:
The following front panel displays how these control names would appear to the user.
Do not use Boolean controls if the two options are not opposites of each other. For example a DMM might only allow two-wire or four-wire resistance measurements. The instrument allows only two options, but in this case you would use a ring control because the options are not opposites. The two states are understood clearly from the front panel. A Boolean constant makes the block diagram difficult to understand. On the other hand, a Text Ring constant makes the block diagram easier to understand. The block diagram in the figure below uses a Text Ring to make the block diagram easier to understand.
Text rings also make it easy to edit the driver if the instrument might add additional options in a future version. You can add options to a ring control without breaking end user applications. The front panel in the figure below shows good and bad choices for two-state controls.
Use a Text Ring when you have a finite number of selections. The front panel in the figure below includes good examples of using Text Ring.
Avoid using Text Rings for selections of numeric values. Instead, use an integer or double precision sparse ring for selections of numeric values. Sparse ring values associated with ring entries do not need to be sequential. For example, you can map "5.5" to the double precision value of "5.5" in a ring, which is helpful when you have only a few value numerics to choose from (such as 4.5, 5.5, and 6.5). By mapping to the same value, you can then directly pass that value to Format Into String to build up the command to send to the instrument. The front panel in the figure below includes good and bad techniques for creating rings for channels.
If possible, make the value names in the Text Ring obvious. However, sometimes the selections cannot be fully described in the selection. In this case, it is important to document the value options in the Context Help. The Context Help window below shows clear documentation of menu selections.
Use data types users can integrate easily in their applications. For example, if a user enters a voltage level using a numeric control, which likely has a double precision data type, the instrument driver VI should handle the formatting process that converts the double precision data to a string to send to the instrument. Similarly, the instrument driver VI should parse instrument responses and format them into a data type suitable for further analysis and presentation. For example, if the instrument returns a waveform, the instrument driver VI should parse the waveform string and create the waveform data type before it sends the data to a graph. The VIs in the figure below demonstrate building a waveform within an instrument driver VI.
Even if you can represent a number as a 16-bit or 8-bit integer, use a 32-bit integer value because you provide the user with a consistent API and minimize data conversions within the instrument driver and in the end-user's application.
If the value a user enters could be a non-integer value, ensure that the control uses the double-precision data type representation. For example, use double-precision representation value with physical units, such as voltage, power, frequency, length, and angle. Even if you can represent a number as a single-precision value, use a double precision value because you provide the user with a consistent API and minimize data conversions within the instrument driver and in the end-user's application.
Avoid using strings as input parameters. If the set of strings the user can pass to an instrument is finite, use a text ring control so users can select the string to pass. Using a string control requires the user to enter the string with the proper spelling, case sensitivity, and word order, which is prone to error.
The front panel below demonstrates how requiring uses to enter units in a text string can confuse them.
However, use a string indicator to display messages to the user.
Passing cluster information between VIs makes the application more complex because doing so requires users to bundle and unbundle the information in the clusters. Re-evaluate the grouping of the inputs for the VI. Use clusters only when you can logically group a set of controls, such as a bank of digital control lines that you pass to several VIs.