Configuring the Property Nodes of Each Channel Separately

Updated Jul 28, 2023

Reported In

Hardware

  • NI-9361

Software

  • LabVIEW

Driver

  • NI-DAQmx

Issue Details

I am having one of the  issues below: 
  • When configuring a counter read task and mapping the counters to the physical inputs, I am getting the same readings for each channel.
  • I can't change the properties for just one channel in a DAQmx Task. 
  • How do I use the ActiveChans property correctly? 

Solution

When mapping the terminals to the counters, we need to specify the active channel we want to modify. This can be done by declaring the ActiveChans on the property list, which receives a string as an input. 

On the example below we create a single task with two channels and map the ctr0 to PFI0 on channels "Frequency_0" and map the ctr2 to PFI2 on channels "Frequency_1"



This can be used with any property accessible through the DAQmx Channel  Property Node after declaring the active channel not just for counter tasks. Additionally, you can create a task using DAQ Assistant  and them convert it to DAQmx code.

 

Additional Information

When writing to a property node, it's processed from top to bottom. This means that if no active channel is defined before, the property node will apply for all channels on the task. 

On the example below, we are setting the logic level behavior for both channels while setting the counter input terminal separately for "chan1" and "chan2". In this case, just one Create Channel function was used. However, it contains 2 different channels (ctr1 and ctr2) that you can modify their properties individually using the ActiveChans function. You can reference them by the names "chan1" and "chan2".