XNET Read (State LIN Comm) VI
- Updated2025-10-07
- 6 minute(s) read
Reads the state of LIN communication using an XNET session.

Inputs/Outputs
session in
—
session in is the session to read. This session is selected from the LabVIEW project or returned from the XNET Create Session VI. The session must use a LIN interface.
error in (no error)
—
The error in cluster can accept error information wired from VIs previously called. Use this information to decide if any functionality should be bypassed in the event of errors from other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed.
session out
—
session out is the same as session in, provided for use with subsequent VIs.
LIN comm
—
LIN comm returns a LabVIEW cluster containing the communication elements. The elements are:
error out
—
The error out cluster passes error or warning information out of a VI to be used by other VIs. The pop-up option Explain Error (or Explain Warning) gives more information about the error displayed. |
Description
You can use the XNET Read (State LIN Comm) VI with any XNET session mode, as long as the session interface is LIN. Because the state reflects the LIN interface, it can apply to multiple sessions.
Your application can use the XNET Read (State LIN Comm) VI to check for problems on the LIN network independently from other aspects of your application. For example, you intentionally may introduce noise into the LIN cables to test how your ECU behaves under these conditions. When you do this, you do not want the error out of NI-XNET VIs to return errors, because this may cause your application to stop. Your application can use the XNET Read (State LIN Comm) VI to read the LIN network state quickly as data, so that it does not introduce errors into the flow of your LabVIEW VIs.
The following table lists each value for last error, along with a description, and applicable use of last received, last expected, and last identifier. In the last error column, the decimal value is shown in parentheses after the string name.
| Last Error | Description | Last Received | Last Expected | Last Identifier |
|---|---|---|---|---|
| None (0) | No bus error has occurred since the previous communication state read. | 0 (N/A) | 0 (N/A) | 0 (N/A) |
| Unknown ID (1) | Received a frame identifier that is not valid (0–63). | 0 (N/A) | 0 (N/A) | 0 (N/A) |
| Form (2) | The form of a received frame is incorrect. For example, the database specifies 8 bytes of payload, but you receive only 4 bytes. | 0 (N/A) | 0 (N/A) | Received frame ID |
| Framing (3) | The byte framing is incorrect (for example, a missing stop bit). | 0 (N/A) | 0 (N/A) | Received frame ID |
| Readback (4) | The interface transmitted a byte, but the value read back from the transceiver was different. This often is caused by a cabling problem, such as noise. | Value read back | Value transmitted | Received frame ID |
| Timeout (5) | Receiving the frame took longer than the LIN-specified timeout. | 0 (N/A) | 0 (N/A) | Received frame ID |
| Checksum (6) | The received checksum was different than the expected checksum. | Received checksum | Calculated checksum | Received frame ID |
If the bus error is detected at time when no frame ID is received (such as wakeup), last identifier uses the special value 64.
Alternately, to log bus errors, you can set the Interface:Bus Error Frames to Input Stream? property to cause LIN bus errors to be logged as a special frame (refer to Special Frames for more information) into a Frame Stream Input queue.
session in
—
error in (no error)
—
session out
—
LIN comm
—
fault code
—
fault?
—
communication state
—
error out
—