Hi everyone,
I use motoplus to make a application for ethernet communication. And then, I create 3 tasks in void mpUsrRoot() as follow.
Task_id1 = mpCreateTask(MP_PRI_TIME_NORMAL, MP_STACK_SIZE, (FUNCPTR)mpMain,
arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); //main frame of the application and where I create a client
Task_id2 = mpCreateTask(MP_PRI_TIME_NORMAL, MP_STACK_SIZE, (FUNCPTR)mpOnRecvData,
arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); //for receiving data from my computer
Task_id3 = mpCreateTask(MP_PRI_TIME_NORMAL, MP_STACK_SIZE, (FUNCPTR)mpSendData,
arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); //for sending data to my commputer every 50ms
In the mpRecvData, operation like following:
void mpOnRecvData()
{
while(1)
{
RecvCount = mpRecv(SockHandle,RecvBuf,100,0);
}
}
Now I compile the code and load the *.out to my robot. But the robot can not startup with many errors.
And then, I comment some code like following.
void mpOnRecvData()
{
//while(1)
//{
// RecvCount = mpRecv(SockHandle,RecvBuf,100,0);
//}
}
But the result is always that the robot can not startup normally. So I comment the code which is to create the task like following.
//Task_id3 = mpCreateTask(MP_PRI_TIME_NORMAL, MP_STACK_SIZE, (FUNCPTR)mpRecvData,
arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); //for sending data to my commputer every 50ms
Then the application can run very well and can send data to my computer.
I need help with this issue.
Thank you very much!
BR!
Jonson