XNET Database I/O Name

NI-XNET 19.1 Help

Edition Date: June 2019

Part Number: 372841W-01

»View Product Info
Download Help (Windows Only)

To communicate with hardware products on the external CAN/FlexRay/LIN network, NI-XNET applications must understand how that hardware communicates in the actual embedded system, such as the vehicle. This embedded communication is described within a standardized file, such as CANdb (.dbc) or NI-CAN (.ncd) for CAN, FIBEX (.xml), or AUTOSAR (.arxml). Within NI-XNET, this file is referred to as a database. The database contains many object classes, each of which describes a distinct entity in the embedded system.

Use the XNET Database I/O name to select a database, access properties, and invoke methods (for example, save). For general information about I/O names, such as when to use them, refer to NI-XNET I/O names.

When using a database file with NI-XNET, you can specify the file path or specify an alias to the file. The alias provides a shorter, easier-to-read name for use within your application. For example, for the file path C:\Documents and Settings\All Users\Documents\Vehicle5\MyDatabase.dbc, you can add an alias named MyDatabase. In addition to improving readability, the alias concept isolates your LabVIEW application from the specific filepath. For example, if your application uses the alias MyDatabase, and you change its file path to C:\Embedded\Vehicle5\MyDatabase.dbc, your LabVIEW application continues to run without change. The alias concept is used in most NI-XNET features, including deployment of database files to LabVIEW Real-Time targets. For more information about aliases, refer to What Is an Alias?.

User Interface

When you select the drop-down arrow on the right side of the I/O name, you see a list of all database aliases known to NI-XNET, followed by a separator (line), then a list of menu items. If you have not added an alias, the first list is empty.

You can select an alias from the drop-down list or by typing the name. As you type a name, LabVIEW selects the closest match from the list.

Right-clicking the I/O name displays a menu of LabVIEW items and items specific to NI-XNET.

The XNET Database I/O name provides the following menu items in right-click and drop-down menus:

  • Browse For Database File: If you have an existing CANdb (.dbc), FIBEX (.xml), AUTOSAR (.arxml), LIN Description File (.ldf), or NI-CAN (.ncd) database file, select this item to add an alias to NI-XNET. Use the file dialog to browse to the database file on your system. When you select OK, NI-XNET adds an alias to the file. The alias uses the filename, such as MyDatabase for a file path of C:\Embedded\Vehicle5\MyDatabase.dbc. If the alias is not unique, NI-XNET appends a number per LabVIEW conventions (for example, MyDatabase 2). After adding the alias, you can select the objects in that database from any NI-XNET I/O name.
  • New XNET Database: If you do not have an existing database file, select this item to launch the NI-XNET Database Editor. You can use the NI-XNET Database Editor to create objects for the database and then save to a file. When you save the file, the NI-XNET Database Editor also adds an alias. Therefore, after you save from the editor, the database becomes available in the XNET Database I/O name drop-down list.
  • Edit XNET Database: If you have selected a database using the I/O name, select this item to launch the NI-XNET Database Editor with that database file. You can use the editor to make changes to the database file.
  • Manage Database Aliases: Select this menu item to open a dialog to manage aliases. You can review your list of aliases and associated file paths, remove an alias (without deleting the file), and add new aliases.

    If you are using LabVIEW Real-Time (RT), you can right-click the RT target within a LabVIEW Project and select the Connect menu item. This connects to the RT target over TCP/IP, which in turn enables the user interface of NI-XNET I/O names to operate remotely. If you open the Manage dialog while connected to an RT target, the dialog provides features to review the list of databases on the RT target, deploy a new database from Windows to the RT target, and undeploy a database (remove the alias and file from the RT target).

String Use

Use one of two syntax conventions for the XNET Database I/O name string:

  • <alias>
  • <filepath>

The <alias> is the database file short name, used as an alias to the complete filepath. This syntax is the only option available when you select a database from the drop-down list or use the menu items.

Lowercase letters (a–z), uppercase letters (A–Z), numbers, underscore (_), and space ( ) are valid characters for <alias>. Period (.) and other special characters are not supported within the <alias> name. Because the <alias> is used as the filename portion of an internal filepath (that is, absolute path and file extension removed), it must use the minimum file conventions for all operating systems. The alias name is not case sensitive.

The <filepath> is the absolute path to the text database file, using the operating system file conventions (such as C:\Embedded\Vehicle5\MyDatabase.dbc). You can use the <filepath> syntax to open the database directly, without adding an alias to NI-XNET.

Valid characters for <filepath> include any characters your operating system supports for an absolute file path. Relative file paths are not supported. Because special characters typically are required in an absolute filepath (such as \ or :), NI-XNET uses these characters to distinguish the <alias> syntax from <filepath> syntax.

You can use the XNET Database I/O name string as follows:

  • XNET Create Session (Generic) VI: The commonly used XNET Create Session VI instances use signal or frame I/O names and not the database directly. The Generic instance provides advanced features to pass in database object names as strings, including the database itself. Within Create Session, NI-XNET opens the database file, reads information, and closes the database.
  • Open Refnum: LabVIEW can open the XNET Database I/O name automatically. Wire the I/O name to a property node or VI, and the refnum is opened prior to the first use.
  • Remove Alias, Deploy, Undeploy: These VIs enable you to manage an existing alias at run time, much like the Manage Database Aliases dialog. The XNET Database is passed in as a string, and is not opened as a refnum. These VIs require the <alias> syntax for the XNET Database (not filepath).

Refnum Use

You can use the XNET Database I/O name refnum as follows:

  • XNET Database Property Node: The XNET Database property node provides information on its contents, such as the list of all XNET Clusters. This property node is the most common use case for the XNET Database I/O name, because it provides the features needed to query and/or edit all database contents from the top-level down to all other objects.
  • XNET Database Create (Cluster) VI: If you are creating a new database, call this VI to create a new XNET Cluster within the database.
  • XNET Database Save VI: After you set properties for the database or any of its objects, call this VI to save those changes to the file. The file is saved in the FIBEX format.


Not Helpful