Elmomc Multi-Axis Motion Controller-Maestro Uživatelský manuál Strana 130

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 313
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 129
Parsing of Maestro’s sample response:
CString Input; // Maestro response string
//1 - new line removing
int n = Input.Find( "\r\n" );
while( n != -1 )
{
if( n == 0 )
{
Input = Input.Right( Input.GetLength() - 2 );
}
else
{
CString left = Input.Left( n );
CString right = Input.Right( Input.GetLength() - n - 2 );
Input = left + right;
}
n = Input.Find( "\r\n" );
}
//2 - prompt ‘>’ removing
Input = Input.Left( Input.GetLength() - 1 );
if(bCheckEcho)
{
//3 - new line removing
CString output = Output;
output.TrimRight('\r');
int n = Input.Find( output );
if( n != 0 ) return FALSE; // ECHO is invalid
//4 - echo removing
Input = Input.Right( Input.GetLength() - output.GetLength() );
}
return TRUE;
Maestro Software Manual RS-232 Protocol Specification
MAN-MASSW (Ver. Q)
7-2
Zobrazit stránku 129
1 2 ... 125 126 127 128 129 130 131 132 133 134 135 ... 312 313

Komentáře k této Příručce

Žádné komentáře