LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reentrant execution for loop

Solved!
Go to solution

Hi,

 

Is it possible to make a reentrant execution of a VI in a for loop? So that every iteration of the for loop has it's own instance of the VI... I am having trouble withe Highpass filter VI, when i put this in a for loop and set the "init/cont" to true it does not does a proper job because it uses the same VI every itteration, and it should clone itself for every itterartion and use the same instance of the VI when it comes back in the itteration...

 

I hope you understand what i mean...

 

Best regards,

Thijs 

0 Kudos
Message 1 of 21
(2,990 Views)

Not that I know.

 

But if the filter VI inside the for loop is reentrant AND you set your for loop to be parallelized as many times as the number of elements in the array it's indexed on maybe that would work?

 

Pure guess though, I've never really used parallel For loops.

 

Does your array always contain the same number of element (I guess signal to filter)?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 21
(2,986 Views)
The parallel forloop doesn't do the job... That has something to do with the cores of the processor i think...
0 Kudos
Message 3 of 21
(2,982 Views)
And the array can have different numbers of signals..
0 Kudos
Message 4 of 21
(2,980 Views)

I tried the parallelism for loop but it doesn't do it... The 2 seperate Vis works great, but that's not what i want....

Download All
0 Kudos
Message 5 of 21
(2,971 Views)

What is the maximum size of your array?

 

If you do have a max array size that is not too high maybe you could do something like this :

 

Clipboard01.png

 

At least I know thi would work, I know because I've used this technique in a case where I could have form 1 to 4 channels to filter.

 

hope this helps


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 6 of 21
(2,959 Views)

Maybe not the most efficient way of accomplishing this, but you could wrap whatever you want to do in a vi template and open a new instance for each iteration using vi server.



CLA
www.dvel.se
0 Kudos
Message 7 of 21
(2,955 Views)

It is a solution but i prefer, a dynamic solution...

thanks

0 Kudos
Message 8 of 21
(2,952 Views)

How would i do that? M_Peeker?

0 Kudos
Message 9 of 21
(2,950 Views)

Using VI Server to instanciate clones of the filtering VI, as suggested by M_Peeker will work and is dynamic but will require some additional coding :-o.

 

 


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 10 of 21
(2,946 Views)