IO602 - CAN Read
IO602 - CAN Read — Read CAN (HS) and CAN-FD messages
from one channel of the IO602 I/O module
Library
Simulink Real-Time - Speedgoat

Description
The IO602 CAN Read block reads messages from one channel of the IO602 input queue.
In each execution step it reads one message and indicates if more messages are
available.
Refer to the "Usage Notes" to find out how this block can be used in a "do-while"
subsystem to prevent overflows of the read buffer.
The read buffer has a nominal capacity of 256 CAN messages per channel. The read
buffer's capacity will be reduced by higher DLCs possibly applied with CAN-FD. It
will be further reduced by one for each acknowledge of a sent message.
Ports
Which outputs are available depends on the Channel
Selection setting of the corresponding IO602 Setup block and the
Message Type setting of the respective block:
CAN (HS) & CAN: The only message type available is CAN_MESSAGE
output
CAN-FD & CAN: The only message type available is
CAN_FD_MESSAGE_BUS output
CAN (HS) & RAW: Identifier, Length, Identifier Type, Timestamp and
Data outputs are available
CAN-FD & RAW: Identifier, Data Length Code (DLC), Identifier Type,
Timestamp, BRS and Data outputs are available
RAW + CAN: All output ports related to CAN (HS) or CAN-FD apply
Outputs
-
Data Present
Status signal is "1" if new data is available and "0" otherwise. The
data type is boolean.
-
CAN Msg
The complete CAN message. Please use the "CAN Unpack" or "CAN-FD
Unpack" block to resolve the data, depending on which setting applies to
the channel.
The data type is CAN_MESSAGE if CAN (HS) is selected.
The data type is CAN_FD_MESSAGE_BUS if CAN-FD is selected.
-
ID
The CAN message identifier. The data type is uint32.
-
EFF
The identifier type (Extended Frame Format) of the CAN message.
The data type is uint8.
-
Length/DLC
If CAN (HS) is selected in the related Setup block, this port outputs
the length of the payload data. If CAN-FD is selected in the related
Setup block, this port outputs the DLC.
The DLC and corresponding byte lengths are as follows.
The data type is uint8.
-
Timestamp
The timestamp for receipt of the CAN message. The resolution is
1 µs. The data type is double.
-
BRS
The Bit Rate Switch (BRS) indicates whether the data segment of the
received message was transmitted with the fast data rate. The data type
is uint8.
-
Data
Outputs the payload of a message as a vector of data type uint8. If
the payload is shorter than the size of this output port, it is
completed with zeros.
The data length of the output port is 8 bytes with CAN (HS).
The data length of the output port is 64 bytes with CAN-FD.
Parameters
-
Module ID
This ID defines the link to the corresponding Setup block
-
Sample Time
Defines the base sample time at which this driver block gets its sample hit. This
parameter can also be set to -1 for inherited
sample time. The units are in seconds.
-
Channel Number
Select the CAN channel to which this driver block corresponds.
-
Message Type
Defines how the CAN message is represented at the block outputs. It
depends also on the Channel setting of
the related IO602 Setup block.
CAN with CAN (HS): Only one CAN Msg output port is available.
The port will always be connected to one or more CAN Unpack
blocks
CAN with CAN-FD: Only one CAN Msg output port is available.
The port will always be connected to one or more CAN-FD Unpack
blocks
RAW with CAN (HS): The message content is presented by a
number of output ports: ID, Length, EFF, Timestamp and
Data
RAW with CAN-FD: The message content is presented by a number
of output ports: ID, DLC, EFF, BRS, Timestamp and Data
CAN + RAW: Both versions are displayed
-
Output as bus
Select this option for the block to output CAN messages as a bus signal.