hi
what is the error?please inspect the code for me,thank you very much!
the code is:
int CVICALLBACK GenerWave (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
// double p;
switch (event)
{
double *wave;
double samples;
double f;
double phase;
double cycnum;
double sampcyc;
double amp;
case EVENT_COMMIT:
GetCtrlVal (panelHandle, PANEL_AMP, &);
GetCtrlVal (panelHandle, PANEL_SAMPCYC, &sampcyc);
f=1.0/sampcyc;
GetCtrlVal (panelHandle, PANEL_CYCNUM, &cycnum);
GetCtrlVal (panelHandle, PANEL_PHASE, &phase);
samples=sampcyc*cycnum;
wave=malloc(samples*sizeof(double));
SineWave (samples, amp, f, &phase, wave);
// DeleteGraphPlot (panelHandle, PANEL_GRAPH, -1, VAL_IMMEDIATE_DRAW);
// PlotY(panelHandle, PANEL_GRAPH, wave, samples, VAL_DOUBLE, VAL_THIN_LINE, VAL_EMPTY_SQUARE,VAL_SOLID, 1, VAL_RED);
PlotY (panelHandle,PANEL_GRAPH,wave,samples,VAL_DOUBLE,VAL_THIN_LINE,VAL_EMPTY_SQUARE,
VAL_SOLID,1,VAL_RED);
free(wave);
break;
}
return 0;
}