03-03-2014 01:45 PM
Hi, I am adquiring data from a proccess in real time, I want to create TDMS files every five minuts, my problem is how rename the file every iteration and if it is possible to do with a while loop.
03-03-2014 07:17 PM
Hi Leon27,
Do you have the VI code? What is the name of the files you want to recreate?
Presuming that you want to programmatically create a new file for every 15 mins, it is possible. You'll need to use a combination of shift registers (to hold previous values), while loop, case structure (if else conditions) and a timer to trigger the condition.
You can find the example here: https://decibel.ni.com/content/docs/DOC-22640
Warmest regards,
Lennard.C
03-04-2014 09:02 AM
Hi, Lennard.
I am sending you an image from my VI´s code. Yesterday I could achieve to create a file every 5000 samples, but the file is overwriting every iteration, I will review the information you sent me.
Thanks.
03-04-2014 09:14 AM
You should use the GetDateTime VI in conjunction with FormatDateTimeString to build unique file names
the format string %Y%m%d%H%M%S gives a one second resolution which should be good enough
don't forget the open/close file handling
03-04-2014 10:11 AM
Leon27 wrote: but the file is overwriting every iteration
That is because you never change the file name. As was stated earlier, using the Date/Time to build an unique file name is a good route to go. The other option is to put the loop index number in the file name.
03-04-2014 11:08 AM
Hi, Lennard.
With base on your code I could resolve my problem.
thanks.
03-04-2014 11:26 AM
Crossrulz and Christian_w,
thanks for your opinion, now I am trying to prove your comments.