05-19-2010 02:43 PM - edited 05-19-2010 02:44 PM
Hello,
I'm having a bit of trouble with data resolution when taking voltage measurements from my photodiode. I have been collecting data at about 1 point per ms and I need to be collecting at a resolution greater than this (however my actual needed resolution is not yet known as the signal is currently buried due to resolution problems). I'm currently using labview version 8.6 to collect data from a ThorLabs PDA36A amplified photodetector (resolution of 17MHz) running to a NI BNC-2110 and then to a PCI-6143 card with a 250kHz resolution. I've attached the code below.
The one item of interest that I have noted is that I am able to select the frequency of data collection in the DAQmx_read.vi properties however whenever I run the code all it spits out is one point per ms. With any frequency higher than 1kHz (which is the default) the data output occasionally puts 5-6 data points at one time each time being on ms apart.
Any help will be appreciated.
P.S. I've attached both files which I use to check our data. The Light Sensor is the file that collects the data, the Read File file just spits out a graph after I've saved the information. I've tried to speed this code up as much as possible and am now convinced code speed is no longer an issue and that the problem lies elsewhere.
05-19-2010 08:55 PM
I don't know where you might be setting the properties for the DAQmx Read. There's certainly nothing in your code. In any case, it does not matter what you set the sample rate to because you are ignoring it by using the 1 Sample read mode. You are using software timed acquisition. To actually use the
DAQ card's sample clock, you must use N Samples mode.
05-20-2010 01:13 PM
Thanks for the reply, as you can see I'm still getting used to programming in LabView.
I've placed the DAQmx_Timing.vi in the code before the read function and have a control set for the rate of samples yet no matter how high I set it it's still giving me one sample per ms. I've tried the multiple samples option in the read function but when it ouputs I get a massive amount of multicolored lines and no discernable data.
05-20-2010 01:51 PM
Can't really comment since you did not post your modified code. I would suggest you read the tutorials at the DAQmx Getting Started and in LabVIEW, go to Help>Find Examples. Open the Hardware Input & Output>DAQmx>Analog Measurements>Voltage. Start with one of the simple examples such as "Cont Acq&Graph Voltage-Int Clk" and then look at the examples that demonstrate how to save the data.
p.s. Did not notice in your original VI that you had the chart outside the loop. Wrong place. You should also look at the free LabVIEW tutorials.
05-21-2010 04:38 AM
And while we are at it: If you sample with 1kHz but your signal can be as high as 17MHz you should add a anti aliasing filter with 470Hz (maybe the TIA has a lowpass filter setting).
05-24-2010 09:24 AM
Well I've re-written the code entirely. I used a sample I found on the NI website. This was working great up until I changed something small and now I'm only getting one sample every time I run the program. I cannot figure out why I'm only getting one sample no matter which settings I change but perhaps you can see the error in my ways.
Also, I want the chart to be outside the loop so that it plots after the data is collected so that it runs faster (or so my advisor says).
05-24-2010 10:17 AM
05-25-2010 12:37 PM
Alright, this might just be the last question. I've rewritten the code a couple times, I've gotten it to do what I need however I'm not sure how to get a time output with each data point. I need this to check that each point is indeed under the 1ms threshold.
Code is attached.
05-25-2010 03:44 PM
On your DAQmx Timing vi, you need to specify the source input to Onboard Clock. Otherwise you have no timing source. On your DAQmx Read vi, set the polymorphic selector to Single Channel - Multiple Samples - Waveform. Then use the Get Waveform Components to get dt. This gives the time interval between samples. You can use the same Get Waveform Components to get Y, which is the same 1D array of data as you get in your original code.
If you use the Waveform data type, you can wire it directly to a Waveform Graph and eliminate the top loop altogether.