LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cRio data logging too slow

Solved!
Go to solution

Hi,

I am using a cRio 9074 in scan mode and I have a fairly simple timed loop that should run at 5-10mSec periods to operate a pwm control. I also need to do some data logging and save two input signals (at approx. 1kS/sec). However, when I use write to spreadsheet, the loop speed drops and my timed loop period goes up to 50mSec. How can I speed this up, and what is the efficient way to save data in scan mode.

Thanks.

0 Kudos
Message 1 of 6
(3,733 Views)

Hi Soheil,

 

If the Write to Spreadsheet File.vi seems to be negatively affecting your determinism, then I would recommend utilizing a producer/consumer architecture and moving your File I/O functions to the non-time-critical consumer loop.

 

I hope this helps!

 

- Greg J

0 Kudos
Message 2 of 6
(3,717 Views)

The single best way to improve determinism is to divide your acquisition/logging into two distinct producer/consumer loops as VTHokie says. Next best improvement would probably be using a binary format file structure rather than Write to Spreadsheet, which converts all data to ASCII representation prior to writing to file. Writing to ASCII files rather than binary files degrades performance in four ways:

 

 

  1. CPU must be used to do the number to text conversion
  2. ASCII represented numbers lose precision and don't exactly convert back to original data
  3. The filesize is larger
  4. When you go to read the file, it's slower for the above three reasons
On the other hand, an ASCII file is more portable - e.g., you can easily import into a third-party spreadsheet analysis program. But who in their right mind would export data OUTSIDE of LabVIEW when it offers best-in-industry analysis tools?

 

0 Kudos
Message 3 of 6
(3,710 Views)
Solution
Accepted by topic author Soheil

Hi Soheil,

 

You might want to check out the community example I have found regarding producer/consumer loops.

It could come in quite helpful.

 

http://decibel.ni.com/content/docs/DOC-2431

 

Any problems let me know.

 

Kind Regards

Michael
NIUK Application Engineer
0 Kudos
Message 4 of 6
(3,698 Views)

Thanks all.

I am trying the producer/Consumer method and will keep you posted on the outcome.

Thanks,

Soheil


0 Kudos
Message 5 of 6
(3,685 Views)

Thanks all.

 

The producer consumer method worked fine. I even tried the TDMS method but that was too slow too.

 

 

0 Kudos
Message 6 of 6
(3,669 Views)