Example Code

Using Channel Names as Control Captions

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

Coding that illustrates how you can acquire multiple channels of data and then automatically set the channel names as the captions for controls on the front panel.

 

Description

This example illustrates how you can acquire 6 channels of data and take the associated 6 channel names and apply them to the controls in the cluster as captions. This methodology can be expanded to any number of channels provided that the Channel Settings are changed appropriately in the DAQ Assistant and the cluster is adjusted such that it contains the correct number of controls. Also, this example uses a DAQ Assistant though the same principals could be applied to the lower level DAQmx API. The controls must be contained within a cluster in order for their associated caption to be adjusted programmatically. Only a caption (not a label) can be modified programmatically in this manner.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code
1. Double click the DAQ Assistant, and change the names of the channels
2. Select the Run button.
3. Observe how the Cluster control change the caption on its controls.

 

Additional Information or References

Capture.PNG

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.