LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I delete the array reference when I save to a file?

And the learning continues... I have a VI that saves collected data to a file. I am saving my data using an array and shift registers in a while loop. All is fine until I save my data to a file. I have four columns of data to save. My problem is that in the first column I get the array reference saved as well, ie, [0,0,0], [1,0,0], [2,0,0]. I tried using the delete from array and it does what it says it should do, it deletes the first column which is my data and the reference remains. Any ideas on how I could get rid of this? Thanks for the help in advance.
0 Kudos
Message 1 of 7
(2,819 Views)
I suppose you could do this in a loop with registers, but quick question...
Is there any reason why you avoided the "Write To Spreadsheet File.vi"? You can wire a 2D array into this VI and it will handle all the details for you.
0 Kudos
Message 2 of 7
(2,811 Views)
The data that I am writing is a string format which this VI only accepts numeric.
0 Kudos
Message 3 of 7
(2,803 Views)
Open Write to Spreadsheet File and look on the diagram. There are simple instructions on how to change it to accept string arrays. Don't forget to save it with a new name and to a new location
0 Kudos
Message 4 of 7
(2,800 Views)
I just tried this and it did not work. I did not get any data in my saved file that I wanted. All I got was a 1/2 for the entire file.
0 Kudos
Message 5 of 7
(2,791 Views)
Are you absolutely sure you have a 2D array and not a 3D array?? 😮

What you are describing, only happens when you try to write a 3D array.
Check the help for "Array To Spreadsheet String" for details.
0 Kudos
Message 6 of 7
(2,787 Views)
I found another way to fix my problem. Instead of taking the text right out of the array and writing it to a file I am taking the write to file data from the input to the table of the front panel which is the index array output on the block diagram. It now works fine. Thanks for all the help.
0 Kudos
Message 7 of 7
(2,783 Views)