05-08-2015 03:45 AM
Hello,
I want to call a thread from a labwindows/cvi code file to another labwindows/cvi code file. Namely, my thread function (GraphLoop) is in 'TestsModel.c' ; but I will call the thread in 'Tests.c' . My code in 'Tests.c' is in the following;
int CVICALLBACK GraphLoop (void *functionData);
int GraphLoopId;
int callbackDataGraphLoop;
int CVICALLBACK CBBasla (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
CmtInstallThreadPoolCallback (poolHandle, EVENT_TP_THREAD_BEGIN, GraphLoop, callbackDataGraphLoop, GraphLoopId);
if (tiklandiE3631ACihazinaBaglan == 0 && tiklandi34401ACihazinaBaglan == 0) // 'E3631A Cihazına Bağlan' ve '34401A Cihazına Bağlan' tuşlarına basılmamışsa uyarı verir.
{
MessagePopup ("Uyarı", "Lütfen cihaz bağlantısını kontrol ediniz.");
}
else
{
if (tiklandiKaydet == 0)
{
MessagePopup ("Uyarı", "Lütfen ayarları kaydediniz.");
}
else
{
SetCtrlAttribute (Testler, PnlTestler_BASLA, ATTR_DIMMED, 1); // 'Başla' tuşunu pasif hale getirir.
SetCtrlAttribute (Testler, PnlTestler_BASLA, ATTR_DISABLE_PANEL_THEME, 1); // 'Başla' tuşunun etiketini pasif hale getirir.
SetCtrlAttribute (Testler, PnlTestler_BITIR, ATTR_DIMMED, 0); // 'Bitir' tuşunu aktif hale getirir.
SetCtrlAttribute (Testler, PnlTestler_BITIR, ATTR_DISABLE_PANEL_THEME, 0); // 'Bitir' tuşunun etiketini aktif hale getirir.
CmtNewThreadPool (DEFAULT_THREAD_POOL_HANDLE, &poolHandle); //Yeni bir thread oluşturur.
CmtScheduleThreadPoolFunction (poolHandle, GraphLoop, NULL, &GraphLoopId); // GrapLoop thread fonksiyonunu başlatır.
}
}
break;
case EVENT_RIGHT_CLICK:
break;
}
return 0;
}
I take that errror after executing this code;
error:Undefined symbol '_GraphLoop' referenced in "f:\Tests.obj"
Please, can you help me for my question?
Regards...
05-11-2015 02:12 AM
Hello Eren,
I assume this is a link error.
Do you have TestsModel.c file included in your project?
Constantin.