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: 

How to input different files in a loop

Hello!

 

Currently, my VI plots out result based on my measurement which comes in the form of a csv file. The picture i attached reads the csv file into a subVI to generate the result. As i would like to plot the result of multiple csv files, what i can get this objective going is to read individual csv file into individual similiar subVI and combine to get the result.

 

Therefore, I would like to have multiple csv files generated into a loop with a single subVI to process my measurement, how do i go about creating the loop and reading the different files?

0 Kudos
Message 1 of 7
(3,888 Views)

Hi etedwin,

 

you seem to read just one row from each file…

 

- I would put those rows into an array (when they have different length  I would use an array of cluster of array).

- Then I would call this subVI with the array containing all rows and additionally a parameter describing which rows to use for calculations…

 

<sarcasm> You don't like to use AutoCleanup before uploading images of your VI? You understand LabVIEW code much better with hidden and bended wires all over?</sarcasm>

Best regards,
GerdW


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

Sounds like a simple FOR loop to me.  Just put your files into a array and autoindex on that array.  You can also autoindex the output to create the output arrays as well.



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

 Hi crossrulz,

 

which are the files are you referring for me to put into an array?

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

@etedwin wrote:

 

which are the files are you referring for me to put into an array?


 

Create an array of filenames and autoindex that array on a FOR loop that operates on one file per iteration.

Message 5 of 7
(3,807 Views)

Hi altenbach,

 

I think i have gotten it. I have my results in! Attached the picture as shown

0 Kudos
Message 6 of 7
(3,804 Views)

@etedwin wrote:

 

I think i have gotten it. I have my results in! Attached the picture as shown

MultipleFilesLoop


That code makes absolutely no sense! Everything belongs into one loop. Your blue-green code in the upper left is not even used, delete it! You don't have an array of file names as suggested. It makes no sense to create a 3D array. Do all files have arrays of the same dimension? Are you really trying to read zero rows?

 

Please attach your VI instead of pictures. Also include a few datafiles.

0 Kudos
Message 7 of 7
(3,800 Views)