LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Update data into array

Hello,

 

My problem is, as I update my data (the slider) the old data gets rewritten into the array. i wish to store all the data points with the real time at which the new data got entered into an array, or perhaps a spreadsheet. I would like to export this spreadsheet into an Excel file that displays ALL data that has ever been recorded with the time( and date if possible) associated with it. 

 

Thank you for your help!

 

Data2.png

0 Kudos
Message 1 of 11
(4,269 Views)
  • What's the purpose of the FOR loop?
  • What do you mean by "real time".
  • Why are you formatting floating point values with an integer format (%d)?
  • What determines the loop rate. (Currently you would run quickly out of memory if you would accumulate the data in a shift register.)

Just open a file for writing before the loop, append new data pairs inside the loop until stop is pressed, the close the file.

0 Kudos
Message 2 of 11
(4,258 Views)

- For loop is just to represent a 1D array.

-Real time as in I want to also record the time/date of when the new data has been entered

 

In this VI that I have attached, i generate a spreadsheet looping table. After 10 data entries, the previous data gets deleted and the new data gets recorded simutaineously. Somethign like this is preferred. For example I would liek to record 100 of the recent data entries.

 

I would also like to export the data into an excel file. 

0 Kudos
Message 3 of 11
(4,250 Views)

@Thuba25 wrote:

- For loop is just to represent a 1D array.


A 1D array with one element. Does not seem to make a difference here.

 


Thuba25 wrote:

In this VI that I have attached, i generate a spreadsheet looping table. After 10 data entries, the previous data gets deleted and the new data gets recorded simutaineously. Somethign like this is preferred. For example I would liek to record 100 of the recent data entries.


So why don't you use it? All you need ot do is change a diagram costant. Why is the table a "control" if you actualy use it as an indicator? Change it to an indicator and get rid of the local variable.

How often would you like to save to a file? Do you want to only keep the last 100 entries in the file or should the file grow forever?

 

 

 

0 Kudos
Message 4 of 11
(4,239 Views)

Hi Thuba25!

I made this VI, I think it should work for you, if doesn't please tell us

0 Kudos
Message 5 of 11
(4,236 Views)

@13Cmmkl wrote:

Hi @Thuba25!

I made this VI, I think it should work for you, if doesn't please tell us


The goal should be to help the OP understand how to program what he needs; not spoonfeed him with a VI.

0 Kudos
Message 6 of 11
(4,231 Views)

you are correct about the elements in the 1D array. I was just using that to implent a 1dD array. 

 

ideally, i want to run this VI, and let is save all the data without stopping the program, lets say for a day. BUT I want to only save the last, say 100, recent data entries. 

 

How can i do this?

0 Kudos
Message 7 of 11
(4,229 Views)

13Cmmkl wrote:

I made this VI, I think it should work for you, if doesn't please tell us


  • You need to limit the rate of the loop
  • You need to initialize the shift registers
  • You don't limit the array size to the last 100 elements as requested
  • Your table does not update in real time
  • You are not writing to excel as requested.
0 Kudos
Message 8 of 11
(4,227 Views)

Thuba25 wrote:

ideally, i want to run this VI, and let is save all the data without stopping the program, lets say for a day. BUT I want to only save the last, say 100, recent data entries. 


You are contradicting yourself in the same sentence. you cannot "save all the data" and "only save the last 100 entries". You need to be more clear.

0 Kudos
Message 9 of 11
(4,222 Views)

Sorry abotu the confusion. What I meant to say was, I want the VI to run continuously, making track of what data has been recorded. BUT I just want to keep the last 100 entries in an array/spreadsheet/array, whatever it may be. 

0 Kudos
Message 10 of 11
(4,212 Views)