From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

write to spreadsheet file path

file path.JPG

I have a program that uses the write to spreadsheet file.vi as shown above, in the beginning of the program (left) it is meant to set up all the headers and then at the end (right) store the data to the same file path (thus the local variable).

 

I noticed if I don't specify a path and i let it prompt me for one, it doesn't store that location, instead it will prompt me again a second time (when the program gets to the write to spreadsheet on the right) and it will save to a 2nd file, even though I use the local variable.  Is there a way around that?  Maybe if I just wire it directly (w/o the local variable) it will keep it in the same path?

 

0 Kudos
Message 1 of 6
(3,708 Views)

YOU are not storing the location. You should be using the path output of the function and wire that to the next instance.

 

Stacked sequence and local variables. Not exactly a robust architecture.

0 Kudos
Message 2 of 6
(3,707 Views)

So I can just wire it directly then and that should fix the problem.

 

Whats wrong with flat sequence and locals?

0 Kudos
Message 3 of 6
(3,698 Views)

Flat sequences do not give you any options to alter execution. Cannot branch or terminate early. Using wires gives you execution order and using a state machine gives you flexibility. Locals create data copies and often race conditions. Using a local instead of a wire to make 'cleaner' diagrams is just not the correct way.

0 Kudos
Message 4 of 6
(3,693 Views)

@LarsUlrich wrote:

 

Whats wrong with flat sequence and locals?


Just search around this forum and you'll come across dozens and dozens of posts about this. In fact, we've collected a bunch of examples of how local variables have been abused and misused: http://forums.ni.com/t5/BreakPoint/Why-some-people-say-Local-Variables-are-bad/td-p/711239

 

The regulars here typically see sequence frames used by those who come from a text-based programming background, so they are not using dataflow programming.

0 Kudos
Message 5 of 6
(3,691 Views)

@smercurio_fc wrote:

 

 

The regulars here typically see sequence frames used by those who come from a text-based programming background, so they are not using dataflow programming.


Yes, but that's not surprising either, since that's how text-based programming works.  Just like NASCAR folks have trouble making rights.Smiley Very Happy

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 6 of 6
(3,673 Views)