Raw CAN Transmit Messages -
Intrepidcs API
Main
To transmit a message you must assemble a transmit message as shown in tables 1 and 2 below. This is a transmit request. When neoVI has successfully transmitted a message it will send a transmit complete report. If you send messages faster than neoVI can place them on the bus you can cause a Main51 Transmit FIFO overflow to occur.
Table 1 - Transmit Standard Arbitration ID (SID) Frame Format
| BYTE 1 | BYTE 2 | BYTE 3 | BYTE 4 | BYTE 5 | BYTE 6 |
BYTES 7-14 |
||||||||||||||||||||||||||||
| NETID_XX
NETID OF CAN NETWORK: NETID_HSCAN, NETID_MSCAN, NETID_SWCAN, NETID_LSFTCAN |
DESCRIPTION ID MSB | DESCRIPTION ID LSB | STANDARD ARB ID BITS 10:3 |
IDE = Set to 0 when this is a standard frame. EID Bit 17 and 16 = undefined for a standard ID message
|
RTR = Remote Transmit Request set to 1 for a remote frame (no data)
|
CAN Data bytes 0 - 8
Remote Frame Have No Data |
Table 2 - Extended Arbitration ID (EID) Frame Format
| BYTE 1 | BYTE 2 | BYTE 3 | BYTE 4 | BYTE 5 | BYTE 6 | BYTE 7 | BYTE 8 | BYTE 9-16 | ||||||||||||||||||||||||||||
| NETID_XX
NETID OF CAN NETWORK: NETID_HSCAN, NETID_MSCAN, NETID_SWCAN, NETID_LSFTCAN |
TIMESTAMP MSB | TIMESTAMP LSB | EXTENDED ARB ID BITS 28:21 |
IDE = Set to 1 when this is an extended frame.
|
EXTENDED ID BITS 15:8 |
EXTENDED ID BITS 7:0 |
RTR = Remote Transmit Request set to 1 for a remote frame (no data) |
CAN Data bytes 0 - 8
Remote Frame Have No Data |
C/C++ Examples:
Changing the Arb ID into Bytes for a Standard Frame
bData
[3] = uiArbID >> 3; // standard id high ( shift left 3 bits ) bData[4] = (uiArbID & 7) << 5; // mask off upper five bits
Changing the Arb ID into Bytes for an Extended Frame
bData[3] = uiArbID >> 21;// 4 header bytes with the standard ID first
bData[4] = (((uiArbID & 0x001C0000) >> 13) & 0xFF) + (((uiArbID & 0x00030000) >> 16) & 0xFF) | 8;
bData[5] = (uiArbID >> 8) & 0xFF; // extended id high
bData[6] = (uiArbID & 0xFF); // extended id id least significant bits
| intrepidcs API Documentation - (C) Copyright 2000-2012 Intrepid Control Systems, Inc. |
Last Update: Tuesday, December 03, 2002