| Contents | Index |
xPC Target Library for CAN
The Send driver block transmits data to a CAN network from within a block model.
Tip To prepare a remote frame, use the CAN Pack block with the Remote frame check box selected. To request the current value, send the remote frame to the responding subsystem. |

Selects the CAN port to which the CAN message is sent.
Selects the identifier range of the CAN messages sent by this block instance. If an application makes use of mixed standard and extended identifier ranges, you must use at least two instances of this block, each defining the corresponding identifier range.
Defines the identifiers of the CAN messages sent by this block. It must be a row vector in which the elements define a set of either standard or extended identifiers. Each element must be in the range between 0 and 2047 for standard identifiers or 0 and 229 − 1 for extended identifiers. The number of identifiers for each CAN port in a model per physical CAN board cannot exceed 200 (limitation of the firmware's dynamic object mode). The number of elements defined here also defines the number of input ports of the block. The block icon displays the selected identifier at each input port. Each input port accepts the data frame to be sent along with the CAN message. The signal entering each input port must be a scalar of type double representing the maximum size of 8 bytes of a CAN message data frame.
Defines the data frame size for each identifier (CAN message) in bytes. It must be a row vector where the elements define a set of data frame sizes. Each element must be in the range between 1 and 8. If the data frame sizes for all identifiers defined in the Identifiers parameter must be the same, you can provide the size as a scalar only and scalar expansion applies. If the sizes are different for at least two identifiers (CAN messages), you can provide one size element for each identifier defined in the Identifiers parameter. Therefore the length of the two vectors must be the same.
Enables status output ports for each identifier (CAN message). If the check box is selected, the block shows as many output ports as input ports. The data type of each output port is a double and the value is identical to the return argument of function CANPC_write_object(...), described in the Softing user manual. Refer to the manual for more information. The function return codes are:
| Code | Description |
|---|---|
0 | Function executed without detecting an error. |
-1 | Request overrun. |
-4 | Timeout firmware communication. |
-99 | Board not initialized. |
Defines the sample time at which the Send block is executed during a model (target application) run.
You can use as many instances of the Send block in the model as required. For example, by using two instances of the block, you can send CAN messages at different sample times. Or you can use multiple instances to structure your model more efficiently.

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |