Advantech PCI-1682U Manual de usuario Pagina 45

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 104
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 44
39 PCI-1680U/1682U User Manual
Chapter 4 Software Requirements
4.3.5 WriteFile
Users can use this interface to send data to CAN port which was opened. One or
more frames can be selected each time.
Syntax
BOOL WriteFile(
HANDLE hDevice,
LPCVOID lpBuffer,
DWORD nNumberOfFramesToWrite,
LPDWORD lpNumberOfFramesWritten,
LPOVERLAPPED lpOverlapped
);
Parameters
Return Value
It will be considered successful if non-zero values are returned in the following situa-
tions:
Driver send all the requested data.
Timeout occur when driver only send part of the data or no data.
It will be considered unsuccessful if zero values are returned in the following situa-
tions. Please call GetLastError.
If user cancel the operation or reset chip while drivers are sending data, GetLastEr-
ror will be called to return ERROR_OPERATION_ABORTED.
If busoff of device is discovered before drivers send any frames, GetLastError will be
called to return ERROR_GEN_FAILURE.
If drivers cannot allocate resources according to the number defined by the third
parameter frame, GetLastError will be called to return
ERROR_INVALID_PARAMETER.
Note! The third and fourth parameters of WriteFile are defined as byte length
in MSDN, but stand for the number of frames here.
Name Direction Description
hDevice Input Handle of the device which was opened.
lpBuffer Input Start address of send buffer.
nNmberOf-
FramesToWrite
Input
Number of frames to be sent to drivers. The definition here
is different from that in MSDN.
lpNumberOf-
FramesWritten
Output
Real number of frames sent to driver. The definition here
is different from that in MSDN.
lpOverlapped Input
If CreateFile uses asynchronous open, asynchronous
operation must be supported here. Please refer to MSDN
for detailed instruction to asynchronous open.
*Note In WINDOWS CE,set to NULL.
Vista de pagina 44
1 2 ... 40 41 42 43 44 45 46 47 48 49 50 ... 103 104

Comentarios a estos manuales

Sin comentarios