LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you access a control's value on an EasyTab panel?

I am trying to access the value of a control embedded on an EasyTab.

Here is a code snipet:
===================================================
int panelTabs;
int tabCtrl;

int InputUI(void)
{
//display graph
panelTabs = LoadPanel (0, "daqstartup.uir", PANEL);

//convert canvas to tabs
tabCtrl = EasyTab_ConvertFromCanvas(panelTabs, PANEL_CANVAS);

EasyTab_LoadPanels (panelTabs, tabCtrl, 1, "daqstartup.uir", __CVIUserHInst, FNPANEL, filenameTab, 0);

//Display the panel and run the UI
InstallPopup (panelTabs);

//process system events
run = RunUserInterface ();

//Free resources and return
DiscardPanel (panelTabs);
}

//access c
ontrol value
SetCtrlVal (FNPANEL, FNPANEL_DATAFILE, filename); //DOES NOT WORK!
===================================================

DATAFILE is the name of the control on the FNPANEL.

Am I supposed to substitue filenameTab for the panel name? What am I doing wrong?

rink
0 Kudos
Message 1 of 4
(3,246 Views)
The first argument in SetCtrlVal is the panel HANDLE not the panel CONSTANT. That means it should be filenameTab (declared as int) instead of FNPANEL.

Best Regards,

Chris Matthews
National Instruments
0 Kudos
Message 2 of 4
(3,246 Views)
Thanks for the help, Chris.

It also turned out that I hadn't passed the panel handles to EasyTab_LoadPanels by reference (&filenameTab). It never complained at compile time or runtime. It just didn't work.

Kay
0 Kudos
Message 3 of 4
(3,246 Views)
Right. It won't complain since you could actually be wanting to store the reference in an integer.

Chris
0 Kudos
Message 4 of 4
(3,246 Views)