LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Are subvi of reentrant vi need to be specified as rentrant?

It's the first time I need to use reentrant VIs so I'm not familiar with this. I want to test four unit in parallel, so I have 4 clones of the test engine vi (not called dynamically). The test engine vi contains a lot of subVIs, should they also be made reentrant?

 

 

Ben64

0 Kudos
Message 1 of 9
(2,967 Views)

It depends on the need. If you are using USR (Uninitialized Shift Register - More info ) in those sub vi's and want to use the data differently for the different units then make those vi's clone but generally its not required to make the sub vi's clone.

-----

The best solution is the one you find it by yourself
Message 2 of 9
(2,964 Views)

I'm not using any AE in the subs, I will try without making the subVI reentrant.

 

Thanks.

 

Ben64

0 Kudos
Message 3 of 9
(2,953 Views)

@ben64 wrote:

I'm not using any AE in the subs

 

Ben64



But I am Damn sure you will use it in the future.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 4 of 9
(2,951 Views)

I've already been using AE a lot for a while, but not in this case.

 

Ben64

0 Kudos
Message 5 of 9
(2,948 Views)

You can use non-rentrant in a re-entrant VI but if both instances are trying to use the same non-reentrant sub-VI, the second will hang waiting fo rthe first to finish using the sub-VI.

 

If you are talking LVOOP and recursive classes... then it appears everything has to be re-entrant. Well at least I LV insisted I make them all re-entrant.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 9
(2,935 Views)

@Ben wrote:

You can use non-rentrant in a re-entrant VI but if both instances are trying to use the same non-reentrant sub-VI, the second will hang waiting fo rthe first to finish using the sub-VI.

 

If you are talking LVOOP and recursive classes... then it appears everything has to be re-entrant. Well at least I LV insisted I make them all re-entrant.

 

Ben


Thanks Ben,

 

In this case it is not LVOOP and recursive classes. I want to test 4 units in parallel so I have 4 copies of my test engine VIs. From what you're saying it seems I should made some of the subVIs reentrant to avoid the other instances to hang. One of the sub is a test state machine so probably this one also will have subVIS to be made reentrant.

 

Ben64

0 Kudos
Message 7 of 9
(2,932 Views)

Sounds right.

 

Here are a couple of tip if you run into a situation where you you would love to use an AE in that scenario but can't because the two different re-entrant instances would interfere with each other.

 

Option 1

Use Call by Ref nodes to invoke the AE and open a new instance of the Ae for each top-level re-entrant VI.

 

Option 2

Use a DVR to store the data (one for each top-Level) and pass the RDV ref to a pseudo-AE and let act on the DVR data instance instead of data from its internal SR.

 

Option 3

Use LVOOP methods instead of an AE, and keep the Class data in the Top-level re-entrant.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 8 of 9
(2,929 Views)

Thanks Ben

0 Kudos
Message 9 of 9
(2,921 Views)