LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Ring Control changes without a write to the ring control

I am experiencing a weird phenomenon. My application opens a main gui.

 

On the main gui is a ring control which allows our operator to choose the test mode that they want the tests to run in. This basically controls the way data is handled and the tests that can be run in that mode.

 

There is another ring control which allows the operator to select the test that they want to run.

 

Once the operator selects a test, there is a Run Test button on the main gui.

 

The issue:

The user selects a test to run then hits the "Run Test" button. Another gui pops up, the main gui remains open, but the second gui becomes the active gui. The test runs and the second gui closes making the main gui the active gui again. On several occassions, and without clicking anything the operator has watched the "Test Mode" Ring change it's value about 10 - 15 seconds after they ran the last test.

 

I have gone through my code and there is nowhere that I programatically write to this control. I only "GetCtrlVal" and dim or undim the control with "SetCtrlAttribute". 

 

Any insight as to what could be causing this is appreciated. I am thinking there maybe a context switching issue here.

John O'C
Staff Test Systems Engineer
Woodward, Inc.
Skokie, Illinois, USA

"Life is not a journey to the grave with the intention of arriving safely
in a pretty and well preserved body, but rather to skid in broadside,
thoroughly used up, totally worn out, and loudly proclaiming...
Wow...What a Ride!"
0 Kudos
Message 1 of 4
(4,266 Views)

Hey johnoc,

 

What you’re seeing does seem pretty weird. Have you noticed if this behavior happens with any specific test that you choose or any specific test mode that you choose?  Is it completely random?

 

I would think that this behavior could only be happening if you have a SetCtrlVal function that is updating your ring value.  Do you have anything in your code that could be doing that?

Taylor
0 Kudos
Message 2 of 4
(4,222 Views)

From my experience, this is often the result of using a panelhandle/control ID combination that don't belong together in a call to something like SetCtrlVal(...).  In a large project, this can be challenging to track down.  What I would look for is a call to SetCtrlVal(...) with the panelhandle of your main GUI with a control ID that is on some other panel.  You can also look in the uir .h file(s) and search for the macros that have the same value as your ring control and see if they are being used inappropiately.  Another way is to turn on "Break on Library Errors", as not all the calls with mismatched panelhandle/control ID combos will work so this may help you track down where they are located in the code.  Hope this helps.

0 Kudos
Message 3 of 4
(4,217 Views)

A common mistake is not using tab page handles.

If you are using tabs in your application, you have to get a separate panel handle for the tab and use it to access a ring on that tab.

 

Make sure you are not making that mistake.

S. Eren BALCI
IMESTEK
0 Kudos
Message 4 of 4
(4,204 Views)