CAN_send block
Short summary
Name |
CAN_send |
→POU type |
|
Category |
more system blocks, Blocks for CAN, block with internal error diagnostic |
Graphical interface |
|
Available since |
This block is supported for →phyBOARD-Regor, →phyBOARD-Wega and →µMIC.200. |
Functionality
The block sends CANopen or CAN 2.0 messages.
Inputs, outputs
|
Identifier |
Description |
|
Inputs: |
HANDLE |
DINT |
handle of the CAN interface (with initial value -1) |
CANID |
UDINT |
CAN 2.0 or CANopen message ID |
|
RTR |
BOOL |
remote transmission request flag |
|
DLC |
USINT |
number of the sent data bytes in the CAN message (= data length code) |
|
DATA |
REF_TO ARRAY[0..7] of BYTE |
→reference to the the transmission data |
|
Outputs: |
RC |
CAN_RETURN_CODE |
return code of the block call as specified in data type CAN_RETURN_CODE with the following values: |
Input EN and output ENO are available when →calling
the block. See "Execution control: EN, ENO" for information on input EN and output ENO.
Internal error diagnostic for block
The block checks the following error cases and – if they occur – the block sets the output ENO of the block value FALSE (or an equivalent): The return code of the block has not been 0 (see the above table under RC).
Example for usage within ST-editor
Best practice in order to get to know the usage of the CAN blocks: Create a new project based on the project template Simple logi.CAD 3 CANopen Project for PHYTEC phyBOARD-Regor and study this sample project. This project contains a usage of this block.