XNET Read (State J1939 Comm) VI
- Updated2025-10-07
- 3 minute(s) read
Reads the state of J1939 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.
J1939 comm
—
J1939 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 SAE J1939 Comm) VI with any XNET session mode, as long as the session interface is CAN. Because the state reflects the CAN interface, it can apply to multiple sessions.
Your application can use the XNET Read (State SAE J1939 Comm) VI to check for problems on the J1939 network independently from other aspects of your application. For example, you intentionally may introduce noise into the CAN 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 SAE J1939 Comm) VI to read the J1939 network state quickly as data, so it does not introduce errors into the flow of your LabVIEW VIs.
session in
—
error in (no error)
—
session out
—
J1939 comm
—
fault code
—
fault?
—
PGN
—
src addr
—
error out
—