Vehicle NetworkToolbox-simulink
CAN Configuration block
configures parameters for a CAN device that you can use to transmit and receive messages.Specify the configuration of your CAN device before you configure other CAN blocks.
CAN Receive block
The CAN Receive block receives messages from the CAN network and delivers them to the Simulink® model. It outputs one message or all messages at each timestep, depending on the block parameters.
The CAN Receive block has two output ports:
- The f() output port is a trigger to a Function-Call subsystem. If the block receives a new message, it triggers a Function-Call from this port. You can then connect to a Function-Call Subsystem to unpack and process a message.
- The CAN Msg output port contains a CAN message received at that particular timestep.
The CAN Receive block stores CAN messages in a first-in, first-out (FIFO) buffer. The FIFO buffer delivers the messages to your model in the queued order at every timestep.
CAN Unpack block
The CAN Unpack block unpacks a CAN message into signal data using the specified output parameters at every timestep. Data is output as individual signals.
The CAN Unpack block has one output port by default. The number of output ports is dynamic and depends on the number of signals you specify for the block to output. For example, if your block has four signals, it has four output ports.
CAN Pack block
The CAN Pack block loads signal data into a message at specified intervals during the simulation.
CAN Pack block has one input port by default. The number of block inputs is dynamic and depends on the number of signals you specify for the block. For example, if your block has four signals, it has four block inputs.
This block has one output port, CAN Msg. The CAN Pack block takes the specified input parameters and packs the signals into a message.
CAN Transmit block
The CAN Transmit block transmits messages to the CAN network using the specified CAN device. The CAN Transmit block can transmit a single message or an array of messages during a given timestep. To transmit an array of messages, use a mux (multiplex) block from the Simulink® block library. You cannot have more than one Transmit block in a model using the same NI-XNET device channel.The CAN Transmit block has one input port. This port accepts a CAN message packed using the CAN Pack block. It has no output ports.