10-12-2012 04:20 AM
Do you want to change the items or TextRing2 to a different list depending on what's selected in TextRing1? Like a subfolder?
In my example it's easy to add, in the value change event, have your lists in a case structure, and depending on what TextRing1 is, send the appropriate list to the Items[] property of TextRing2
/Y
10-12-2012 04:49 AM
yes i want to change TextRing2 to a different list depending on what's selected in TextRing1. Yes it shall behave like a subfolder. But the problem is that i want to change constants from the host vi and not controls, so that i have automaticcally the right values in text ring 2 constant, when i change the value of text ring 1 constant in the host vi.
10-12-2012 06:47 AM - edited 10-12-2012 06:52 AM
Looking at your code and rereading your posts, you want to change a control in the main vi from the sub-vi? Just send a control ref to the sub-vi and you can change it from inside the sub-vi via properties.
/Y
10-12-2012 06:53 AM
Hello Y, I have post already the two VIs in Post 7 of this discussion.
Thanks.
10-12-2012 08:30 AM
I noticed that, that's why i edited my post. You must have managed to answer in the mean time. 🙂
/Y
10-12-2012 08:43 AM
🙂 I want to change the strings in a combo box control constant placed in the main vi in dependence of a string which i select from a second combo box control constant in the main vi. To control this functionality the sub vi shall be used. I hope you understand what i want to do now.. 🙂
10-12-2012 10:43 AM - edited 10-12-2012 11:19 AM
Diagram constants are just that: constants! Since they don't even show up in the main program front panel, they are irrelevant to the users. You don't even need them.
All you need to do is populate the second control according to the state of the first control when the subVI starts and before waiting for user input. This can be easily done with a few modifications of the code that you already have. All relevant code belongs into the subVI!
(If you still insist of doing it the Rube Goldberg way, you can modify my code and hide the controls on the main vi. (right-click terminal...hide control))
10-12-2012 10:54 AM
A text ring's data type is an integer. Why can't you just pass around the integer? Or you can use the Ring Text.Text property to get the visible string.