LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Make own create VI resusable

Solved!
Go to solution

Hello, 

I have create a sub VI for a specific function, however, when I drag 2 of them on the block diagram it's like it is one. the controls have the same memory. How to make each one independent?

Regards,

0 Kudos
Message 1 of 12
(3,035 Views)
Solution
Accepted by topic author idir93

Hi idir,

 

to create two independent instances of the very same VI you need to make it reentrant in its VI settings!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 12
(3,027 Views)

Even if I make it prelocated clone reentrant execution, the subvis still share the same memory and act as if it is one.

Even with the PID vi that is proposed by NI, it is the same thing.

 

0 Kudos
Message 3 of 12
(2,932 Views)

Hi idir,

 

when there is a problem within YOUR VI you should attach this VI.

We cannot debug your VI when all you provide are some sentences…

Best regards,
GerdW


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

ok. here it is

Download All
0 Kudos
Message 5 of 12
(2,925 Views)

Hi idir,

 

how do you check the different data spaces when your subVI doesn't use any in/outputs?

Why do you need reentrancy for such a subVI? This only makes sense when you use shift registers inside the subVI!

 

For me it looks fine after some editing:

check.png

(Well, in general I think it would be a good idea to name VIs like "Main" and "sub" instead of "iii" and "vii"…)

Best regards,
GerdW


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

Thanks a lot for the help.

But I think you didn't get me well.

I want to be able to run the same subvi twice at the same time with access to two front panels of the subvi in order to be able to change some controls. I do not want them to be connectors like I/O.

Thanks

0 Kudos
Message 7 of 12
(2,914 Views)

Hi idir,

 

But I think you didn't get me well. I want to be able to run the same subvi twice at the same time with access to two front panels of the subvi

Did you say so before?

 

Just open the frontpanel of both VIs. What's the problem?

(I set your subVI to show it's frontpanel and run the main VI: I can change the control in each subVI independently from the other subVI.)

Best regards,
GerdW


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

Thanks,

So you mean the use of shift registers is a must?

Regards,

0 Kudos
Message 9 of 12
(2,903 Views)

Hi idir,

 

no, for the reply in my last message I took your original VIs.

All I changed was the display settings of the subVI…

Best regards,
GerdW


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