From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Read last row in excel

Hi, 

 

I am trying to build a VI that saves an analog signal (temperature) automatically every 5 degrees celsius. My approach is to write to an excel spreadsheet and then to read the last row and if the analog signal has increased by 5 degrees, to save to the same excel spreadsheet.

 

I have used the Read from spreadsheet function but it only has two optoins, either to read all rows or the first row. Is there a way of reading the last row from the file?

 

Any help would be appreciated.

 

Kind regards,

 

Niral

0 Kudos
Message 1 of 5
(3,933 Views)
First, you have a generic LabVIEW question and not something related to data acquisition. Second, you are not using excel. You are creating a text file. Lastly, why do you want to read the file? Just keep the last saved value in a shift register.
0 Kudos
Message 2 of 5
(3,924 Views)

Thank you Dennis. 

 

I am new to LabView and I am still unable to carry out this operation.

 

Is there a way of saving one sample of data once the temperature has reached a set target temperature?

0 Kudos
Message 3 of 5
(3,880 Views)
As I said, use a shift register. You can use a case statement. After comparing the measured temp to the setpoint, wire the Boolean result to a case statement. In one case, wire the value to the shift register and in the other case, just pass the shift register through.
0 Kudos
Message 4 of 5
(3,877 Views)

First of all thank you for your help.

 

I am still struggling and my deadline is soon approaching. I am basically trying to heat an electric heating mat at for example 35 degrees celsius and then switching it off and waiting for it to cool down to 30 degrees and save measurements. I then need it to switch on and heat to 45 degrees and cool to 40 and so on for upto 85 degrees. I have tried many approaches but always seem to get stuck with things like latching a boolean signal, event structures keep on cycling the idex for my arrays. 

 

In my front panel control I have two arrays for the user to enter a list of heating mat temperatures and target temperatures.

 

I have attached my VI, please have a look.

0 Kudos
Message 5 of 5
(3,854 Views)