Open an XNET Database with a Path Control

Updated Jul 9, 2021

I need to open an XNET Database reference in my LabVIEW code by passing its location on a Path Control, but the XNET Database Property Node only accepts XNET Database constants. The way I'm distributing my test application requires that the XNET Databases to be loaded from a specific path every time, how can I achieve this?

The XNET Database constant reads from the nixnetAlias.xml file located in C:\ProgramData\National Instruments\NI-XNET, which contains string paths to the database files. If you wire a string constant directly to the XNET Database Property Node, it will make an implicit conversion to the needed type (showing a red coercion dot). You can use the Path To String.vi to make the conversion.

On you LabVIEW VI, follow these steps. 

1- Add a Path Control.
2- Use the Path to String.vi to make the conversion.
3-Wire the string output to the XNET Database Property Node

 

example.PNG