Raptor-Dev-CAN-Library

From NewEagleWiki
Jump to navigation Jump to search

New Eagle > Products Wiki > Raptor Platform > Raptor-Dev > Raptor-Dev Library > Raptor-Dev CAN Library

Raptor CAN

Overview

The blocks in this subsystem can be used to send and receive both raw and message-based CAN messages.

Blocks

Block Description Appearance
CAN Definition

This block is used to create a CAN bus resource and map it to a particular hardware I/O point. This block will generate all of the code necessary to connect and coordinate all the Raptor™ CAN blocks with the hardware CAN interface. Each CAN bus that will be used in the model must include a CAN definition block.

CAN Definition block
CAN Definition block
CAN Mailbox Properties

This block is used to configure properties on a CAN receive mailbox at runtime. The block exposes the ID and Mask that configure the acceptance criteria for the mailbox. The ID and Mask on the defining CAN recieve message are used in addition to the values passed into this block, and therefore should be at least as open as the filter configured by this block.

CAN Mailbox Properties block
CAN Mailbox Properties block
CAN Receive Message

This block is used to receive a CAN message. The Raptor CAN Rx Raw block can be used if the raw receive bytes are needed. This block accepts a standard DBC file which describes the messages and signals on a CAN bus. The DBC block will automatically decode and scale the signals defined in the DBC file.

CAN Receive Message block
CAN Receive Message block
CAN Rx Raw

This block is used to receive a CAN message when access to the raw receive bytes is necessary. The Raptor CAN Rx Message block can be used if the raw receive bytes are not needed.

CAN Rx Raw block
CAN Rx Raw block
CAN State

This block reports back the status of the specified CAN bus. It can be used to determine if the CAN bus is communicating properly or if error conditions exist.

CAN State block
CAN State block
CAN Trigger

The CAN trigger block is used to execute code when a CAN message arrives. The mailbox field is used to link the trigger block to a particular CAN receive block and will trigger its function call output every time a message matching the receive block is received. Multiple CAN trigger blocks can use the same mailbox, but each mailbox can have only one receive block.

CAN Trigger block
CAN Trigger block
CAN Send Message

Each CAN tx message block not set to transmit periodically has a transmit queue. This queue is used to store messages if the transmit block is executed faster than the messages can be transmitted on the CAN bus. This will typically happen if the tx raw block is located in a for or while loop. If the queue is full when the block executes the oldest tx message will be overwritten.

CAN Send Message block
CAN Send Message block
CAN Tx Raw

This block is used to transmit a message on the CAN bus. The message is transmitted whenever the block is executed. The Raptor CAN Tx Message block can be used to transmit periodic messages and when access to the raw CAN message frame is not necessary.

CAN Tx Raw block
CAN Tx Raw block