DAQmx Clear Task.vi
DAQmx Control Task.vi
Don't abort the execution using the abort button if you are using a while loop to read or write and the Clear task is executed after the loop. Use the Stop Button attached to the conditional terminal of the Loop instead.
Each type of hardware (PCI/PCIe and cDAQ) has a limited number of concurrent hardware sessions available. This limits the number of concurrent tasks an application can call simultaneously.
When using E, M, S, X, or AO Series DAQ devices, you can do one hardware-timed analog output task. However, most devices also support performing one or more software-timed tasks simultaneously with one hardware-timed task. This functionality allows the device to generate different signals with different timing characteristics at the same time on the same device.
You should be able to achieve this behavior by implementing an example in LabVIEW. Navigate to LabVIEW examples by selecting Help>>Find Examples... In the example finder select the Browse tab then Hardware Input and Output>>DAQmx>>Analog Output>>Voltage - Continuous Output vi. This will allow you to select any number of channels on the front panel and output the same waveform to those channels. To implement a phase shift on those channels you can edit the existing example in a similar way to the screen shot below.
Save and close the Waveform Buffer Generation (multi) VI. On the front panel of the Cont Gen Voltage Wfm-Int Clk VI, choose the two channels to output the simultaneous waveforms. For example, to output the waveforms on channels 0 and 1 of device 1, the physical channels should be Dev1/ao0:1. See the following article about how to select multiple channels in LabVIEW: Select More Than One NI-DAQmx Channel in LabVIEW . When the program runs, the waveform should be similar to the following image (for a phase shift of 180°).
Other workarounds include:
Multiple Software-Timed Tasks Simultaneous With One Hardware-Timed Task
Multiple AO Channels on One Hardware-Timed Task
Inside of a hardware-timed task you can include multiple AO channels. These channels will share the same timing information because they will share the AO sample clock. However, different signals can be output on each channel. Here is an example of this.
Note: On devices like the NI PXIe-4461/3 there are dedicated timing engines for both analog outputs, so it is possible to run two independently timed analog output tasks off each channel. Case 7: Attempting to use a task in NI-MAX while it is being used by a running LabVIEW program. If a LabVIEW program is currently running your DAQmx task to acquire data, then it will reserve the hardware resource corresponding to this task. This means that NI-MAX will be unable to concurrently access this hardware resource, or device.To prevent this conflict, you can either perform any NI-MAX actions before or after running your LabVIEW program, or while your program is stalling in a state before DAQmx Start Task has been called or after DAQmx Clear Task has been called. These functions reserve and release hardware resources, respectively.Case 8: Using the wrong source for a counter taskMake sure that the source you are selecting is supported for the task you are trying to run. (for example, wiring in an internal counter for a digital edge instead of the onboard clock).
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.