07-21-2011 02:58 PM
Hi,
I'm making a program where I need to change the voltage into two different motors throughout a set period of time:
ex
Start: 5v 1v
after 5 min: 1v 2v
after 10 min: .7v 2v
and I need to program it to work for several hours.
I already have most of the program built up but I can't figure out how to get my numbers from a spreadsheet(or document) into my program.
Thank you,
Lost Student
Solved! Go to Solution.
07-21-2011 03:19 PM
To get your numbers from a .txt file you can use Read from Spreadsheet VI which produces an array. Make sure that you have checked marked "Read whole File" or something similar. At each index of the array, a different line from your input file will be in it. You can just index it and convert to a number. There is your numerical input.
As for the program to run for severel hours or each part running a 5 min interverls like your example looks like: create a vi that its only job is to loop.
Time you want a set point to run / setting for Time delay = # loop iterations
This will control how long the program runs
hope this helps.
07-21-2011 03:20 PM - edited 07-21-2011 03:21 PM
File I/O Palette > Read from Spreadsheet.vi
EDIT: Too late!
07-21-2011 03:24 PM
Keep in mind that a spreadsheet does not mean an xls file. It is a text file with columns which are by default separated by a tab.
07-22-2011 09:03 AM
@SteveChandler wrote:
Keep in mind that a spreadsheet does not mean an xls file. It is a text file with columns which are by default separated by a tab.
Good point Steve. I never use XLS, ActiveX or the Report Generator Toolkit so I often forget that when many people say "spreadsheet" they mean an Excel spreadsheet.
Since Excel has extra formatting embedded in it the simple LabVIEW primitives can't read it correctly. My advice is always to save to a raw data format like Tab Seperated Values.
07-28-2011 12:49 PM
Hi,
I found the "Read From Spreadsheet" but I coudn't find a "read whole file" button or conector. I'm also not sure what you mean by "index and convert."
Thank you,
Falcon9a
07-28-2011 03:51 PM
I was actually able to get a friend to help me with this one, If you put a double into a "For" loop it cycles through all the numbers in order 🙂