background image

UM-0086-A2

 

CANgate User’s Manual 

Page 20 

RQSTJ – Request J1939 Data 

 

{ slot }

 RQSTJ 

CANport

 

PGN

 

{ startByte{

.

bit}

 

endByte{

.

bit}

 

ECUaddr

 

 priority

 

sampleRate } { 

FORMAT 

fmtOpt } 

The parameters for a 

RQSTJ

 slot are the same as for a RECVJ slot (except that 

ALL

 is not a valid setting for 

sampleRate

), 

but they are used in a somewhat different way. 
When a RQSTJ slot is polled, CANgate will send a message to request a particular parameter group (PGN). The format of 
this request message is defined in SAE J1939/21 (Data Link Layer). The request will be sent to destination address 

ECUaddr

, or to the broadcast address if 

ECUaddr

 = 

256

. The source address will be set to CANgate's configured address 

(see 

SETADDR – Set CANgate Address

 

(P25)

). 

CANgate will then listen for a response with an appropriate CAN identifier, the same as a RECVJ slot. 
Some PGNs have more than 8 bytes of data (which is the limit of a single CAN frame) associated with them. In this case the 
ECU will respond with a multi-packet transfer. This may take the form of a multi-packet broadcast, or it may be a 
point-to-point transfer using the J1939 transport protocol. CANgate will accept either type of response. 
Note that there are some special considerations to be aware of regarding multi-packet transfers; see 

Multi-Packet J1939 

Messages

 

(P30)

See also 

Request PGNs

 

(P29)

Note

: As is the case with ISO-14230 (RQST slots), the response time will depend upon the particular ECU. J1939 requests 

are queued in the same way as ISO-14230 requests – CANgate will only send out one request at a time, and will time out 
after approximately 400ms if there is no response. 

Examples 

  RQSTJ 2 65254 1 1 0 6 1000 FORMAT .25 

Once per second (1000ms), send a request on CAN port 2 for PGN 65254 (time/date) to the ECU with address 0, and expect 
a reply with priority 6. The first byte of the response (seconds x 4) is extracted and returned. 

GPS – Receive NMEA-0813 Messages 

 

{ slot }

 GPS "

header

fieldNum

 

{ option

 

sampleRate }

 

FORMAT 

formatOptions } 

where: 

 

slot

 is the memory slot being defined (integer, 

0-150

). If not specified then 

0

 is assumed. If CANgate is in Run Mode 

then zero is the only value that can go here. 

 

header

 is the NMEA-0183 sentence header string, without the leading 

