0% found this document useful (0 votes)
67 views12 pages

J1939/Modbus Slave Gateway FAQ v1.2

The document provides frequently asked questions and answers about configuring and using the J1939/Modbus Slave Gateway. It explains how to solve common issues like CAN bus transmission failures or bus-off errors. It also provides details on restoring factory defaults, communication baud rates, and examples of configuring the gateway's input and output tables to exchange data with J1939 devices like an engine controller.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views12 pages

J1939/Modbus Slave Gateway FAQ v1.2

The document provides frequently asked questions and answers about configuring and using the J1939/Modbus Slave Gateway. It explains how to solve common issues like CAN bus transmission failures or bus-off errors. It also provides details on restoring factory defaults, communication baud rates, and examples of configuring the gateway's input and output tables to exchange data with J1939 devices like an engine controller.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

J1939/Modbus Slave Gateway FAQ v1.

J1939/Modbus Slave Gateway


FAQ
Version 1.2

(For GW-7228/GW-7238D)

ICP DAS Co., Ltd.


J1939/Modbus Slave Gateway FAQ v1.2

Table of Contents
Q01 : How to solve CAN Bus Transmission Fail problem? ................................................................ 2
Q02 : How to solve CAN Bus-Off problem? ...................................................................................... 2
Q03 : Why the gateway can not transmit J1939 output messages? ................................................ 2
Q04 : How to restore factory default?.............................................................................................. 3
Q05 : What is the communication Baud Rate in J1939 protocol?.................................................... 3
Q06 : Should I add the termination resistor (120Ω) between CAN-H and CAN-L with our engine,
when it connect to the gateway? ............................................................................................ 3
Q07 : Explain the Device Name and Network Address Configuration in the Utility......................... 4
Q08 : What’s the relation between the address in the J1939 Input/Output Table and the J1939
device? .................................................................................................................................... 5
Q09 : Is Input or Output Table for getting the J1939 messages from the engine?..................... 5
Q10 : The J1939 Input Table configuration with common PGNs from the engine. ......................... 6
Q11 : Example of the J1939 Input/Output Table configuration. ................................................. 7
Q12 : How to get the parameter from engine if the source address of the engine is unknown? ... 8
Q13 : How to configure the gateway to send requested speed to the engine? .............................. 9

1 ICP DAS Co., Ltd.


J1939/Modbus Slave Gateway FAQ v1.2

Q01 : How to solve CAN Bus Transmission Fail problem?


A01 :
Make sure the CAN bus wiring is connected, and connected to the correct pins. The CAN bus wire
connection for the GW-7228 should be noted as follows:

Q02 : How to solve CAN Bus-Off problem?


A02 :
Make sure that no short circuit exists in the CAN bus wiring between the GW-7228/GW-7238D
and other J1939 devices.

Q03 : Why the gateway can not transmit J1939 output messages?
A03 :
1. Make sure the Start/Stop sending J1939 output messages register (42009) is 0.
2. Make sure the Update Rate of J1939 output messages table is not zero.

2 ICP DAS Co., Ltd.


J1939/Modbus Slave Gateway FAQ v1.2
Q04 : How to restore factory default?
A04 :
1. Power on the GW-7228/GW-7238D.
2. Change the Dip-Switch position of the GW-7228/GW-7238D and to complete the following
steps in 5 seconds.
Step1. From “Normal” to “Init” position.
Step2. From “Init” to “Normal” position.
Step3. From “Normal” to “Init” position.
Step4. From “Init” to “Normal” position.
3. When the correct implementation of the above steps, the
J1939/Modbus LEDs of the gateway should be turn on, and that
should be turn off after 500 ms later.
4. Power cycle the gateway, and it would go back to the factory defaults.
5. For serial network, reconnect the GW-7228/GW-7238D by using the
network setting as 115200 baud with none parity, 1 stop bit and 1 Net
ID.
For Ethernet network, reconnect the GW-7238D via the default IP
address 192.168.255.1 with the same subnet.

Q05 : What is the communication Baud Rate in J1939 protocol?


A05 :
According the J1939-11 specification, the J1939 communication Baud Rate is 250K bps.

Q06 : Should I add the termination resistor (120Ω) between CAN-H and CAN-L with
our engine, when it connect to the gateway?
A06 :
It depends on the environment, we usually use the oscilloscope to measure the CAN bus signals,
it will be determined according to the waveform, please refer the following figure.
➢ In this situation, we recommend to add termination resistor.

Figure 1: Waveform of the termination resistor being not added.

3 ICP DAS Co., Ltd.


J1939/Modbus Slave Gateway FAQ v1.2
➢ After add the termination resistor, the waveform is as below.

