From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, 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: 

Opening different files within the same loop

Hi folks,

I am currently trying to automate a testing procedure using LabVIEW
that requires the user to select the test from a drop down menu (Ring)
and then clicks a button to start the test. When the button is pressed
an 'open file' window appears asking for a name to save the file as.
This all works fine the first time it is run, but i need to be able to
stop the current test, select a new one, and then choose a different
filename to save it as, without having to restart the program.

I am currently using a timed loop (as the test is time specific) and
case statements for each individual test routine. I can only think of 2
ways to implement this, the first works only once (asking for a
fliename when the program is first run), the second repeatedly asks for
the filename each time the loop frame executes.

So the process is: select test - click button - chose filename - stop
test - select new test - click button - choose new filename -
etc.......

Thanks in advance,

Darren.

0 Kudos
Message 1 of 3
(2,185 Views)

There can be many ways to do this

One way would be, to keep the file read operation inside a seperate case stucture ( inside the while loop itself)

and use a boolean switch ( mechanical action>> Latch) and read a new file at each click of this button

look at attached VI, probably you can build on its logic

 

 

0 Kudos
Message 2 of 3
(2,178 Views)
Cheers mate, got it working and also managed to clear up the block
diagram as well! Double bonus!

Thanks again!!

0 Kudos
Message 3 of 3
(2,170 Views)