It serves as the foundation for all other development steps such as.CANdb Admin offers functions to draw up communication matrices for complete vehicles as well as for aircrafts and it enables, among other things the exposition of the signal routing via gateways and timing analysis for estimating the run-time behavior of networks.
![]() But what are DBC files Ive seen it in Busmaster, but never used it. I have found the Kvaser database editor, I think our design subcontractor uses it, hes in tomorrow so can give me a hand if all else fails. Where DLC is number of bytes for this frame SignalPos and SignalLen is in bits, SignalPos counted strangely reversed bitorder LSB(it)-MSB(it) (so 764 really means bits 0.63) Signed is or - Receivers: comma separated list of nodes that will filter that signal If a frame is by definition mapped to several mutually exclusive nodes (in reality it is a bad idea to have two nodes send the same ID) on a subnet, define it this way: Code: Select BOTXBU MessageIDdecimal: Node1,Node2; Comments for various elements defined before: Code: Select CM Bus description; CM BU SenderName Sender description; CM SG MessageIDdecimal SignalName Signal description; That would be a minimal approach, but there is tons more in there to set key-value properties of signals and frames, ive got no idea if the format would be valid without it and load in tools that work with it. Anyway, it is usually not worth the trouble messing with those proprietary formats, just load the raw data into a spreadsheet and go from there. Ive created a couple with bustmaster, handy when you have to apply conversion factors. But I think they will then pop up in your autocompletion list, cluttering the results which is why I was happy to see that void worked with gcc. Its a universal.dbc to.h converter. Dbc Can Tool Code To MatchThe idea is that embedded systems developersprogrammers shouldnt have to manually maintain their code to match the requirements, messages and signals of the current CAN bus project. As these projects are very often being maintained using Vectors CANdb tool to define messages, signals, nodes, etc - I set off to create a convenient way to import that information into C source code. After some experimenting, I found a good way to structure the information in a most useful way for C. My main goal was to enable auto-completion (e.g. I could easily get a list of available messages and signals, their meta-information (ID, length, position, IDE bit, etc). I then also implemented a generic way to extract specific signal values by name - also autocomplete supported. This is done using a macro that links a struct pointer to the uint8t8 array. The comments contain usage examples and should help understanding the concept. And most important of all, it is easy to use - simply import the.h file into your project and off you go. I had to make the structs static, unfortunately - otherwise Id have to split the whole thing up into a.c.h pair and it wouldnt be as portable. I checked compiled code sizes, though and it seems as if the code size is unaffected by this. It requires the raw CAN data to be received in the form of a little endian uintt8 array, just like it is the case per default on STM32 HAL. Download: click the attached dbc2h.zip at the bottom of this post. I hope that this little tool is of help for all you CAN afficionados out there - it most definitely is a LOT for me. But I find it much more convenient to define messages, signals and their positions in CANdb than doing it manually, e.g. Also that.dbc file then helps e.g. But believe me, you dont want your own superyacht Charter one for a while. I think currently this tool just ignores signals that are not in the first 8 bytes of the data field. Result: as it seems, the converter already did support fd in a basic way. I also fixed a nullptr exception when using it without any defined nodes in the network. FD frames in the resulting header file is by checking if DLC 8. I dont have a use for this converter still (yet) but appreciate the work youve put in. I can see it correctly generates the structures corresponding to CAN signals, but not sure about CAN message structures. I thought CAN Message structures are supposed to contain all the signals within them (signals as bitfields and also a set of signalpositioned structures). I am also attaching my dbc and generated.h files. Thanks again Mikhail. I am not sure if I can use the bitfields in sigValues to access signals correctly. Also my compiler does not like void bitfields and I might have to remove the sigValues from the code. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |