05-19-2014 07:33 AM - edited 05-19-2014 07:34 AM
Hey swap15,
I guess, performance could be the drawback.
From the LabVIEW Help:
(http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/using_advanced_file_io/)
You also can use File I/O functions for disk streaming operations, which save memory resources by reducing the number of times the function interacts with the operating system to open and close the file. Disk streaming is a technique for keeping files open while you perform multiple write operations, for example, within a loop.
Wiring a path control or a constant to the Write to Text File function, the Write to Binary File function, or the Write To Spreadsheet File VI adds the overhead of opening and closing the file each time the function or VI executes. VIs can be more efficient if you avoid opening and closing the same files frequently.
To create a typical disk-streaming operation, place the Open/Create/Replace File function before a loop, the read or write function in the loop, and the Close File function after the loop so continuous writing to a file can occur within the loop without the overhead associated with opening and closing the file in each iteration.
Disk streaming is ideal in lengthy data acquisition operations where speed is critical. You can write data continuously to a file while acquisition is still in progress.....
In addition I would avoid the variable x+1. You could shift the value through the while-loop, this would avoid the feedback node too.
The selector wired to the case selector is indeed redundant.
And one final question:
What happens with the file reference if you shut down your program?
Closed or not?
Regards,
CMW..
05-19-2014 07:55 AM
hey,
thanks for the info. No, the file reference is not closed.
Just for your info:
My main purpose is I am using this code (complete code as shown in previously attached pic) for simultaneously acquiring data from 10 sensors and logging resective data in individual files. So each sensor will have seperate file name appended with 0,1,2...and so after a specific file size.
05-19-2014 08:03 AM
Hey swap,
I know your purpose from you previous Post.
Regards,
CMW
05-19-2014 08:42 AM
OK, so I am going to ask....
Why code this at all when Write to measurements file express vi coded it for you?
05-19-2014 08:57 AM
That's a good question....
...the point is, I don't like Express VIs. (even if they have the right to exist)
05-19-2014 09:06 AM
@CMW.. wrote:
That's a good question....
...the point is, I don't like Express VIs. (even if they have the right to exist)
Niether do I .... for the most part. Write to measurement file and Elapsed time do pretty good jobs though! Express vi.s are not evil. Those two in particular will find themselves on my block diagrams now and then when warented.