12-18-2015 12:54 PM
Hi guys, I am preparing Labview codes for synchronized analogy reocording and playback. Specifically, I want to record for 6 seconds, while output sounds for 5 seconds. This means the analog output stop 1 second before the end the recording. In addition, I want to save the 6 second recording into 3 TDMS file (2 seconds each). However, I could not make my current codes work in the required way (attached). I have detected two problems that are beyond my skill.
1. "Some or all of the samples requested have not yet been acquired". This is weird, because I have already put the ''DAQmx Read'' function under the condition that only when there is sample to read.
2. Instead of saving the data to 3 TDMS files, only one file is generated.
I am appreciate any of your help. Thanks very much.
Solved! Go to Solution.
12-18-2015 01:52 PM
I can tell you why #2 is happening.
The error wire joins all of the functions together. If the DAQmx read throws an error, it passes down the line. The TDMS Write has LabVIEW's standard error functionality set so that it only executes in the event it has no incoming error.
So the issue relates back to #1. It is not obvious to me at the moment why you are getting that error. I'd suggest going back to simpler code and just try to get the DAQmx portion debugged before adding in the TDMS write code, particularly the DAQmx analog input section.
12-18-2015 03:08 PM - edited 12-18-2015 03:34 PM
@luojh135 wrote:
Hi guys, I am preparing Labview codes for synchronized analogy reocording and playback. Specifically, I want to record for 6 seconds, while output sounds for 5 seconds. This means the analog output stop 1 second before the end the recording. In addition, I want to save the 6 second recording into 3 TDMS file (2 seconds each). However, I could not make my current codes work in the required way (attached). I have detected two problems that are beyond my skill.
1. "Some or all of the samples requested have not yet been acquired". This is weird, because I have already put the ''DAQmx Read'' function under the condition that only when there is sample to read.
2. Instead of saving the data to 3 TDMS files, only one file is generated.
I am appreciate any of your help. Thanks very much.
You have a mess! (Sorry, but you do) Your code make little sense.
First, If you want to log data to a TDMS file from a DAQmx Task just do it! Enable Data Logging It will greatly simplify your Block Diagram to the point where some of the other issues become more obvious.
Now, Let's look at this section :
In this I can tell you used to be a text programmer. Those "Replace Array Subsets" actually boggle my mind! Why replace the first element of arrays full of zeros? and why is that one array of 5000 elements? It looks like you are putting 5000 Zeros on the front and back of some noise AND stuffing a 0.99 into the first element of an array of 5000 zeroes only to replace the array of one 0.99 and 4999 zeroes with an array of 5000 zeroes TWICE! (in case the first replace array subset didn't work? WWYT?) But, Back up a bit.... A Highpass Filter with fh = 11000 and fl = 8000?????
Backing up to the Help File we find:
So, What is that 110000 constant doing there? (Other than being ignored)
Back up a bit father and you a generating 1.25M points of gausian noise with a 0.1 Standard Deviation but the constant is labled rms. (Go fix that now before you confuse us any more!!!)
In all seriousness. I've seen worse but please fix up the obvious that I pointed out and we might be a lot more effective at helping with the subtle stuff that may still be wrong.
12-18-2015 03:18 PM
Dear Jeff, thanks very much for your help. Please forgive my naive: I am trying to build my first program with Labview. It is a frustrating process while switching from Matlab to Labview. The general problem I am experiencing is that I can't find systematic manual to learn through as compared when I was learning Matlab a few years ago.
It's really helpful that you pointed that I can directly log the data to the disk. I am working on it.
For your second point, it seems you did not finish it. Could you please explain me again for the missing part?