08-05-2019 07:09 AM
Hi!
I am a newbie in LV programming.
I am trying to create a LV program that makes a communication with a CAN interface.
I have to load a DBC file and I do not want to always put it manually everytime I change it in the home directory of the program.
I made my program search for the .dbc extention and extract its full path: ex: C:\Data\Users\name\Documents\Labview\DBCFile.dbc.
Now, what I want to do is to open this file via XNET Database and have it as a Cluster, an easy thing to do if you select it manually everytime.
Is it possible?
I am sorry for my bad english.
Solved! Go to Solution.
08-06-2019 06:54 AM - edited 08-06-2019 07:11 AM
I found the solution. I have used an XNET ADD ALIAS.
Used the alias database with which the found .dbc file path is linked to.
What I was doing wrong was to use different aliases for each .dbc, which I had to manually select each time.
Here is a ss.
And the sub vi.
I mention that the path of the .dbc is automatically detected. So as a user I only drop the .dbc file along with all of the other files intro a folder and voila.
P.S. Almost forgot the most important thing...You have to close the database after each use. Outside my sub vi is an XNET CLOSE DATABASE vi that has as input the Refnum Out data.
05-18-2022 07:09 AM - edited 05-18-2022 07:12 AM
Sorry for replying to an old post, but just in case anyone else is trying to use this VI to load different database files during runtime and is encountering error -1074384637 (like I was), this snippet I adpated from darkiebov's solution should correct for this.