LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to change Programmacticly VI from preallocate or clone to Non-Reentrant in labview and Vice Versa

Solved!
Go to solution

HI ,

 

    I need to Change Programtically VI Properties of Exceution of Reentrancy Options(Non-reentrant,Shared Clone and Preallocted Clone).

 

Pls help me out

0 Kudos
Message 1 of 5
(188 Views)

Hi ncn,

 


@ncnteam wrote:

I need to Change Programtically VI Properties of Exceution of Reentrancy Options(Non-reentrant,Shared Clone and Preallocted Clone).


Can you describe the reasons why you need to change that setting "programmatically"?

 

(This setting requires the compiler to recompile your LabVIEW program!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(155 Views)

Hi GerdW,

I have a scenario where I have two loops(MHL), and the same Sub VI is called multiple times. I need to make some of them Shared Clone or Preallocated Clone, and others Non-reentrant, based on user selection through a GUI.

In my program, there are multiple Sub VIs, and based on their function, I need to make this decision dynamically.

My Plan:

  1. Create a GUI that allows users(My fellow Developers) to:

    • Browse and select VIs.

    • Choose the desired Reentrancy Mode (Shared Clone, Preallocated Clone, or Non-reentrant).

  2. Implement a feature to apply the changes programmatically based on the user selection.

Current Progress:

  • I can already change reentrancy modes from Shared Clone to Preallocated Clone.

  • However, I need help in changing the reentrancy mode to Non-reentrant programmatically. (I have attached the VI that I am currently working with.)

Request:

Could you please guide me on how to implement this functionality or if there is any better approach to achieve the same?

Thanks in advance!

0 Kudos
Message 3 of 5
(149 Views)
Solution
Accepted by topic author ncnteam

Hi,

 

It depends whether this is for:

 

1. Modifying a VI in a running application:

 

In this case you simply can't because it requires LV to recompile your program, as @ explained.

So make the VI always reentrant and create as many clones as needed dynamically (1 or more).

Also I don't think this would be a good idea to let a user (non-developer) to choose whether a VI should be reentrant or not.

 

 

2. Making a scripting tool for using when coding (target VI is in edit mode):

 

You can do that by using VI properties:

"Execution > Is Reentrant"

"Execution > Reentrancy Type":

 

Non-reentrant:

raphschru_0-1735647990384.png

 

Reentrant with shared clones:

raphschru_1-1735648014810.png

 

Reentrant with preallocated clones:

raphschru_2-1735648044701.png

 

Also, you may want to save the VI afterwards to make the changes persistent:

raphschru_0-1735655749782.png

 

Regards,

Raphaël.

Message 4 of 5
(130 Views)

Thanks Raphaël for solution.

0 Kudos
Message 5 of 5
(83 Views)