Let's take the same steps as defined in the previous chapter. First of all, let's make general setup. There are two types of devices or to put it better two types of operation.
| - | When connected to vehicle bus, for example, we only need to listen to whatever is happening on the line. |
| - | For dedicated sensors, it is often necessary to send an acknowledgement that the data was received |
We need to set up the hardware to meet the application we have. This is done in the Hardware setup.
Clicking on Operation mode button changes it between Listen only mode and Acknowledge mode
. We need to set this up first, before connecting to the bus so as not to interfere with the bus operation.
The baud rate setting
is very important. In fact, some vehicle operations can be interrupted if we connect to the bus with the wrong baud rate set. Under the baud rate edit box, we also have a notification of how many messages came through the bus and how many of them were corrupted (red). This information shows if the baud rate is correct and also if the bus has any problems due to bad connections or bus overload.
Next we can scan for the messages. As soon as we check the Scan option, the messages that are coming from the bus will be displayed. So now we can see message IDs, speed of the messages and the raw binary values coming from the bus.
If we know them, we can define the channels from the specification. We choose the Setup button and the empty message setup screen will appear.
And now... we have to know... or guess. We know that the first 15 bits of this message is the steering wheel angle. We need to add a channel by clicking the Add button. We enter the Name of the channel, the Unit
, and the Data format Intel. We set the Data type as Unsigned, change the Length of the channel to 15 bits
and enter a scaling Factor
.
Let's add another channel - Steering wheel sign
which is just one bit long and starts at bit 16. So far, we have defined two channels that can be used in our measurement.
If we close the message setup, the two added channels will appear under the message (if we expand the message to also show the channels).
The second way to add messages is to simply load the description file. The data format of description file is *.dbc. We select the file by clicking on the Import button
. For our test, the description file loads all the channels for the messages.
The data appears on the bus with different rates - we can see that more important information has higher data rates. The steering wheel in this case has a speed of 100 Hz, the engine info has a speed of 50 Hz while the temperature has a speed of only 5 Hz. The message ID priority of the CAN bus forces the manufacturers to make it so that the most important information has the lowest arbitration ID and therefore the highest priority. Now let's select a few channels and see how they appear in a real measurement.