03-10-2016 11:43 PM
Hi all,
I have a problem when I want to use the +10V Analog input of myRIO1900 to sample a high speed valve displacement signal ( +10V Analog signal).
I need the sample rate at least 50kS/s (20us time segment betwee two sample data). According to the myRIO specifications the Analog Input has an Aggregate sample rate at 500kS/s, which means that should be fast enough for me.
I used a timed loop in my code and set the timing source 1MHz, period 20us (which I need). However, in my LabVIEW code I can only get aroud 3ms (333kS/s) time segment (delta t) between two sample data, see attached .xls file, which comes from the 'write to measurement file' function. I'm not sure whether this is a problem of the data recording when I use the 'write to measurement file' function, since the time stamp (delta t) of the 'write to measurement file' is different from the time stamp (delta t) of the data which I export from the waveform chart. But I do need to use the 'write to measurement file' function to record the real time data.
So how can I figure out what sample rate exactly I get for the data? If not that fast how can I do it? Is the unit of time s or ms for the write to file data?
Attachments are my project file, the write to measurement file(.xls), and the exported data file (.xls) from the waveform chart.
I appreciat it very much if someone can give me some suggestion since I'm a beginner to myRIO and not that familiar with LabVIEW code.
Thanks in advance.
Huan
Solved! Go to Solution.
03-11-2016 04:05 PM
You don't have to abandon using the Write to Measurement File however I don't think it should be in your time critical loop. I would use a producer-consumer architecture (see here: http://www.ni.com/white-paper/3023/en/ ) to use a non-time critical/lower priority loop (or just a regular while loop) to handle the data logging to an .xls file. You can communicate data between loops through various methods however a regular queue should work for your application.
03-13-2016 05:16 PM - edited 03-13-2016 05:43 PM
Hi,
Sorry about my delay reply. Thanks very much for your advise.
I've tried the producer-consumer architechture. I used timed loop in the producer loop and tried both the while loop and timed loop for the consumer loop, while the results kept the same. I can still only get 10ms time difference between two sample data points, i.e. 100S/s sample rate. It's still far away from my requirment 50kS/s. And I noticed that the data from 'Write to Measurement File' and that exported from the Waveform Chart have the same sample rate.
A new prolem is that the time column (X_Value) all became 0 in my .xls file from 'Write to Measurement File'. I can tell the time difference because my input analog signal is a periodic signal, which has a cycling period of 100ms. I got 10 points for each cycle so the sample rate is 10Samples/0.1sec=100S/s.
I've attached my project with producer-consumer architechture and the data file below. Would you please help to have a look at it and tell me what's the poblem? I appreciate it so much.
Thank you!
Huan
03-13-2016 05:46 PM
Sorry I forgot to attach the project file. I will attach all the files again.
03-14-2016 01:11 PM
Since you are using a single sample analog input VI, you are essentially software timing your acquisition (which is in timed by your timed loop). This is adequate for lower sample rates, however since you are trying to acheive high sampling rates, you should be using the Analog Input Express VI . See here for more info why: http://zone.ni.com/reference/en-XX/help/373925C-01/myriohelp/myrio_one_sample_n_samples/