Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Rate specified is not the rate at which data is logged.

I have a collection of analog data that I am trying to read and log (NI 9201, NI 9221, NI 9215, and NI 9211) on the NI 9012 CompactRIO and the NI 9101 Backplane.  The data is being read fine, but not at the rate I stated within the *.vi's.  I am trying to log this to an *.lvm measurement file so the data can be analyzed at a later date.  It may be working at the correct rate in the FPGA, but the *.lvm measurement file timestamp is not consistent with any of the rates that I stated.  What can be done to enhance the speed of collection to the rate I am asking for?  Attached below are the *.vi's used and a sample *.lvm output file.

 

Thanks.

Download All
0 Kudos
Message 1 of 2
(3,066 Views)

Hi Vlee,

 

The source of your problem is the Write to Measurement File ExpressVI.  It is not able to execute in the 100ms time frame that you want.  Every time your code gets to this VI it opens a reference write to the file and close the reference (and probably some other things).  This process is not happening before the next 100ms multiple.

 

This is the perfect case for a producer consumer loop architecture.  There is a pretty good example using RT FIFOs here.  You can also look at this example to see a more efficient way of writing to a file in the producer consumer loop.

 

I would also suggest using timed loops to control the timing and setting the producer loop to a higher priority.

Additional reading

 

Let me know if you have any questions

Justin Parker
National Instruments
Product Support Engineer
Message 2 of 2
(3,044 Views)