Raptor-Dev-CAN-Library: Difference between revisions

From NewEagleWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 37: Line 37:
! <h5>[[Raptor:CAN Trigger|CAN Trigger]]</h5>
! <h5>[[Raptor:CAN Trigger|CAN Trigger]]</h5>
| <p>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.</p>
| <p>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.</p>
| [[file:CANTRIG.png|frameless|border|CAN Trigger block|center]]
| [[file:RaptorCANTrigger.jpg|frameless|border|CAN Trigger block|center]]
|-
|-
! <h5>[[Raptor:CAN Send Message|CAN Send Message]]</h5>
! <h5>[[Raptor:CAN Send Message|CAN Send Message]]</h5>
Line 45: Line 45:
! <h5>[[Raptor:CAN Tx Raw|CAN Tx Raw]]</h5>
! <h5>[[Raptor:CAN Tx Raw|CAN Tx Raw]]</h5>
| <p>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.</p>
| <p>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.</p>
| [[file:CANTXRAW.png|frameless|border|CAN Tx Raw block|center]]
| [[file:RaptorCANTxRaw.jpg|frameless|border|CAN Tx Raw block|center]]
|}
|}

Latest revision as of 17:39, 14 September 2023

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