LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.net object to VALUE

Does anyone know of plans to add another primitive to labview that will behave like "Variant To Data" but instead of taking a variant, it would take a .NET object?  I'm using the ".NET Object to Variant" then I have to convert the variant to the right data type.  It seems that it should be possible to go straight from .NET to labview data.

thanks,
George
0 Kudos
Message 1 of 4
(2,903 Views)

@gharris wrote:
Does anyone know of plans ...

Only the super-secret agents know this.Smiley Wink

Any considerations of what may or may not be added to future versions of LabVIEW is not openly discussed by NI. Part of this is to not get people's hopes up. You can, however, submit a Product Suggestion.

Just out of curiosity, what is the .NET object that you're using? Is this a custom .NET assembly? Why would it output a generic object type as opposed to a specific type?
0 Kudos
Message 2 of 4
(2,894 Views)

The reason it works like this is simple - this is a VI which was created for LV 7.0 (which is actually just a wrapper for a private VI server method). Back then, NI didn't really do VIs which automatically adapt to their input, only primitives (although there a few which do this using external nodes).

With LV 8, NI added Xnodes, which allow you to do this. They've never been officially released, but NI does use them, so they work at least partially and you should be able to do this yourself (although I wouldn't). If you want to know more, go to LAVA forums and look for the Xnodes forum.


___________________
Try to take over the world!
0 Kudos
Message 3 of 4
(2,876 Views)
Thanks for the replies.  I'll take a look at XNodes and suggest a "Convert .NET to value" primitive.  I'm using npgsql - a .NET client interface for postgresql.  Postgres has supported array data types for years but there hasn't been an easy way to read and write arrays without having to convert them to/from ascii strings.  Npgsql just added array handling capability where in Labview the arrays are returned as .NET objects.  Since I always know the data type of what I'm asking for from the database, its no big deal to convert from .NET to labview data.  Npgsql also has methods for writing .NET objects directly to the database (instead of using regular old ascii sql statements).  I haven't started using that yet, but I'm hoping that it could save some time by not having to do any string parsing.
0 Kudos
Message 4 of 4
(2,863 Views)