05-04-2022 03:25 PM
Hi,
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!
Best Regards,
Zuc
05-04-2022 04:00 PM
Which error code and message are you getting?
05-04-2022 04:03 PM
Please attach the VI in an earlier version (preferably 2016)
05-04-2022 07:49 PM
Some general comments:
Hope this is helpful.
Bob Schor
05-04-2022 11:19 PM
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.
05-05-2022 02:34 AM
Hi,
Thank you for your answer here the error codes that I have obtained:
EnavBSSvi_4Ch_ver2.vi<append>
<B>Property: </B>RelativeTo
<B>Requested Value: </B>Current Write Position
<B>Property: </B>Offset
<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.
05-05-2022 02:45 AM
Hi.
Thank you for the answer. Here the vi in a previous version!
Best Regards,
Zuc
05-05-2022 09:15 AM
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!
05-05-2022 09:34 AM - edited 05-05-2022 10:09 AM
Hi,
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:
https://zone.ni.com/reference/en-XX/help/370469AP-01/daqmxprop/attr1826/
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P6VkSAK&l=it-IT
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000PA1PSAW&l=it-IT
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!
Best Regards,
Zuc
05-05-2022 10:22 AM - edited 05-05-2022 11:12 AM
Hi,
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!
Best Regards,
Zuc