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 screenshot 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 the DAQmx Start Task has been called or after the 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).Case 9: Configuring multiple counter tasks without using the DAQmx Control Task (VI); Specially when using the C Series modules that do not have built-in counters (like NI 9401), rather they access the chassis' internal counters.If the C Series module does not have built-in counters, it accesses the chassis' internal counters. See cDAQ Module Support for Accessing On-board Counters. To access the counters, the DAQmx driver decides the route between the signal and the chassis' internal counter. When you configure one counter task, NI-DAQmx assigns a route for that task. Now, when you configure another counter task, no matter if you use a different counter than the first task, the NI-DAQmx driver can still try to route the signal in a way that interferes with the first task's route. This can result in error -50103.Therefore, to avoid this, you need to explicitly tell the NI-DAQmx driver successively with the configuration of each task that this route is reserved for this task. This, way when assigning the route for the subsequent tasks, NI-DAQmx will not try to use the already reserved routes.For this purpose, you can use the DAQmx Control Task (VI) with the "Reserve" action when configuring each counter task. See Error -201133 in LabVIEW When Running Multiple Digital Output DAQmx Tasks for more details.
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.