07-11-2023 04:06 AM
I used the Write CSV file to save the data. When I open the saved CSV file during the measurement to see the collected data, it stops saving the data. Even if I close the CSV file, it does not save the data anymore.
What would be the reason?
Thanks
07-11-2023 05:24 AM
Maybe the program reading the file blocks write access to the file.
07-11-2023 08:49 AM
What did you open the CSV file in? I know Excel will lock the file so you cannot write to the file anymore. I will often look at data files while tests are running using Ultra Edit or Notepad++, which do not lock the file and will even give you the option to reload.
07-11-2023 08:53 AM - edited 07-11-2023 08:55 AM
Hi,
In Windows you can open a file as 'read-only'
If a file is opened in this way another application can still write to the file.
If you don't want to create it yourself you can use UltraEdit to view a file and still leave it open for additional writes by another source.
UltraEdit also detects if a file is changed.
Kees
Seems like Crossrulz uses the same tools ☺
07-11-2023 09:45 AM - edited 07-11-2023 09:47 AM
@inst_soleil wrote:
I used the Write CSV file to save the data. When I open the saved CSV file during the measurement to see the collected data, it stops saving the data. Even if I close the CSV file, it does not save the data anymore.
What would be the reason?
Thanks
The reason is Windows (like any operating system) will only allow one program to have a file open for writing at a time.
If another program tries to open a file for read/write access it causes a Sharing Violation
If you must open a file while your LabVIEW program has it open, you can only open it in Read Only mode or copy the file and open the copy.
07-11-2023 10:41 PM
I would probably try to use report generation toolkit if I wanted to look at the data while the test was running.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 Chronicles 7:14 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
07-12-2023 11:00 AM
Why aren't you getting an error about this? Are you implementing error handling?
07-12-2023 11:03 AM
@GRCK5000 wrote:
I would probably try to use report generation toolkit if I wanted to look at the data while the test was running.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 Chronicles 7:14 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Actually I would stay as far away from proprietary formats like MS Word/Excel. It seems like every time MS Office gets updated, something breaks in the RGT.🤔
Also, you don't need any special application to read a CSV file. Any text editor will do.
07-12-2023 11:27 AM
Ordinarily, when you open a file to read or write to it, you "lock" the file so that only your read (or write) can take place -- no-one else can open (and potentially mess with) the file you are using. In addition, reading (or writing) a file has three steps -- Open the file, do as many reads (or writes) as you want, then Close the file.
The Delimited Spreadsheet VIs behaving differently, especially Write, which does the following:
So mixing Reading and Writing Delimited Spreadsheet files is almost guaranteed to give you "something you didn't predict" and (for free!) "something you don't want".
Bob Schor
08-31-2023 05:18 AM
Dear All,
Thanks for all the responses, and sorry for being late to reply. I was away f rom work for a while.
It is true that the answer is reading the file from two different sources during the measurement. I know that I was saving the data in DAT format and I didnt have such an issue.
Cheers
i