Software Support
© SYS TEC electronic GmbH 2007 L-1032e_9 73
7.3.2.4 EthCanReadCanMsg
Syntax:
BYTE STDCALL EthCanReadCanMsg(
tEthCanHandle EthCanHandle_p,
tCANMsg* pRcvCanMsg_p
tCANTimestamp* pRcvTime_p);
Usability:
HW_INIT
Description:
This function reads a CAN message from the DLL’s message buffer.
The CAN message is then deleted from the message buffer. If there is
no CAN message in the receive buffer, the function will return with
value ETHCAN_CANERR_QRCVEMPTY.
Parameter:
EthCanHandle_p: Instance Handle of the CAN-Ethernet Gateway
pRcvCanMsg_p: Address to a CAN message structure
This address must not be NULL!
The structure of the CAN message is as follows:
typedef struct
{
DWORD m_dwID; // CAN-Identifier
BYTE m_bMsgType; // CAN-Frame-Format
BYTE m_bLen;; // CAN-data length
BYTE m_bData[8]; // CAN-Data (max. 8 Bytes)
}tCANMsg;
Figure 17: CAN Message Structure
When formatting the CAN message, there is differentiation between
two types. CAN messages with 11-bit identifiers (Standard CAN
Frame) and CAN messages with 29-bit identifiers (Extended CAN
Frame) are supported. This also applies for so-called remote frames