10-12-2016 03:57 PM
It's been awhile since I posted:)
How do you run two cmd prompts in parallel?
Regards,
-SS
Please note using LV 8.6.
Solved! Go to Solution.
10-12-2016 04:25 PM
You might need to put a wait command with a small value. Otherwise one loop will hog CPU resources and won't allow the other to execute.
Why do you have a STOP if TRUE condition with a true constant? Your loops will only run one time. Are you wanting them to repeat?
10-13-2016 09:49 AM
Hi Aputman,
I guess I thought that putting them in the while loop would force LabView to run them on seperate processors. I only need the while loops to launch once - they will eventually have programming routines that are hooked up to seperate USB connections and two wireless radios that we are trying to program at once to reduce test time. I thought about the problem and I don't really care if it's using parallel processors but I do want both programming routines to start at roughly the same time using seperate cmd prompts. I was using highlight execution and expected to see both cmds to open at the same time but this may not be how this works. I put in a small wait state 10ms and this didn't seem to change the behavoir.
Right now cmd1 executes and completes and closes then launches cmd2 and completes and closes. I would like them to execute near simultaneously.
Regards,
-SS
10-13-2016 10:09 AM
Running in highlight execution mode will not reveal if they are running simultaneously or not. Is that the only way you "know" that they are not running simultaneous? If so, I would look for another way to confirm that. Maybe by writing to two separate text files and recording a timestamp. How long does the process take that you want to execute with the command prompt?
If you only need to run each command once, the loops are not necessary. Labview, by design, takes advantage of multithreaded processors as long as there are no dependencies between the two commands.
10-13-2016 11:00 AM
Also, are you calling the same command with both processes? If so, that could be the cause of your problem. Maybe the exe that you want to call can't be called from one location until the other one has completed execution.
I'm assuming you don't want to know the PATH environment variable twice, as your code shows.
10-13-2016 11:51 AM