LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I store data being continuously aquired to a spreadsheet or datasheet file

I am using a camera to aquire an image and then using the light intensities of the pixels to calculate the center of the image and see how it moves as i adjust the light source. The final numbers I get are the distance the center is from the top left of the camera. I need to store this number in a datasheet or spreadsheet file as it is collected. The number is always changing as i move the light source. I want every outputed number to be stored in an XY table format showing time and distance. I attached my program. Thanks

mattbarry
0 Kudos
Message 1 of 6
(2,591 Views)

Create a parallel loop with queue, from the current while loop pass the DBL data to the 2nd while loop. In the second while loop convert the DBL data to string format and write it to a text file with "," as delimiter . DO not use write to spreadsheet VI use write to text file primitiv and set the file position to last before writing the data to the file. I am sure with this instruction you will be able to make the code, try and come back if you face any problem.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 6
(2,558 Views)

In terms of the actual storing of the data to a file, you have a couple basic options. A delimited text file is in some ways the easiest to generate, but it also has significant limitations in terms of numeric precision and the ability to randomly access your data.

The other option is some sort of binary file to retain full numeric precision, and a good choice here is TDMS because it let's you save contextual data along with the numbers.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 6
(2,526 Views)

first i need to store the data in a matrix or an array. RIght now the program creates an array as big as the number of times the program runs through the loop, but the data entered into it is only the last number that comes out of the program. I need it to store the data collected for each loop iteration one by one so i have an array matching the loop iteration with the data that goes with it.

mattbarry
0 Kudos
Message 4 of 6
(2,468 Views)

Did you make any code updated after the suggestion. Please shows us the updated code.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 6
(2,465 Views)

I actually just got it to work. Thanks for your help. Heres what it looks like now in case your curious.

mattbarry
0 Kudos
Message 6 of 6
(2,462 Views)