12-08-2004 06:25 PM
I have not timed the thing at all. The file-writing of the real thing is not written yet. I am looking to avoid things that I know are time-consuming (and memory consuming), such as the unnecessary-copying syndrome.
If writing the file was all I had going on, I wouldn't worry about it. But I have TCP connections and other data collection and screen updates to keep going while this is happening. So anything I can do to save time contributes to the betterment of the whole system.
Plus there's the fact that it's just a mystery. I have noted before that the type of a VALUE property is different from the type of a terminal, if the control is a typedef. I don't know why.
Another question that comes to me is: Is this the best way to do it? If the write-it-all-as-one-big-chunk hogs the CPU for this two seconds or whatever and starves other threads, maybe I should find another way to get it done.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-08-2004 06:39 PM
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-08-2004 06:57 PM
A fair question, but the buffer allocation tool shows that a buffer is created, so it thinks it needs to.
The NEW FILE function needs to know only the data-type, but the property node doesn't necessarily know that.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-09-2004 08:43 AM
12-09-2004 09:01 AM
The implication is that this is a universal fact. As we have seen, it apparently is not true in this case, for reasons I don't understand.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
12-09-2004 09:10 AM
I have, in the past, used "hybrid" files. I created the file as a datalog file, wrote the header stuff as a cluster and closed the file. Then I opened the SAME FILE as a bytestream file, skipped to offset X (past any possible header stuff), and wrote data as a bytestream.
I handled all the calculations of where sample #X of channel # Y were in the file. It gave me several advantages: only the correct files appeared in the file-selection dialogs, simple file I/O (for the header, anyway), keeping all data in one file, not having to assemble all the data into one huge array.
It worked great, EXCEPT:
When NI changed the format of their datalog files (between LV4-5 and again between LV5-6, IIRC), they provided a converter to read the file and rewrite it in the new internal format. Of course, the converter knew nothing about my hybrid files, and truncated the data portion. But I built a converter of my own to handle that.
Blog for (mostly LabVIEW) programmers: Tips And Tricks