09-14-2017 10:24 AM
Hi Everyone,
I want to write a vi to systematically open text files in a folder, count the cumulative sum of numbers in a particular collumn, write this value to an array and then open the next text file. How can I code this in labview?
Many thanks,
Sam
Solved! Go to Solution.
09-14-2017 10:33 AM
Hi sw,
you should use several functions found in the file palette like ListFolder and ReadSpreadsheetFile.
You should use a FOR loop and an ArraySum function.
See how far you get…
This forum is mainly to discuss specific problems/questions regarding LabVIEW. We usually don't solve other peoples homework for free…
09-14-2017 11:04 AM
There's also a great VI called "Recursive File List.vi", so you just input the top-level folder and it will dig through the directory for you.
09-15-2017 03:37 AM
Thanks, yes I have worked through your algorythm. It currently works once only, is there something wrong with my while loop?
09-15-2017 03:37 AM
Thank you for your help
09-15-2017 03:46 AM
Hi sw,
It currently works once only, is there something wrong with my while loop?
It works as long as you run the VI. And there is nothing wrong with the while loop on its own… 😉
But the content of the while loop seems wrong to me!
What's the purpose of the shift register, when the value in the wire NEVER changes?
Why do you read the same file again and again?
What's the point in building an array from the read string?
Did you even try to debug your VI?
09-15-2017 03:52 AM
I wanted the shift register to add 1 each loop to add to the filename each time, why does it not do this? I want to build the array so that I can process the data when it is read into labview. I have tried, but my labview is not yet very good I am afraid! Thanks,
Sam
09-15-2017 04:31 AM
Hi Sam,
I wanted the shift register to add 1 each loop to add to the filename each time, why does it not do this?
Because you didn't program this "+1"…
I want to build the array so that I can process the data when it is read into labview.
You need an additional shift register to store the array!
I have tried, but my labview is not yet very good I am afraid!
Well, then I suggest to take all those free learning resources offered by NI!