PCAN-Explorer is a universal tool for monitoring data traffic on a CAN network. For easy and clear allocation of the individual messages, these can be identified as so-called symbols. The integrated VBScript support allows the creation of macros to automate complex tasks. The integrated data logger means that the data traffic of a bus can be recorded, analyzed, and stored. PCAN-Explorer is designed as automation server and can therefore be remote controlled through scripts.
PCAN-Explorer 5 Licenses:
GTK DBF Editor is a free and open source DBF viewer and editor. As the name suggests, this software's main purpose is to edit DBF files, but you can also use it to view DB files. This DBF viewer has one of the simplest interface when compared to other DBF viewers. This database viewer. Free Can Dbc File Viewer 9/20/2019 Load.dbc Files and Create Messages Vector CAN Database Support Vehicle Network Toolbox™ allows you to use a Vector CAN database. The database.dbc file contains definitions of CAN messages and signals.
Single Computer License - With this license you get an installation CD and a license file. With that you can install, unlock, and use the software on a single computer exclusively.
Portable License + USB Copy Protection Dongle - With this type of license, you get an USB copy protection dongle for each purchased license in addition to the installation CD. You can install PCAN-Explorer 5 on several computers. In order to unlock and use the software, you must plug the copy protection dongle into a free USB port.
PCAN Explorer 5 Training:
We offer a training session for the PCAN-Explorer, which includes an introduction to the main features of the software, the work with the PCAN-Symbol Editor, and a demonstration of the add-ins. For further information, please have a look at the web page Trainings.
DBC file is a proprietary format that describes the data over a CAN bus.
In this article, you will learn the basic syntax of a DBC file that defines up to 8 bytes of CAN message data. A lot of CAN bus related tools can read the DBC file and display values next to each 'signal' that you define in the DBC file.
The second part of this article discusses how the auto-generated code can help you read and write the CAN message data. Essentially, each 'message' defined in a DBC becomes a C structure with the signals being the members of the C structure.
- 1DBC Data
- 3CAN Communication Handling in C
DBC Data
Free Dbc File Viewer
Best vst plugins torrent sites.
Simple DBC Message
A simple DBC message contains the Message ID (MID), and at least one signal. Let's demonstrate by showing a message that contains a single 8-bit signal. Spaces and the syntax is really strict, so if you get a single space incorrect, the auto-generation script will likely fail.
Observations:
- The message name is IO_DEBUG and MID is 500 (decimal), and the length is 4 bytes (though we only need 1 for 8-bit signal)
- The sender is IO
- 0|8: The unsigned signal starts at bit position 0, and the size of this signal is 8
- (1,0): The scale and offset (discussed later)
- [0|0]: Min and Max is not defined (discussed later)
- ': There are no units (it could be, for instance 'inches')
- @1+: Defines that the signal is little-endian, and unsigned: Never change this!
Signed Signal
A signed signal can be sent by simply applying a negative offset to a signal. Let's add a signed signal to the previous message.
Fractional Signals (float)
A floating point variable can be sent by deciding the range, and the precision that you require. For example, if we choose 8-bits, with 0.1 as a fraction, we can send the data range of 0.0 -> 25.5. On the other hand, if we want more precision and negative representation, we could use 12-bits with 0.01 as a fraction, and an offset. The second fractional signal also contains an explicit minimum and maximum, which is limited by 12-bit that can represent 4096 different numbers, and by factoring in the offset, and using half of the range for negative representation, it ends up with the limited range of -20.48 -> 20.47
Enumeration Types
An enumeration type is used where the user wishes to use or see names, instead of numbers. For example, instead of a state machine showing up as '0, 1, 2', we could see it as 'stopped, running, paused'. It is accomplished by adding two new lines in the DBC file.
A 'BA_' field needs to be added, and for the sake of simplicity, you can follow the example below to list an enumeration as a 'FieldType' first. Then, you need a 'VAL_' field that actually defines the enumeration values.
Multiplexed Message
A multiplexed message can be used (indirectly) to send more than 8 bytes using a single message ID. For example, if we use a 2-bit MUX, we can send 62-bits of data with four multiplexers (M0, M1, M2, M3). In other words, your message could state that:
- If first 2-bits are 0 (M0), then 62-bits of data is for the car's front sensors
- If first 2-bits are 1 (M1), then 62-bits of data is for the car's rear sensors
Likewise, we could use 8-bit multiplexer, and then we can send 7 bytes of unique data * 256 multiplexers using the same MID. Multiplexed messages are used quite often when:
- Certain information should be grouped under a single MID.
- If there are 100 sensors that use 32-bit value, it is better to use a multipexer rather than 100 different message IDs.
- 11-bit MID does not provide any space to send information under a different MID
- We wish to use the same MID for CAN priority purposes
Observe the following things in the example below:
- There are two multiplexed messages, m0, and m1.
- m0 has the value of 0b0000 for the MUX, and m1 has the value of 0b0001
- We could have a theoretical m15 with value 0b1111 since there is only a 4 bit MUX.
- The 4-bit 'M' needs to be defined first.
- In this rather advanced example, we also have a non-mux'd signal called SENSOR_SONARS_err_count that is sent with all multiplexed messages
- There are four sensor values sent with multiplexor m0
- There are four 'un filtered' sensor values sent with multipexor m1
In conclusion, you can define a multiplexed message that uses a single message ID, however, they are treated, and decoded differently depending on which multipexed value was sent. In order to send a multiplexed message below, you will have to send two separate messages, one for the m0 and one for the m1.
DBC Example
Auto-Generated Code
In a nutshell, the AGC (Auto-Generated-Code) allows a C/C++ application to deal with structures, and avoid the work of packing and unpacking data from a CAN message. Here is an example of a message defined in the DBC, and its auto-generated code artifact:
--> |
CAN Communication Handling in C
I created auto-generation tool that operates on the DBC file that produces the AGC. AGC contains useful artifacts such as:
- C structures that store data variables as described in the DBC message
- Each signal that your controller is a recipient of will occupy a member variable of the struct
- If your controller is the sender of the message, then all signals of the DBC message will appear in the structs
- Receive handling to convert a CAN message to the C structure
- Transmission handling to convert the C structure into the CAN message's data bytes
Can Dbc File
The AGC essentially removes the burden of encoding and decoding the CAN message data. For example, you don't have to parse fields individually by doing something such as 'bit 5 of byte 6 means foo', and instead, you will simply have a C structure where the CAN message data can be parsed and stored upon.
MIA Handling
MIA means 'Missing in Action', and the objective is that if a periodic message is not received as expected, then the contents of the parsed message can be defaulted to the data of your choice. For example, if a temperature sensor reading is not received, then we can tell the AGC to default the sensor reading value to 68 degrees Fahrenheit. This reduces code clutter because each time you use the temperature sensor's value, you don't have to check if the corresponding CAN data was received in the last few seconds.
CAN RX
To handling the messages that are to be received, we must have 'glue code' that pieces together the data of a received messages to the target structure. Unfortunately the AGC cannot generate the glue code because it is decoupled from the CAN driver and furthermore, it leaves it up the application to provide the destination structure to convert the CAN data onto.
CAN TX
The transmission side is simpler than receive because you simply provide an 8-byte data storage for the CAN message, and the encode_ functions convert the C structure onto the 8-bytes that you can send out as part of the CAN message. The encode_ functions also return the message ID and the length of the CAN message and this was done in an effort to decouple the CAN driver from the AGC.
Free Db File Viewer Online
CAN TX with callback
There is an alternate method of sending CAN messages that may make your life easier by defining a callback function to send a CAN message. This way, your application doesn't have to deal with a CAN message at all!
Portable License + USB Copy Protection Dongle - With this type of license, you get an USB copy protection dongle for each purchased license in addition to the installation CD. You can install PCAN-Explorer 5 on several computers. In order to unlock and use the software, you must plug the copy protection dongle into a free USB port.
PCAN Explorer 5 Training:
We offer a training session for the PCAN-Explorer, which includes an introduction to the main features of the software, the work with the PCAN-Symbol Editor, and a demonstration of the add-ins. For further information, please have a look at the web page Trainings.
DBC file is a proprietary format that describes the data over a CAN bus.
In this article, you will learn the basic syntax of a DBC file that defines up to 8 bytes of CAN message data. A lot of CAN bus related tools can read the DBC file and display values next to each 'signal' that you define in the DBC file.
The second part of this article discusses how the auto-generated code can help you read and write the CAN message data. Essentially, each 'message' defined in a DBC becomes a C structure with the signals being the members of the C structure.
- 1DBC Data
- 3CAN Communication Handling in C
DBC Data
Free Dbc File Viewer
Best vst plugins torrent sites.
Simple DBC Message
A simple DBC message contains the Message ID (MID), and at least one signal. Let's demonstrate by showing a message that contains a single 8-bit signal. Spaces and the syntax is really strict, so if you get a single space incorrect, the auto-generation script will likely fail.
Observations:
- The message name is IO_DEBUG and MID is 500 (decimal), and the length is 4 bytes (though we only need 1 for 8-bit signal)
- The sender is IO
- 0|8: The unsigned signal starts at bit position 0, and the size of this signal is 8
- (1,0): The scale and offset (discussed later)
- [0|0]: Min and Max is not defined (discussed later)
- ': There are no units (it could be, for instance 'inches')
- @1+: Defines that the signal is little-endian, and unsigned: Never change this!
Signed Signal
A signed signal can be sent by simply applying a negative offset to a signal. Let's add a signed signal to the previous message.
Fractional Signals (float)
A floating point variable can be sent by deciding the range, and the precision that you require. For example, if we choose 8-bits, with 0.1 as a fraction, we can send the data range of 0.0 -> 25.5. On the other hand, if we want more precision and negative representation, we could use 12-bits with 0.01 as a fraction, and an offset. The second fractional signal also contains an explicit minimum and maximum, which is limited by 12-bit that can represent 4096 different numbers, and by factoring in the offset, and using half of the range for negative representation, it ends up with the limited range of -20.48 -> 20.47
Enumeration Types
An enumeration type is used where the user wishes to use or see names, instead of numbers. For example, instead of a state machine showing up as '0, 1, 2', we could see it as 'stopped, running, paused'. It is accomplished by adding two new lines in the DBC file.
A 'BA_' field needs to be added, and for the sake of simplicity, you can follow the example below to list an enumeration as a 'FieldType' first. Then, you need a 'VAL_' field that actually defines the enumeration values.
Multiplexed Message
A multiplexed message can be used (indirectly) to send more than 8 bytes using a single message ID. For example, if we use a 2-bit MUX, we can send 62-bits of data with four multiplexers (M0, M1, M2, M3). In other words, your message could state that:
- If first 2-bits are 0 (M0), then 62-bits of data is for the car's front sensors
- If first 2-bits are 1 (M1), then 62-bits of data is for the car's rear sensors
Likewise, we could use 8-bit multiplexer, and then we can send 7 bytes of unique data * 256 multiplexers using the same MID. Multiplexed messages are used quite often when:
- Certain information should be grouped under a single MID.
- If there are 100 sensors that use 32-bit value, it is better to use a multipexer rather than 100 different message IDs.
- 11-bit MID does not provide any space to send information under a different MID
- We wish to use the same MID for CAN priority purposes
Observe the following things in the example below:
- There are two multiplexed messages, m0, and m1.
- m0 has the value of 0b0000 for the MUX, and m1 has the value of 0b0001
- We could have a theoretical m15 with value 0b1111 since there is only a 4 bit MUX.
- The 4-bit 'M' needs to be defined first.
- In this rather advanced example, we also have a non-mux'd signal called SENSOR_SONARS_err_count that is sent with all multiplexed messages
- There are four sensor values sent with multiplexor m0
- There are four 'un filtered' sensor values sent with multipexor m1
In conclusion, you can define a multiplexed message that uses a single message ID, however, they are treated, and decoded differently depending on which multipexed value was sent. In order to send a multiplexed message below, you will have to send two separate messages, one for the m0 and one for the m1.
DBC Example
Auto-Generated Code
In a nutshell, the AGC (Auto-Generated-Code) allows a C/C++ application to deal with structures, and avoid the work of packing and unpacking data from a CAN message. Here is an example of a message defined in the DBC, and its auto-generated code artifact:
--> |
CAN Communication Handling in C
I created auto-generation tool that operates on the DBC file that produces the AGC. AGC contains useful artifacts such as:
- C structures that store data variables as described in the DBC message
- Each signal that your controller is a recipient of will occupy a member variable of the struct
- If your controller is the sender of the message, then all signals of the DBC message will appear in the structs
- Receive handling to convert a CAN message to the C structure
- Transmission handling to convert the C structure into the CAN message's data bytes
Can Dbc File
The AGC essentially removes the burden of encoding and decoding the CAN message data. For example, you don't have to parse fields individually by doing something such as 'bit 5 of byte 6 means foo', and instead, you will simply have a C structure where the CAN message data can be parsed and stored upon.
MIA Handling
MIA means 'Missing in Action', and the objective is that if a periodic message is not received as expected, then the contents of the parsed message can be defaulted to the data of your choice. For example, if a temperature sensor reading is not received, then we can tell the AGC to default the sensor reading value to 68 degrees Fahrenheit. This reduces code clutter because each time you use the temperature sensor's value, you don't have to check if the corresponding CAN data was received in the last few seconds.
CAN RX
To handling the messages that are to be received, we must have 'glue code' that pieces together the data of a received messages to the target structure. Unfortunately the AGC cannot generate the glue code because it is decoupled from the CAN driver and furthermore, it leaves it up the application to provide the destination structure to convert the CAN data onto.
CAN TX
The transmission side is simpler than receive because you simply provide an 8-byte data storage for the CAN message, and the encode_ functions convert the C structure onto the 8-bytes that you can send out as part of the CAN message. The encode_ functions also return the message ID and the length of the CAN message and this was done in an effort to decouple the CAN driver from the AGC.
Free Db File Viewer Online
CAN TX with callback
There is an alternate method of sending CAN messages that may make your life easier by defining a callback function to send a CAN message. This way, your application doesn't have to deal with a CAN message at all!