08-25-2011 10:31 AM
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?
08-25-2011 10:38 AM
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.
08-25-2011 12:17 PM
So I can just wire it directly then and that should fix the problem.
Whats wrong with flat sequence and locals?
08-25-2011 12:20 PM
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.
08-25-2011 12:23 PM
@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.
08-25-2011 09:11 PM
@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.![]()