02-04-2008 09:02 AM
Thanks for fielding all my questions, DF.
That's wonderful that HWS automatically chunks the data. I will definitely change the fetch chunk size. As far as writing to disk in a separate loop, using a queue is the best method to do that, right?
As an aside (and a background leading up to a question about VI design), right now I'm using a modified Producer/Consumer template and added two 'Generator' loops that handle either continuous monitoring & processing, or high bandwidth operations (like high speed acquisition or video) that shouldn't bog down the consumer loop. So right now I've got 4 loops: Producer, Consumer, Generator 1 (reading of a spindle speed & some processing), Generator 2 (niScope acquisition).
Generator 1 essentially runs mindlessly, but communication with Generator 2 is via a queue w/ the # of times and amount of data to acquire. In manual mode, the data is saved in the Consumer loop (since the data is stored in a hidden front panel variable), but 'auto' mode has the saving routines inside the Generator 2 loop. After thinking about it a bit, and after your last post, I'm considering gettting rid of all the saving routines in the Consumer and Generator 2 loops and puttting them into a third "De-Generator" loop that is dedicated to streaming info in a queue (which would include the HWS waveform ID) to disk. My question is, since I'd be generating data faster than I can send it to disk, will LabVIEW have conniptions when I start reaching the 16G limit of my RAM? I imagine it would and that some kind of communication regarding "done writing to disk" would be needed between the two loops. An occurrance or notifier, maybe?
02-04-2008 03:09 PM
02-04-2008 03:19 PM
02-05-2008 02:14 AM
02-05-2008 08:32 AM
06-18-2009 05:30 PM
I was reading this thread and this page http://zone.ni.com/devzone/cda/epd/p/id/5273 (NI-SCOPE Stream to Disk Using Win32 File IO) and am still a bit confused by the stream to disk operation. The application example "writes data to disk using the LabVIEW primitive Write to Binary File.vi". I am trying to adapt the "Array to Spreadsheet String" or "Write to Text File", and came up with this, which generates an error. Is there a special Win32 Open File, or am I missing something?
06-25-2009 04:37 PM
Hi Douglas,
I am interested in knowing what kind of error you are seeing, whether it may be coming from the File I/O operations or the NI-SCOPE functions. I could not tell from the picture, but I am also interested in knowing what function you are using to open the file before calling the Write to Text File VI. In the normal example that you would download at the page you linked, it does use a special Win32 Open File function, which is optimized by disabling Windows caching when writing to a binary file. This is the suggested method of streaming to disk since it will provide the least amount of overhead from the software when writing to the hard drive. However, this Win32 function should not be used when writing to a text file; instead, you would want to just use the standard LabVIEW Open/Create/Replace File primitive. Also, keep in mind that you will not be able to achieve high streaming rates from your device if you are streaming this data to a text file. If you need the data in a spreadsheet-type format, you may want to consider post-processing to read the binary file and convert the binary data to a spreadsheet, which is not going to be a time-dependent process.
I hope this helps, and please let me know if you have any additional information/details/questions. Regards,