Figure 2: Waveform of the termination resistor being added

Q07 : Explain the Device Name and Network Address Configuration in the Utility.

A07 :
 Device Name
The “Device Name” is not the name of the connected J1939 devices. It is the name of the J1939
gateway itself. In general, it will not affect the function without changing it.

 Network Address Configuration


It is the network address of the J1939 gateway on the CAN bus. The J1939 gateway can avoid
address conflict on the CAN bus by setting multiple spare network addresses (max.:20) for the
gateway in this field. When the address conflict happens, the J1939 gateway will apply the other
spare address for normal communication.

4 ICP DAS Co., Ltd.


J1939/Modbus Slave Gateway FAQ v1.2
Q08 : What’s the relation between the address in the J1939 Input/Output Table and
the J1939 device?

A08 :
The J1939 gateway can receive the J1939 messages from the J1939 device. The J1939 gateway
can also send out the J1939 messages to the J1939 device on the bus.

 J1939 Input Table is the configuration table for the gateway to receive the J1939 messages
from the J1939 devices. The “Address” field is the “Source Address” in the table, which is
the address of the J1939 device.

 J1939 Output Table is the configuration table for the gateway to send out the J1939
messages to the J1939 devices. The “Address” field is the “Destination Address” in the table,
which is the address of the J1939 device.

Q09 : Is Input or Output Table for getting the J1939 messages from the engine?
A09 :
Please refer to the J1939 Input Table configuration and the comparision table in the “Q10”.
These configurations for getting the speed, temperature, pressure, etc. of engine should be
added to the J1939 Input Table in the utility.

The J1939 PGN/SPN Tx messages listed in the engine manual are J1939 messages sent from the
ECU of the engine to the gatway. They should be configured in the J1939 Input Table.

The J1939 PGN/SPN Rx messages listed in the engine manual are J1939 messages got by the ECU
of the engine from the gateway. They should be configured in the J1939 Output Table.

Every PGN message is composed of several SPNs.

5 ICP DAS Co., Ltd.


J1939/Modbus Slave Gateway FAQ v1.2
Q10 : The J1939 Input Table configuration with common PGNs from the engine.
A10 :
Please refer to the following J1939 input table configuration and Modbus register comparison
table.

Modbus Register comparison table

J1939 Input Table Configuration in GW-7228/GW-7238D Utility

It is also recommended to read the pdf file “J1939_PGN_Modbus_Comparison.pdf” and load


the configuration file “GW7228_BasedJ1939PGN.txt” in the utility folder.

6 ICP DAS Co., Ltd.


J1939/Modbus Slave Gateway FAQ v1.2
Q11 : Example of the J1939 Input/Output Table configuration.
A11 :
1. Please refer to “Q13” for the J1939 Output Table configuration.

2. Example of the J1939 Input Table configuration:


For reading the engine speed, the J1939 PGN 61444 message (Electronic Engine Controller 1,
EEC1) contains the engine speed which is the SPN 190.

The SPN 190 (Engine Speed) is located at the 4th, 5th byte (Start Position 4-5) and the length is 2
bytes. The value of the SPN 190 is integer which need to be multiplied by the
“Resolution”(Table 2) to convert it to the physical speed. Users can refer to the engine manual
for more detailed information on the supported PGNs.

Table 1: Content of the PGN 61444 message


Start Position Length Parameter Name SPN
1.1 4 bits Engine Torque Mode 899
1.5 4 bits Actual Engine - Percent Torque High Resolution 4154
2 1 byte Driver's Demand Engine - Percent Torque 512
3 1 byte Actual Engine - Percent Torque 513
4-5 2 bytes Engine Speed 190
6 1 byte Source Address of Controlling Device for Engine Control 1483
7.1 4 bits Engine Starter Mode 1675
8 1 byte Engine Demand – Percent Torque 2432
Note: PGN 61444 Transmission Repetition Rate: engine speed dependent.

Table 2: SPN 190 Engine Speed


Data Length 2 bytes
Resolution 0.125 rpm/bit, 0 offset
Data Range 0 to 8,031.875 rpm
Operational Range Same as Data Range
Type Measured
PGN Reference 61444

To get the SPN 190 (Engine Speed) from engine, a PGN 61444 item should be added to the
J1939 Input Table in the utility. Map the SPN 190 (Engine Speed) to the address 30001 of the
Modbus input register in the gateway for the request by the Modbus master as depicted in the
following figure 1.

Figure 1: J1939 Input Table configuration for engine speed

7 ICP DAS Co., Ltd.


J1939/Modbus Slave Gateway FAQ v1.2

Where the instructions to the columns are as follows:


 Input Register: Unit: Byte. It is 0-based byte address which mapped to the Modbus Input
