Solution
The NI-XNET Database Editor may encounter difficulties parsing database files for several reasons. To resolve this issue, follow the steps outlined below.
Setting a Compatible Format (DBC only)
The problem could stem from a compatibility issue, as the DBC file format is proprietary to Vector and not an international standard like FIBEX. To avoid compatibility issues, you need to convert it to DBC format, that is compatible. This requires the use of Vector CANdb++, a freeware automotive database editor.
The steps below explain how to export a compatible DBC file:
- Download CANdb++ from Vector’s website.
- Open the database that you wish to convert in CANdb++.
- Navigate to File>>Export>>Into CANdb Network Files...
- Check the Use compatible DBC format option in the window and select OK to export the DBC file.
- Open the converted DBC file in the NI-XNET Database Editor.
Confirming Text Encoding (for LDF, DBC)
DBC does not specify the text encoding. NI-XNET currently assumes the file is in the operating system’s default locale, which can cause issues when importing files produced on systems with alternate codepages. To solve this problem, follow these steps:
- Remove the non-English characters in the database.
- Revert to the version prior to NI-XNET 19.1 or earlier.
- Set the OS language as English and load the .ldf file. Then revert the language settings back to the local language if you need to use localized LabVIEW.
- Convert the file to UTF-8 and back again using Notepad. This appears to fix the encoding, and the file can import as expected. This must be performed on a system using the database’s language codepage. The procedure is performed by:
- Opening the file in Notepad (You will see that the current encoding is ANSI in the bottom-right of the screen).
Select File>>Save As, change the text encoding to UTF-8, click on Save.
- Select File>>Save As, change the text encoding back to ANSI, click on Save.
- Open the file in the XNET Database Editor.
Clearing NI-XNET Database Editor Cache
The error can also be caused by corrupted or incompatible cached databases with the same alias that might have been left by a previous NI-XNET installation. In this case, it is recommended to clear the NI-XNET Database Editor cache following the next steps:
- Navigate to C:\ProgramData\National Instruments\NI-XNET\dbCache.
- Delete the affected databases in the directory.
- Re-create the aliases for the database in the NI-XNET Database Editor.
Export the Database Using NI-XNET Database Editor of Older Version of NI-XNET
You can try opening the DBC file using the NI-XNET Database Editor from an older version of NI-XNET (for example, NI-XNET 19.0). If it opens successfully, you can export it as a new DBC file. After that, try opening the newly created DBC file in the newer version of NI-XNET.
Adding the Database as an Alias
You can add the database by selecting File>>Manage Aliases>>Add Alias... This process may not solve the issue but it will provide an Error code and more information to solve it.