LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file output

Hello people,
 
Little question. My vi make the acquisition of many thermocouple readings and store the results into a .dat file. I can choose the sampling rate, the total acquisition time, and the time interval to save the data into the .dat file. For example, the vi use a 5 Hz sampling rate, a total time of acquisition of 4 seconds, and a 2 seconds time interval to save the data, meaning that it will save the data 2 times during the acquisition. Each time it saves the data, the vi uses the "get date, time string" sub vi and put this information into the data file.
 
I you run the vi, you will get this file:
 
17:53:11      22.909573        20.041359
       20.571033        20.344105
       20.835646        20.722260
       20.571033        20.344105
       20.835646        20.722260
17:53:13      20.986481        20.835340
       21.439610        20.797548
       20.986481        20.721956
       21.439610        20.797548
       20.986481        20.721956
 
 
I would prefer having something like that:
 
17:53:11      22.909573        20.041359
                    20.571033        20.344105
                    20.835646        20.722260
                    20.571033        20.344105
                    20.835646        20.722260
17:53:13      20.986481        20.835340
                    21.439610        20.797548
                    20.986481        20.721956
                    21.439610        20.797548
                    20.986481        20.721956
 
How can I achieve that? Thanks
 
Marc
 
 
 
0 Kudos
Message 1 of 5
(3,049 Views)
Hi,
 
It appears as though you are simply trying to get your lines of data slid over to the right a bit.  Is that correct?  If so, all you would need to use is a concatenate string VI with a tab delimiter as input.  It appears, however, that you've already done this in your code, which makes me think that there's something else you're trying to accomplish.
 
Please provide a bit more information if there's something else you're trying to do - otherwise, best of luck!
 
Peter
 
Peter L.
Applications Engineer
National Instruments
www.ni.com/support/
0 Kudos
Message 2 of 5
(3,020 Views)
Hello Peter,
 
The reason I want to have my ouput file that way is because of the postprocess done with Excel. By loading the file produce by the vi I attached, in Excel it does something like that:
 
1st              2nd      3rd colum                                             
 
17:53:11     21.4     22.3
21.3            23.0
21.4            22.3
21.4            22.3
21.4            22.3
17:53:13     21.4     22.3
21.3            23.0
21.4            22.3
21.4            22.3
21.4            22.3
 
 
I wish it would do 3 separate columns: 1 for time, 1 for thermocouple #1 and 1 for thermocouple #2. I don't want the vi to mix the data  
 
1st              2nd      3rd colum
 
17:53:11     21.4            22.3
                   21.3            23.0
                   21.4            22.3
                   21.4            22.3
                   21.4            22.3
17:53:13     21.4            22.3
                   21.3            23.0
                   21.4            22.3
                   21.4            22.3
                   21.4            22.3
 
 
By using the concatenate string VI with a tab delimiter as input, that would be ok if I had a sample rate of 1 Hz, it would do something like that
 
17:53:11   21.4  22.3
17:53:13   22.4  22.6
....
 
But I will use a sample rate of 100Hz, so I will still get a file with mixed colums. Do these informations help for solving my problem?
 
Thanks
 
Marc
 
0 Kudos
Message 3 of 5
(3,006 Views)

Try doing it this way. The problem you see is because you take the time and concantanate it to a 2D array that's been converted to a string. It's only the first row that has the time and then the next row starts with the second row of numeric data. In the attached, the numeric array is converted to a string array and the time column is added. Then the Array to Spreadsheet will work.

p.s. It seems you are using local variables just to eliminate some wires on the diagram and make it look neater. None of them seem to be really necessary and you can also eliminate the sequence structure.

Message Edited by Dennis Knutson on 10-23-2006 03:27 PM

Message Edited by Dennis Knutson on 10-23-2006 03:30 PM

Message 4 of 5
(3,000 Views)
Hello,
 
Thanks a lot. That is exactly what I wanted to know. I've test it and it works fine.
 
Cheers
 
Marc
0 Kudos
Message 5 of 5
(2,964 Views)