01-03-2019 10:26 AM - edited 01-03-2019 10:27 AM
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");
}
Solved! Go to Solution.
01-05-2019 08:16 AM
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.
01-07-2019 06:55 AM
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.