LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a file in one loop and use the path control of close file function in other loop

New to this forum. Apologize my language.

Project: Recording the Crystal pressure gauge value in the excel sheet for Relief Valve test.

I’ve modified and developed the code to read the gauge value and also managed to store the recording in 2D array.

In my Labview front panel I’m using a button (“Record Button”) to create a excel file and to save it.

At the moment, if I press the record button it prompts the user to enter the file name in the dialog box to create .xls file.

Once the user typed the file name and click ok, LabVIEW will start to record the actual value and save the recorded value in the “Data array” (2D).

Problem: After the required amount of reading, if I stopped the record button I want the readings to be saved in the excel.

Labview expects me to trigger the record button (second time) again to save the recorded value (“Data Array”) in the excel.

 

I'm using stacked sequence structure for the whole program. My first stack sequence having a loop with rising slope condition. (in other words, it will become true only once (like a pulse) when I press the "Record Button" in front panel). I have data storage loop in my second stack sequence. This loop is controlled by timer to acquire real time pressure value. While tracing the problem, found that the use of "waveforme export" function in slope controlled loop causing the above mentioned second time trigger problem. When i tried to use the same code in data storage loop, LabVIEW prompts every iteration to open/create a file to store the value. How to come over this problem? any suggestions are highly appreciated.

 

Thanks

Tamil

Download All
0 Kudos
Message 1 of 2
(2,982 Views)

Am I correct that you are trying to learn LabVIEW entirely on your own?  [I hope noone is instructing you to use a Stacked Sequence -- they are almost never the right way to do anything ...].

 

Learn about State Machines.  Open LabVIEW, Create Project, and choose Simple State Machine.  Study the example.  You can easily have States like "Initialize", "Open File", "Collect Data", "Save in File", "Close File", etc. and have simple logic (Start button, End button, etc.) hep you decide when to do what.  Another Pattern you might find useful is the Queued State Machine or Queued Message Handler, as it couples nicely with Event Structures (which handle Front Panel Controls in a simple way).

 

Have you visited the various LabVIEW Tutorials listed on the first page of the LabVIEW Forums?

 

Bob Schor

Message 2 of 2
(2,978 Views)