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

  • 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 249
3. Verify an IP address.
typedef union IP_CONVERT
{
DWORD dw;
BYTE bt[4];
} IP_CONVERT; //IP Address converting
CString sIP;
sIP.Format(_T("%u.%u.%u.%u"), _IP.bt[3], _IP.bt[2], _IP.bt[1],
_IP.bt[0]);
long lIP = 0;
spLocator->IsPresentMaestro(CComBSTR(sIP), &lIP);
if( _IP.dw == (DWORD)lIP )
{//IP successfully verified
}
else
{//failure
}
4. Create a subscription via the Subscribe method. dwIP is the DWORD variable with
the Maestro IP address.
HRESULT hr = m_queue->Subscribe(dwIP);
5. Cancel the subscription via the Unsubscribe method. dwIP is the DWORD variable
with the Maestro IP address.
HRESULT hr = m_queue->Unsubscribe(dwIP);
6. Clear the Message Queue via the MessageQueueErase method.
HRESULT hr = m_queue->MessageQueueErase();
7. Obtain the Message Queue Size via the MessageQueueSize method.
DWORD dwSize=0;
HRESULT hr = m_queue->MessageQueueSize(&dwSize);
8. Obtain a Maestro Message via the ReadMessage method.
DWORD dwIP, dwID, dwWParam, dwLParam, dwTime;
HRESULT hr = m_queue->ReadMessage(&dwIP, &dwID, &dwWParam,
&dwLParam, &dwTime);
Maestro Software Manual Maestro Message Queue
MAN-MASSW (Ver. Q)
14-3
Zobrazit stránku 249
1 2 ... 245 246 247 248 249 250 251 252 253 254 255 ... 312 313

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

Žádné komentáře