Can NI-XNET Database Aliases Be Programmatically Imported/Exported?

Updated Nov 1, 2023

Reported In

Driver

  • NI-XNET

Issue Details

  • I'd like to programmatically load or unload the NI XNET databases registered on my machine depending on whether they are loaded already or not.
  • I have a new version of a database file with the extension .dbc, .fibex or .xml. that I want to update automatically from a script or dynamically in my program.

Solution

Using the NI-XNET API for LabVIEW

Use the File Management Palette of the XNET API to:
  • Add or remove registered aliases
  • Deploy or undeploy databases from RT targets
  • Get List.vi will provide a list of all registered XNET aliases
XNET File Management Palette

This can be found in the following palette: Measurement I/O>>XNET>>Database>>File Mgt

The example program on how to use this API is called Managing Local Databases.vi

Snippet of example code from the Managing Local Databases.vi example

Refer to the NI-XNET Manual for more information.

Using the NI-XNET API for C

For a C implementation of these functions, refer to the nxdb<NameOfFunction> family of function calls. More detail is available in the NI-XNET Hardware and Software Help that is part of the installation. Refer to NI-XNET API for C >> Reference >> Functions for further information.
 

Using the NI-XNET Python API

For the implementation of these functions in Python, refer to the nixnet.database.<NameOfFunction> family of function calls. More detail is available in the NI-XNET Python Documentation.

Additional Information

The NI-XNET Database Editor can be used to manage these databases manually. NI software uses aliases to reference the database files registered by the machine, so you need to manage these aliases to import/export different databases.

After you create an alias, it exists until you explicitly delete it. If you exit and relaunch LabVIEW, the aliases from the previous use remain. If you uninstall NI-XNET, the aliases are deleted; however, if you reinstall (upgrade) NI-XNET, the aliases from the previous installation remain. Deleting an alias does not delete the database file itself, but merely the association within NI-XNET.

You can find more information in the NI-XNET Hardware and Software Help in the NI-XNET API for <LabVIEW or C> >> Databases >> What is an Alias?