Jump to content

Streaming Data to Disk with LVRT


Recommended Posts

I need to stream a lot of data to disk quickly with a LVRT system running on PXI. The data is being acquired at up to 5kHz from my DAQ card of about 350 channels. (So, if all the data was SGL's, it's up to 7 MB/sec)

Right now, I have my data aquisition running in a timed loop and writing the data to RT FIFOs. The FIFOs are then read by a consumer loop which will write the data to files.

My question is -- What's the best way to write this data to file to make sure that the rest of my application doesn't die? I can write in pure binary, but I know that I need to wait for 512-byte chunks. What about TDMS? Since the 'S' stands for streaming, is this optimized for streaming data to disk? Will it automatically do the 512-byte chunks for me?

Has anyone had luck with TDMS and fast data? Can you share any experiences?

Thanks for all your help!

Link to comment
About writting file on HD my experience is to use firewire HD (you need a firewire PXI Board) in place to write on the PXI HD. I use this with LV7.1 on PXI-8187. CPU load dicrease significantly...

hope this help you...

Hi Jeff,

i had a lot of problems with writing to disk in LVRT 7.x destroying the determinism of my application, and finally just started streaming the data to my host program. However, I recently upgraded to LVRT 8.2, and now, using the same code, I have no problems streaming data directly to the hard drive of my RT controller.

Link to comment
Hi Jeff,

i had a lot of problems with writing to disk in LVRT 7.x destroying the determinism of my application, and finally just started streaming the data to my host program. However, I recently upgraded to LVRT 8.2, and now, using the same code, I have no problems streaming data directly to the hard drive of my RT controller.

I seem to remember reading somewhere that the file write functions now (LV 8.2 ?) automatically take care of the 512 byte chunking before writing to file.. maybe that is contributing to a more efficienct file read and write.

Neville.

Link to comment
  • 2 weeks later...
You might want to have a look at http://forums.lavag.org/index.php?s=&s...ost&p=23027.

Herbert

Thanks, Herbert! It sounds like TDMS may be a good choice, since I'm just writing 2D numeric arrays.

Curious... with TDMS, should I still save up data so it's a multiple of 512 for a faster disk write? Also, would you suggest open/write/close for every time I write to the file, or a open/close once at the beginning and end and then many write/flushes in between?

Thanks again!

Link to comment

Jeff,

the 512 thing is something I cannot really confirm, since there's several "sweet spots" for chunk sizes that are floating around (the one I hear most often is 65535). Since we still add several bytes of index information every time we write, you would also need to use a different value to exactly hit 512. In general, I would rather use large data chunks to lower the number of times you access the disc.

I would clearly recommend to open the file, then keep writing and finally closing it. The performance of opening the file does slightly decrease with the file size, because we're setting up index information for random access when we're opening a file. Flushing is something you only need if you have to make absolutely sure that all data you have acquired is on disc even in case of a complete system failure. Otherwise, just using TDMS Write will be perfectly sufficient.

Hope that helps,

Herbert

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.