Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert .dbc to database reference

I'm hoping this will be an easy one! Is there any way to programmatically convert a path to a .dbc file into an XNET database reference? In other words, instead of using the XNET database constant/control and selecting a.dbc database file, how can I convert a.dbc file path into a database reference?

 

I've tried typecasting the path string to a database reference, but that doesn't seem to do the trick:

DbcToDatabase.png

 

Although I can read frames within the cluster using this method, the returned baud rate is always zero. If I use a database constant and manually select my .dbc file instead of typecasting, the baudrate is returned correctly.

0 Kudos
Message 1 of 2
(5,383 Views)

OK, I think I figured it out. The .dbc file needs to first be configured as an alias (XNET Database Add Alias.vi) and then this method works correctly.

0 Kudos
Message 2 of 2
(5,362 Views)