01-03-2007 07:54 AM
01-03-2007 09:06 AM
01-03-2007 09:10 AM
01-03-2007 09:13 AM
01-03-2007 09:24 AM
01-03-2007 09:41 AM
01-03-2007 10:40 AM
You could try modifying the OpenG Variant Configuration VIs to work with extracting data from tables or queries, but I would advise against it, as that would require your cluster elements to have the same name as your columns and would create a strong coupling between your application and the database.
Personally, I just use the method you described - I have my typedef'd data structures (which are only relevant within my application) and when I have to put data from the DB in one of them, there is a subVI which will get the data from the DB and put it into the cluster one element at a time (although even with large clusters, I try to avoid the sequence structures). You can organize your queries to have fields with the same data type near each other and then convert entire subsets of the resulting array into that datatype and use the Index Array primitive to get out all the adjacent ones without using too much screen space.
01-03-2007 10:45 AM
That method is better than what I am using, but it still seems crude. I can write my cluster natively to the table, but I can't read it. Maybe NI will work on that.
Thanks!
01-03-2007 11:03 AM
01-03-2007 09:02 PM - edited 01-03-2007 09:02 PM
Here is the seed of an idea I had been nocking around.
Compose an SQL query based on the cluster elements. I chose to use the caption of the cluster elements so that the unbundles have the names I want but the caption can be set to match the collumn names from the table. (If you really want to get fancy, update the captions of the cluster of the typedef before the application opens)
Do the query and get your array of variants. They should be returned in the order of the query (which we composed based on the cluster order)
Pass the array of variants into another foor loop that uses the Class ID to do the variant conversion.
Come to think of it....
Just wiring the variants to the geneic value refs of the cluster may be good enough.?????
In theory if "cluster" is a type def, new fileds can be added to tthe typedef and it should get updated from the DB.
Maybe turn this into a template?
Your thoughts?
Ben
Message Edited by Ben on 01-03-2007 09:02 PM
Message Edited by Ben on 01-03-2007 09:04 PM
Message Edited by SarahM on 01-08-2007 12:24 PM