Application topology:

The gateway reading scheme is as follows:

Gateway working mode settings
1. Set the protocol read by the gateway on the CAN bus to J1939 protocol. After saving and applying, the following figure is shown.

2. Set the J1939 terminal reading parameters
2.1 Click to view J1939 parameters

2.2 Configure the gateway local ID to 5 and the baud rate to 250K

2.3 After confirming the CAN bus parameters, click Protocol Traffic to view the J1939 message as follows

2.4 After confirming that accurate data has been received, return to the J1939 parameter configuration page for configuration.

3. Follow the steps below to configure the read J1939 data
3.1 D1 data reading, setting name, reading address, PGN, the key is offset0 and date length1

3.2 D2 data reading

3.3 D3 data reading

3.4 D4 data reading

3.5 D5 data reading

3.6 D6 data reading

3.7 D7 data reading

3.8 D8 data reading

3.9 After configuration, please remember to click Done, then click Save, and then enable all configurations, so that all configurations can be saved completely.

3.10 After saving, go to the diagnostic page to check whether the tags are saved in the corresponding data in order.

After confirming that the data is saved in the corresponding data, the next step is to set the data mapping relationship on the Modbus TCP slave side.
4. Modbus TCP slave address mapping
4.1 Enter the Modbus data mapping web page

4.2 Click this to configure the Modbus TCP slave parameters

4.3 Set the TCP slave port number to 502 and the ID to 1

4.4 Add TAGS. As shown in the figure below, add J1939 data in order. First, map D1 to address 30000.

4.5 Set the read J1939 data

4.6 Set the J1939 data of the first Modbus register map

4.7 Click DONE to save

4.8 You can see that the 30000 address of the Modbus TCP slave has been mapped to the data of D1.

4.9 Same as above, continue to add tags to map other J1939 data to the Modbus TCP slave end in sequence

4.10 Click SAVE and GO TO APPLY SETTINGS, and finally click APPLY


Modbus TCP Master Read
1. Use Modscan to read the data and compare the original J1939 data as follows
Modscan connection settings are as follows

1.2 The reading status is as follows

The above description shows that the function of data conversion and adjustment of the number of saved bits has been set up and communication is normal.

