LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to efficiently provide run-again option using most recent data file read?

I have a rather large application that reads data from a file, this is data to be analyzed and plotted on an X-Y Graph.
 
When the program is run, a select file dialog opens wherein a file is selected.  Once the data from the file is read and the file closed the data exists in a variety of types, 1 dimensional arrays of doubles, doubles, strings, etc.  Call this point A in terms of program execution.  The data is then programatically filtered, analyzed and charted before the program run terminates.  During this process other front panel controls are used to determine filter parameters, calibration factors, etc.
 
I would like to give the user the ability to change some front panel controls (calibration factors for instance) and then run the program again (from point A described earlier) using the same data previously read from the file without presenting the file dialog and repeating the file open, read, close process.
 
What is a practical logic structure to achieve this goal?
 
Would it involve putting the entire program (except the file open, read, close) inside a do while loop tied to a stop button, or are there some other alternative structures that might be more practical?
 
Thanks,
Bernie
0 Kudos
Message 1 of 5
(2,697 Views)

Hello Bernie,

 

Thank you for posting to the NI Discussion Forums!  There are, of course, many ways to set up your program but I’ll discuss 2 possibilities below:

 

Possibility 1:

Keep your code modular!  It sounds like from start to “Point A” you are doing a well-defined set of actions.  Why not make this a sub-VI?  You could then choose whether or not to call that sub-VI depending on whether the program has run before.  You’ll need to store this information somewhere in your program either through one of the two types of globals, a hidden control, or clever use of an uninitialized shift-register.  See VI1 below.

 

Possibility 2:

Remove the “run” arrow button altogether and force your users of your program to use an interface you design.  You can design this interface to skip the stuff before “point A” if the program has been run before.  Use loops as discussed in your posting for this.

 

Hope these help, if any other users have suggestions we will welcome those too!  Please let us know if you have other questions-

 

Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 2 of 5
(2,680 Views)

Travis,

Thanks for the reply, I have LV 7.0 and could not open your sample file.  Please advise.

Regards,

Bernie

0 Kudos
Message 3 of 5
(2,670 Views)
Hope it helps!
Travis M
LabVIEW R&D
National Instruments
0 Kudos
Message 4 of 5
(2,663 Views)
Thanks, used uninitialized shift registers.
0 Kudos
Message 5 of 5
(2,654 Views)