06-13-2025 08:38 AM
Hi volks,
i have a main vi with a tab. Each tab should contain the same vi but they have to run independendly from each other. Therefore i placed subpanels within the tabs. I load the sub panel vi (preallocated clone) by using "Open vi reference" with parameter 0x80 (what should not be needed), call "Start asynchronous call" (as I don't want to to lock my main vi) and give that reference to the "Insert VI" method of the sub panel.
This works fine.
However I need to keep the reference to the reentrant clone and pass it over to other vis. And that's where my problems start - I won't get it right.
I tried the generic vi reference constant in my cluster to store the reference but here I cannot bundle the reference, that came from "open vi reference" as the generic type constant does not accept the strict type, that "open vi reference" requires. I tried to make a strict type reference constant and placed it in my cluster. But it is not working, too. Here it claims a "wire: function conflict".
I tried generic reference with "to more specific class" but the polymorphic vi doesn't accept strict typed vi references.
So to sum it up:
- Generic vi reference and no dynamic vi instance = ok
- Strict typed vi reference and store this ref in a cluster = bad
Is there a solution for this problem? Or is there another way I can achieve the same goal?
What I want:
Main VI with multiple tabs, all tabs contain a sub panel of the same vi. Those vi instances have to run completely independend. There must be no effect to each other. Those VIs have to run independend from the host vi. The sub panel vis have own code with UI and interaction, the host decides when and how to close them (right now I implemented a notifier to do so).
Have a nice weekend 🙂
06-13-2025 09:06 AM
@Nils_Thomsen wrote:
I tried to make a strict type reference constant and placed it in my cluster. But it is not working, too. Here it claims a "wire: function conflict".
Create your constant from the refnum wire that comes out of your "Open VI Reference", so you will be sure to have the correct strict VI refnum type.
Also, showing/attaching some actual code is often more efficient than trying to describe your problem textually.
Regards,
Raphaël.
06-13-2025 10:23 AM
If you just want to store the reference to your async VI to insert it into a subpanel, put a generic VI reference in your cluster. There will be a coercion dot since it typecasts your strictly typed VI to a generic VI reference. But you can still insert it into a subpanel, remove it, abort it etc.
06-23-2025 09:37 AM
Hi Basjong53,
sorry, was on sick leave.
Your solution works fine until I try to use the "Wait on asynchronous call". Because this requires a strictly-typed reference and as far as i tried there's no way to convert the ref?!
06-23-2025 09:53 AM - edited 06-23-2025 10:42 AM
@Nils_Thomsen ha scritto:
Hi Basjong53,
sorry, was on sick leave.
Your solution works fine until I try to use the "Wait on asynchronous call". Because this requires a strictly-typed reference and as far as i tried there's no way to convert the ref?!
That's right, you cannot set the VI reference type at runtime, since the connector pane can differ between the VIs. That's simply not how the call by reference works. What you CAN do, is place different strictly typed VI reference (with the same connector pane!) each in a separate case of a case structure (or use a select function if you have just 2 VIs) and select from those at runtime. Then you can dynamically select the VI you want to run.
06-25-2025 02:24 AM
@Nils_Thomsen wrote:
... as far as i tried there's no way to convert the ref?!
You can use To More Specific Class to cast the reference, but as mentioned, the type has to be strict and you have to supply it statically. This means that either all VIs have to have the same type, or you need to wrap the wait node in a case structure, so each wait can have the correct type.
06-25-2025 03:28 AM
@tst wrote:
@Nils_Thomsen wrote:
... as far as i tried there's no way to convert the ref?!
You can use To More Specific Class to cast the reference, but as mentioned, the type has to be strict and you have to supply it statically. This means that either all VIs have to have the same type, or you need to wrap the wait node in a case structure, so each wait can have the correct type.
Doesn't seem to work, or am i missing something?
06-25-2025 03:49 AM
@Yamaeda wrote:
@tst wrote:
@Nils_Thomsen wrote:
... as far as i tried there's no way to convert the ref?!
You can use To More Specific Class to cast the reference, but as mentioned, the type has to be strict and you have to supply it statically. This means that either all VIs have to have the same type, or you need to wrap the wait node in a case structure, so each wait can have the correct type.
Doesn't seem to work, or am i missing something?
No, looks like I was mistaken. A quick test with various conversion tricks makes it looks like there's no simple way of doing this conversion. I was sure this did work for strict VI refs, but apparently not. I guess I didn't have the need for this specific behavior.