ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create multiple Files in a common Folder

Hello LabView enthusiasts,

 

I use multiple sensors to measure the pressure in a room. I have a task to store the measured data in a csv- file. The storage of the data and its timestamp is possible by my written program. However, I don't want to enter the file path every time I open my program (because the task is extended by 30 additional sensors and this would be quite time-consuming). For this reason I considered to create a File in a folder when starting the program, in order to save time and make the programm more efficient.
Is it possible to generate several different files with different data in a common folder? 
Unfortunately I did not find a successful solution. Does anyone have an idea or a starting point how to solve this problem?

 

In the apendix the vi and one image of the programm with multiple sensors.

 

Thanks for any help!

 

Cheers 

Jason

Download All
0 Kudos
Message 1 of 7
(3,645 Views)

Hi Jason,

 

just as I wrote a minute ago here

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,605 Views)

Personally, I like to put Date/Time stamps in my data file names.  So I can use Format Into String and Build Path functions to create the file path that I need.



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 3 of 7
(3,581 Views)

@crossrulz wrote:

Personally, I like to put Date/Time stamps in my data file names.  So I can use Format Into String and Build Path functions to create the file path that I need.


That is usually a good idea.  And doing it in YY-MM-DD_HH:MM:SS format and the alphabetical sorting of the filenames will also coincide with chronological ordering.

0 Kudos
Message 4 of 7
(3,551 Views)

Hey Gerd,

 

unfortunetaly I have Labview 2013 which doesn t support the "Create File with Incrementing Suffix" Vi. Can I program it by myself or is it even possible??

 

Cheers

Jason

0 Kudos
Message 5 of 7
(3,474 Views)

Hi Jason,

 


@J_Print wrote:

unfortunetaly I have Labview 2013 which doesn t support the "Create File with Incrementing Suffix" Vi. Can I program it by myself or is it even possible??


Yes, you can program it for yourself!

Spoiler
ListFolders to get the current list of files, find the latest file, create a new filename based on your rules, create a new file…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 7
(3,467 Views)

@RavensFan wrote:

@crossrulz wrote:

Personally, I like to put Date/Time stamps in my data file names.  So I can use Format Into String and Build Path functions to create the file path that I need.


That is usually a good idea.  And doing it in YY-MM-DD_HH:MM:SS format and the alphabetical sorting of the filenames will also coincide with chronological ordering.


Just to close this loop...

I actually tend to use YYYY-MM-DD HH-MM-SS format.  Y2k (and Y3k) compliant!  It also makes it very obvious what is the year.  And, yes, the sorting is a bonus.  Here is a somewhat typical way I will create a log/report file path.



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
Message 7 of 7
(3,451 Views)