04-14-2016 11:30 AM
I want to save my measurment data, and access it while the test is running. To prevent file issues I generally create a copy of the file and work with the copy while the test is running; my file's are .csv.
My question is does anyone have a more elegant approach to viewing the same data file you are writing to?
Thanks
Solved! Go to Solution.
04-14-2016 11:39 AM - edited 04-14-2016 11:42 AM
You have to use the low level file VI's that pass a file reference, not the write to file Express VI or Write to Spreadsheet file VI
Once you open a file using Open/Create that file is locked for access.
Now if you try to open that file with Excel you can open it in read only mode and LabVIEW can still write to the file.
04-14-2016 11:46 AM - edited 04-14-2016 11:54 AM
Here are some examples
Open a file (pops up a file dialog box) and write the column headers
Write numeric data to file
And of course you have to close the file when you exit
04-14-2016 12:43 PM
After you open a file, you can allow access by other application using this function. Just "deny write only", for example, allowing read access by other applications.
I would stay away from *.csv because it can cause problems in localities that use a comma as decimal delimiter or if one of the header fields contans a comma. I would use tab delimited text files.
Much easier would be to use an array of header strings and "array to spreadsheet string" . Much less wiring! 😄
04-14-2016 01:06 PM
@altenbach wrote:After you open a file, you can allow access by other application using this function. Just "deny write only", for example, allowing read access by other applications.
I would stay away from *.csv because it can cause problems in localities that use a comma as decimal delimiter or if one of the header fields contans a comma. I would use tab delimited text files.
Much easier would be to use an array of header strings and "array to spreadsheet string" . Much less wiring! 😄
Yeah, I know but these things always start out small, just a couple columns, and grow from there adding one or two more at a time.
If I had started out with this many colums I probably would not have done it this way.
Also I have not found a need to use the Deny Access since the default is to allow read and deny write access when you open a file this way.
04-14-2016 02:00 PM
@LabviewNerd wrote:I want to save my measurment data, and access it while the test is running.
Access it in what way? Often what I do is have a single loop that is generating the data and then use multiple queues or a single User Event to send the data to different loops. One loop could be just for viewing the data and another for logging.