LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

use Read from Spreadhseet file to read 1 additional row each loop iteration

Solved!
Go to solution

Hi,

 

I have written a program that takes certain number of data points depending on user specified parameters. For each data point, I am using a  Read from Spreadhseet VI to correct each data point according to calibration spreadsheets that I have already saved. So for each data point I need to multiply/divide it by the corresponding values in each calibration spreadhseet. This corrected number is then displayed in an XY graph as well as saved into another spreadsheet file of corrected values. I have placed indicators at the output of each Read from Spreadsheet VI to see what value is actually being read. The program reads the first data point in each spreadsheet correctly but then in each successive iteration the number is completely wrong and I am not sure what is happening.

 

Essentially, I need to know how to read successive rows of a spreadhseet file where the row number that is read coresponds to the iteration number of the enclosing loop. I think the problem lies in my inexperience with this VI since I am not sure if I am inputting my desired parameters correctly.

 

I have attached my program as well as two of the three related calibration spreadsheet files (the thrid is the same size and format as the sample diode spreadsheet). The program is quite large but the problem is contained in the IPCE case. The calibration spreadhseets are taken in the IPCE Calibration case.

 

Thanks in advance,

Kai

 

 

0 Kudos
Message 1 of 3
(2,463 Views)
Solution
Accepted by topic author UNCKai

Hallo Kai,

 

you should look at the context help for and use both ReadPosition in- and output!

You have to provide a file postion when reading line by line and so you have to keep the read position of your last read call in mind. Keeping "in mind" can be translated to LabVIEW speek as "shift register"! Btw. reading a file once and using the array data afterwards usually is much easier for such small tables...

 

But before you tackle this problem you should get rid of atleast 95% of all those local variables. LabVIEW is all about DATAFLOW, it doesn't use (or even need) variables to process data. Your "Overlord" VI is a bunch of (possible) race conditions mixed up with a huge amount of RubeGoldberg... 😄

 

Kennst du das deutschsprachige LabVIEW-Forum?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(2,457 Views)
With all of those sequence structures and local variables, your program is pretty badly written and I'm not going to try to decipher it. However, you should only need to read a file once. After that, you just index the array that is returned.
0 Kudos
Message 3 of 3
(2,453 Views)