I’m trying to generate 4 audios on 4 different channels of a PXI using DAQmx. In particular in my vi I create the desired audios by adding different components. Then I need that the best signal shift after each iteration from the first channel to the second one and so on. I obtained that with a case struct controlled by the value of the for-loop iteration i. The problems arise at the second loop showing a message of unnamed task or error on the DAQmx start task. I have tried everything, placing the creating, closing and clear task Vis inside and outside the Case struct and the for loop, but I can’t understand the reason behind these errors. Can anyone help me?
Thank you for everything!
Please attach the VI in an earlier version (preferably 2016)
Some general comments:
Hope this is helpful.
Bob's recommendation to start with a single channel will help you get started. In that same spirit of getting started, try the DAQmx analog output examples. Note that the DAQmx examples do not use the Wait Until Done function for continuous tasks. Start your task once.
For the case of multiple ao channels, I suspect you are selecting analog output channels on the same device. Unless that device supports multiple timing engines, you need to add all output channels on the same device to the same task.
But overall, start simple and build upon success. When you do get an error, turn on retain wire values and rerun your VI. Find out which error was thrown first and which VI returned that error. Help>>Explain Error... should give you details that will help in debugging.
Thank you for your answer here the error codes that I have obtained:
<B>Requested Value: </B>Current Write Position
<B>Requested Value: </B>0
<B>Task Name: </B>_unnamedTask<DD>
DAQmx Wait Until Done.vi:3580004<append>
<B>Task Name: </B>_unnamedTask<E1>
The first one It’s seen at the end the vi, he second it’s shown at the second loop.
I butchered your VI, but here is a revised version that runs two iterations with two channels. I switched the timing mode to Finite so that each iteration of the For Loop is essentially a separate run of the task. Remember, a task is a group of channel and timing configuration, so it doesn't make sense to delay a single channel in a task by inserting a delay. Hope this helps!
some of the problems are solved, for now the last one remained seems to be linked to the presence of the DAQmx Write.vi followed by the DAQmx Start Task.vi. From what I can tell, the default value of the Write.vi Auto start property is true so it’s an error to put the start task after it with that Boolean set to true. This fact can be related to the error -200479 “Specified operation cannot be performed while the task is running” which occurs at the start task vi. But I can’t figure out why this problem arises only at the second loop of the for loop.
Hereafter I attach the link of the NI paper which help me together with your help:
A last question the DAQms Stop Taswk.vi must be included in the for loop for avoid problem with the task or a shift resister can be enough?
Thank you for the help!
I have observed your vi and it was helpful for some of my doubts bout the DAQmx. One thing is still bothering me, if a single task has inside itself different channels how I can select which signal goes on the corresponding channel? In my vi I need that each of the four channels generate 4 different audios at the same time.
Moreover, it's possible that with the waveform data passed in the for loop the sound is cut before its end after the first round?
Thank you very much for the help!