Table Of Contents

XNET Read (State » J1939 Comm) (G Dataflow)

Last Modified: November 2, 2017

Reads the state of J1939 communication using an XNET session.

connector_pane_image
datatype_icon

session in

The session to read. This session is selected from the LabVIEW project or returned from XNET Create Session. The session must use a LIN interface.

datatype_icon

error in

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Default: No error

datatype_icon

session out

An output that is the same as session in, provided for use with subsequent nodes.

datatype_icon

J1939 comm

An output that returns a LabVIEW cluster containing the communication elements.

datatype_icon

PGN

A parameter that specifies the J1939 PGN that occurred the last error. You cannot assign a PGN to every error.

datatype_icon

src address

A parameter that specifies the source address that occurred the last error. You cannot assign a source address to every error.

datatype_icon

dest addr

A parameter that specifies the destination address that occurred the last error. You cannot assign a destination address to every error or warning.

datatype_icon

transmit error

A parameter that indicates a transmit-related error occurred.

datatype_icon

receive error

A parameter that indicates a receive-related error occurred.

datatype_icon

fault?

A parameter that indicates that a fault occurred, and its code is available as fault code.

datatype_icon

fault code

A parameter that returns a numeric code you can use to obtain a description of the fault. If fault? is false, the fault code is 0.

A fault is an error that occurs asynchronously to the NI-XNET nodes your application calls. The fault cause may be related to CAN communication, but it also can be related to XNET hardware, such as a fault in the onboard processor. Although faults are extremely rare, XNET Read (State J1939 Comm) provides a detection method distinct from the error out of NI-XNET nodes, yet easy to use alongside the common practice of checking the communication state.

To obtain a fault description, wire the fault code into the LabVIEW Simple Error Handler error code input and view the resulting message. You also can bundle the fault code into a LabVIEW error cluster as the code element and use front panel features to view the error description.

datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

error in does not contain an error error in contains an error
If no error occurred before the node runs, the node begins execution normally.

If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

Description

You can use XNET Read (State J1939 Comm) 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 XNET Read (State J1939 Comm) 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 nodes to return errors, because this may cause your application to stop. Your application can use XNET Read (State J1939 Comm) to read the J1939 network state quickly as data, so it does not introduce errors into the flow of your LabVIEW nodes.

Where This Node Can Run:

Desktop OS: Windows

FPGA: Supported

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics