PCI-1680U/1682U User Manual
40
In asynchronous mode, operation will be pending if drivers cannot complete user's
write request at present, and GetLastError will be called to return
ERROR_IO_PENDING.
See MSDN for more information.
Example
Write one frame data in synchronous mode.
DWORD dwWrite;
canmsg_t WriteBuffer;
ZeroMemory(&WriteBuffer, sizeof(canmsg_t));
//WriteBuffer.flags = 0; //Standard frame
WriteBuffer.flags = MSG_EXT; //Extended frame
//WriteBuffer.flags |= MSG_RTR; //Remote frame
WriteBuffer.id = 0;
WriteBuffer.length = DATALENGTH;
for(int i=0; i<DATALENGTH; i++)
{
WriteBuffer.data[i] = i;
}
BOOL bSuccess = WriteFile(hDevice, &WriteBuffer, 1, &dwWrite,
0);
if(bSuccess)
{
if(dwWrite == 1)
{
//SUCCESS
}
else{
//Timeout
}
}
else{
DWORD dwError = GetLastError();
if (dwError == ERROR_IO_PENDING)
{
//pengding
}
else if(dwError == ERROR_INVALID_PARAMETER)
{
//parameter error
}
else if(dwError == ERROR_OPERATION_ABORTED)
{
//cancelled
}
else if(dwError == ERROR_GEN_FAILURE)
{
//bus off
}
}
Содержание PCI-1680U
Страница 10: ...PCI 1680U 1682U User Manual 4 ...
Страница 16: ...PCI 1680U 1682U User Manual 10 5 Click Next as the following 6 Click Next as the following ...
Страница 22: ...PCI 1680U 1682U User Manual 16 ...
Страница 26: ...PCI 1680U 1682U User Manual 20 Figure 3 2 PCI 1682U Silk Screen ...
Страница 29: ...Chapter 4 4 Software Requirements This chapter has information on the software of PCI 1680U 1682U ...
Страница 85: ...79 PCI 1680U 1682U User Manual Chapter 4 Software Requirements WDM CE ...
Страница 89: ...83 PCI 1680U 1682U User Manual Chapter 4 Software Requirements CE 4 8 2 Flow Chart 4 8 2 1 Send flow chart ...
Страница 90: ...PCI 1680U 1682U User Manual 84 4 8 2 2 Receive flow chart ...
Страница 91: ...85 PCI 1680U 1682U User Manual Chapter 4 Software Requirements 4 8 2 3 Configure flow chart ...
Страница 92: ...PCI 1680U 1682U User Manual 86 4 8 2 4 Event flow chart Either flow chart of the two sub threads is as below ...
Страница 103: ...97 PCI 1680U 1682U User Manual Chapter 5 Pin Assignments and Wiring ...