LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a new csv file for each measurement?

Solved!
Go to solution
Highlighted

Dear community,

 

I'm using a DMM+Switch setup (using NI example:  Switch - Scanning with a DMM - Handshaking (NI-SWITCH) .vi)

 

I would like to save a NEW csv file for each measuremnt (each item in the scan list). Is there a way to do that? I searched the forum but most topics are how to load multiple csv files. 

 

How do I set up the file name in this case? I want each csv file contains numbering like 101, 102, 103...but I cannot use %s or %d in the file path control box.

 

Thank you!

0 Kudos
Message 1 of 5
(243 Views)
Highlighted

Sure you can.  You use %d in a format into string, then build that into a file path.

 

For more help, attach the VI you have now so we can better guide you how to implement the changes.

0 Kudos
Message 2 of 5
(209 Views)
Highlighted

Hi thanks for confirming %d should work. I attach some screenshots here. Where should I put %d in the path? This VI is producing 4 values from DMM, say I want to create one csv file for each measurement. How do I do that?

 

Sample csv could be:

1.csv

|number 1|80|

 

2.csv

|number 2|90|

 

3.csv

...

4.csv

...

ylflex_1-1596166326005.png

 

 

ylflex_0-1596166290760.png

 

 

Also, how do I get the current route in the scan list, please?

 

Thank you,

 

Yanshu

 

 

0 Kudos
Message 3 of 5
(158 Views)
Highlighted
Solution
Accepted by topic author ylflex

Hi Yanshu,

 


@ylflex wrote:

Where should I put %d in the path? This VI is producing 4 values from DMM, say I want to create one csv file for each measurement. How do I do that?


As has been said before:

You use %d in a format into string, then build that into a file path.

I don't see any FormatIntoString function in your images:

 

Instead I see a whole bunch of Rube-Goldberg:

NEVER use ArrayToCluster followed by Unbundle when you can use a plain IndexArray function.

You don't need to call NumToFloat several times as it can handle an array as well!

That "separator" control should be a string constant…

 

Next time please post real code instead of images of code…

Best regards,
GerdW

using LV2011SP1 + LV2017 (+LV2020 sometimes) on Win10+cRIO
Download All
0 Kudos
Message 4 of 5
(145 Views)
Highlighted

Thanks a lot for this!

0 Kudos
Message 5 of 5
(96 Views)