03-11-2014 11:44 AM
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.
03-12-2014 06:15 AM
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?
03-12-2014 08:15 AM
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
03-13-2014 05:04 AM
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.
03-13-2014 05:16 AM
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#...
03-13-2014 05:21 AM - edited 03-13-2014 05:22 AM
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.