LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving data while viewing data

Solved!
Go to solution

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

 

 

 

 

 

0 Kudos
Message 1 of 6
(3,734 Views)

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. 

========================
=== Engineer Ambiguously ===
========================
Message 2 of 6
(3,729 Views)
Solution
Accepted by topic author Erickey

Here are some examples

 

Open a file (pops up a file dialog box) and write the column headers

F1.PNG

 

Write numeric data to file

F2.PNG

 

And of course you have to close the file when you exit

 

F3.PNG

========================
=== Engineer Ambiguously ===
========================
Message 3 of 6
(3,716 Views)

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! 😄

0 Kudos
Message 4 of 6
(3,690 Views)

@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.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 6
(3,673 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 6
(3,663 Views)