Hello,
i habe a problem with mutlithreading in LabWindow/CVI 6.0.
I have two main functions which habe to work at the same time.
1. PANEL:
int CVICALLBACK OPEN_COM (...)
{
OpenComConfig(1,...) //Function to open a COM-Port
CmtScheduleThreadPoolFunction(DEFAULT_THREAD_POOL_HANDLE; Start_Timer, NULL, NULL);
return 0;
}
int CVICALLBACK Start_Timer(void *funtionData)
{
timerID1 = NewAsyncTimer(1.0, -1, 1, ComPort, NULL);
return 0;
}
int CVICALLBACK ComPort (int reserved, int theTimerId, int ebent, void *callbackData, int eventData1, int eventData2)
{
... //get the string from ComPort 1 an write it to global string Puffer
}
2. PANEL:
void Function()
{
SendByComPort(string); //This functions sends a String to another PC 2
Delay(100); //wait for the answer of PC 2
ReceiveAnswerFromPC2(string); //receive the data from PC 2 which a written to global string Puffer to work with
}
The problem is that the timer which is startet in PANEL1 stops working when i call Delay(100) in Panel2 Function()
thx
Paco