07-28-2017 11:02 AM
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'.
07-29-2017 01:12 AM
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...
07-29-2017 05:18 AM
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.
07-31-2017 10:23 AM
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!
07-31-2017 10:38 AM
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??