LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you set the system exec to properly wait until complete

Solved!
Go to solution

Hi all,

 

Im currently using the system exec.vi to run a .bat file.  Now i want it to wait until complete and then move to the next task in my application. If i dont wait until complete then it executes the bat and moves on before it is finished.  However if i turn the wait to true then it runs the bat and when the bat is complete it will just hang.  How do i properly set this to move to the next task when complete?

 

Thank you,

 



-Matt
0 Kudos
Message 1 of 5
(3,707 Views)
Solution
Accepted by topic author Wolleee

Make sure the last line of your batch file contains the command "exit", else it will remain at the prompt and not terminate the command window.

 

For example:

 

This batch file will stall after completion and not return to LabVIEW until you close the command window.

timeout 10

 

This batch file will return to LabVIEW:

timeout 10
exit

 

Message 2 of 5
(3,694 Views)

Altenbach,

 

This command worked yesterday, but now when i try to put the exit at the end of the batch file it seems to get added to the name of the previous file in the batch file.  Such as file5.bin exit.  So of course it cant find this file and it errors out. Advice?



-Matt
0 Kudos
Message 3 of 5
(3,616 Views)

We probably need to see some code. Do you generate the batch files inside LabVIEW?

0 Kudos
Message 4 of 5
(3,610 Views)

After an hour of research and frustration i realized that my compiler was not using the right language and the reason it worked yesterday was formatted by labview in txt editor.  It was a simple line feed issue.  I do appreciate the quick reply though.



-Matt
0 Kudos
Message 5 of 5
(3,604 Views)