04-08-2009 09:29 AM
Hey there,
For a drum program, i have 2 piezo buzzers connected to the DAQ, In the code I have it set up so that a different sound sample would be assigned to each sensor. However initially when i ran the code, i hit one sensor (a1), it plays that ok. When i hit (a0), its kind of random. It sometimes plays the sample assigned to a0 or a1 or plays on then the other.
Then from messing around with the DAQ assistant i changed the input signal range and found that the a1 input played the a0 assigned sound instead. My mind is boggled.
Attached code.
Thanks in advance,
Emile
Solved! Go to Solution.
04-09-2009 08:13 AM
Hi Emile,
Looking at your code, I can see you are sending your queue to two consumer loops. Currently, one loop will dequeue the 1st element, then the other loop will dequeue the next one, and so on. I think this may be why you are not getting the expected sound file for the drum sensor being activated as you will only be outputting a sound file for every other set of daq samples.
In the attached VI's I have stripped out your processing and am simply passing the producer loop iteration number into the queue to illustrate how the elements are being dequeued and where.
Dequeue1.vi illustrates how the elements dequeue in alternating consumer loops.
Dequeue2.vi illustrated one solution that passes the data into both loops.
I hope this helps, but please post back if you have further questions.
04-09-2009 12:47 PM
04-14-2009 03:17 AM
Hi Emile,
I hope you had a good Easter break.
My apologies for the 8.6 versions, and for your having to wait the long weekend for these versions. I hope these illustrate my original point.
04-23-2009 08:49 AM
Hi Sheela
Thanks, I had a good Easter break. Hope you had a good one too.
I modified the code from with the way it is shown from the Dequeue 2 VI you gave me. I still have the same problem.
Perhaps it might have something to do with the "split signals" block not seperating the signals the way i want it to?
Also i notice from the waveform graph the when i hit one sensor i see a voltage change from one of the sensors, but when i hit the other sensor I see a voltage change from both sensors and from that i can see how im hearing the 2 samples. But i dont know why there's a change in voltage in both sensors when i hit one sensor. The wires from both sensors are completely seperated.
Thanks again for the help.
Emile
04-23-2009 08:50 AM
And here's the slight change i made.
04-23-2009 10:02 AM
Hi Zerroth,
I cannot see anything wrong with your code. You can verify that the split signals function is working correctly by putting graphs on each of the output signals just to check that you only see on channel per output.
I am wondering if this might be a hardware/connection issue. Which DAQ device are you using? How do you have the sensors connected - which pins are you connecting to?
04-24-2009 06:24 AM
04-29-2009 05:34 AM
Hi Emile,
Sorry for the delay in getting back to you. The channel crosstalk that you are seeing is due to the connections you have made to the AI GND pins. By connecting up in this way, you have created a hybrid between differential and referenced single ended wiring modes. The connection to ground you are making allows the signal on one channel to transfer to the adjacent channel. So I would recommend removing the ground connections, and see how that goes.
For some further information on wiring modes, please see this devzone article: Field Wiring and Noise Considerations for Analog Signals
If you have any further questions, please post back.
05-06-2009 10:23 AM
Hi Emile,
How are you getting on? Were you able to solve the problem? If you have any further questions, please do post back.
All the best