07-21-2016 06:51 PM
Hello guys,
I'm making a .NET interop assembly from a few similar VIs which have a cluster as input, some of them have 3 DBL inside the cluster, some have two DBL..
Using some magic, the compiler creates a .NET class for each cluster found. And then, when using that dll we have to Construct a cluster object which we can set the values and then use the object reference as input to the method...
After the first attempt I realized I had different clusters with the same name "Parameters" among my VIs, but the DLL will need different names for each of them. This makes sense so no big deal let's give them a meaningful name.
Here's the bug, even if I give different names to all my controls, when the compiler finds a second "3 dbl" cluster it will not create another "3 dbl" class, resulting to the impossibility to construct that class when using the dll.
The only workaround I found so far is to make the second cluster "3 sgl" instead so the compiler sees a different type and creates its class.
Is this a known bug? Is it on .NET side or LabVIEW? I'm pretty new to the .NET world so I don't know how it looks like from other languages.
Cheers
07-21-2016 08:59 PM
07-22-2016 06:04 AM
07-22-2016 09:47 AM
Actually even with "Diconnect type definitions" unchecked, it doesnt create two classes with the same signature.
07-25-2016 09:44 AM
Hey Jim,
When you build the assembly, how are the structures named? Looking at the Help (http://zone.ni.com/reference/en-XX/help/371361M-01/lvhowto/charac_net_interop/) it looks like each cluster, even when not type-def'd, should get a unique name.
Cason
Applications Engr., NI
07-26-2016 03:10 PM
Yes that's what I did.
I realized it didn't help to typedef the clusters.
Even if every public controls have a unique name, when they have the same digital signature, LabVIEW won't create another .NET class.
I think it's a LabVIEW bug, nobody complained yet?
I tried with the LabVIEW 2011 compatibility mode and it didn't help...
07-27-2016 10:26 AM
Sorry, I should've been more clear. I meant, what are the names of the .NET structures? According to that help, LabVIEW should give the clusters either default names (LVCluster_#) or, if they're typedef'd, should use the label name as the .NET structure name. I'm wondering what the names are in your case. If you have them as typedef's, do all of the clusters show up with one specific cluster's name? Do they all show up as a generic name?
07-27-2016 10:39 AM
I don't get any LVCluster_#, only the name of the typedefs, everything is named properly except the ones with an identical digital signature are not created.
When I use LabVIEW 2011 compatibility mode, everything gets a generic name like LVCluster_#, but still have the digital signature issue.
07-28-2016 10:28 AM
Jim,
Do you think it would be possible to post, if not the entire project, at least a VI that contains some clusters that demonstrates the problem when you build an assmebly out of it? I'd like to reproduce the issue, and be able to play around with it, but I want to see exactly how you're doing it so we stay on the same page.
Cason
07-28-2016 11:02 AM
I made this simple project which has two methods getCircle and getSquare...
Each has a cluster as input, 3 dbl but different names. myCircle class is available in the dll but not mySquare...
You may have a look at testUI.vi which uses the .NET dll, we can construct a myCircle but not mySquare...
How do you explain that?