CAN FD Transmit
Transmit CAN FD message to selected CAN FD device
Libraries:
Vehicle Network Toolbox / CAN FD Communication
Description
The CAN FD Transmit block transmits messages to the CAN network using the specified CAN device. TheCAN FD Transmitblock can transmit a single message or an array of messages during a given timestep. To transmit an array of messages from a signal bus, use aBus Creator(Simulink)orVector Concatenate, Matrix Concatenate(Simulink)block.
Note
You need a license for both Vehicle Network Toolbox™ and Simulink®software to use this block.
The CAN FD Transmit block has one input port. This port accepts a CAN message packed using theCAN FD Packblock. It has no output ports.
CAN is a peer-to-peer network, so when transmitting messages on a physical bus at least one other node must be present to properly acknowledge the message. Without another node, the transmission will fail as an error frame, and the device will continually retry to transmit.
Other Supported Features
TheCAN FD Transmitblock supports the use ofSimulink Accelerator™mode. Using this feature, you can speed up the execution of Simulink models. For more information, seeAcceleration(Simulink).
TheCAN FD Transmitblock supports the use of code generation along with the packNGo function to group required source code and dependent shared libraries.
Code Generation
Vehicle Network Toolbox Simulink blocks allow you to generate code, enabling models containing these blocks to run in Accelerator, Rapid Accelerator, External, and Deployed modes.
You can use Vehicle Network Toolbox,Simulink Coder™, and Embedded Coder®software together to generate code on the host end that you can use to implement your model. For more information on code generation, seeGenerated Code Compilation(Simulink Coder).
The block generates code with limited portability. The block uses precompiled shared libraries, such as DLLs, to support I/O for specific types of devices. With this block, you can use thepackNGo
function supported bySimulink Coderto set up and manage the build information for your models. ThepackNGo
(Simulink Coder)function allows you to package model code and dependent shared libraries into a zip file for deployment. You do not need MATLAB®installed on the target system, but the target system needs to be supported by MATLAB.
To set uppackNGo
:
set_param(gcs,'PostCodeGenCommand','packNGo(buildInfo)');
In this example,gcs
is the current model that you want to build. Building the model creates a zip file with the same name as model name. You can move this zip file to another machine and there build the source code in the zip file to create an executable which can run independent of MATLAB and Simulink. The generated code compiles with both C and C++ compilers. For more information, seeCode Compilation Customization(Simulink Coder).
Note
On Linux®platforms, you need to add the folder where you unzip the libraries to the environment variableLD_LIBRARY_PATH
.
Ports
Input
Parameters
Extended Capabilities
Version History
Introduced in R2018a
See Also
Blocks
- CAN FD Configuration|CAN FD Pack|CAN FD Receive|Bus Creator(Simulink)|Vector Concatenate, Matrix Concatenate(Simulink)