4.1.22 CAN_ReceiveMsg
Description:
Obtain receive message from CAN controller’s RXFIFO or software
buffer. After calling the functions
CAN_EnableRxIrq
and
CAN_InstallIrq
, the messages is within the software buffer, otherwise it
is within the CAN controller’s RXFIFO.
Note! If users’ PC go into “Standby mode” or “Sleep mode”, this
function will can’t receive any message.
Syntax:
int CAN_ReceiveMsg(BYTE BoardNo, BYTE Port, PacketStruct
*CanPacket)
Parameter:
BoardNo: [input] PISO-CAN board number (0~7)
Port: [input] CAN port number (1~8)
*CanPacket: [output] The structure for CanPacket is defined below,
typedef struct packet
{
LONGLONG MsgTimeStamps;
BYTE mode;
DWORD id;
BYTE rtr;
BYTE len;
PISO-CAN/PEX-CAN/PCM-CAN Series User’s Manual (v2.6 Dec/2013) -------
56
BYTE data[8];
} PacketStruct;
MsgTimeStamps: This parameter in Windows 98/Me/NT4 will record the
time with system clock counter and in Windows 2000
/XP will record the system interrupt-time count of
100-ns unit when the CAN message is received from
SJA1000. The system clock counter starts to count
after the PC boots up. If more than one CAN
messages are received and stored in the 64-byte
SJA1000 FIFO, the time stamps of these CAN
messages may be closed.
mode: 0
→
11-bit identifier, 1
→
29-bit identifier.
id: Identifier
ГК
Атлант
Инжиниринг
–
официальный
представитель
в
РФ
и
СНГ
+7(495)109-02-08 [email protected] www.bbrc.ru