01-19-2011 12:09 PM
Hi,
I am a beginner of Labview programming. I am trying to get signal from monochromator and plot it with real time. Since the signal is very noise, I planed to average it for every 3000 data points using mean function and set number of samples as 3000 in DAQmx Read. Then I sent the averaged signal to both waveform chart and write to file. I used the property node to control the maximum value of X-axis and tried to make it as real time by using the x-axis multiplier. My question is that, how is the value I set for the X-axis maximum corresponding to the X-axis range appeared on the chart? Is the unit of the value which I set in second? I set multiplier around 2.4 which gave me about the right real time, however my sampling rate should be much faster than that. How can I know my actual sampling rate? Can anyone have the answer for this?
Vi is attached.
Thanks,
--
Weiye
01-20-2011 07:07 PM
Weiye,
How many samples per second are you pulling? What is happening is that you are pulling off batches of sequential samples, averaging them, and returning a single number to the chart. Is this what you are trying to do?
Regards from Austin,
01-20-2011 10:24 PM
Ben,
Thank you for your reply. Yes, that's what I want. The A/D board I am using is SCB-68, E-series. The board is 12 bit. I don't know which model is it in E-series. I supposed that it is using the fastest sampling rate. If I set the number of samples as 3000 in DAQmx Read function, does it average these 3000 samples into one data point? I have ~20 data points/second after averaging using 3000. If so, sampling rate is 3000*20=6E4 sample/sec.
Thanks,
--
Weiye
01-21-2011 11:06 AM
Weiye,
Try throwing a DAQmx Timing VI in there so you can ensure your sampling speed.
Regards from Austin,
01-21-2011 03:11 PM
Ben,
I put the Timing VI just before the while loop and set rate as 3000 sample/sec. I also set "numbers of sample" in Read VI as 3000, which will give me one sample per second after averaging. However, when I run the program, I was given some error message about Timing VI: "Specified property cannot be set while task is running" What did I do wrong?...
I have another basic question about DAQmx Read. What is the difference between "multiple sample in single channel" and "single sample in single channel"?
Thanks,
--
Weiye
01-21-2011 08:52 PM
Sounds like you did not look at any of the numerous examples that come with LabVIEW. You probaly put the timing function after the start task instead of before.
Multiple means more than one. That is what happens when you specify 3000 samples. Single means one sample.
01-24-2011 09:45 AM
Thanks for replying. I put the clock in front of the start VI. It works.However the program stopped running and show the error message “Measurements: Attempted to read a sample beyond the final sample acquired. The acquisition has stopped, therefore the sample specified by the combination of position and offset will never be available.” No matter what number I input, the error message always pop up. Do you know what happened?
Thanks,
--
Weiye
01-25-2011 03:47 PM
Weiye,
I would recommend uploading the new VI with every post so we can help you more.
Regards,
01-25-2011 04:09 PM
Ben,
The updated VI is attached.
Thanks,
--
Weiye
01-25-2011 09:46 PM
What's missing is selected sample rate and number of samples. One would hope that the number of samples is less than the rate.
Also, you don't need a control for the multiplier. You just divide the number of samples by the rate. For example, if you have a sample rate of 1000 S/sec and request 500 samples, the multiplier is .5.