12-31-2024 03:44 AM
HI ,
I need to Change Programtically VI Properties of Exceution of Reentrancy Options(Non-reentrant,Shared Clone and Preallocted Clone).
Pls help me out
Solved! Go to Solution.
12-31-2024 06:32 AM
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!)
12-31-2024 06:51 AM
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.
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).
Implement a feature to apply the changes programmatically based on the user selection.
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.)
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!
12-31-2024 08:37 AM - edited 12-31-2024 08:57 AM
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 @GerdW 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:
Reentrant with shared clones:
Reentrant with preallocated clones:
Also, you may want to save the VI afterwards to make the changes persistent:
Regards,
Raphaël.
01-01-2025 10:12 PM
Thanks Raphaël for solution.