04-09-2009 09:10 AM
04-09-2009 10:01 AM
Well, you could try checking for error return values for SetCtrlVal(), (and GetCtrlVal(), while you're at it) just to be absolutely sure you are addressing the control you think you are. You say that the number of iterations is repeatable - is there a clue here? (eg the Nth ring is accidentally a double one, not an int.)
JR
04-09-2009 10:40 AM
04-09-2009 11:12 AM
Hey Guillaume,
If you are trying to change the value of one of the indices in the ring control, you should use ReplaceListItem. SetCtrlVal sets the active item of a ring control to the first of its items that matches a given value.
NickB
National Instruments
04-09-2009 07:30 PM
I'll just rephrase NickB in order to make it clear for myself.
Please correct me if I'm wrong.
For a ring, SetCtrlVal function changes the current selected item of a ring control to the one with the value given as the 3rd parameter to SetCtrlVal.
In order to be able to do it, sometime before that, some code (or the uir editor) should add some value-label pairs to that ring control.
If this is not obeyed, then the behaviour will not be correct.
So, probably the code given starts to fail, when it starts to set values to rings that do not have that values already.