LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the pattern on UIR changes that change code?

I have noticed that when I change my UIR file, without adding/deleting controls, that my application acts differently.
- Sometimes the application's SetCtrlVal() changes the incorrect controls.
- Sometimes the threads are running incorrectly.
- Sometimes the incorrect panels open up.

However, when I re-build the application, everything works fine.

I did a DIFF (using VSS before I checked in my code), I noticed that the file changed the values of the controls, after:
- only changing the text of a control
- only moving controls to align with other controls.

What are actions that I can do with UIR files that will not modify the file? Or make my application act differently?
0 Kudos
Message 1 of 3
(3,047 Views)
First off, you should be using the constant names of the controls (i.e. PANEL_TEXTBOX), not numeric values in your code to reference the controls, then this wouldn't be an issue.

Assuming you have some reason why you are not using the constants, CVI sets the value of the constants based on TAB ORDER. If the tab order changes, the values of the control constants change. If you noticed a change in values for the control constants, the tab order must have changed in your UIR.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 3
(3,047 Views)
Sorry for the confusion... Actually, I am using the constants given in the UIR.H file. The global value I use is the panel<_handle> variable the is created. I use the global variable instead of the parameter passed in the callbacks.
callback( int panel, int control, ...)
{ use(panel_handle, PANEL_CONTROL1);
The unusual pattern that I have seen is that when I don't change the tab order and:
- I move a control in the file,
- or I change the text from "old text" to "new text" (title for the control)
- and other unusual situations...

that's the time I (sometimes) get unusual conditions. But when I recompile the code all is (always) well.
*** I was hoping that when I change the UIR file, I won't have to re-compile.
- I don
't change the tab order
- I don't add any controls,
- I only move the controls to align it with other controls,

I don't see any announcements that identify any patterns. These conditions is sometimes okay, and sometimes not. I've taken to tell my users not to modify the uir file at all, and when I modify the file, I always re-compile it.

Is there a pattern that I should watch out for?

Thanks.
0 Kudos
Message 3 of 3
(3,047 Views)