CAN Controller (Init/Info)
This function block sends back information to a CAN controller and allows it to re-initialize it.
The controller is selected over the input “CANIf”. The values “1” and “0” select the 1st CAN controller, otherwise each value only selects a controller. If the value is not supported, a “1” is sent back to the output “BitRate”.
If there is a “HIGH” signal at the input “Reset”, the CAN controller is re-initialized.
The status output “State” sends back the current mode of the CAN controller (normal, error warning, error passive, busOff).
The set bitrate is issued at the output “BitRate”.
The used node number is provided at the output “NodeID”. If no node number is used, “0” is sent back.
Generally, setting the node number and bitrate is accomplished in a special dialog over the IDE: “Tools" -> CAN configuration.
Signals
Name | I/O | Type(s) | Function |
---|---|---|---|
CANIf | I | UCHAR | Select CAN interface |
Reset | I | BIT | Reset |
State | O | UCHAR | State |
BitRate | O | LONG | Bitrate (Bit/sec) |
NodeID | O | UCHAR | Node number |