Part 2: Adding Analog Input and Output Channels to a DAQ Device
- Updated2023-02-21
- 4 minute(s) read
In this section, the example code modifies the analog inputs and outputs of a DAQ device:
- Adding an Analog Input Channel to a DAQ Device
- Adding an Analog Output Channel to a DAQ Device
- Adding Channel Mappings for DAQ Analog Inputs and Outputs
2a. Adding an Analog Input Channel to a DAQ Device

|
|
Obtain the reference to the existing Analog Input section under the DAQ device in the system definition using the GetAnalogInputSection method. |
|
|
Remove the existing Analog Input section from the system definition file using the RemoveNode property. Removing any existing analog input channels prevents conflicts between existing channels and channels you add. |
|
|
Create a new Analog Input section and add it to the DAQ device using the CreateAnalogInputs method. |
|
|
Add a new analog input channel by initializing a new instance of the DAQAnalogInput class. |
|
|
Add the new analog input channel to the Analog Input section using the AddAnalogInput method. |
|
|
Create an alias and link it to the new channel by:
|
Related Links
2b. Adding an Analog Output Channel to a DAQ Device

|
|
Obtain the reference to the existing Analog Output section under the DAQ device in the system definition using the GetAnalogInputSection method. |
|
|
Remove the existing Analog Output section from the system definition using the RemoveNode method. Removing any existing analog output channels prevents conflicts between existing channels and channels you add. |
|
|
Create a new Analog Output section and add it to the DAQ device using the CreateAnalogOutputs method. |
|
|
Create a new analog output channel by initializing a new instance of the DAQAnalogOutput class. |
|
|
Add the new analog output channel to the Analog Output section using the AddAnalogOutput method. |
|
|
Create an alias and link it to the new channel by:
|
Related Links
2c. Adding Channel Mappings for DAQ Analog Inputs and Outputs

|
|
Get the node path for the AO0 channel. |
||
|
|
Get the node path for the AI0 channel. |
||
|
|
Convert the node paths from strings to arrays using Build Array functions.
|
||
|
|
Map AI0 to AO0. Note that the source channel, AI0, maps to the destination channel, AO0, but the destination channel stores the mapping information. |
Related Links
Programming with the System Definition API in LabVIEW
Navigating the System Definition API








