I am creating an application that uses .NET assemblies to display a from & display data on it. I am using a datagrid control to display data (I have found the Labview table is difficult to handle than the .NET one look at the wiring I would have to do just to limit table size!). Before reading following please refer to the VI I have attached.
The .NET function (DataRowCollection.Add()) demands a .NET referance. Unfortunately I need to pass a string to it! So I have to create a sring class as I have put into the diagram. (BTW the String class is in C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\mscorlib.dll).
I need to know if there is a simple way to convert the labview string into a .NET string class referance. I would also like to here if support for .NET events is getting to us in near future 🙂
There are a couple of VIs you need that are in vi.lib. Go to /Platform/dotnet.llb
These two VIs convert between LV data types and .NET types. On the return trip (from .NET to LV), they return LV Variants. You then use the Variant to Data VI to convert to the specific type of LV data type you want. I tried them out using the DataRowCollection and it seemed to work fine.
I'm not sure exactly what you need to know. What, specifically isn't working? The To Object VI's?
Also, please let me know what version of LV you are using. Since this post, LV 8 and 8.0.1 have come out and there have been more changes to how we adapt to .NET types.