How Do I Replace Counter Set Attribute.vi with NI-DAQmx VIs?

Updated Aug 9, 2025

Reported In

Driver

  • NI-DAQ™mx
  • Traditional NI-DAQ

Issue Details

I am currently working on replacing a program that was created using LabVIEW 7 and NI-DAQ 7.5 with the latest LabVIEW and NI-DAQmx version. The process involves measuring frequency using both counter output and input. However, I do not know how to replace the following NI-DAQ function with NI-DAQmx function.

Function: Counter Set Attribute.vi

Attribute ID: Specifies which attribute that will be set (e.g., clock source, mode)

Attribute Value Type: Indicates the data type of the value passes (e.g., float, integer)

Using this function, pulses are counted with the counter input from when the counter output starts until it stops.

What NI-DAQmx function can be used to replace the above function?

 

Solution

With NI-DAQmx, the Counter Set Attribute.vi can be replaced and streamlined using the following approach:

  1. Create Counter Channel

    Use DAQmx Create Channel.vi to create a counter input or output channel and specify whether the channel is for counter, pulse generation or frequency measurement.

  2. Configure Counter Attributes

    Use the DAQmx Channel Property Node to set specific attributes such as:
    - Frequency
    - Duty Cycle
    - Initial Delay
    - Idle State

    These properties allow fine-tuned control over the counter behavior, similar to what was previously done with Counter Set Attribute.vi.

Additional Information

NI-DAQmx provides better performance, error handling and hardware abstraction compared to Traditional NI-SAQ. Therefore, migrating to NI-DAQmx is recommended for all new applications and hardware.