LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Parameter type mismatch; expecting char but found pointer to char.

Solved!
Go to solution

This is the error I am getting when trying to format this output below. It doesn't work with the character array and doesn't work with a string as your output constant either. Any help would be appreciated. I had a bunch of spaces I just commented it out to keep just in case I need to go back. When I use the integer constant, it functions with no problems at all.

 

NON-FATAL RUN-TIME ERROR:   "Database.c", line 480, col 39, thread id 416:   Parameter type mismatch; expecting char but found pointer to char.

Here is my code:

 

SetCtrlVal(panelHandle,PANEL_lstsolenoid,"Test Index \t\t\t\t\t Session ID Operator SN Test Date Test Time Error Num Error Desc. System No. Part No.\n");
while((code = DBFetchNext(ch)) == DB_SUCCESS)
{
sprintf(TI1,"%-*d",TESTI,Test_Index1);
sprintf(SID1,"%-*d ",SESSID,Session_ID1);
sprintf(OP3,"%-*c",OP,Operator1);
sprintf(SerialNum1,"%-*d",SERIAL,SN1);
sprintf(TD3,"%-*s",DATE,TestDate1);
sprintf(TT3,"%-*s",TIME,TestTime1);
sprintf(EN1,"%-*d",ERRN,ERRNUM1);
sprintf(ED2,"%-*s",ERRD,ERRDES1);
sprintf(SYSTEMNUM1,"%-*d",SYN,SYNUM1);
//sprintf(PN1,"%-*d",WP,WorkPart_No1);

 

 

//SetCtrlVal(panelHandle,PANEL_lstsolenoid," ");
SetCtrlVal(panelHandle,PANEL_lstsolenoid,TI1);
//SetCtrlVal(panelHandle,PANEL_lstsolenoid," ");
SetCtrlVal(panelHandle,PANEL_lstsolenoid,SID1);
//SetCtrlVal(panelHandle,PANEL_lstsolenoid," ");
SetCtrlVal(panelHandle,PANEL_lstsolenoid,Operator1);
// SetCtrlVal(panelHandle,PANEL_lstsolenoid," ");
SetCtrlVal(panelHandle,PANEL_lstsolenoid,SerialNum1);
//SetCtrlVal(panelHandle,PANEL_lstsolenoid," ");
SetCtrlVal(panelHandle,PANEL_lstsolenoid,TestDate1);
//SetCtrlVal(panelHandle,PANEL_lstsolenoid," ");
SetCtrlVal(panelHandle,PANEL_lstsolenoid,TestTime1);
//SetCtrlVal(panelHandle,PANEL_lstsolenoid," ");
SetCtrlVal(panelHandle,PANEL_lstsolenoid,EN1);
//SetCtrlVal(panelHandle,PANEL_lstsolenoid," ");
SetCtrlVal(panelHandle,PANEL_lstsolenoid,ERRDES1);
//SetCtrlVal(panelHandle,PANEL_lstsolenoid," ");
SetCtrlVal(panelHandle,PANEL_lstsolenoid,SYSTEMNUM1);
//SetCtrlVal(panelHandle,PANEL_lstsolenoid,WorkPart_No1);
SetCtrlVal(panelHandle,PANEL_lstsolenoid,"\n");
}

 

 

0 Kudos
Message 1 of 3
(3,680 Views)
Solution
Accepted by topic author mpwbs

Knowing the line the error arise on would help, the same as the type of variables you are using! 

With the informations you give I can only suppose the error is on the line

sprintf(OP3,"%-*c",OP,Operator1);

%c expects a number and converts it into the corresponding character. If you pass a string to it you are likely to get that error.

If you give us a bit of details more we can assist you better. 



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 3
(3,659 Views)

I solved my issue while waiting for a reply, nothing against you guys but I found that I didn't use the right naming convention with the variables I created in the callout to print my data. I did quite a bit of looking around and I figured it out. But, thanks for that advise I'll keep that in mind when doing my next project that I have to be aware of what I pass.

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