Thank you very much Eric. The answer is Yes or no. For now we just use a motor#n address which is not connected to any physical motor to be safe.
Our goal is to call the user-defined servo routine from a c program on the IDE. I tried out your flag check idea (Mptr->ClosedLoop or Mptr->AmpEna), but still after enabling motor ( #nj/ ) from terminal the sevoCtrl routine starts and never gets stop; I actually confirmed that by printing a command on the unsolicited window from the servoCtrl function below. I am still looking for a stop command such that I can call it from terminal and be able to stop servoCtrl routine below, in other words what is the opposite command to (#nj/) . Any idea would be greatly appreciated.
double PIDmodel_user_servo(struct MotorData *Mptr)
{
servoout = 0;
//In this loop it is asked to stop sending message to unsolicited window once motor amplifier was disabled
// Motor[n].ServoCtrl = 0 from terminal, but it does not seem to work as it keeps printing the message on the unsolicited //window forever until we reset the whole system.
if (Mptr->AmpEna)
{
servoout = 0;
MyCharArray[0]= 'H';
Send(1,&MyCharArray);
}
//use_return
return servoout;
}