LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Parameter type mismatch error

hi
I got Parameter type mismatch error during running my cvi application,
Parameter type mismatch:
expecting double but found pointer to double
 
the relative code is:
 sprintf(str,"\nMobile Phone-> %s, Batt.Volt: %3.2f V, SN: %s",g_szDutName,g_vArrayVol[i],g_szDutSn);
            OutputResult(str);
 
I know it is the setting of g_vArrayVol[i], i set it ViReal64 g_vArrayVol[4][32] in the *.h file.
 
Maybe this is a little bit stupid question, but I really can not solve it.
Hope anybody help me.
crystal
0 Kudos
Message 1 of 4
(3,503 Views)
Crystal, as you say your data array is defined as g_vArrayVol[4][32]
I have stressed out the dimensions since your problem is directly involved with them: when you are printing out the battery voltage, you are passing to sprintf  g_vArrayVol[i], thet is the address of the whole 32 elements array of index [i] (let is to say, the whole i-th row in the matrix); the error you are finding states exactly that the parameter passed to sprintf is an array (i.e. a pointer to a memory area that stores actual data in double format) and not a double precision variable.
You should instead pass an individual element in the 2d array, as an example g_vArrayVol[i][0] .


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 4
(3,491 Views)
Same opinion...

Message Edited by CVI-User on 01-24-2006 09:54 AM

-----------------------
/* Nothing past this point should fail if the code is working as intended */
0 Kudos
Message 3 of 4
(3,492 Views)

Hi Roberto,

Thanks for your help and explanation. I have solved this problem.

crystal

0 Kudos
Message 4 of 4
(3,462 Views)