LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert a Labview data type to .NET data type?

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 🙂

Thanks & Regards,
Suraj
0 Kudos
Message 1 of 7
(5,314 Views)
Your VI did not come through for some reason. If you want to try and post it again, I would be happy to take a look.
Robert Mortensen
Software Engineer
National Instruments
0 Kudos
Message 2 of 7
(5,296 Views)
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.
Message 3 of 7
(5,289 Views)
I don't know why it didn't came through ?

Message Edited by Suraj on 05-16-2005 06:08 PM

0 Kudos
Message 4 of 7
(5,288 Views)
Yes it works! It seems there are bonus items in the vi.lib directory got to explore 😉
0 Kudos
Message 5 of 7
(5,283 Views)
How did you get it to work ? I am facing the same problem.

Kudos are the best way to say thanks 🙂
0 Kudos
Message 6 of 7
(4,781 Views)
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.
 
Brian
0 Kudos
Message 7 of 7
(4,759 Views)