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: 

can you run two separate vi's in parallel

Solved!
Go to solution

Can you run two seperate Vi's in parallel? Will this make response considerably slower? 

0 Kudos
Message 1 of 11
(5,751 Views)

In general, yes, and in general the code will run truly in parallel (as much as can be accomplished with multi-threading).  There are enough gotchas though that you'd be better off providing more details and getting a more tailored response.

 

 

Are you asking if you can run the same VI twice at the same time? If you can drop the same VI on a block diagram twice? 

 

 

0 Kudos
Message 2 of 11
(5,730 Views)

@Zwired1 wrote:

In general, yes, and in general the code will run truly in parallel (as much as can be accomplished with multi-threading) 

 


There is no way you can make such a statement.  The original question was too incomplete.  Without details on what they are really asking, you can't make a blanket statement about what the code can and cannot do.

0 Kudos
Message 3 of 11
(5,697 Views)

Hi, what more detail is needed? They are two entirely seperate independent vi's with no shared sub vis.

 

I just wanted to know if you can run two independent vi's at the same time, as in just have two seperate programs and run them.

0 Kudos
Message 4 of 11
(5,689 Views)
Solution
Accepted by topic author eugeniap

That is more details.

 

Yes you can them in parallel without any problems.

0 Kudos
Message 5 of 11
(5,678 Views)
Solution
Accepted by topic author eugeniap

I'd be in a LOT of trouble if I couldn't.  I usually have a VI for each part of my system: DAQ reading, instrument control, state machine, user interface, data logging, etc.  They all run in parallel and I have some sort of communications between them as necessary.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 11
(5,657 Views)

@eugeniap wrote:

Hi, what more detail is needed? They are two entirely seperate independent vi's with no shared sub vis.

 

I just wanted to know if you can run two independent vi's at the same time, as in just have two seperate programs and run them.


Separate isn't the same as independent.  That's why they wanted more information. 

 

Your second question asked about slowed response.  That's another place you didn't offer anywhere near enough information for a true answer.  How many loops are you running in each of these independent VIs?  How many cores does your processor have?  Are you including a 0ms wait in your loops to avoid railing your processor?

 

It's possible you'll see such a negligible change in processing that you won't notice.  It's also possible you'll feel like you're draining your system.  It's generally best to err on the side of too many details rather than too few when you're asking questions.  If you don't know the answer, you likely don't know how each piece plays a part in the answer.  More information allows others to pick out the relevant pieces and give you a better answer.

0 Kudos
Message 7 of 11
(5,630 Views)

@eugeniap wrote:

Hi, what more detail is needed? They are two entirely seperate independent vi's with no shared sub vis.

 

I just wanted to know if you can run two independent vi's at the same time, as in just have two seperate programs and run them.


This question often occurs when the developer does not understand the paradigm shift that a "Dataflow" language like LabVIEW necessitates.

 

Unlike other development enviorments you may use,  LabVIEW is unique in that reguard.  Pararell threads are automatic with a dataflow language,  what other specifics do you need?


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 11
(5,619 Views)

I appologise if my response came across as rude, I was just asking what details were needed as I was unaware. 

 

I didn't really want a detailed answer regarding running two independent vi's, just a yes or a no. 

 

Also the speed question was just secondary, a passing comment, I will see when I test it.

 

Thanks for your help.

0 Kudos
Message 9 of 11
(5,597 Views)
You should know that a simple yes/no is not possible without a few details. What each of the VIs does is extremely important. For example, you cannot run two VIs in parallel if they access the same DAQ hardware.
0 Kudos
Message 10 of 11
(5,562 Views)