Not Receiving Input CAN Frame Data with J1939 Transport Protocol Reference Example

Updated Apr 21, 2021

Reported In

Driver

  • NI-CAN

Issue Details

I am trying to read J1939 CAN data with the J1939 NI CAN Frame Example.vi in the J1939 Transport Protocol Reference Example provided under Example Code on the NI Community site, but I am not seeing any data on the Input CAN Frame. I can monitor the bus and see that frames are being transmitted/received, but cannot see any frames in the example. I have verified that I have configured the example appropriately for my application hardware and specifications

Solution

The error you are seeing could be caused by the lack of a case for parsing unrecognized arbitration IDs in the "Process Incoming Messages" loop. If an unrecognized arbitration ID is received, a default, empty frame will be output by the program.
To add a case for handling unrecognized arbitration IDs, you will need to go into the J1939 Process Incoming Messages by PDU F.vi and modify the "Proprietary B" case for the unrecognized arbitration IDs depending on the functionality you want for the messages you're receiving. Once these cases are defined, you should be able to correctly see your CAN Input Frames. Screenshots are attached below showing the progression of subVIs to get to the case you need to modify.

J1939 NI CAN Frame Example.vi Block Diagram

J1939 Process Incoming Messages.vi Block Diagram

J1939 Process Incoming Messages by PDU F.vi Block Diagram