Generating Code for Tasks/Channels

NI-DAQmx Name Control

Generating Code for Tasks/Channels

You can generate code for a task or global channel from a DAQmx task name control or DAQmx global channel control, respectively. Complete the following steps to generate code.

  1. Place a DAQmx task name control or DAQmx global channel control on the front panel.
  2. Select the task or channel for which you want to generate code.
  3. Right-click the control and select Generate Code from the shortcut menu. Select one of the following code generation options.
    • Example—Generate all the code necessary to run the task or channel, such as VIs needed to read or write samples, VIs to start and stop the task, loops, and graphs. Select this option if the task or channel is specific to your system, and you do not use the task or channel on other systems.
    • Configuration—Generate the code associated with the configuration. LabVIEW replaces the I/O constant or control with a subVI that contains VIs and Property Nodes used for channel creation and configuration, timing configuration, and triggering configuration used in the task or channel. Select this option if you need a portable configuration that you can move to another system.
      Caution  Although generated configuration code includes code to create virtual channels and tasks, it does not include code to create scales. If you generate configuration code for deployment of applications that include scales, you must ensure that the scales are configured on the client computer.

      Refer to deployment in the NI-DAQmx Help for deployment options. Refer to the Measurement & Automation Explorer Help for NI-DAQmx for detailed instructions on how to export and import configurations for deployment.

    • Configuration and Example—Generate configuration code and example code for the task or channel in one step.