Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing time and voltage to a file

I am using labview 7 Express with Windows XP. I have a PCI-MIO-16XE-10 DAQ card. I want my program to update 5 times a second. It is doing this with a while loop. However, I only want to write the date to a file once every 10 seconds. I want to write the time, and two voltage values to the file. Now it writes the voltages to a file every time it updates, and only the voltages,not the time. I am using the write to spreadsheet file.vi. I was unable to attach the labview file to this question, hope I can still get some help. Thanks.
0 Kudos
Message 1 of 4
(2,544 Views)
If you're using the Write to Spreadsheet File VI, then you're closing the file after each write -- then it should be easy.

To time when the time should be written, you can either count the number of times your loop has run, divide that by 50 using the Quotient and Remainder VI (5 times a second times 10 seconds), and take the Remainder and any time it is 0, write the time...

Or you can check the current time every loop, and when the difference from when the last time the time was written is greater than 10 seconds, write the time again...

Anyway, get the current time string, concatenate a tab after it, and wire that to the Write Characters to File VI, using the same filename that your Write to Spreadsheet VI is using. This will put the current
time into your spreadsheet file and add a tab, so that your spreadsheet file is still in the right format. (The "spreadsheet" file is just a tab-delimited text file, where the text is your data.)

Mark
Message 2 of 4
(2,544 Views)
Thank you Mark, you were a lot of help.
-TIM
0 Kudos
Message 3 of 4
(2,544 Views)
Glad I could be of assistance!
0 Kudos
Message 4 of 4
(2,544 Views)