cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Parallel Execution of VIs in LabVIEW

Solved!
Go to solution
Highlighted

Parallel Execution of VIs in LabVIEW

Hi,

     I want to parallely execute 3 VIs simultaneously.  I have used a global variable to trigger event in 3 VIs. But the input from 1st VI is used as the ouput for 2nd one. So the 2nd VI is waiting for 1st VI to complete. How to overcome this problem? The input is an array variable. I want ot execute the 2nd VI for each row updation of array from 1st VI.

Please give a solution

0 Kudos
Message 1 of 20
(215 Views)

Re: Parallel Execution of VIs in LabVIEW

Hi rakesh,

 

But the input from 1st VI is used as the ouput for 2nd one. So the 2nd VI is waiting for 1st VI to complete. How to overcome this problem? The input is an array variable. I want ot execute the 2nd VI for each row updation of array from 1st VI.

To let the 2nd VI execute AFTER the 1st VI you should use DATAFLOW by wires!

When you really want to execute them in parallel but still have 2nd wait for 1st you should use a queue (producer-consumer scheme)…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 on Win7+cRIO
Kudos are welcome Smiley Wink

Message 2 of 20
(212 Views)

parallel execution of VIs

I want to run three VIs in parallel. One VI will generate a set of data (say 1 row of 2D array in each iteration). The 2nd VI will do some processing  in the first row and calculate result and update the data structure.. The third VI has to display this and log to a text file. 3rd VI will then wait for 2nd row to update. The three VIs has to run parallel. 

Please tell a solution for the above problem ?? . Also which data structure I have to use for sharing data between VIs?Thanks in advance

0 Kudos
Message 3 of 20
(198 Views)

Re: parallel execution of VIs

Hi rakesh,

 

what's your reason to start a new thread for the same topic - after you got an answer?

 

Please tell a solution for the above problem ??

Use a producer-consumer scheme.

 

The three VIs has to run parallel. 

Why do they need to run in parallel when they have to wait for each other???

 

Also which data structure I have to use for sharing data between VIs?

Data structure depends on your data…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 on Win7+cRIO
Kudos are welcome Smiley Wink

Message 4 of 20
(193 Views)

Re: parallel execution of VIs


rakesh@labview wrote:

Please tell a solution for the above problem ??


Definitely look at the Producer/Consumer.  The idea is to use queues to send the data from one loop to the next.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 5 of 20
(162 Views)

Re: parallel execution of VIs

Ok. thanks.

How can I share data between two VIs other than global variable?.

Producer consumer means through queue message handler?

 

 

0 Kudos
Message 6 of 20
(159 Views)

Re: parallel execution of VIs

My data generation is in one VI and processing is in another VI. So how can I exchange data using message queues?

0 Kudos
Message 7 of 20
(156 Views)

Re: parallel execution of VIs

did you have a look at the link for the producer-consumer pattern?

did it answer your question?

have you tried to implement the pattern in your own VI?

do you have problems? do you have code to show your problem?


If Tetris has taught me anything, it's errors pile up and accomplishments disappear.
0 Kudos
Message 8 of 20
(151 Views)

Re: parallel execution of VIs

Thanks for the reply.Yes I have.

But the problem is I have to use two VIs. One will generate data in loop and another Vi has to get this data and do some processing and display to the main GUI. For the literature and NI template I got a single VI for production nad consumption. How to implement it in two VIs. Please help

 

0 Kudos
Message 9 of 20
(143 Views)

Re: parallel execution of VIs

Hi rakesh,

 

implement a producer-consumer scheme.

LabVIEW comes with ready-to-use example projects, (atleast) one of them shows a typical producer-consumer setup!

 

What have you tried? Where are you stuck? What is your problem?

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 10 of 20
(138 Views)