To begin taking measurements using the sample code provided, download and install the NI-DAQmx driver to interface and configure your NI data acquisition devices. Use the code in the Connect to NI DAQ Hardware for this guide.To connect to your hardware:
If you don’t have NI data acquisition hardware yet, you can use this guide by creating a simulated device that replicates hardware behavior to run functions or programs. To create a simulated device, open Create Simulated Device.vi from the attached sample code. Run the code by clicking on the run arrow. This VI creates a simulated device called SimuDAQ on your computer, which is discussed later in this guide.
Figure 2: If you don't have hardware, follow along with a simulated device.
Open Acquire Analog Inputs Using the DAQ Assistant.vi from the Connect to NI DAQ Hardware.lvproj. This VI includes a prebuilt UI and analysis code. For this exercise, you need to add the code required to acquire a signal.
Figure 3: Starting Point.
2. The DAQ Assistant provides a step-by-step guide for configuring, testing, and programming measurement tasks. Start by adding a DAQ Assistant Express VI to your diagram. To do this, right-click on your block diagram and navigate to Measurement I/O»NI-DAQmx»DAQ Assistant, and then click and place the DAQ Assistant icon onto your block diagram. Alternatively, you can press <Ctrl-Space> to open Quick Drop, type DAQ Assistant, and select the entry from the list.
Figure 4: Navigating to the DAQ Assistant.
You can find the finished VI in the Solutions folder in the Connect to NI DAQ Hardware.lvproj.
Though the DAQ Assistant provides a quick and easy way to acquire or generate data without programming, more advanced users may need added flexibility and lower-level control than what the DAQ Assistant offers. The NI-DAQmx driver features a comprehensive API of basic and advanced functions for control over such parameters as timing, synchronization, data manipulation, and execution control.
Figure 10: The DAQmx API provides added programming flexibility.Open Acquire Analog Inputs using the DAQmx API.vi for an example of a more advanced application. Here you can configure channels, recording options, triggering options, and advanced timing settings.
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.