LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Error returning "expected pointer to void"

I'm trying to pass an argument to a log file, by using "GetCtrlVal", but I get an error stating "expected pointer to void"

//In this function, I'm trying to pass "tin" argument to a log file but I get an error compiling.
void CVICALLBACK FPAdviseCallBack(void* buffer)
{
IAByte* Databuffer;

FP_CallbackParamType g_param;
float* value;
double tsh;

int i,j;

g_param = *((FP_CallbackParamType*) buffer); //cast data from void*
Databuffer = g_param.buffer;

//Temperature In value
value = (float*)(Databuffer);
SetCtrlVal (panelHandle, PANEL_AI0, *value);
GetCtrlVal (panelHandle, PANEL_AI0, tin);
}

//In the function below, I am able to pass the two arguments to a log file with n
o problems.
int CVICALLBACK configure_mchs(int panel, int control, int event, void *callbackData, int eventData1, int eventData2)
{
double holio;
if (event == EVENT_COMMIT)
{
GetCtrlVal (panelHandle2, CONFIGURE_HEATSINK, HeatSink);
GetCtrlVal (panelHandle2, CONFIGURE_FLOWRATE, Flowrate);


SetCtrlVal (panelHandle, PANEL_HEATSINK, HeatSink);
SetCtrlVal (panelHandle, PANEL_FLOWRATE, Flowrate);


HidePanel (panelHandle2);
}
return(0);
}
0 Kudos
Message 1 of 2
(4,090 Views)
The GetCtrlVal function expects a pointer as the third parameter, and that way it stores the value read in the variable pointed to by that pointer.
You should modify your code as follows:
GetCtrlVal (panelHandle, PANEL_AI0, &tin);
supposing 'tin' type matches the data type of the control PANEL_AI0.

Hope this helps
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 2
(4,090 Views)