LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need automatic timestamp collumn, collumn headers, and title in tabdelineate file

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)

0 Kudos
Message 1 of 7
(3,002 Views)
Take a look at the attached VI and tell me if it does what you want.  Feel free to modify as needed. 
0 Kudos
Message 2 of 7
(2,981 Views)

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

0 Kudos
Message 3 of 7
(2,966 Views)

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

0 Kudos
Message 4 of 7
(2,964 Views)
The reason you have noise in your file is because i changed the task setup from differential to RSE to correspond to hardware I had at my desk.  You should be able to make the changes to the software to get the timestamp and headers as you want them.  Go ahead and give it a try and ask specific questions as you go.
0 Kudos
Message 5 of 7
(2,963 Views)

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

0 Kudos
Message 6 of 7
(2,919 Views)

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.

0 Kudos
Message 7 of 7
(2,908 Views)