XNET Session I/O Name

The XNET Session represents a connection between your National Instruments CAN/FlexRay/LIN hardware and hardware products on the external CAN/FlexRay/LIN network. Your application uses sessions to read and write I/O data.

Use the session class I/O name primarily for sessions created at edit time using a LabVIEW project. When you create a session at run time with the XNET Create Session VI, the I/O name serves only as a refnum (its string is irrelevant).

Use the XNET Session I/O name to select a session defined in a LabVIEW project, for use with methods such as the XNET Read or XNET Write VIs. For general information about I/O names, such as when to use them, refer to NI-XNET I/O Names.

User Interface

When you select the drop-down arrow on the right side of the I/O name, you see a list of all available sessions.

If you are using a VI within a LabVIEW project, the available sessions are listed under the VI target ( RT or My Computer ). If you are using a VI within a built application ( .exe ), the available sessions are in the NI-XNET configuration file ( nixnetSession.txt ) the LabVIEW build generates.

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

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. The XNET session drop-down list shows (target disconnected) until you connect the RT target. When the RT target is connected, the drop-down list shows all sessions on that RT target (for example, PXI chassis).

When you right-click the I/O name, the menu contains LabVIEW items and the following items:

  • Edit XNET Session : This item opens the Properties dialog for the selected session. You can change the session properties and select OK to save those changes in the project. This menu item is available at edit time only, before you run your VI.
  • New XNET Session : This launches the wizard to create a new XNET Session. The new session is created under the same target as the current VI. This menu item is available at edit time only, before you run your VI.

String Use

Use a session name from the drop-down list.

LabVIEW conventions for names in a project allow any character, including special characters such as space ( ) and slash (/).

The session name is case sensitive.

The XNET Session I/O name string is not used directly, in that it always is opened automatically for use as a refnum.

Refnum Use

The XNET Session refnum always is opened and closed automatically. When you wire the I/O name to a node, LabVIEW opens a refnum for the session. The refnum is closed automatically when your top-level VIs are no longer executing (idle). You also can close the refnum by calling the XNET Clear VI.

The XNET Session refnum features represent the core NI-XNET functionality, in that you use the session to read and write data on the embedded network using the following property node and VIs:

  • XNET Session Node: Use the XNET Session property node to change the session configuration.
  • XNET Read VI: Read data for an input session and read state information for the session interface.
  • XNET Write VI: Write data for an output session.
  • XNET Start, XNET Stop, and XNET Flush VIs: Control the session and buffer states.
  • XNET Wait and XNET Create Timing Source VIs: Handle notification of events that occur in the session.
  • XNET Connect Terminals and XNET Disconnect Terminals VIs: Connect/disconnect synchronization terminals.
  • XNET Clear VI : Close the session refnum, including stopping all I/O. If this VI is not called, LabVIEW closes the refnum automatically when your top-level VIs are no longer executing (idle).