When I run the project, once I click inside the frequency control, the program crashes. I set breakpoints withing the code and the case EVENT_COMMIT: is never executed. It hits the switch (event) and then goes directly to return 0. Why is this happening? (I've double-checked my control on the UIR panel and the control mode is set to "hot" as usual.)
int CVICALLBACK FREQUENCY (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
unsigned int fvco; //oscillator frequency
int fref=FSNOM; //reference frequency
int flag1;
double divn, divr=RNOM;
switch (event)
{
case EVENT_COMMIT:
GetCtrlVal (PANEL, PANEL_FREQUENCY, &f
vco); //gets frequency
GetCtrlVal (PANEL, PANEL_GAIN, &s_cpgain); //gets gain value
flag1=1;
if((fvco<(FMIN/1e6))|(fvco>(FMAX/1e6))) flag1=0; //checks range of frequency
while(flag1==0);
fvco*=1e6; //converts freq to MHz
divn=MakeInteger(fvco/fref); //sets n divider
fvco=fref*divn; //recalculates frequency
GainAdjust(fvco); //function to set gain based on frequency input
FindData(divr, divn); //function to calculate structure elements
Build_NCL(ADF_NCL); //function to calculate elements of binary words
Display_PANEL_data(); //function to display data to panel
break;
case EVENT_RIGHT_CLICK:
break;
}
return 0;
}