xPC Target | ![]() ![]() |
The Send driver block is used to transmit data to a CAN-network from within a block model.
The dialog box of the block lets you define the following settings.
CAN port -- The first control (pop-up menu) is used to select at which CAN port the CAN message will be sent out.
CAN identifier range -- The second control (pop-up menu) is used to select the identifier range of the CAN messages sent out by this block instance. If an application makes use of mixed Standard and Extended identifier ranges, at least two instances of this block have to be used, each defining the corresponding identifier range.
Identifiers -- The third control (edit field) is used to define the identifiers of the CAN-messages sent out by this block. It has to be a row vector where the elements define a set of either Standard or Extended identifiers. Each element has to be in the range between 0 and 2031 for Standard identifiers or 0 and (2^29)-1 for Extended identifiers. The number of identifiers for each CAN port in a model per physical CAN-board cannot exceed 200 (restriction of the firmware's dynamic object mode). The number of elements defined here, define at the same time the number of inputs 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 has to be a scalar of type double representing the maximum size of 8 bytes of a CAN-message's data frame.
Data frame sizes -- The fourth control (edit field) is used to define the data frame size for each identifier (CAN-message) in bytes. It has to be a row vector where the elements define a set of data frame sizes. Each element has to be in the range between 1 and 8. If the data frame sizes for all identifiers defined in the control above have to be the same, the size can be provided as a scalar only and scalar expansion applies. If the sizes are different for at least two identifiers (CAN-messages) one size element has to be provided for each identifier defined in the control above. Therefore the length of the two vectors have to be the same.
Show status: Output ports -- The fourth control (check box) lets you enable status output ports for each identifier (CAN message). If the check box is checked, 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.
Sample time -- The fifth control (edit field) 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 needed. For example by using two instances of the block, different sample times at which CAN messages are sent out can be defined. Or you can use multiple instances to structure your model more efficiently.
![]() | Setup Driver Block | Receive Driver Block | ![]() |