LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running two cmd prompts in parallel

Solved!
Go to solution

It's been awhile since I posted:)

How do you run two cmd prompts in parallel?

Regards,

-SS

 

Please note using LV 8.6.



0 Kudos
Message 1 of 6
(5,449 Views)

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?

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 2 of 6
(5,442 Views)

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



0 Kudos
Message 3 of 6
(5,385 Views)
Solution
Accepted by ShotSimon

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.  

 

 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 4 of 6
(5,378 Views)

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.  

 

 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 5 of 6
(5,368 Views)

Thanks Aputman,

 

I think we got it to work, and thanks for all the suggestions.  I think in the end it was working as expected and the highlight execution was throwing me off.

 

Regards,

 

-SS



0 Kudos
Message 6 of 6
(5,359 Views)