05-09-2011 07:54 AM
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
05-09-2011 08:01 AM
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.
05-09-2011 08:15 AM
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.
05-10-2011 11:13 AM
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....
05-10-2011 12:13 PM
You should clear the 2 D array every time after you write it to the file. Write then clear then write then clear.
05-10-2011 12:25 PM
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??
05-10-2011 12:39 PM
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.
05-11-2011 05:00 AM
is there any method to clear a 2D array programatically????
or simply should i wire an empty 2D array?
05-11-2011 05:37 AM
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... 😄