LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET Interop Assembly with LV Clusters

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

 

0 Kudos
Message 1 of 12
(5,114 Views)
Are these clusters typedef'd?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 12
(5,100 Views)
It doesn't matter, I tried both cases and the compiler seems to ignore that.
0 Kudos
Message 3 of 12
(5,083 Views)

Actually even with "Diconnect type definitions" unchecked, it doesnt create two classes with the same signature.

0 Kudos
Message 4 of 12
(5,063 Views)

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

Cassandra Longley
Senior Technical Support Engineer - FlexRIO, High Speed Serial and VRTS
0 Kudos
Message 5 of 12
(5,029 Views)

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...

0 Kudos
Message 6 of 12
(5,008 Views)

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?

Cassandra Longley
Senior Technical Support Engineer - FlexRIO, High Speed Serial and VRTS
0 Kudos
Message 7 of 12
(4,987 Views)

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.

0 Kudos
Message 8 of 12
(4,983 Views)

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

Cassandra Longley
Senior Technical Support Engineer - FlexRIO, High Speed Serial and VRTS
0 Kudos
Message 9 of 12
(4,962 Views)

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?

0 Kudos
Message 10 of 12
(4,956 Views)