LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Create a new csv file for each measurement?

Solved!
Go to solution

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
(2,610 Views)

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
(2,576 Views)

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
(2,525 Views)
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 LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Download All
0 Kudos
Message 4 of 5
(2,512 Views)

Thanks a lot for this!

0 Kudos
Message 5 of 5
(2,463 Views)