LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Series and Parallel Code Flow Time

Solved!
Go to solution

Hello Everyone,

 

If I Run 5 Sub Vi In Parallel and another Condition Same 5 Sub Vi In Series. Wait Time is 100ms

 

How Time execution Work in Series and Parallel Operation?

 

Thank you.

SeriesSeriesparallelparallel

0 Kudos
Message 1 of 7
(1,491 Views)
Solution
Accepted by rupesh.v

Hi rupesh,

 

ever heard of the basic THINK DATAFLOW! mantra of LabVIEW?

 

The loop will iterate when all its content has been executed! (DATAFLOW!)

So it will iterate when all subVIs are executed AND the parallel running 100ms wait is finished.

Executing your subVIs will take longer to execute in series (one after the other) than in parallel. Depending of the code inside those subVIs executing them in series may even take longer than your 100ms wait (which may also happen when executed in parallel)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(1,459 Views)
Solution
Accepted by rupesh.v

As GerdW said your loop will not run faster than the loop timer (100 ms in your example). If you want to decrease the time then make the loop timer smaller. Additionally, if that is 5 copies of the same subvi as it appears then you must set the subvi to run reentrant in order to run in parallel. If the subvi is at the default non-reentrant then each copy of the subvi has to complete before another copy can execute.

 

Edited to add: I made the assumption that you had tested both loops and were coming up with identical 100 ms timing, which you should if the code in the subvis run fast enough to complete 5 times in 100 ms.

0 Kudos
Message 3 of 7
(1,433 Views)

There is not enough information to really answer anything:

 

  • What does the subVI do?
  • Looks like it gets data from a DMM. How?
  • Are these five different instruments?
  • How do you communicate with them? (serial, ethernet, etc.)
  • Is the subVI reentrant? Is it even safe to run it in parallel? Who wrote it? Why are there no inputs (except error)?
  • Is each subVI call significantly faster than 100ms or does each lock the caller for extended times?
  • To compare the two scenarios, remove the wait and measure the loop time.
0 Kudos
Message 4 of 7
(1,410 Views)

Hi GredW,

 

Thank for Reply.

 

My Quires is ,How WAIT time is Working? when Code Executed ,For Below Sub Vi

 

Its Wait 100ms For All 5 Sub Vi or it will Divide for 5 Sub Vi ? 

 

Thank you.

 

 

 

 

0 Kudos
Message 5 of 7
(1,358 Views)
Solution
Accepted by rupesh.v

It has nothing to do with how many subVI's there are.

 

It is its own parallel path.  The loop won't finish and iterate again until all code inside is done.  If 1 or 100 subVI's go really fast,  faster than 100 milliseconds, the the Wait will hold up the loop because it won't finish until the 100 milliseconds have passed.

 

If those subVI's take a long enough time, either running together or in series, or some combination where it takes more than 100 msecs for them to finish, then the wait function will finish first after 100 msec, but the loop iteration won't finish until all that other code has also finished.

0 Kudos
Message 6 of 7
(1,355 Views)

Hello  Sir,

 

Its very Nice To Explained. It Was Clear Concept, For Me.

 

Thank you In Advanced.

 

 

 

 

0 Kudos
Message 7 of 7
(1,345 Views)