06-07-2024 04:58 AM
Hello, I have a dbc file that I want to use to analize CAN. I don't know much about the possibilities, but I want to insert the dbc in the program to convert the CAN received into real data.
I also want to make a program where if I insert an ID with 8 bytes of any value, it appears to me the conversion of the DBC.
I know I am asking a not very precise information, I just haven´t found too much information about it.
I also found a VI to open the DBC and show the different parameters, but I don't think it works to make the conversion.
Solved! Go to Solution.
06-07-2024 06:56 AM
See community example CAN Frame Signal Conversion or shipping examples at Example Finder >> Hardware Input and Output >> CAN >> NI-XNET >> Introduction to Sessions >> Conversion
06-11-2024 07:09 AM
I have seen the example, but i don't think is what i am looking.
Now I want to write the 8 bytes of a ID, and I want to see the results of the DBC, to see if the SEATBELT is 1 or 0.
06-11-2024 07:20 AM
I don't think you understand how the XNET Conversion sessions work. I would recommend to try playing around with different signals or different database using that example.
If you post your trimmed DBC file with only one desired ID, I can show you how to convert from payload bytes to signals.
06-11-2024 08:05 AM
I deleted all DBC unless one ID, I don't know if you can help me just with that.
06-11-2024 08:13 AM
It sounds like you are new to CAN so I'd recommend checking out my CAN Blog. Specifically Part 5 on the Signal API. What you want to do is possible. I've had applications built in the past that read the DBC and import it on the application start, then use that. This way we can update the DBC file without needing to update the whole application. Nothing is hard coded into the application. Once imported you can read scaling or ID information that is in the DBC. Non of this requires XNet hardware which is also pretty nice of NI. I still don't fully know what you are trying to do so I can't really give any other suggestions other than to try to understand what is possible.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-11-2024 08:31 AM
Well, I really know about CAN, but I haven't used any DBC or labview until now. I read your blog a month ago and its really nice. What I am doing is reverse engineering of a car part. I have found a DBC of the ECU of a car that has that part, so I want it to help me to simulate the rest of the car CAN IDs that this part needs. I have done it before with another part, but reverse engineering needs sometimes too much time, so i want to be faster using this DBC.
My idea is to write the bytes of different IDs that I have read in the car to see if my DBC is correct and also to see how some signals (torque for example) change in certain situations. So as I write the bytes, I want the program to return the signals value.
For example, if Torque is 4 bytes and 8|4@1+ (1,0) [0|15], I want to see how it changes when i modify the byte 1. I don't know if i have explained myself.
06-11-2024 09:17 AM
Oh in that case then yes the code already posted is probably best for you.
https://forums.ni.com/t5/Example-Code/CAN-Frame-Signal-Conversion/ta-p/3534000
Just provide your DBC, then put in the signals you want to convert. You can then have a control where you change the ID an 8 bytes, and see how that gets converted into the engineering units for the signals you selected.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
06-12-2024 02:39 AM
I am not able to install de OpenG Dependencies. I sent you a private message, but I don't know what's the problem.
06-12-2024 08:08 AM
What you need to do with the shipping examples is:
1. Launch NI-XNET Database Editor and open your DBC file. This will register your DBC as an XNET alias.
2. Open the shipping example.
3. Right on the signal list >> Select XNET Database >> <name of your DBC>
4. The signal lists will be cleared out when you change the database. Select the desired signal.
I have attached a configured version based on your trimmed DBC. You should be able to load with your full DBC. Select the same signals and you can observe the conversion based on the info defined in DBC.