06-17-2022 03:34 AM
Hey everyone,
I porgrammed a table (mulicolumn list) in LabVIEW. I used "ring controls" as the input. For some of them I unchecked "sequential values" and entered my own numbers for "values". Unfortunately, as soon as I start the VI and display the values in the table, the input values show incorrect values or no values at all. In my VI, you can see this especially for the controls: "Waveform Function", "Channel 1:1", "Cycle Count".
Can someone help me and tell me why the values are not taken over in this way?
Thanks in advance.
Solved! Go to Solution.
06-17-2022 03:35 AM
here my VI
06-17-2022 07:01 AM - edited 06-17-2022 07:03 AM
Did you make the controls strict type defs?
Did you deselect "Allow undefined Values?" Did you set Default Values in the type defs?
You didn't attach any ctl files.
06-17-2022 12:31 PM - edited 06-17-2022 12:35 PM
Since you are really only interested in the strings and not the values (you only use the values to get the strings), you would've probably been better off with a combo box instead so you can just use the string directly. In your cycle count, you have item 1 with value 2 and item 2 with value 1. Yet you index your string array with the value of your ring, so if you choose item 1, you index string array element 2, which has a string value of (doesn't exist). Since there is no element 2 in your array, it returns the default value for the string data type which is empty string. I haven't looked at the other ones, but I am very sure they have the same issue. This method of indexing a string value from the string array only works if the values are sequential and start from 0.
Use a combo box and you avoid this mess because the value is the string.
06-17-2022 02:12 PM - edited 06-17-2022 02:51 PM
@Leamri wrote:
here my VI
OK I booted the Laptop
Lets look
So with the Item Square you get a Value of 1 and the element at index 1 is Square (Sine 0 is not shown)
And at the Item "Sinc" you get a value of 11 and the element at index 11 is Expo Rise there are only 13 items so Gaussian 13 gets you the default string value of empty string.
You need to search the Value array for the Value index and then get the string value at that index. so Square "1" is found at element 1 and the string at Strings[]1 is Square Same with Gaussian 13 found at Values index 9 and a string of Gaussian at Strings[]9
Or even this minor mod that protects disabled items
06-18-2022 04:18 AM
Thank you very much! That helps me a lot!
Wish you a good weekend.