Getting Started with DAQmx: Basics of DAQmx Property Nodes

Updated May 12, 2023

Environment

Software

  • Measurement & Automation Explorer (MAX)
  • LabVIEW

Driver

  • NI-DAQmx



The NI Getting Started with NI-DAQmx Series is aimed at helping you learn NI-DAQmx programming fundamentals. Through video and text tutorials, this series will take you from verifying your device's operation in Measurement & Automation Explorer (MAX) to programming data acquisition applications using LabVIEW. It is intended for both the beginner who wants to learn how to use the DAQ Assistant, as well as the experienced user who wishes to take advantage of advanced NI-DAQmx functionality.

In general, property nodes allow you to modify or query the property of a certain reference. The DAQmx Property Node gives you the ability to read or write the properties of your data acquisition system. 
 

NI-DAQmx System Property Node

The DAQmx System Property Node can return the available devices, tasks, or channels on the current computer. The figure below shows the System Property Node returning the device names on the current system.
 


 

C Function: DAQmxGetSysDevNames
 

NI-DAQmx Device Property Node

You can use a DAQmx Device Property Node to query general device settings such as the bus type (PCI, PXI) or the device serial number. You can also query more specific settings to find the maximum analog input sampling rate or even which pins are used to access the onboard counters. The figure below shows an example of using the Device Property Node.
 


 

C Function: DAQmxGetDevIsSimulated
                 DAQmxGetDevBusType
                 DAQmxGetDevMaxSingleChanRate

 

There is also a property node that corresponds to each major DAQmx functionality-creating channels, timing, triggering, reading, and writing. These property nodes can be used to access advanced functionality.
 

DAQmx Channel Property Node

The DAQmx Channel Property Node can be used to configure or read the more advanced features of a DAQmx channel. This property node requires the task reference from the DAQmx Create Channel VI. This reference tells the driver that the property node is referring to the specified channel. The figure below shows how the Channel Property Node can be used to both read and write properties of a channel.
 


 

DAQmx Timing Property Node

The DAQmx Timing Property Node gives the user access to dozens of attributes that are not available from the DAQmx Timing VI.
 


 

C Function: DAQmx<Get/Set/Reset>SampClkActiveEdge
                 DAQmx<Get/Set/Reset>SampQuantSampMode
                 DAQmx<Get/Set/Reset>MasterTimebaseRate
 

From this property node, you can change the Active Edge of the clock, configure Change Detection on a digital line, or query the sample clock rate. In general, this property node provides you with dozens of more advanced timing properties.
 

DAQmx Trigger Property Node

The DAQmx Trigger VI also has a property node associated with it that provides access to advanced triggering functionality. However, you can also use the DAQmx Triggering Property Node without the Trigger VI to set up a triggering event. The figure below shows a snippet of code that sets up a pause trigger for a counter output task. All of the triggerings are configured via the property node.
 


 

C Function: DAQmx<Get/Set/Reset>PauseTrigType
                 DAQmx<Get/Set/Reset>DigLvlPauseTrigSrc
                 DAQmx<Get/Set/Reset>DigLvlPauseTrigWhen
 

DAQmx Read and Write Property Nodes

There are property nodes for both the DAQmx Write and the DAQmx Read VIs. These property nodes are useful in querying the status of a write or read operation. They can also be used to programmatically change an ongoing write or read task.
 

Specifically, you could use the DAQmx Read Property Node to specify which samples you want to read off of the buffer. For example, you could choose to read only the most recent values by setting the RelativeTo property. The figure below shows how to configure the property node to read the most recent 100 samples on the buffer.
 


 

C Function: DAQmx<Get/Set/Reset>ReadRelativeTo
                 DAQmx<Get/Set/Reset>ReadOffset
 

Similarly, you could write to these same properties with the DAQmx Write Property Node to define where to put new data on the output buffer. You can also use the Write Property Node to configure analog output regeneration or to query the buffer to see how much space is available. The figure below shows how this property node can be used to continually monitor the buffer status of a write operation.


C Function: DAQmxGetWriteCurrWritePos
                 DAQmxGetWriteSpaceAvail
 

Use the LabVIEW help documentation for detailed descriptions of all the different available DAQmx properties.