Can-Network (Controller Area Network): Prioritising
Conflicts can occur in a network when several control modules wish to send a message at the same time. For example when the driver presses the brake pedal at the same time as the passenger changes the climate control settings and a passenger in the rear seat opens the power window.
For safe function the messages have to be prioritised. In addition the time delays which occur in case of queue situations must be held within reasonable limits. This is so that the customer does not experience the system as "sluggish" or slow.
To solve problems with conflicts and time delays there is a priority order of messages to ensure good functionality.
Prioritisation of messages is determined by the number of zeroes at the beginning of a message, the more zeroes the higher the priority.
Prioritisation occurs as follows:
- When the network is available, all the control modules that have "something to say" send bit one in their message.
- All the control modules detect what has been transmitted on the network
- If a control module has transmitted 0 those that have sent 1 stop and wait until the next time the network is available
- Those that transmitted 0 transmit bit two of the message
- If a control module has transmitted 0 as bit two those that have sent 1 stop and wait until the next time the network is available and so on.
The message with the highest priority (most zeroes at the beginning) "wins" and is sent first.
The end of a message is seven zeroes. The control modules then know that the network is available and a new message can be sent in priority order.