06-27-2023 07:11 AM
Hey there,
in my code, which gets compiled into a PPL, I need to call a VI in another application reference. (I guess this is the spot I need to change my requirement!)
To hand over the application reference, I'm using Open VI Reference. No matter if I use VI Server methods, or Call By Reference (with a strict typedef), I will have the same problem:
If there are only LV native data types, everything works fine... But the VI to call has a class on the connector pattern.
When I use Call By Reference I will get
Error 1031 occurred at Open VI Reference in PPL.lvlibp:Call By Reference.vi
Possible reason(s):
LabVIEW: VI Reference type does not match VI connector pane.
When I use VI Server, I cannot cast the class with variant to data:
Error 91 occurred at Variant To Data in PPL.lvlibp:Call By VI Server.vi
Possible reason(s):
LabVIEW: The data type of the variant is not compatible with the data type wired to the type input.
I need to hand over that class between my PPL and the VI. When the class gets pulled into the PPL it gets namespaced, so finally the class inside the PPL is not compatible with the class outside the PPL. I know this is only happening, because I try to dynamically call a VI outside the PPL. If that VI gets pulled into the PPL as well, also the class on the connector pane of the VI will be namespaced and everything would be fine. Why I'm opening the VI dynamically is because I need to call the VI in another application reference...
Any ideas how I could solve that?
I've created a minimal example (LV2016) showing my problem.
Solved! Go to Solution.
06-27-2023 08:54 AM
Hi,
Even if you don't put the class directly inside the library, the PPL will contain a namespaced copy of the class anyway because you are using it statically here:
and here:
The only way I see is putting the class in its own PPL. So both your primary PPL and the "other application" would use the same "packed" class.
Regards,
Raphaël.
06-27-2023 09:00 AM
@raphschru wrote:
The only way I see is putting the class in its own PPL. So both your primary PPL and the "other application" would use the same "packed" class.
Yes, I tried that and it works. Unfortunately, in the real project the VI to call belongs to an installed VIP in vi.lib, which depends on three other lvlibs, so I need to maintain four PPLs which depends on external sources...
06-27-2023 09:56 AM
06-27-2023 10:28 AM
Wow, thank you very much for your effort and your clever solution!
In my real project I need to pass in a class and the VI outputs a big cluster containing several arrays of different classes. So I would need to add a lot of code, but hey, it seems possible! 😀
If anyone has an even more general solution, I still would be interested.