01-07-2014 12:54 PM
Hello:
I am really new to labview and I do have a question about how to use the data from a predefined excel file to control my machine.
The excel file has three colums which are time, temperature and water level and more than 1000 rows. Time, temperature and water level are all different for each row.Based on the information from this table, I need to control my machine to matain certain temperature and water level for a period of time according to the corresponding colum 1 time number. What I have done so far is only read the predefined excel table and save as a 2D array. I am thinking to use a for loop to read the array row by row, and then assign each number to corresponding machine port, or just use a timed loop. I really run out of ideas. Need help, Thanks!
01-07-2014 01:07 PM
Well, using a FOR loop like this traps you into inner code that might be hard to escape (except maybe using the conditional terminal).
I would read the file as you have now, then use a state machine.(states are reading a new file, process rows, pause, stop, etc.) The central case is where you process the rows. Keep track of the current row in a shift register, read the first row, apply the setpoints, and check for the elapsed time regularly. When the time has elapsed, increment the row and repeat. If you run out of rows, go to the idle state, or whatever.
01-07-2014 01:09 PM
Thanks altenbach for your answer. But how do I use the state machine? Is there a sub vi ready?
Thanks,
01-07-2014 01:27 PM
There are templates that ship with LabVIEW.