06-29-2010 06:37 AM
Hi I am trying to save all of my waveform data in one file. I have two analog inputs, one temperature and one voltage. I can't figure out how to put all the while loop iteration's waveform data together into 1 array. I tried using the append waveforms because I saw that as a possible solution in some other posts, but I couldn't get it to output. then I tried replace array, but it still returns a empty array to write. But, I put a little array indicator and I can see the data going into the replace array vi.
Is there something wrong with the size of my initialized array, or just the way the program is structured? Could someone help me on this. I have Labview 8.6.
I want to be able to have the data together so that I can work with it in excel or matlab later on.
Thanks,
Arthur J.
06-30-2010 01:22 PM
Instead of the replace array subset you should use the build array function. The replace array subset only works if you already have data in the array. You are starting your loop with an empty array.
07-01-2010 09:56 AM
I was told that wasn't a great use of memory, thats why I changed my original build array. But, I got around that issue. I can just write the the file within the loop, then I don't have to worry about one array having all my data for me.
But, I've run into another issue that I was wondering if someone would be able to help me out with.
I've attached my updated vi here. I have the data being collected and written the way I want I believe. But, I'm getting quite a bit or high frequency noise in the signals. I tried introducing a lowpass filter to reduce it but I get this error that the cut off frequency needs to be less than half of my sampling frequency. I'm collecting 1k samples at 10K, and I set my filter to only 50 hz but it still comes up as an error.
Or is there a better/alternative way to get a signal with less noise?
Thanks,
Arthur J.
07-02-2010 02:52 PM
It looks like the data type is the problem here. By reading the data as a Double array, you are not storign any time values with the data. Therefore your Sampling frequency is nonexistant where the filter is concerned. You have to change your Read VI to output a waveform which stores the t0 and dt along with the rest of the data. You can then wire this directly to the Filter VI (skip the To Dynamic Data node, you don't need it) and you should be set.
07-05-2010 02:49 AM
Thank you for the input. But, I just tried that and it still gives me the same error. I tried placing the filter before indexing the waveform and after but neither seems to be correct. I've attached my updated vi in waveform mode.
Is there something else that I'm not seeing that could be preventing me from using a filter?
Thanks
Arthur J.
07-07-2010 03:41 PM
What error are you getting? What did the explanation suggest?
07-08-2010 02:08 AM
Sorry I thought I mentioned it before. The error occurs in the filter which I have set to low pass. It says "The cut-off frequency, fc, must meet: 0 < f_low < f_high < fs/2. I've seen the error before and corrected it in other vi's, just by staying under 1/2 my sampling rate. But in this case I can't seem to figure out how to apply a filter correctly.
I'm collecting 1k samples at a 10K rate, and even setting the low pass to 50hz returns that error.
Thanks,
Arthur J.
07-08-2010 05:47 PM
Something strange is happening when you acquire multiple channels and then index the array. I noticed that if you change the DAQmx read to a single channel, or simply wire the multiple channels directly to the filter VI, it works like a charm. It still seems that by modifying that data type you are stripping the time value from the data.