LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CVI 8.11 does not update ring control settings

Dear NI,
LabCVI V8.1 and 8.11 do not programmatically update my ring control index upon initialization.  V7.11 did it correctly
Is there any work around for this issue?
Below is some of my code:
int main(int argc, char *argv[])
{
int i;
 
 if (InitCVIRTE (0, argv, 0) == 0)return -1; // out of memory
 if ((TopPanel = LoadPanel (0, "TEST.uir", PANEL)) < 0)return -1;
 TabCtrl = EasyTab_ConvertFromCanvas(TopPanel, PANEL_CANVAS);
 EasyTab_LoadPanels(TopPanel, TabCtrl, 1, "TEST.uir", __CVIUserHInst,NZEPANEL,&NzePanel,UTIL_PANEL,&UtilityPanel,0);
DisplayPanel(TopPanel);
 GetProjectDir (Proj_Dir);
 i = OpenFile (init_file, VAL_READ_ONLY, VAL_OPEN_AS_IS, VAL_ASCII);
 if (i>0)
 {
  ReadLine (i, Temp[0],99);
 ReadLine(i,Interface_Type,1);
  ReadLine (i, User_Comm,2);
  CloseFile(i);
 }
Interface = atoi(Interface_type);
SetCtrlIndex(TopPanel,PANEL_INTERFACE,Interface); //Interface value = 2, but ring index stayed at 0
ProcessSystemEvents();
ProcessDrawEvents();//Just to verify if this works or not
......
RunUserInterface();
.....
Best Regards
Ton Nguyen
0 Kudos
Message 1 of 3
(3,469 Views)
Hi Ton,

I tried creating a very simple example program here, and my control is being initialized as expected.  I have pasted the code below.  I tried to make it as similar to yours as possible.  I am using CVI 8.1.  Is there any way for you to post a stripped down version of your code that I can try here?

int main (int argc, char *argv[])
{
    int error = 0;
   
    /* initialize and load resources */
    nullChk (InitCVIRTE (0, argv, 0));
    errChk (panelHandle = LoadPanel (0, "Main with UI.uir", PANEL));
    errChk (tabHandle = EasyTab_ConvertFromCanvas(panelHandle, PANEL_CANVAS));
    errChk (EasyTab_LoadPanels(panelHandle, tabHandle, 1, "c:\\cvi stuff\\Utility Panel.uir",__CVIUserHInst, PANEL, &tabPanelHandle, 0));
   
    /* display the panel and run the user interface */
    errChk (DisplayPanel (panelHandle));
    errChk (SetCtrlIndex(panelHandle, PANEL_RING, 2));
    errChk (RunUserInterface ());

Error:
    /* clean up */
    DiscardPanel (panelHandle);
    return 0;
}
Pat P.
Software Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,441 Views)

Hello Patrick,

Thank you for your support.  I am using now the built-in Tab in V 8.1 and the problem disappeared.

Regards,

Ton

 

0 Kudos
Message 3 of 3
(3,429 Views)