$

 character (string, eg.

"GPGLL"

 

fieldNum

 specifies the data field of interest in the NMEA-0183 string (integer, 

1-19

). The field immediately following 

the sentence header is field #1. 

 

option 

(single character: 

D

 or 

M

 or 

N

, default:

N

). If 

N

 (normal) is specified then the indicated field is returned as is. 

Otherwise, the indicated field and the next field are interpreted as a latitude or longitude value  with format 

DDDMM

.

mmmmm

,

h

 – 

DDD

 = degrees, 

MM

.

mmmmm 

= minutes, 

h

 = hemisphere (

N

S

E

 or 

W

). If 

option

 = 

D

 then 

the 

degrees

 component is returned, ie. 

DDD

, which will be prefixed by a minus sign if 

h

 = 

S

 or 

W

. Similarly, if 

option

 = 

M

 then the 

minutes

 component is returned, ie. 

MM

.

mmmmm

, which will also be prefixed by a minus sign if 

h

 = 

S

 or 

W

 

sampleRate

 is the rate at which to return values to the host (integer, in ms, must be multiple of 100ms). May also be 

ALL

, in which case a value is returned on receipt of every matching GPS message. If this parameter is 

0

 or not 

specified, the memory slot will only return data when it is polled by the host system (using the 

RP

 command). 

 

formatOptions

 specify how the data value is to be formatted when it is returned to the host system; see 

FORMAT 

Sub-command

 

(P21)

 for more details. Note that GPS data is always treated as a string; scaling options will be ignored. 

The 

FORMAT

 clause is therefore only useful for adding before and after text. 

 
If a GPS receiver is connected to CANgate then positional data (latitude, longitude, elevation, etc.) can be returned along 
with measured CAN parameters. 
A GPS receiver will transmit position messages via its RS232 interface, typically about once per second. These messages 
are formatted according to the 

NMEA-0183

 protocol. NMEA-0183 defines many different 

sentences

, each of which consists 

of an identification string followed by a number of comma separated data values. For example, the sentence: 
 

$GPGLL,3749.1965,S,14458.9940,E,073510.22,A 

provides a basic positional fix, containing the current latitude (37° 49.1965' S, 144° 58.9940' E), and the time the fix was 
taken (07:35:10.22 UTC). Other sentence types (eg. 

$GPGGA

) provide more detailed information, including elevation, 

accuracy, number of satellites in view, etc. 
A CANgate 

GPS

 memory slot is used to parse incoming NMEA-0183 data and then return specific fields to the host. This will 

capture all messages with the specified ID string, and extract the required data field. When polled (using the 

RP

 command), 

or at the intervals specified by the 

sampleRate

 parameter, the slot will return the most recent value for the data field. If no 

messages have been received, or if the specified field does not exist in the received messages, then nothing will be returned 
(other than the configured static formatting text, which is specified by the 

FORMAT

 sub-command and by default is just 

CRLF). 

Summary of Contents for CANgate

Page 1: ...Intelligent Data Logging Products CANgate User s Manual A guide to programming wiring communications www datataker com...

Page 2: ...EPT AS EXPRESSLY PROVIDED IN THIS WARRANTY STATEMENT THERMO FISHER DISCLAIMS ALL OTHER WARRANTIES WHETHER EXPRESS OR IMPLIED ORAL OR WRITTEN WITH RESPECT TO THE INSTRUMENTS INCLUDING WITHOUT LIMITATIO...

Page 3: ...Summary 15 Command Reference 16 Commands and Parameters 16 Slot Definition Commands 16 RECV Receive Standard ID CAN Messages 16 RECVE Receive Extended ID CAN Messages 17 SEND Transmit Standard ID CAN...

Page 4: ...minal Control 30 KWP2000 OBD II ISO 14230 Requests 30 Reading Fault Codes 31 OBD II 31 J1939 31 Using CANgate with a DT8x Data Logger 32 Escaping Control Characters 32 Serial Sensor Direct Mode 33 Usi...

Page 5: ...N ports are hot pluggable and all CANgate settings are saved in non volatile flash memory so that the unit will resume its configured tasks following a power interruption Typical CANgate application A...

Page 6: ...Unit GPS Global Positioning System ID Identifier ISO International Standards Organisation NMEA National Marine Electronics Association OBD On Board Diagnostics PGN Parameter Group Number PID Parameter...

Page 7: ...ows Pin Signal Function 1 5V out 5Vdc output 200mA max 2 GND Ground 3 CAN1 HI CAN port 1 high 4 GPS RXD GPS port Receive Data input 5 CAN1 LO CAN port 1 low 6 CAN2 HI CAN port 2 high 7 CAN2 LO CAN por...

Page 8: ...agram Note By default the CANgate host port operates at a high baud rate 57600 baud At this speed the maximum cable length for the host computer or data logger connection is approximately 5 metres ass...

Page 9: ...ysical layer as defined in ISO 11898 2 SAE J2284 This is by far the most widely used physical layer The important characteristics of this standard are two wire 5V differential signalling bit rate 10kb...

Page 10: ...then an external termination resistor may be required Direct connection to a single ECU In this case a short 1m cable is used so the two 120 resistors are combined into one 60 resistor If a long cabl...

Page 11: ...ff off off x x x x off 38400 off off ON x x x x off 19200 off ON off x x x x off 9600 off ON ON x x x x off Host port baud rate 115200 ON off off x x x x off hardware x x x off x x x off Host port flo...

Page 12: ...sive and active For RECV RECVE RECVJ and GPS slots CANgate passively receives all matching messages then returns the last known data value either at a fixed rate or when requested by the host data log...

Page 13: ...ing Commands CANgate memory slots and other settings are configured by sending textual commands via the host port The available commands are detailed in the Command Reference P16 If CANgate is directl...

Page 14: ...cters after the apostrophe up until the end of the line will be ignored Run Mode and Program Mode CANgate has two operational modes Run Mode is the normal mode of operation Following power up CANgate...

Page 15: ...ddr sampleRate FORMAT options slot RECVJ CANport PGN startByte bit endByte bit ECUaddr priority sampleRate FORMAT options slot RQSTJ CANport PGN startByte bit endByte bit ECUaddr priority sampleRate F...

Page 16: ...ot specified then 8 is assumed If bit is not specified then 1 is assumed sampleRate is the rate at which to return values to the host integer in ms must be multiple of 100ms May also be ALL in which c...

Page 17: ...ed connect the two CAN ports together and set up the RECV slot on the other port Examples SEND 2 0x302 1122FF07 RP This will immediately send a CAN message on CAN port 2 The message s identifier will...

Page 18: ...negative response and indicates that an invalid request was made All messages are transmitted using the ISO 15765 network layer protocol This protocol fragments long messages into multiple CAN frames...

Page 19: ...slot That is it listens for CAN messages with a particular extended identifier extracts the required data field then returns it to the host when polled or at regular intervals or after every message...

Page 20: ...ter D or M or N default N If N normal is specified then the indicated field is returned as is Otherwise the indicated field and the next field are interpreted as a latitude or longitude value with for...

Page 21: ...specifies the data type integer floating point etc and possibly some other formatting details If no conversion specifier is present which is the default the data value will be output in raw hexadecim...

Page 22: ...that the last matching CAN message had the data 01234567AABBCCDD RECV 1 0x100 1 2 returns 0123 CR LF RECV 1 0x100 1 2 FORMAT 100 returns 29100 00 CR LF 0123 hex scaled by 100 RECV 1 0x100 1 2 FORMAT r...

Page 23: ...of responses may not match the order of the memory slots Examples RP 1 150 Poll all defined memory slots RQSTJ 2 65226 3 6 FORMAT f n RP SEND 1 0x142 112233 RP The RP command is often appended when d...

Page 24: ...time all incoming CAN messages on the specified port are received For each distinct CAN identifier that was received the following information is displayed identifier type standard 11 bit STD or exte...

Page 25: ...cified both CAN ports are measured This command measures the traffic load on one or both CAN ports and reports it as a percentage of the theoretical maximum for the bit rate in use It should be noted...

Page 26: ...es 2 8 end Flags c0820000 Sample 0 ms 1 RECV CAN1 RxID 0x0001 RxBytes 1 8 1 1 Flags c0020000 Sample 0 ms 2 RECV CAN1 RxID 0x0002 RxBytes 1 8 1 1 Flags c0020000 Sample 0 ms 3 RECV CAN1 RxID 0x0003 RxBy...

Page 27: ...s sent by CANgate will be displayed eg CAN2 TX 18EC00FF 132C0007 FFEBFE00 which shows that a message has been sent on CAN2 with identifier 0x18EC00FF and the indicated data value if bit 1 1 then all C...

Page 28: ...adcast PGNs J1939 based systems typically have a multitude of SPNs Suspect Parameter Numbers each representing an individual measured quantity or status A group of related SPNs will be broadcast over...

Page 29: ...d causes the memory slot to be immediately polled which will cause the request to be immediately sent Note that it doesn t make sense to poll a RECVJ slot immediately after defining it because at that...

Page 30: ...at any one time Terminal Control The following example is intended to be used with an ANSI VT100 terminal or emulator Two data values are extracted from received CAN messages with ID 0x212 and one fro...

Page 31: ...eg RQST 1 0101 RP 81066060 The most significant 8 bits 81 of the 32 bit result contains the most pertinent information In this case b31 is set which indicates that the Malfunction Indicator Light MIL...

Page 32: ...ed memory slots a number of 1SERIAL commands within one or more logger schedules typically one 1SERIAL command per parameter of interest These commands will normally send a poll command RP memslot the...

Page 33: ...logger connection from now on will be ignored by the logger and will instead be forwarded to the serial sensor port ie to CANgate Furthermore all normal text output from the logger eg real time data...

Page 34: ...also flash during the snoop If the CAN LED gives a brief flash at two second intervals then this may indicate that bus errors are occurring causing CANgate to disconnect from the bus then retry every...

Page 35: ...pear in the received data stream which will probably disrupt the parsing of the returned data With the logger in pass through mode verify that CANgate is configured for normal operation with no extran...

Page 36: ...message returned if in verbose mode CAN1 BUS ERROR DISCONNECTED The most common cause for this is an incorrectly configured bit rate although it may also be caused by noise or an intermittent electri...

Page 37: ...version 6 Type RESET to clear any existing CANgate configuration 7 Type VXVX All CANgate LEDs will turn on to indicate that the bootloader is active Some random characters may be returned as the bootl...

Page 38: ...1 stop bit Flow Control Not supported Protocols NMEA 0183 Host Data Logger Computer Interface 1 RS232 port Port Speeds 9600 19200 38400 57600 default 115200 baud Serial Parameters No parity 8 data bi...

Page 39: ...r Consumption Idle 0 75W 50mA 15V Maximum CANgate only 2 25W 150mA 15V Maximum CANgate external device drawing 200mA from 5V output 3 75W 250mA 15V Physical Construction Anodised aluminium plastic sur...

Page 40: ...ly to a mode 0x01 request The second byte is the PID and the third and subsequent bytes are the actual data value PID hex Data Size bytes Description Scale Offset Units 00 4 PIDs supported b31 0 PIDs...

Page 41: ...e travelled since DTCs cleared 1 0 km 32 2 Evaporative system vapour pressure 0 25 8192 Pa 33 1 Barometric pressure 1 0 kPa abs bytes 1 2 Sensor 1 WR lambda 1 Equivalence ratio 0 0000305 0 34 4 bytes...

Page 42: ...rain B body C chassis or U network For example P0118 Engine Coolant Temperature Circuit High Input P0203 Injector Circuit Malfunction Cylinder 3 U0003 High Speed CAN Communication Bus Open When a DTC...

Reviews: