Problem with position query
Nora_Harb
Posts: 1
I'm using tha parallax motor and sending a position query command using the following code in C
void QPOS(HANDLE hCom){
byte input[2];
unsignedchar command[] = {0x08};
WriteFile(hCom,command, 1, &read,NULL);
Sleep(100);
ReadFile(hCom, input, 2, &read, &osReader);
}
However, when i send the query, the next write command does not pass through and the position read is not getting sent.
All i get is garbage
whats the solution for this? how could i send a query command and recieve the position correctly?
//cout<<input;
return fWaitingOnRead;
void QPOS(HANDLE hCom){
byte input[2];
unsignedchar command[] = {0x08};
WriteFile(hCom,command, 1, &read,NULL);
Sleep(100);
ReadFile(hCom, input, 2, &read, &osReader);
}
However, when i send the query, the next write command does not pass through and the position read is not getting sent.
All i get is garbage
whats the solution for this? how could i send a query command and recieve the position correctly?
//cout<<input;
return fWaitingOnRead;