LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to wait until the 1st part of the processing is done

Hi,
 
I had a hard time to combine two parts of processing in one .vi file, and thus would like to get some advice/help through the forum.
 
Attached is the partial finished vi file I made. You can see that it is composed of two parts. The upper part is to run a bat file (check_result.bat), which generates a result.txt file. The lower part is to use the result.txt file as an input file, and check if the key word called "test case passed" is included in the result.txt file or not. So I want to run the upper part firstly, and then run the lower part after the upper part is finished.
 
However, I don't know how to connect the two parts in a right way that the lower part only starts running after the upper part is finished. Any comments/help is highly appreciated.
 
Thank you in advance.
 
Xuedong 
0 Kudos
Message 1 of 7
(3,422 Views)
Use a sequence structure and place the top portion in the first frame.  Right click it and add frame after, then place the bottom portion of your code into the new frame.  This will execute your top portion first and then your bottom portion second.
0 Kudos
Message 2 of 7
(3,417 Views)
The magic of dataflow! 😄
 
All you need is a data dependency between the two parts. Often critical parts of each section contain error terminals, so you can just string em along in the proper order and each part must wait until the previous node has finished.
 
In your particular case, the read operation has no error input, so you can recruit any other input. Create a fake data dependency by strategically placing a small sequence frame containing common code. The sequence cannot start until all code that provides imputs has finished, serving your purpose.
Of course it seems silly to even try to read the file if the previous node failed. Right? 😮 So simply place the second part inside a case and hook it up to the error output. Now the second part (1) waits until the first part has finished AND (2) execute only of the first part succeeded. No sequence needed.
 
All clear? 🙂 

Message Edited by altenbach on 02-07-2007 02:34 PM

Download All
0 Kudos
Message 3 of 7
(3,416 Views)
Thank you so much! Using sequence structure solved my problem.
 
One more question: after running the vi file, I still see the DOS window is there, and I have to manually close it. The DOS window is opened by system exec for running a bat file. Is there any way that we can close the opened DOS window automatically?
0 Kudos
Message 4 of 7
(3,385 Views)
Thank you so much! Using sequence structure solved my problem.
 
One more question: after running the vi file, I still see the DOS window is there, and I have to manually close it. The DOS window is opened by system exec for running a bat file. Is there any way that we can close the opened DOS window automatically?
0 Kudos
Message 5 of 7
(3,388 Views)

I think your commandline is too complicated. 😉

You current commandline is "cmd /x /c start c:\check_result.bat".

Why don't you delete "cmd /x /c start" and shorten the commandline to "c:\check_result.bat"? Try it! 🙂


What is your OS version? Looking at the microsoft help for cmd under windows XP, the /x option is not even listed. (See: http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true)
What is /x supposed to do anyway?

Message Edited by altenbach on 02-08-2007 08:08 AM

0 Kudos
Message 6 of 7
(3,375 Views)

You are the veteran!!!

It works perfectly, using your suggestion! Thanks a looooooot.

0 Kudos
Message 7 of 7
(3,365 Views)