LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ExtentionData .net: How to handle the value returned by the .net assembly via reference?

Hi,

 

As in subject.

 

How to handle the value returned by the .net assembly via reference? The assembly returns a reference to the object which is string type. How to read the value of the string?

 

There is no properties available and the methods are: Equals, GetHashCode, GetType, ToString.

0 Kudos
Message 1 of 6
(3,345 Views)

Hi,

 

What is the datatype returned? Is it a .NET reference with the properties you listed? Or is it a numeric pointer? 

 

What .NET assembly are you using?

 

I assume you've tried to ToString and this is what is returning your reference?

 

 

Ian S
Applications Engineer CLA
National Instruments UK&Ireland
0 Kudos
Message 2 of 6
(3,317 Views)

Capture.PNG

 

The ExtentionData contains the reference to the string.

 

The .NET assembly is self build assembly (C#) which serves other part of our sysyem. It is a kind of interface from any environment to the company systems.

 

When I did to string I received the name of the type which was: System.Runtime.Serialization.ExtensionDataObject

0 Kudos
Message 3 of 6
(3,309 Views)

Have you consulted with the people who wrote the .NET assembly? They may be able to give you pointers (no pun intended)

 

Looking at the MSDN page for the ExtensionData class, it's not obvious that there is any way to access the contents directly, it looks like it just gets used in serialization.

 

Basically I think we need to find out how the data would be retrieved in the C# environment, I imagine it would be the same as LabVIEW. As you can see in your screenshot, actual string datatypes are returned to LabVIEW as strings.

Ian S
Applications Engineer CLA
National Instruments UK&Ireland
0 Kudos
Message 4 of 6
(3,293 Views)

Yes, actual strings data types are returned as strings. No problem with that.

 

I've contacted with the team who wrote the assembly.

 

I'm not sure you can use pointers in C#...

0 Kudos
Message 5 of 6
(3,285 Views)

As Ian said, Extension Data is likely a real object, and therefore needs to be treated as such. Have you tried to connect a Method and/or Property Node to that refnum and look what methods or properties are present there? It could be an enumeration interface or a simple data reference. For a data reference only, you could use the LabVIEW provided function .Net Object to Variant.vi. But that likely won't work for a more involved interface like an enumeration or such.

Rolf Kalbermatter
My Blog
0 Kudos
Message 6 of 6
(3,281 Views)