LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using a DBC in labview with X-NET

Solved!
Go to solution

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.

0 Kudos
Message 1 of 12
(854 Views)

See community example CAN Frame Signal Conversion or shipping examples at Example Finder >> Hardware Input and Output >> CAN >> NI-XNET >> Introduction to Sessions >> Conversion

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 2 of 12
(834 Views)

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.

0 Kudos
Message 3 of 12
(784 Views)

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.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 4 of 12
(781 Views)

I deleted all DBC unless one ID, I don't know if you can help me just with that.

0 Kudos
Message 5 of 12
(765 Views)

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.

0 Kudos
Message 6 of 12
(760 Views)

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.

0 Kudos
Message 7 of 12
(751 Views)

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.

Message 8 of 12
(744 Views)

I am not able to install de OpenG Dependencies. I sent you a private message, but I don't know what's the problem.

0 Kudos
Message 9 of 12
(719 Views)
Solution
Accepted by topic author electronic_lab

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>

 

ZYOng_0-1718197370910.png

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.

-------------------------------------------------------
Control Lead | Intelline Inc
0 Kudos
Message 10 of 12
(701 Views)