04-15-2009 10:48 AM
Solved! Go to Solution.
04-16-2009 01:24 PM
Hi,
Please see attached two screeshots that show how we can write to multiple channels within 1 task (The only way to do this because there is only one timing engine on our DAQ cards --> only one analog output task is possible at any given time). You will notice that I use the merge signals Express VI to merge the two sine ways signals and wire that to the DAQmx write. Currently as is this VI allows me to switch the parameters of the sine waveson the fly as they are inside of the while loop.
klet me know if you have any questions regarding this!
04-17-2009 01:27 AM
CharlesD,
thanks for the reply. I am able to vary the frequency and amplitude dynamically but not the phase. I need to restart the program to see a change in phase. Why is this happening?
04-17-2009 03:04 AM
04-17-2009 02:30 PM
When I run the vi, I get the following error message
Error -200462 occurred at DAQmx Start Task.vi:1
Before starting a buffered generation, write data. Unreserving a task empties the buffer. Changing the size of the buffer or setting the Regeneration Mode property will result in the buffer being unreserved and emptied.
I moved DAQmx start task from before the loop to after the loop. It does not help. What can be done?
Thanks
04-17-2009 05:04 PM
Ensure that you are starting the task BEFORE the While loop like in the screen shot. I made the same mistake earlier when I forgot to put a start task block before the while loop and I got the same error. Also make sure that all of the drop down menus below the DAQmx functions are the set to same exact values as I have put in my block diagram. Lets try this and then we will go from there, My program seemed to work fin on my machine so it could very well be that you did not copy something appropriately.
04-17-2009 06:13 PM
I spent quite some time to ensure that I copied your code right, and I did not find any discrepancies. Can you upload your vi here? That ll help me resolve this issue much quicker. Thnks
04-20-2009 09:30 AM
Please see attached LabVIEW code:
04-20-2009 01:19 PM
Even this vi (the one you sent) shows the same error. Nothing related to the setup has changed. Is there some alternate approach to solve this issue?
04-21-2009 09:38 AM
Alright let's try one more thing. It sounds like this error is saying that it wants you to write some data to the buffer BEFORE we start the task. with my device I got the same error as you after re-running it with real-hardware instead of a simulated device. I was then able to rectify the error code by writing an empty data (0) to the buffer before starting the task. PLease see the attached VI. If this does not work let me know and we will try something different.
Thank you