04-03-2017 02:52 PM
Hi,
I'm trying to create a guitar tuner program that, using the myDAQ, can read in a signal from the Audio In jack and output a PWM signal from an Analog Out pin to control a servo motor. I have managed to get both of these functions working separately
However, when I try to run them at the same time, the motor runs for only a split second and I get an error message - Error -200290 - telling me that the program cannot write samples to the buffer fast enough.
The error message does give some examples of solutions, but none of them have worked for me. I'm not really sure if I'm implementing them right, or if I'm just barking up the wrong tree! If anyone could point me in the right direction (or to a tutorial) it would be much appreciated.
Thanks
04-04-2017 02:08 AM - edited 04-04-2017 02:15 AM
Hello jgair,
you do both in one loop AI and AO. The AI runs with 40 KHz and 100 KSamples this means the loop iteration time is 2,5 seconds ( samples/rate). The AO runs with 100 Khz and 10KSamples this means the loop run with 0,1 seconds. Both function for AI and AO are in the same loop but have different timing, also a calculation is done inside of the loop, which also need some time. The next is AI and AO are in row, this also makes problems.
Both functions should run with the same timing. The best is both functions run in a separate while loop and the data is transferred with queues between the two loops.
Try to set the Samples for AI to 4k, in the simulation with a USB 6210 work this.
04-04-2017 12:04 PM
Hi Alexander,
Thanks for the help - that seems to have sorted out the problem!
Cheers
04-06-2017 12:56 PM
Hi again,
unfortunately I've run into some more issues - the solution from before seems to work for a while when the program is started (much longer than it did in the first version that I posted on here), but then I get the same error (Error - 200290). Have I implemented the solution incorrectly, or is it something else this time?
04-06-2017 01:50 PM
Hello jgair,
04-07-2017 01:06 AM - edited 04-07-2017 01:13 AM
Hello jgair,
attached a modified VI with a new architecture inside. I think the problem was the samples you are generation do not match the samples you are writing.
04-07-2017 04:33 AM
Hi,
Thanks for the help - in what way did the samples being generated not match the samples being written?
Cheers
04-07-2017 05:03 AM
Hello jgair,
Generation is set to fs=1000 s#=1000 -> one second of data
Writing is set to rate=100000 samples=10000 means -> 100ms to write