04-25-2010 05:25 AM
Hi all,
I am writing data from a thermister circuit to a spreadsheet, with a time stamp and a random number. When i open the excel file the header remains above each data entry. I only want the header to remain once and the data below. see below. Any help would be really appriciated.
thank
jason
Time | Temp | Random | |
11:04:32 | 24.72318 | 7 | |
Time | Temp | Random | |
11:04:32 | 24.72318 | 9 | |
Time | Temp | Random | |
11:04:32 | 24.72318 | 2 | |
Time | Temp | Random | |
11:04:33 | 24.72318 | 4 | |
Time | Temp | Random | |
11:04:33 | 24.72318 | 7 | |
Time | Temp | Random | |
11:04:33 | 24.72318 | 1 |
04-25-2010 07:46 AM
Hi jpraffer,
how do you write your file? Are you using the express vi? If yes, then you can change the settings to "only one header" per segment.
Mike
04-25-2010 07:56 AM
hi mike,
thanks for the reply. see attached for the VI. Im new to labview so im not sure about the format.
jason
04-25-2010 08:01 AM
just some more information. i am trying to write to spreadsheet from 3 sources - a time stamp, a random number generator and from an external thermister-resistor circuit. the results are then logged into an excel file. but i am getting header information for each data point recorded. see first post.
regards,
Jason
04-25-2010 08:54 AM
Hi Jason,
you can check first if the file already exists. If this is the case, then don't write the header into your file. Are this three independent programs which write into the file or only different vi's? Maybe you can change the layout and write from only one location, then it would be possible to open the file only ones and close it after a specified number of lines.
Mike
04-25-2010 10:31 AM
You have two write to Spreadsheet files. And worse, you have a race condition between them. It's possible that the writing to the files can happen in any order because they are operating in parallel.
Set them to operate in a sequence, and that the header part only writes on the first time through the loop.
04-25-2010 01:02 PM
Maybe something like this would work for your assignment?
04-26-2010 09:46 AM
thanks alot, that worked. makes life alot easier.
regards,
jason
04-26-2010 10:00 AM
I often use the following function for this type of jobs. Although jrjones solution is much better for that one.
From Help..
First Call? Function
Owning Palette: Synchronization VIs and Functions
Indicates that a subVI or section of a block diagram is running for the first time. The First Call? function returns TRUE only the first time you call it after you click the Run button.
Dimitrios