LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

List Variant

Hi,
 
I am using the VI "DB Tools Select Data.vi" from the data connectivity toolset and the output is variant. When I get specific data from a table, I would like to get them in a table or listbox, hos is that possible? If you look at the Vi that I have attached, it is the "value" in the inner For Lopp I would like to store in a table or list. anyone have any ideas?
 
Thank you
0 Kudos
Message 1 of 4
(2,800 Views)
Convert the data to strings using the Database Variant to Data function (since the output is an array of variants, you will need to do this inside one or two nested for loops, depending on whether you have 1 or 2 dimensions) and then wire it into the table or into the listbox's Strings[] property.

___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(2,791 Views)

Hi,

But I can't figure out how to give the listbox a string property, because when ever I add a listbox, it is of property I32, and I can't change the representation of it. I can now make it write to a listbox, but every time a new data arrives, it writes over the last one, I would like to add it to the listbox, not overwrite whatever was there before.

Any idea? Thank you!

0 Kudos
Message 3 of 4
(2,786 Views)

Hi Frida

You need to convert the variant data return from your SELECT and convert whatever column item you want,  row by row. Here I am auto indexing out each row and taking the first column, coverting that into a string, converting to a 1D string array and supplying that to the Item Names Property of the list box

Example attached in LV8

Hope this helps

David

0 Kudos
Message 4 of 4
(2,779 Views)