Register (Unit: word, 2 bytes, 1-based address started from 30001). In this case, the value
is 0 which is mapped to the MSB of the Modbus address 30001(0~1 byte). If this field is set
to 2 which maps to the start of the Modbus address 30002 (2~3 byte).
 Data Length: Unit: byte. The data length of this item. In this eample, it is 2 for the engine
speed. Consider the “Input Register” and “Data Length” together, it means the received
engine speed(2 bytes) will be stored at the Modbus Input Register 30001 (0 ~ 1 byte).
 PGN: It is 61444 in this example.
 Source Address: The address of the J1939 device (engine ECU) which sends out the PGN
61444. If the address is unknown, address 255 can be set to receive the PGN(61444)
messages from all J1939 devices with different addresses on the bus.
 Update Rate: Uint: ms. Update Rate is equivalent to the “Transmission Repetition Rate” of
the supported PGNs listed in the engine manual. It is “engine speed dependent” in this
example. 20 ms is set here.
 Message Offset: Unit: byte. The offset value is 0-based value which is corresponding to the
“Start Position” of the.SPN in the PGN. Engine Speed (SPN 190) is at the 4th byte in the PGN
61444. The message offset should be 3 (3 = 4-1, 0-based index).
After the above configuration is uploaded to the J1939 Gateway, the Modbus Input Register
30001 is stored with the engine speed(2 bytes). The value of the 2 bytes integer need to be
multiplied by the “Resolution” in the previous Table 2 to get the physical speed.

Q12 : How to get the parameter from engine if the source address of the engine is
unknown?
A12 :
For the Source Address in the J1939 input configuration table, it shall only be one device on the
network with a given source address, messages received must match both the PGN and source
address to be used for this data field. If the Source Address set to 255, any message with a
matching PGN will be accepted.

8 ICP DAS Co., Ltd.


J1939/Modbus Slave Gateway FAQ v1.2
Q13 : How to configure the gateway to send requested speed to the engine?
A13 :
Please refer to the manual of the engine to understand the supported J1939 messages. The
following is an example of setting the requested engine speed.

a. TSC1 - PGN 0, SPN 898 (Requested Speed)


The Requested Speed (SPN 898) in the PGN 0 message is at the position of the 2nd and the 3rd
byte.

TSC1 (Torque/Speed Control #1) Parameter Group 0


Transmission Rate 20 ms
Data Length 8 Default Priority 3
Identifier (hex) 0C 00 00 03
Start Position Length Parameter Name SPN
1.1 2 bits Override Control Mode 695
1.3 2 bits Requested Speed Control Conditions 696
1.5 2 bits Override Control Mode Priority 897
2, 3 2 bytes Requested Speed 898
4 1 byte Requested Torque 518
5-8 4 bytes Not defined

b. Configure the J1939 Output Table


Identifier = 0C000003h where 03h is the address of the gateway. So, address 3 should be only
added to the “Network Address Configuration” in the utility as shown in the below figure. The
“Auto Transmission” should be checked to enable the function, too.

The following item can be added to the J1939 Output Table:


Output Register Data Length PGN Priority Destination Address Update Rate Message Offset
0 8 0 3 0 20 0

Please refer to the manual for details about these parameters. The payload (8 bytes) of the PGN
0 message is mapped to the Modbus Holding registers 40001 ~ 40003 in the gateway (according
to Output Register = 0 and Data Length = 8).

9 ICP DAS Co., Ltd.


J1939/Modbus Slave Gateway FAQ v1.2

Download the configuration to the gateway to take effect the settings ([File]=>[Download
Parameter]). The gateway sends out the PGN 0 messages continuously after download.

c. Set Requested Speed


The following table shows the Scaling/Range of the requested speed, which help to get the
physical values. 2 bytes value of the Requested Speed multiplying 0.125 gets the rpm value. Rpm
value multiplying 8 gets the 2 bytes value.

If you want 1000 rpm set to the engine, 1000 rpm is multiplied with 8 to give 8000 (decimal),
1F40h in hex (big endian). Flip these bytes to get little endian format, 401Fh. The payload of the
PGN 0 message will look like this:
Identifier Byte 1 Byte 2 Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Byte 8
0C000003 01 40 1F 00 FF FF FF FF
s
Use Modbus FC16 command to setup the requested speed 1000 rpm.
(hex) 01 10 00 00 00 04 08 01 40 1F 00 FF FF FF FF 35 89

10 ICP DAS Co., Ltd.


J1939/Modbus Slave Gateway FAQ v1.2
The following figure shows the J1939 PGN 0 messages sent out from the gateway.

11 ICP DAS Co., Ltd.

You might also like