CAN Over SPI Raw Read

This MotoHawk™ block receives a CAN Over SPI message on the named link.

Block ID

Read CAN Over SPI Raw

Library

motohawk_SPI_lib

Description

This MotoHawk™ block receives a CAN Over SPI message on the named link. Use the ID and ID Mask mask attributes to specify the base message filter that this block shall attempt to read. The Receive Slot Properties Set can be used to further refine the filter used by the block.

Outputs

Data Available (bool)

Optional port that when requested reports whether the block had a message to read.

Age Count (uint32)

Optional port that when requested increments each time the block executes without a message being available. Is zeroed when a message was read.

ID (uint32)

The ID of the message that was received. The ID and ID Mask mask attributes make it possible for a single block to receive more than one message ID.

Length (uint8/uint16)

Defines the number of bytes from the Data port that shall be used in the message. The type is chosen to be large enough to handle the Max Number Message Bytes specified for the block.

Data (uint8(N])

A 1xN vector (where N is Max Number Message Bytes) of uint8 data that is filled with the read message. The Length signal specifies what data elements were used by the message.

Overrun (uint8)

An optional port that when selected indicates the number of messages that were received, but had to be discarded because of insufficient queue space.

Block Parameters

Parameter Field Values Comments/Description
Reference Name Alpha-numeric text, single-quote enclosed Specify the name of the CAN Over SPI link definition that is to be monitored for the defined message.
Max Number Message Bytes Unsigned integer The maximum number of bytes that this message block will ever read. This value can be less than the Message Byte Size defined for the link.
ID hex2dec('701') Message ID to receive. Use with the ID Mask to specify what messages this block is to receive.
ID Mask hex2dec('ffffffff') Each bit in the received message's ID that has a 1 in this mask must match the value of the specified ID before the message will be received by this block.
Queue Size Unsigned integer greater than zero Sets the size of the incoming message queue that will hold messages until this block executes. Received messages remain queued until consumed. It is possible to specify a message to be received by multiple slots.
Slot Name Alpha-numeric text, single-quote enclosed. Each message reception specification, which this block specifies, is referred to as a Slot. The Slot Name associates a name with this definition. It can be left empty. Other blocks such as the Receive Slot Properties Set and the Slot Trigger block will reference the Slot Name.
No special characters, such as spaces, dashes, commas (underscore allowed).
Show Data Available Port Check Box (enable) If selected, a port will be added that will have a value of 1 if a message is available and zero otherwise. One can associate a Simulink Do-While block to this port and poll all of the messages out of the Queue when the Queue Size is larger than 1.
Show Age Count Port Check Box (enable) This port increments every time the block executes and no messages are available. The data from this port can be used to do timeout logic on a message.
Show Overrun Port Check Box (enable) This port shows how many messages were discarded since the block last executed because of insufficient queue space.