I use DAQ 4461 to acquire sound pressure level from DUT and a ref mic. For the ref mic I use AI0 with the following config ( actually I use IEPE sensor)
After meas the output in pascal then I close this line and then I use AI Volatge input (AI1) to acquire the data from DUT. The first time I run the vi everything is fine but if I run the VI again AI.Microphone reading becomes very high with no reason. I have noticed if I disable the part for AI Voltage after few runs it will settle and show me the right value. I don't have this problem if I completely remove the AI Voltage part. I thought for this particular DAQ both lines are independent and can be run at the same time but I don't know why the AI Volateg run has effect on the reading for AI Microphone. Could you please help me with this?
You can se here the diff betwen first run and second and third ( As you can see the first run before AI1 run is fine) . I ahev also attached my code
Well, you got several issues before we can really help you...
First of all, please try to clean up your code. There are things in it which are hard to read without documentation, other (like the "first call" case around the timing VI of the microphone task) seem to be plainly wrong.
Second, the issue can be related to the code, but does not need to be. From your desciption, it can be a grounding issue, so essentially you are observing the load/unload behavior of a capacity.
So please make sure that the code explains in a simple way what (and why) you are doing and also check if external connections are done properly.
Hi Norbert , thank for your help and sorry the vi was not clean. I tried to clean the code
As you can se first I continuously generate a sine wave for 2 sec. After 1 sec delay I measure the ref mic output in pascal (AI Microphone) and then measure the output from DUT in voltage ( AI Volatege) and I still have that issue. Do you have any other suggestions than grounding issue?
I will invenstigate the grounding issue possibility, however I disconnected AI1 from the DUT board . so now just A0.0 generates the sine wave and AI0 acquire mic output amnd I still see this problem
Seems like the problem is switching from AI.Mic to AI.Voltage , somtimes I even hear a click
I would acquire in parallel both channels (ai0 and ai1) in a single task as the rate is the same.
Also, i would acquire the data as long as i generate data and then extract the data i want to have in detail. Point is, software timing is most often inaccurate so your "1s" delay most likely isn't ONE second. It's a bit more or a bit less...depending on the current execution and parallel running applications (e.g. virus scanner). Using hardware timing, i can very much rely on ONE second as accuracy of oscillators usually is somewhere in the range of hundreds of ppm (parts per million). So error is much less than %-range.....
If you turn on (or off) the IEPE supply, the input will make a ~10V step and curve you see (on the second graph of you first post) is (so I assume) the AC coupling decay from that step.
I can't open you vi's (Still at LV2012)
For repeat measurements with IEPE you should configure your task(s) once at the beginning , enter a loop, and close the task(s) once when finished.
Thanks Norbert and Henrik
I acquired them in parallel and I don't see that problem now.
The other problem I have is how to set the number of samples and sampling rate at different frequencies.
I use the same sampling rate and number samples for all the frequencies ( 200kS/s and 10000 samples) . These values are okay with the genrated frequency is 100, 200 , 1k or 10k Hz . At these frequencies the acquired sine wave is very clean . However if I generate a signal at 194 Hz then the acquired sine wave is very distoreted. How can I set the sampling rate for these frequencies?
What do you mean by "distorded"? How does that look like?
Also, adjusting sampling rate to (in most cases) unknown main frequency you want to measure is not easy. Because of that, in most cases, you define a maximum frequency you want to detect.
Following Nyquist, you double that rate and set that as minimum sampling frequency. In many cases, "oversampling" by a factor of 2-5 (so 4-10 times as fast as the maxmimum frequency you want to detect) is recommended to exam the shape of the signal, not only the frequency itself.
Also note that it is recommended to use hardware low pass filters which cut of with the maximum frequency to detect in order to prevent aliasing.
That being said, 200kHz is as perfect to sample 194Hz as any other frequency bigger something like 2kHz.
I assume that your "distortion" derives from insufficient number of samples, hence a low amount of periods in your data. Also note that if the sampling frequency is not an integer multiple of the frequency to detect, you will receive incomplete periods. Therefore, simply chaining finit acquired data next to each other will result in gaps and "jumps" of the signal.
You should consider to acquire continuous if you want a "clean" display of acquired data for a time period covering several seconds (to "open end").