LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I enter different sets of inputs over time?

Solved!
Go to solution

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

0 Kudos
Message 1 of 7
(2,405 Views)

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. 

Message 2 of 7
(2,400 Views)

File I/O Palette  > Read from Spreadsheet.vi

 

EDIT:  Too late! Smiley Sad

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
Message 3 of 7
(2,399 Views)

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.

=====================
LabVIEW 2012


Message 4 of 7
(2,395 Views)

@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.

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019 - Unfortunately now moving back to C#, .NET, Python due to forced change to subscription model by NI. 8^{
0 Kudos
Message 5 of 7
(2,376 Views)

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

0 Kudos
Message 6 of 7
(2,356 Views)
Solution
Accepted by topic author Falcon9a

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 🙂

0 Kudos
Message 7 of 7
(2,343 Views)