Canremovecallback() – ADLINK PCI-7841/cPCI-7841 User Manual

Page 46

Advertising
background image

38

Function Reference

occurs when the event happened. It will not
be disabled until using CanRemoveCall-
Back() or a hardware reset.
Actually, the call-back function is a part of
ISR. You need to care about the DOS reen-
trance problem, and returns as soon as
possible to preventing the lost of data.

See Also

CanRemoveCallBack()

Usage

C/C++(DOS)

#include “pci7841.h
void (far ErrorWarning)();
int handle = CanOpenDriver(0, 0);
//

open the port 0 of card 0


//

Installs the ErrorWarning handling event and
stores the previous one.

void (far *backup) = CanInstallCallBack(0, 2,

ErrorWarning);

CanRemoveCallBack(0, 2, NULL);//Remove the call-

back function

CanCloseDriver(handle);

CanRemoveCallBack()

Purpose

Remove the callback function of event
under DOS environment

Prototype

C/C++(DOS)
int CanRemoveCallBack(int handle, int
index, void (far* proc)() );

Parameters

handle : handle retrieve from CanOpen-
Driver()
Index : event type

Index

Type

2

Error Warning

3

Data Overrun

4

Wake Up

5

Error Passive

6

Arbitration Lost

Advertising