10-20-2014 02:32 AM
Hi!
We are trying to log data from an accoustic sensor using the open/write/close TDMS blocks. Problem is, we cant get it to write to new files for each measurement, or each time the program runs. For example using a date and time stamp on the filename.
Is there a simple solution to this? We're kinda new to LabVIEW, so any help would be appreciated! 🙂
10-20-2014 03:00 AM - edited 10-20-2014 03:01 AM
Hi Superjurg…,
create a filename on your own each time your program starts, maybe using FormatDateTimeString and BuildPath!
Wire this filepath to your TDMS save function.
That's pretty simple. When you're new to LabVIEW I recommend to take all those FREE online courses offered by NI on their website…
10-20-2014 05:15 AM
Thanks for the reply!
We'll try this out right away 🙂
10-20-2014 05:47 AM
We tried making a small VI just to try it out, but we keep getting the <Not a Path> error. I'm not sure what we're missing..
Could you, or anyone, take a look?
10-20-2014 05:49 AM
10-20-2014 05:55 AM
Can you spot anything from this image? 🙂
10-20-2014 05:59 AM
Hi Super,
right now you create a new filename each second…
- You should create file name before the loop starts. That way you only deal with the same filename as long as your loop runs.
- I would advise to use a more suitable format for your date/time string. Something like "%y%m%d-%H%M%S.tdms"…
- You should open the TDMS file before the loop starts and close it after the loop has finished. No need to open and close it in each iteration…
- What kind of filepath is generated and wired to TDMSOpen? Did you try to debug that?
10-20-2014 07:40 AM
Hi again!
We did what you said, and tinkered for a while and got it working, thanks! 🙂
10-20-2014 09:53 AM
Adding to Gerds comment, if you look at the output of the Get Date/Timestring-function, it'll result in 16:32, causing an invalid filename as you cant have colons in the name. You probably also want the seconds active, and you dont need the Get current time, as it's the default for the get date/time string.
Format into string is the solution. 🙂
/Y
10-20-2014 10:22 AM
Superjurg,
I was wondering with the way you presented your code in your picture that you post why you didn't see an error window pop up on the issue with the file name? Unless that was a bug for the LV version you are using?