Canclosedriver(handle), Cangetreceiveevent(), Canclosedriver(handle); cangetreceiveevent() – ADLINK PCI-7841/cPCI-7841 User Manual

Page 48

Advertising
background image

40

Function Reference

CanCloseDriver(handle);

Windows 95/98 Environment

CanGetReceiveEvent()

Purpose

Install the event under Windows 95/98/NT
system

Prototype

C/C++ (Windows 95/98/NT)
void CanGetReceiveEvent(int handle,
HANDLE *hevent);

Parameters

handle : handle retrieve from CanOpen-
Driver()
Heven : HANDLE point for receive event

Return Value

none

Remarks

Retrieve receive notify event
Under Windows 95/98/NT environment,
your program can wait the input message
by waiting an event. You can refer to follow-
ing program to use this function. But the
CAN system is a heavy-load system. Under
the full speed(of course, it depends on your
system), the hardware receives the mes-
sage faster than the event occurs. Under
this condition, the event could be combined
by OS. So the total count of event may be
less than actually receive. You can call the
CanGetRcvCnt() to retrieve the unread
message in the driver’s FIFO.

See Also

CanGetRcvCnt()

Usage

C/C++ (Windows 95/98/NT)

#include “pci7841.h
HANDLE recvEvent0;

int handle = CanOpenDriver(0, 0);
//

open the port 0 of card 0

int count1;
CanGetReceiveEvent(handle, rcvEvent0);
if(WaitForSingleObject(rcvEvent0, INFINITE)
== WAIT_OBJECT_0)
{

Advertising