09-10-2009 05:37 PM
Hi,
I would like to use LabVIEW 8.6 for acoustic measurements using MLS (Maximum Length Sequence) with a NI 4461
For this I have to send the sequence to the speaker and record simultaneously the response of the system with an IEPE microphone
I manage to do this separately, but not at the same time
Which program structure do I have to use to perform the analog output and analog input tasks simultaneously?
Would this be easier with a NI 4431?
Regards
Marc
09-10-2009 11:26 PM - edited 09-10-2009 11:27 PM
Hi,
you can achieve this if you use multi threading technique. To explain simply, first create a SubVI to Output your signal.
Call this VI dynamically and set "wit until done" to fale in the property node.
Then in sequencestart acquisition also.
one thing you need to take care is the input sampling rate and output update rate. you can not choose any number. There should be some relationship between both of them. generally itis "Multiple of powerof 2".........check for this board..........
09-11-2009 01:54 PM
Hi
The output/input have to take place simultaneously, not in sequence, and since we are interested in the frequency content, the samples have to be evenly spaced
The board is supposed to allow simultaneous analogue output/input there should be a way of doing this with LabVIEW, isn't it?
Regards
Marc
09-11-2009 02:04 PM
You will need to clock your data acquistion using the analog output.
Try looking at the example
"Multi-Function-Ctr Retrigg Pulse train Generation for AI Sample Clock.vi"
In your case you will get your clock form the AO (AO convert?).
Ben
09-11-2009 02:38 PM - edited 09-11-2009 02:43 PM
i should not have used the word "sequence".....
what i am tryng to say is..............you create a Sub VI for output and launch it dynamically in parallel with your main VI for data acquisition.........and use the same rate for acquisition and update........
I did work recently with NI 4431 for simultaneous analog input and output. This board requires you to take care of sampling rate and update rate..........if you take 2000Hz sampling rate, then your update rate can be 4000/8000/16000........but this board does not allow any rate for update.......this has some limitations......
51.2 kS/s 80 kS/s 96 kS/s
25.6 kS/s 40 kS/s 48 kS/s
12.8 kS/s 20 kS/s 24 kS/s
6.4 kS/s 10 kS/s 12 kS/s
3.2 kS/s 5 kS/s 6 kS/s
1.6 kS/s 2.5 kS/s 3 kS/s
800 S/s 1.25 kS/s 1.5 kS/s
you can not use any other update rate. So your acquisition rate is also limited to few number of choices........
09-11-2009 02:52 PM - edited 09-11-2009 02:54 PM
Edit!
The following was written while Anil was posting. I'll leave it intact for others.
Sorry Anil.
Hi Anil,
For stimulus vs response tests it is important to know exaclty what the stimulus was that solicited the measured response. In these cases you want to ensure that sample out element "0" goes with measured value element "0".
To pull this off we can use a single clock signal for both output and input. This can be done by configuring the analog input task to use an external clock source to do the analog to digital conversion. If the clock source for the AI is routed from the AO output clock (AO convert) then the analog to digital conversion happens at the same time the output is driven.
I used that approach for a Cyclic Voltametry app where we put probes in a rats brain and hits it with a quick positive followed by a negative spike. On the positive cycle we look at the current flow to determine the concentration of chemicals in the brain at the location the probe was inserted. We had to know exactly what the stimulus was when we made our measurements so we could tell which chemical was the cahrge carrier. It worked better than the end user ever imagined. he can actually watch dopamine come and go in a male rats brain when a female was introduced.
Yes the hardware clock config can be used and the rest of the work passed down to a background VI. But simply setting them both to the same sample rate is not going to let us corelate which value goes with which.
Just trying to help,
Ben
09-11-2009 03:08 PM
Hi Ben,
I was using this board for shaker excitation....so I used to launch shaker control module....and data acquisition module in parallel....This application is not that critical and it is for vibration training purposes........ I used to connect the output signal to shaker and one of the AI pins also. and shaker output to one more AI...and acquire the signal while generating..................I used to acquire both the signals generated signal and shaker response...and analyze them........
09-13-2009 04:34 AM
Hi Ben
Can you please send me the bit of code which used sothe clock from the AO output for the AI?
Thanks
marc
09-15-2009 08:13 AM
marc23 wrote:Hi Ben
Can you please send me the bit of code which used sothe clock from the AO output for the AI?
Thanks
marc
Sorry no. I'm on vacation miles away from that code.
Ben
09-18-2009 04:07 PM
Hi
Please let me know when you are back
Marc