What Is a Session?

NI-XNET Hardware and Software Help

Edition Date: November 2018

Part Number: 372841U-01

»View Product Info
Download Help (Windows Only)

The NI-XNET session represents a connection between your National Instruments CAN/FlexRay/LIN hardware and hardware products on the external network. As discussed in Basic Programming Model, your application uses sessions to read and write I/O data.

Each session configuration includes:

  • Interface: This specifies the National Instruments hardware to use.
  • Database objects: These describe how external hardware communicates.
  • Mode: This specifies the direction and representation of I/O data.

The links above link to detailed information about each configuration topic. The mode topic has additional links to topics that explain how to read or write I/O data for each mode. The I/O data consists of values for frames or signals.

In addition to read/write of I/O data, you can use the session to interact with the network in other ways. For example, the XNET Read VI includes selections to read the state of communication, such as whether communication has stopped due to error detection defined by the protocol standard.

You can use sessions for multiple hardware interfaces. For each interface, you can use multiple input sessions and multiple output sessions simultaneously. The sessions can use different modes. For example, you can use a Signal Input Single-Point session at the same time you use a Frame Input Stream session.

The limitations on sessions relate primarily to a specific frame or its signals. For example, if you create a Frame Output Queued session for frameA, then create a Signal Output Single-Point session for frameA.signalB (a signal in frameA), NI-XNET returns an error. This combination of sessions is not allowed, because writing data for the same frame with two sessions would result in inconsistent sequences of data on the network.


Not Helpful