LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ring Controls values wrong

Solved!
Go to solution

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.

0 Kudos
Message 1 of 6
(1,918 Views)
0 Kudos
Message 2 of 6
(1,917 Views)

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.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 6
(1,885 Views)

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 4 of 6
(1,859 Views)
Solution
Accepted by topic author Leamri

@Leamri wrote:

here my VI


OK I booted the Laptop

Lets look

Capture.pngCapture1.png

Capture4.PNG

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

Capture.png

Or even this minor mod that protects disabled items

Capture.png


"Should be" isn't "Is" -Jay
Message 5 of 6
(1,841 Views)

Thank you very much! That helps me a lot!

 

Wish you a good weekend.

0 Kudos
Message 6 of 6
(1,814 Views)