CAN send

Block to send CAN messages

Description

With this CAN send block you can send a CAN message with a specified identifier on a specified CAN bus. Each time the block is evaluated, a message is send containing the input values.

Remarks

Declaration

Use the CAN config block:

Input

CAN ID (port 1)
The top input port specifies the CAN ID of the message in hexadecimal format. The CAN ID must be applied in a UINT32 signal.
Set the 32nd bit to 1 in the CAN ID to configure it as a 29-bit Extended CAN identifier. For example 0x80000200 for CAN ID 0x200 as 29-bit identifier.

Data (port 2-9)
The input type depends on the configuration.
The amount of inputs depends on the configuration.

Parameters
CAN channel
Select the used channel.
Identifier type
Specify whether to use a standard (11 bit) identifier or a extended (29 bit) identifier. Default setting is standard identifier.
Input ports
Select the amount of ports you want from the given input type.
You can use only up to 8 bytes.

Input type
Select the data type each input port will use.
Byte ordering
Set the appropriate byte ordering for your CAN message:
Checkbox checked = Most Significant Bit (MSB) is send first (Motorola format).
Checkbox unchecked = Least Significant Bit (LSB) is send first (Intel format).
Sample time
Sample time of the block. The Sample time (in seconds) defines the rate at which the block is visited by the real-time scheduler of the target. The value of the Sample time has to be an integer multiple of the base sample time of the model.