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
- Always use a CAN config block to configure the CAN channel enabling and used baud rate.
- Four IDs are reserved for the XCP protocol by design, the CAN channel depends on the 'XCP Config' block.
See the manaul for the used IDs.
- The CAN message supports a message up to 8 bytes. This block
enables the user to specify the classification.
- The CAN send block has build-in support for endianes conversion.
Use this support if the receiving system uses a different endianes.
The STM32 is Little-endian (LSB first).
Declaration
Use the CAN config block:
- To set the baudrate for the selected CAN channel.
- To enable the specific CAN channel.
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.