XNET J1939 CAN Drivers for LabVIEW

Diagram Overlaid on Image of TruckThese drivers use the SAE J1939 protocol to communicate with an automotive ECU (Electronic Control Module) using NI XNET hardware. This driver set is intended for, but not necessarily limited to, use in automated testing and hardware in the loop (HiL) simulation environments. They are completely free and open source.

Since this DMC implementation is written entirely in the LabVIEW development environment, which provides functions at a layer above the base CAN layer, there are several benefits to be realized:

  • The drivers allow the simultaneous capture of data from both poll-and-response J1939 packets using the DMC drivers, and broadcasts CAN frames using the simplicity of the NI XNET API
  • The J1939 CAN drivers integrate seamlessly with LabVIEW, since there are no external DLLs or third-party APIs involved
  • Additional J1939 functionality can be easily incorporated or the implementation of a particular part of the J1939 protocol stack can be changed, since the source code is entirely LabVIEW based

Supported J1939 Functions

At this time, the following critical aspects of the SAE J1939 protocol specification are supported:

  • Data Link Layer (J1939-21)
    • Read / write Broadcast Announcement Messages (BAM) from / to a CAN network
    • Read / write Connection Mode (CM) messages from / to a CAN network
  • Application Layer (J1939-73)
    • Defined Tool, Target, and Global addresses for Source and Destination
    • Perform Parameter Group Number (PGN) request and response messaging
    • Retrieve Active Diagnostic Trouble Codes (DTCs) using Diagnostic Message 1 (DM1)
    • Retrieve Inactive DTCs using DM2, via active request or passive mode
    • Clear Inactive DTCs using DM3
    • Clear Active DTCs using DM11
    • Memory Access Request (DM14), Memory Access Response (DM15), and Binary Data Transfer (DM16) for direct read and write of target memory
    • Support for Short Seed/Key Security and Long Seed/Key Security (DM18). (User must provide the required LabVIEW code and proper algorithm for key generation)
    • Multi-packet capability for DM1, DM2, DM14/15/16, and PGN Request/Response

The drivers are distributed as a VI Package, so VI Package Manager is required for installation. Once VI Package Manager is installed, double click on the package to install it. Once installation has been completed successfully, the J1939 drivers should show up in your LabVIEW 2017 palette as shown below:

Download the drivers. (Zip file)

Feel free to send fixes or useful feature adds to DMC at J1939@dmcinfo.com.

Legal

This trial program (this "program") has been developed by DMC. Although DMC may be contracted to provide technical support for this program, this program may not be completely tested and verified, and DMC does not guarantee its quality in any way or that DMC will continue to support this program or make new revisions of related products and drivers. THIS TRIAL PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. DMC WILL NOT BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, COVER, ECONOMIC, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THIS PROGRAM.

 

Read More

Planning your next project?