06-24-2010 06:57 AM
Hi, I am trying to compare different thermocouples/temperature measuring devices. I have a little experience with labview but not too much. I wanted to know if I am approaching this problem the right way. My supposedly complete data set of temperature seems incomplete when I plot it in my "difference" and "corrected" plots.
There are right now two sources of analog data. I am trying to compile all the data into an array then find the difference between the two data channels, take a best fit and correct the second data channel so that the two channels of data have almost no offset bewteen them. I am using Labview 8.6. I've attached the vi below.
Thank you for any help or advice you may be able to offer. Also occasionally a error pops up when I tried to troubleshoot with the highlight excecution. It says that the data is no longer available.
Thanks
06-24-2010 08:01 AM - edited 06-24-2010 08:02 AM
What exactly is your question? What isn't working on your VI?
Regarding the error, when Highlight Execution is on, the loop runs so slow that the buffer is read dry before the next loop comes around. You can observe this by putting a DAQmx Read Property Node in your loop, and read the AvailSampPerChan and the TotalSampPerChanAcquired.
You are taking very few samples and waiting a long time for them to come in. At a rate of 10 (S/s) and asking for 50 samples, it takes your loop 5 seconds to complete. Why so few samples? You can take hundereds of samples, even a thousand, then take a Mean of those samples and you would not need filtering.
06-24-2010 08:11 AM
Sorry I wasn't clear. My plot of the array data outside the loop doesn't seem to reflect all of the data taken even though I have the shift registers and the "insert into array". Is that the right way to output all the data together in an array that I can manipulate?
I don't know why it goes back to 10 as a default for samples, I had something like a 500 before when I was running it. When I put it to 100 it doesn't seem to like it though. lol.
And I thought that my filter was averaging the data values?
Thanks,
Arthur J.
06-24-2010 09:11 AM
Yes, your data will be on that S/R output, but you are only taking the first two waveforms out of all that data!
Further, building an array like that in a loop is not good memory management. How many iterations do you expect to run that loop? It's best to preallocate an array with X elements and use Replace Array Subset.
06-25-2010 02:56 AM
I meant to index out the waveforms individually, not the first two waveforms. How do I select the two waveforms in the array instead?
And for the predetermined size array, i was thinking about that originally because I do remember reading on the forum that this type of ever-increasing array isn't great for memory. But, I wasn't sure how to deal with the situation if the alloted array size is exceeded, such as what if the person wants a few more data points?
Thanks alot for your help,
Arthur J.
06-25-2010 04:20 PM
Hi Arthur,
Here's another way that you could merge your waveforms.
The blue subVIs simply generate an array with two waveforms within it. In your code you initialize the shift register with a blank array of waveforms. This won't directly work with the above code but you simply need to assign a t0 and dt on the first iteration. This is not the most efficient way of doing this but it should work for you.
I hope this helps!