LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Force subVI allocation


@nathand wrote:

You cannot do this as easily as you'd like. The solutions that come to mind are:

1) Pull apart the filter (or whatever) VI so that you can pass in the state, then save that state in a shift register.

2) Actually allocate a new copy of the filter VI and call it dynamically, using Open VI Reference.

 

Neither of these approaches will work with the Filter Express VI that you show in your image; they'll both require digging into more LabVIEW programming.

 

It would be better to use a shift register around the for loop, instead of a local variable. It's likely that you don't even need the replace array subset at all, and you could just use auto-indexing on the border of the for loop (wire the output of the case structure directly to the for loop border) and then put the indicator outside the loop.


Yes, thank you - this is what I figured I need to do. This works - and if you put the filter inside a clone-reentrant VI this also works. My problem is now I cannot build an application, but I will start a separate thread about it. When I have time, I'll update this thread with the solution.
0 Kudos
Message 11 of 14
(340 Views)

@SenSLabs wrote:
Yes, thank you - this is what I figured I need to do. This works - and if you put the filter inside a clone-reentrant VI this also works. My problem is now I cannot build an application, but I will start a separate thread about it. When I have time, I'll update this thread with the solution.

I can't see how putting the filter inside a reentrant VI is going to solve the problem. You're still going to have a single instance of that reentrant VI on the block diagram inside the for loop that will need to handle unrelated waveforms, but since it's a single instance it will have only one associated memory space. However, maybe I'm misunderstanding something about either the problem or your implementation; please do post your solution if it works for you.

0 Kudos
Message 12 of 14
(319 Views)

@nathand wrote:



I can't see how putting the filter inside a reentrant VI is going to solve the problem. You're still going to have a single instance of that reentrant VI on the block diagram inside the for loop that will need to handle unrelated waveforms, but since it's a single instance it will have only one associated memory space. However, maybe I'm misunderstanding something about either the problem or your implementation; please do post your solution if it works for you.


Thanks! I'll post the solution a bit later, but basically I create references to the reentrant subVIs in each iteration of the loop - so, there are, say, 8 references created but these references are to 2 different types of subVI - type A and type B. When I call these, they each open a separate clone.

A bit short on time right now to post the solution, but will do so when time allows.

Thanks again!

0 Kudos
Message 13 of 14
(310 Views)

@SenSLabs wrote:

Thanks! I'll post the solution a bit later, but basically I create references to the reentrant subVIs in each iteration of the loop - so, there are, say, 8 references created but these references are to 2 different types of subVI - type A and type B. When I call these, they each open a separate clone.

A bit short on time right now to post the solution, but will do so when time allows.

Thanks again!


Right- that's what I meant in my second suggestion about actually allocating new copies of the VI and calling them dynamically - perhaps I should have elaborated more. In that case, no need to post a solution for my benefit, although it may help others.

0 Kudos
Message 14 of 14
(307 Views)