Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I store a DBC file inside a exe?

I have a progaram that I turned into a executable that works fine except that I have to include a DBC file for the XNET sessions that are used in the program.  The problem is that I don't want anyone to find the external DBC file.

 

So the question is if there is a way to put the DBC file into the VI so there is no way to see what it contains?

 

I found the example CAN Dynamic Database Creation.VI, which could work for a low channel count.  My DBC file has 14 messages with over 60 signals, not impossible but I would rather not do it by hand.  I only display about 25 signals on the front panel but I record all of them in a data file.

 

 

Any good ideas on how to go about doing this?

0 Kudos
Message 1 of 6
(6,618 Views)

Bryan,

 

Dynamic database creation is the best solution to this problem. Even if you were to include the DBC file in your EXE build, it would store the DBC file in a data folder created along with the executable, which would be available to anyone browsing through that file structure. I suppose the file could be converted to binary and included, reconstituted to a DBC by your VI and then be destroyed upon program completion. However, the DBC file would still be accessible at some file path during program execution. By far the safest and most straightforward way to handle this is to dynamically create the database. 

 

-Nick-

Nick C | Software Project Manager - LabVIEW Real-Time | National Instruments
0 Kudos
Message 2 of 6
(6,600 Views)

Is there a way to automate the building of the dynamic database from a dbc file?  Or would I have to build a VI that would decode the DBC file then use the data to create the dynamic database?

0 Kudos
Message 3 of 6
(6,592 Views)

Bryan,

 

There is no pre-built VIs that allow you to automate reading from a DBC file to dynamically build the database. Even if there were, you would still need to include the DBC file, which is what you are trying to avoid. As the DBC file contains 60 signals, it wouldn't be a problem to store the information from the database in an array of clusters (one cluster for each signal). Then you could programmatically read each cluster and dynamically build the database. Using autoindexing and a for loop to help build the database will significantly reduce the amount of code that you will have to write.

 

-Nick-

Nick C | Software Project Manager - LabVIEW Real-Time | National Instruments
0 Kudos
Message 4 of 6
(6,584 Views)
You even can read all dbc onformation into cluster using the GetNames and GetPropwrty VIs controls and change them into constants
Message 5 of 6
(6,582 Views)

Thanks Gibson, I will give that a try.

0 Kudos
Message 6 of 6
(6,569 Views)