From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-24-2022 07:56 AM
Hello,
In my experiments, I measure different type of outputs with respect to given inputs. In the first figure, you can have some idea about the data output. This is only for one channel of the rig, I have up to 20 channels by using multiple test rigs. In the second figure, block diagram of save VI can be seen. Data are saved to normal file with intervals that I can decide. Experiments will continue couple of months -maybe even a year(s)-.
I was updating the VI scripts and could not decide whether I should stick the current saving format, or a different one e.g. tdms. All data will be further processed with respective softwares. The VI has an automatic control function as well. I am going to have lots of long data files. I do not want to lose any data point (only related with saving) and I need to access to the data file while the VI is working (currently I use notepad++ for that). Do you suggest me to switch tdms format?
05-24-2022 09:36 AM - edited 05-24-2022 09:50 AM
I have had long term tests running for over a year collecting >50 data points at 1 second intervals.
Frankly, I have found no need for anything more complex than a tab delimited text file.
I found it more important to create a new file daily to limit the file size and put the date in the file name so it's easy to go back and find data from a certain date.
Oh and a note about viewing data files while collecting data...
DON'T
I know this makes it easy to look at the data file while your program is running but...
It you have the data file open in Notepad++ or whatever at the same time LabVIEW tries to write to the file.
Your LabVIEW program will crash with a file sharing violation... (The file will be locked as it is open in Notepad++)
DO
Windows will lock the file so not other program can write to it.
If you need to view the file while your program is running.
Either make a copy and open the copy or most programs (like Excel) will notice the file lock and offer to open the file read only or open a copy automatically.
05-24-2022 11:54 AM
With the requirement for concurrent access I am going to recommend TDMS. You are just plain going to have better experience with having the measurment data as actual numeric data types than text anyway and any spreadsheet file will be far superior for analysis than any text editor.
As a bonus TDMS also can log events. Since you mentioned that there are automated controls as well logging changes and user comments as events can be a huge value add to the file.
05-25-2022 09:26 AM - edited 05-25-2022 09:28 AM
@JÞB wrote:
With the requirement for concurrent access I am going to recommend TDMS. You are just plain going to have better experience with having the measurment data as actual numeric data types than text anyway and any spreadsheet file will be far superior for analysis than any text editor.
As a bonus TDMS also can log events. Since you mentioned that there are automated controls as well logging changes and user comments as events can be a huge value add to the file.
You can write numeric data to a text file and open in in Excel for analysis just fine.
I have been doing it for >20 years
Where as proprietary file formats run the risk of corruption and loss of all data.
05-25-2022 10:37 AM - edited 05-25-2022 10:41 AM
@RTSLVU wrote:
@JÞB wrote:
With the requirement for concurrent access I am going to recommend TDMS. You are just plain going to have better experience with having the measurment data as actual numeric data types than text anyway and any spreadsheet file will be far superior for analysis than any text editor.
As a bonus TDMS also can log events. Since you mentioned that there are automated controls as well logging changes and user comments as events can be a huge value add to the file.
You can write numeric data to a text file and open in in Excel for analysis just fine.
I have been doing it for >20 years
Where as proprietary file formats run the risk of corruption and loss of all data.
Excel is a proprietary file format. TDMS is published. TDMS is made for test measurement data and allows concurrent access. txt and csv do not TDMS has an addon for Excel and several other free viewers. xlxs does not.
05-31-2022 08:41 AM - edited 05-31-2022 08:49 AM
@RTSLVU wrote:
I have had long term tests running for over a year collecting >50 data points at 1 second intervals.
Frankly, I have found no need for anything more complex than a tab delimited text file.
I found it more important to create a new file daily to limit the file size and put the date in the file name so it's easy to go back and find data from a certain date.
Oh and a note about viewing data files while collecting data...
DON'T
- Open the file
- Write a line of data
- Close the file
I know this makes it easy to look at the data file while your program is running but...
It you have the data file open in Notepad++ or whatever at the same time LabVIEW tries to write to the file.
Your LabVIEW program will crash with a file sharing violation... (The file will be locked as it is open in Notepad++)
DO
- Open your file at the beginning of your program
- Pass the File Reference around your loop with a shift register
- Write data as needed
- Close the file at the end of your program
Windows will lock the file so not other program can write to it.
If you need to view the file while your program is running.
Either make a copy and open the copy or most programs (like Excel) will notice the file lock and offer to open the file read only or open a copy automatically.
Thank you for the suggestion. One interesting note, I have never been encounter any error/crash or lost data by reading the data file with notepad++ while the vi is running. I tried your suggestion, currently, the vi creates a data file and then immediately starts writing (no open-close). Even with this option, I can still use notepad++ without any problem. Do I miss something?
05-31-2022 09:12 AM
In my experience, only EXCEL holds the opened file reference and causes an error whereas opening the file using Notepad or Notepad++ in parallel to your logger does not cause any sort of issue.
05-31-2022 09:20 AM
@charmelony_ wrote:
Thank you for the suggestion. One interesting note, I have never been encounter any error/crash or lost data by reading the data file with notepad++ while the vi is running. I tried your suggestion, currently, the vi creates a data file and then immediately starts writing (no open-close). Even with this option, I can still use notepad++ without any problem. Do I miss something?
Notepad++ and UltraEdit open the files without locking them. I'm not as familiar with Notepad++, but UltraEdit will check to see if the file has been updated when you reactivate the window and ask if you want to view the updated file. As long as you don't save through those interfaces, you are fine.
Where I have had issues before was opening test data files in Excel while running a test. Excel (and I assume Word) lock the files. This cause errors with my test. Granted, the data file was being opened, written, and closed for each new data line (not my design choice).
05-31-2022 10:09 AM
@crossrulz wrote:
@charmelony_ wrote:
Thank you for the suggestion. One interesting note, I have never been encounter any error/crash or lost data by reading the data file with notepad++ while the vi is running. I tried your suggestion, currently, the vi creates a data file and then immediately starts writing (no open-close). Even with this option, I can still use notepad++ without any problem. Do I miss something?Notepad++ and UltraEdit open the files without locking them. I'm not as familiar with Notepad++, but UltraEdit will check to see if the file has been updated when you reactivate the window and ask if you want to view the updated file. As long as you don't save through those interfaces, you are fine.
Based on your description of UltraEdit, Notepad++ also works the same way, whenever you switch the active window, it checks for modification and provides the option to reload the file.
06-01-2022 07:12 PM
Yes excel , word etc.. lock files,npp does not. It even has a tail function to watch active files and update as they are written.
For very long tests I agree with using text files and writing a new file daily but also maybe consider a database?
How robust are tdms files that don't get closed properly? That is an interesting point because long running tests are more likely to suffer a crash/power failure.