LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Variant Creation

Hello,

I am currently using the DB Toolkit for LabVIEW 6.1. I need the ability to create a Variant on the fly, or something similar to a cluster.

I have read data from the database (recordset), converted from the defined type (in the column info vi) to strings. The user has changed the strings and needs to be saved back into the database. I know the fieldnames and the types. From this point, I need to create a cluster of the data. Creating a cluster on the fly is just not possible, but since I am playing with variants, I should be able to create my own variant if I can build a type string and the correct flattened data.

My question is has this ever been done before? Can I generically create my own type string and flattened data, then
converting it to a variant? By using the appendix, I am able to know how the type strings are built, but it is not very descriptive on the flatten strings portion.

If anyone has any knowledge or think they can help my situation, much would be appreciated. Thanks in advance!
Kevin Shirey | CLA | Champion | Senior Project Engineer II | DMC
0 Kudos
Message 1 of 5
(3,164 Views)
The OpenG Toolkit contains a package called LabVIEW Data Tools. This provides tools for doing exactly what you are trying to do.

http://opengtoolkit.sf.net >> LabVIEW Data

Good luck,

Jim
Message 2 of 5
(3,164 Views)
Hi,

Since your database data was converted to strings, I'd recommend just putting together the appropriate SQL string to send to the database. If you are adding a new field, use the "INSERT" command and if you are replacing the originial entries, use the "UPDATE" command.

Refer to the attached VI for an example of what I mean.
0 Kudos
Message 3 of 5
(3,164 Views)
"Jim Kring" wrote in message
news:5065000000050000002CCD0000-1042324653000@exchange.ni.com...
> The OpenG Toolkit contains a package called LabVIEW Data
> Tools
. This provides tools for doing exactly what you are trying
> to do.
>
> http://opengtoolkit.sf.net >> LabVIEW Data
>
> Good luck,
>
> Jim
>

I had a problem very similiar to sinequanon's. By using these lib,
most of my problems have been eleminated. THX
0 Kudos
Message 4 of 5
(3,164 Views)
Looking at the LVData routines, I think I can get the data in the form that I was really looking for. They nearly have all the conversions anyone would want. thanks for the link!
Kevin Shirey | CLA | Champion | Senior Project Engineer II | DMC
0 Kudos
Message 5 of 5
(3,164 Views)