To mention it upfront, in order to simulate and analyze SAE J1939 data traffic (PGNs) per MS Visual Studio you will need a CAN hardware. And yes, you could use any CAN gateway in the marketplace, and they all will work, but none of them provides the functionality and ease-of-use of our jCOM.J1939.USB board.
The jCOM.J1939.USB gateway board is a high-performance, low-latency vehicle network adapter for SAE J1939 applications. It allows any host device with a USB COM port to monitor SAE J1939 data traffic and communicate with the SAE J1939 vehicle network. The board supports the full SAE J1939 protocol according to J1939/81 Network Management (Address Claiming) and J1939/21 Transport Protocol (TP).
The strength of the board lies in the fact that the entire SAE J1939 protocol, including all timing requirements, is stored on-chip, thus taking the burden off the main system. The board uses a USB COM port to communicated with the main system, i.e. all data transfer is handled through a standard COM port access. The communication protocol between the board and the main system is well documented and thus allows a porting to any computer system with a USB connection.
Programming the Board Using Visual Studio C#
Every gateway, may it be CAN-to-USB or J1939-to-USB, requires a serial communication protocol for the USB port. In order to not compromise the vast reliability of the Controller Area Network technology, the protocol should include safety features to detect and prevent loss of data. Thus, the protocol we are using is based on byte stuffing and the use message length information plus checksum.
For more information on the protocol and to understand the messages exchanged between the board and the host system (usually a PC), you will need to read our document (PDF):
The sample VS C# application we created demonstrates the most important commands to the gateway and how to receive feedback and data.
I will not engage into a detailed description of the source code, since this would require some tremendous efforts and time. Every programmer will some basic C# experience will be able to recognize the important parts and I have tried to keep the program as simple as possible.
The code covers the reading and writing of the selected USB COM port plus the previously mentioned communication protocol, which will enable the programmer to focus on the actual application and use the gateway’s full capabilities.
A good knowledge of the SAE J1939 protocol is, of course, helpful (see literature references on the right), but you do not need to implement and understand the J1939 protocol stack. For instance, the gateway detects messages longer than eight bytes automatically and invokes the J1939 Transport Protocol (TP). All the user sees on the programming side is the message ID (PGN), priority, data, and message length. The same is true when sending messages.
For more information see our post, Programming the SAE J1939 ECU Simulator Board Using Visual Studio C#.
Download the code:
jCOM1939 Monitor – SAE J1939 Monitor, Analyzer, And ECU Simulator
For those who don’t want or need to program an application, but also for programmers who would like to see the gateway’s full potential, it is worth to have a look at our Windows software, the jCOM1939 Monitor – SAE J1939 Monitor, Analyzer, And ECU Simulator.
This is a free software, and you can download it here. However, please be aware that the software runs only with our board, i.e. it does not support boards from other manufacturers.
The jCOM1939 Monitor Software is the perfect tool to monitor, analyze, and simulate SAE J1939 data traffic. The system combines our jCOM.J1939.USB that functions as an SAE J1939 to USB (or UART) gateway. A comprehensive and easy-to-use, easy-to-understand Windows software displays not only SAE J1939 data traffic; it also allows to scan the network, simulate an ECU (incl. full node address negotiation features), and respond to data request messages.
- ECU Simulation Setup (Preferred Node Address, Negotiable Address Range, NAME, and more)
- Filter J1939 PGNs for Display
- Design J1939 PGNs for Transmission (Data and Request Messages)
- Design J1939 PGNs for Request Responses
- Scan a J1939 Network (Number of Nodes, Node IDs, NAMEs)
- Check Gateway Status (Error Messages, Software/Hardware Version)
- Set Gateway Parameters (Heartbeat Frequency, Message Acknowledgment)
- Free Updates
For more information, please feel free to contact us at any time.