LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing to spreadsheet

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

 

 TimeTempRandom
11:04:3224.723187 
 TimeTempRandom
11:04:3224.723189 
 TimeTempRandom
11:04:3224.723182 
 TimeTempRandom
11:04:3324.723184 
 TimeTempRandom
11:04:3324.723187 
 TimeTempRandom
11:04:3324.723181 

0 Kudos
Message 1 of 9
(3,082 Views)

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

0 Kudos
Message 2 of 9
(3,069 Views)

hi mike,

            thanks for the reply. see attached for the VI. Im new to labview so im not sure about the format.

 

jason

 

 

0 Kudos
Message 3 of 9
(3,065 Views)

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

0 Kudos
Message 4 of 9
(3,063 Views)

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

0 Kudos
Message 5 of 9
(3,051 Views)

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.

0 Kudos
Message 6 of 9
(3,035 Views)

Maybe something like this would work for your assignment?

 

HW-Assignment3b.jpg

LabVIEW 5.0 seems so long ago...
Message 7 of 9
(3,021 Views)

thanks alot, that worked. makes life alot easier.

 

regards,

jason

0 Kudos
Message 8 of 9
(2,982 Views)

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

0 Kudos
Message 9 of 9
(2,977 Views)