4.1.19 CAN_SendMsg
Description:
Send a CAN message immediately.
Syntax:
int CAN_SendMsg(BYTE BoardNo, BYTE Port, PacketStruct
*CanPacket)
Parameter:
BoardNo: [input] PISO-CAN board number (0~7)
Port: [input] CAN port number (1~8)
*CanPacket: [input] The point of structure for CanPacket is defined as
following,
typedef struct packet
{
LONGLONG MsgTimeStamps;
BYTE mode;
DWORD id;
BYTE rtr;
BYTE len;
BYTE data[8];
} PacketStruct;
MsgTimeStamps: Not use in this function.
mode: 0
→
11-bit identifier, 1
→
29-bit identifier.
id: Identifier
rtr: Remote transmission request
len: Data length
data[8]: data byte
Return:
CAN_NoError: OK
CAN_BoardNumberError: BoardNo is not correct or exceeds the current
total board number.
CAN_PortNumberError: Port number is not correct.
CAN_ActiveBoardError: This board is not activated.
CAN_TransmitBufferLocked:
Transmit buffer in CAN chip is locked.
PISO-CAN/PEX-CAN/PCM-CAN Series User’s Manual (v2.6 Dec/2013) -------
53
CAN_TransmitIncomplete:
Transmission is not yet completed.
CAN_ConfigError: Port has not been configured successfully.
ГК
Атлант
Инжиниринг
–
официальный
представитель
в
РФ
и
СНГ
+7(495)109-02-08 [email protected] www.bbrc.ru