LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to display data in text file in column format

Solved!
Go to solution

 


 

Do you use this vi to take data whe ever you collect data from the O-Scope? If so then the way I would tell you to do this would be to read the data out and make an array for all the data that you want to store together and then save it to a file. You will need to remove the save from this vi and move it somewhere where it can be called when yu have all fo the data that you want to save

 


 

hey Tim, I understood your concept..but dont really know how to go about it.. 😛

How can i save the array to a file and how do i call all of these arrays together later so that i can build them and make a 2D array??.... thanx

 

0 Kudos
Message 11 of 19
(531 Views)

OK here is a very simple idea of what I am talking about. If you seperate your data acquisition loop and save then you can make a 2D array and save at a later time. I am assuming that you know when you want to save the data and can make an event or timeout that can cause the code to save. We can expand on the idea here or if you do not understand I can go a little fiurther. In the code that I gave you if you hit the save button you can save the dat from two different sources into one file and even append the data to the end. It will have to get more complicated to ensure that you are not losing data again this is just a simple concept.

Tim
GHSP
0 Kudos
Message 12 of 19
(529 Views)

This is a little clearer on how to do what you are looking to do. Here I am using a state machine to force the first read ten the second then save.

Tim
GHSP
Message 13 of 19
(525 Views)

thanx aeastat...

all this while i had been working with your idea and modifying it to suit to my situation...

i dont know what the problem is now, but sometimes it runs correctly... and at other times it stores many extra columns in the text file....

am i supposed to clear the 2D array for each execution??

i could have posted the code.. but its too big and has many subvis....

thanx....

0 Kudos
Message 14 of 19
(508 Views)

You should clear the 2 D array every time after you write it to the file. Write then clear then write then clear.

Tim
GHSP
Message 15 of 19
(504 Views)

but if i do it every time... how will the shift register pass the value to the next iteration....for buildiing the new column with the original matrix.....

or am i supposed to clear the array before each run of the vi??

0 Kudos
Message 16 of 19
(499 Views)

You only clear after you have written to the file. This should ensure that you only have data that has not be written before. That is the best I can do without seeing your code.

Tim
GHSP
0 Kudos
Message 17 of 19
(496 Views)

is there any method to clear a 2D array programatically????

or simply should i wire an empty 2D array?

0 Kudos
Message 18 of 19
(484 Views)

i wired an empty array... and its working perfectly well.....

thanx a lot for the code aeastat....

thanx to everyone for the help....

this forum is a great place for sharing ideas..... take care... 😄

0 Kudos
Message 19 of 19
(483 Views)