LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Column Labels Not Showing Up...

Solved!
Go to solution

Hey Everyone,

I am wondering why my column labels for the attached Vi are not showing up.  Anyone have any tips/recommendations?

0 Kudos
Message 1 of 8
(2,293 Views)
Solution
Accepted by topic author jisoccer

Serious bugs:

 

  1. race condition! (There is no way to tell what gets written first or last!)
  2. Whatever is written last is the only thing in the file (either data or header. No way to predict!)
  3. You did not wire append=true to "write delimited spreadsheet", thus this function will overwrite the headers.
  4. ...
0 Kudos
Message 2 of 8
(2,277 Views)

Try something like this....

 

altenbach_0-1584818338993.png

 

0 Kudos
Message 3 of 8
(2,275 Views)

... or keep it simple. No need to open/close the file twice.

 

altenbach_0-1584818853897.png

 

0 Kudos
Message 4 of 8
(2,273 Views)

Thank you so much. Just wiring the Append to File? = True solved it.

0 Kudos
Message 5 of 8
(2,203 Views)

@jisoccer wrote:

Thank you so much. Just wiring the Append to File? = True solved it.


NO! It does NOT solve the glaring race condition!!!

 

It might work now most of the time by accident, but on a different computer, different day, different LabVIEW version, or even on the same computer after some minor unrelated code changes, it could decide to write the data first and the header second, leaving you with a file with only the headers.

 

There is currently no data dependency that would enforce writing the headers first and the data second.

 

If you only change to "append=T", your code is still not safe!

 

The simplest way in the current code to solve the race condition would be to wire the error out of "file close" to the "error in" of "write delimited spreadsheet". Now the execution order is enforced. Dataflow!

 

Message 6 of 8
(2,201 Views)

@altenbach

Isn't this slightly leaner?

Write spreadsheet.png

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 7 of 8
(2,165 Views)

@Yamaeda wrote:

Isn't this slightly leaner?


In this case yes, but in the more general case the two write operations are typically separate, Often the writing of the headers occurs once on init (or before the loop) and data is appended with every iteration later.

0 Kudos
Message 8 of 8
(2,153 Views)