Cangettxerrorcount(), Cansettxerrorcount(), Cangettxerrorcount() cansettxerrorcount() – ADLINK PCI-7841/cPCI-7841 User Manual

Page 41

Advertising
background image

Function Reference

33

#include “pci7841.h
int handle = CanOpenDriver(0, 0);//open the port

0 of card 0

….
BYTE error_count = CanGetRxErrorCount();
CanCloseDriver(handle);

CanGetTxErrorCount()

Purpose

Get the current value of the transmit error
counter

Prototype

C/C++
BYTE CanGetTxErrorCount(int handle)

Parameters

handle : handle retrieve from CanOpen-
Driver()

Return Value

value

Remarks

This function reflects the current of the
transmit error counter. After hardware reset
happened, the value would set to 127. A
bus-off event occurs when the value
reaches 255. You can call the CanSetTxEr-
rorCount() to set the value from 0 to 254 to
clear the bus-off event.

See Also

CanRcvMsg()

Usage

C/C++

#include “pci7841.h
int handle = CanOpenDriver(0, 0);//open the port

0 of card 0

….
BYTE error_count = CanGetTxErrorCount(handle);
CanCloseDriver(handle);

CanSetTxErrorCount()

Purpose

Set the current value of the transmit error
counter

Prototype

C/C++
void CanSetTxErrorCount(int handle, BYTE
value)

Advertising