MotoHawk:Blocks:CAN Read Message Block

From MotoHawk
Jump to navigationJump to search

Read CAN Message

This MotoHawk™ block will receive and unpack a CAN message on the selected CAN channel.

Block ID

Read CAN Messages

Library

MotoHawk_lib/CAN Blocks

Description

Read CAN Message.PNG

Block Parameters

Attach Simulink signal specifications the output ports, to convert the output signals to an appropriate data type. Specifically, if a gain or offset is applied in the message specification, assign the signal to the floating-point data type.

Parameter Field Values Comments/Description
Name Alpha-numeric text, single-quote enclosed. Name for selecting CAN channel. Match this with Name field in the CAN Definition block.
Message Definition Identify message definition file. See motohawk_can_example.m A structure or a cell array of structures describing all of the details of 1 or more CAN messages.
Queue Size Numeric Sets the size of the incoming message queue that will hold messages until this block executes. A value of zero or one will make only the most recently received message available.
Slot Name Alpha-numeric text, single-quote enclosed. May be empty. Match a slot name defined in a Receive block. Can be used to connect this block to a slot which can be used to dynamically adjust the ID, ID Mask, Payload, and Payload Mask values. 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 the value 1 if a message is available and zero otherwise. If the queue size is larger than 1, one can associate a Simulink Do-While block to this port and poll all of the messages out of the Queue.
Show Age Count Port Check Box (enable) This port increments every time the block executes and no messages are available. The date from this port can be used to do timeout logic on a message.
Label Wires with Field Names Check Box (enable) Select this checkbox to cause the field names to be applied to the wires leading into the block.