LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid argument type: found 'pointer to char', expected 'int'.

Hello All,

Another question, Please help.

 

int CVICALLBACK tAuto (int panel, int control, int event,
  void *callbackData, int eventData1, int eventData2)
{
 char sMy[50];
 char str[200];
 int d,i;
 switch (event)
 {
  case EVENT_TIMER_TICK:

if (GetBitFestoInputs(1,0)) KLNPassResult = ok;
       sprintf (str, "%d", stTester.ok_mounted_parts);
    MySetCtrlVal (panel, au_esPass, str);
   
   if (GetBitFestoInputs(1,1)) KLNPassResult = nok;
    sprintf (str, "%d", stTester.nok_mounted_parts);
    MySetCtrlVal (panel, au_esFail, str);    /// Highlighted err0r

 

FATAL RUN-TIME ERROR:   "Cobot_Machine Interface.c", line 183, col 17, thread id 7768:   Invalid argument type: found 'pointer to char', expected 'int'.

0 Kudos
Message 1 of 5
(7,345 Views)

In CVI you have both numeric and text indicators / controls. It seems that you are trying to display a string on a numeric control. Check in the UI editor that your au_esFail control actually is a text control...

0 Kudos
Message 2 of 5
(7,318 Views)

Also, make sure that the destination control is on the same panel of the timer control: since you are using 'panel' variable in your call to MySetCtrlVal, you are passing the panel handle of the panel that holds the timer control.

 

Additionally, if you are using an asynchronous timer, the 'panel' variable of timer callback is reserved and does not map to an actual panel handle; if this is your case, you must save the panel handle somewhere and pass it to the timer callback.



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?
0 Kudos
Message 3 of 5
(7,314 Views)

Already solved this issue,

int CVICALLBACK tAuto (int panel, int control, int event,
  void *callbackData, int eventData1, int eventData2)
{
 char sMy[50];
 char str[200];
 int d,i;
 switch (event)
 {
  case EVENT_TIMER_TICK:

if (GetBitFestoInputs(1,0)) {

KLNPassResult = KLNPassResult +1 ;
       sprintf (str, "%d", KLNPassResult );
    MySetCtrlVal (panel, au_esPass, str);

}
   
   if (GetBitFestoInputs(1,1)) {

 KLNFaillResult = KLNFaillResult +1;
    sprintf (str, "%d", KLNFaillResult );

MySetCtrlVal (panel, au_esFail, str);    /// Highlighted err0r

}

 

Thanks!
    

0 Kudos
Message 4 of 5
(7,289 Views)

Good to know!

Just out of curiosity: how did you actually solved the problem? The code continues passing the same string to the very same control, so what??



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?
0 Kudos
Message 5 of 5
(7,286 Views)