01-26-2009 09:43 AM
Specifics:
Simply, I am creating 8 collumns of data from a 8 channels on a DAQ and saving them to a tab delineated transposed file. I need to create a preceding 9th collumn that is contains timestamps of every row. I also need to create collumn headers and a title above the collumns. I wasn't sure how to search for this, but from what I did search, I couldn't find anything. If there is something that explains this well, please let me know. I am just learning this program for my internship and need to learn it very fast to get up to speed with the group.
Someone in the other forum suggested using the Write To Measurement File command. Would this accomplish all of my goals?
I have attached the file
Thank you!
Braden
(This was posted incorrectly in the I/O forum earlier. Apologies)
01-26-2009 11:45 AM
01-26-2009 02:22 PM
Hey,
Thanks for the file. It has a title and headers, and you definitely achieved it in a different way then I ever would have though, but what I need is for the title and headers to be repeated every time the file is appended. In other words, every time I start the file, they are created mostly as a seperator between experimental runs. Then, on the left side in a new collumn I need a timestamp collumn that shows the time (hours, mins, seconds) for every row of the 8 channels. So, there will be 9 collumns of data.
Also, when I run your file I get a lot of noise in the signal that isn't there in my file. I am not sure what the cause of this is; do you know?
Thanks for all your help!
Braden
01-26-2009 02:24 PM
Also, once I get to that point it would be good if the file would prompt the user to input the title each time.
Braden
01-26-2009 02:24 PM
02-02-2009 02:07 PM
After a lot of work and borrowing a for loop and VI, I have the code to this state. I have the title input, the timestamp(s), the headers, the units...I can't get it to append, however. Would one of you show me how to get the data from this program to append? I have the spreadsheet set to append=true and I have the while loop, but every time the program takes data, it writes over the previous data. I am sure I messed up the looping, but don't know in what way.
Thanks!
Braden |
02-02-2009 09:31 PM
You are opening the file in the loop, writing your header information, then closing the file, then opening it up again using the Write Spreadsheet File function. This happens on every loop iteration.
You want to move the writing of the header to outside of the while loop. The reason your data gets overwritten is that when you open the text file, the file pointer is placed at the beginning. Thus writing of the header data eliminates everything after it.