Advantech PCI-1682U Instrukcja Użytkownika Strona 49

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 104
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 48
43 PCI-1680U/1682U User Manual
Chapter 4 Software Requirements
Return Value
Successful: return non-zero values. Unsuccessful: return zero value. Please call Get-
LastError function.
If users cancel the operation or reset chip, GetLastError will be called to return
ERROR_OPERATION_ABORTED.
In asynchronous mode, operation will be pending if drivers cannot complete user's
request, and GetLastError will be called to return ERROR_IO_PENDING.
See MSDN for more information.
Example
Wait event in synchronous mode.
BOOL bSuccess = SetCommMask(hDevice, EV_ERR | EV_RXCHAR);
if(!bSuccess)
{
//error
}
DWORD dwMask = 0;
bSuccess = WaitCommEvent(hDevice, &dwMask, NULL);
if(bSuccess)
{
if(dwMask & EV_ERR)
{
//to do
DWORD dwError;
ClearCommError(hDevice, &dwError, NULL);
}
if(dwMask & EV_RXCHAR)
{
//to do
}
}
See Also
SetCommMask
ClearCommError
Przeglądanie stron 48
1 2 ... 44 45 46 47 48 49 50 51 52 53 54 ... 103 104

Komentarze do niniejszej Instrukcji

Brak uwag