B&B 1939STB User Manual

RS-232 to J1939 Converter CE
Model 1939STB
Documentation Number 1939STB4600
International Headquarters
B&B Electronics Mfg. Co. Inc.
707 Dayton Road -- P.O. Box 1040 -- Ottawa, IL 61350 USA
Phone (815) 433-5100 -- General Fax (815) 433-5105
Home Page: www.bb-elec.com
Sales e-mail: orders@bb-elec.com
Technical Support e-mail: support@bb-elec.com
European Headquarters
B&B Electronics Ltd.
Westlink Commercial Park, Oranmore, Co. Galway, Ireland
Phone +353 91 792444 -- Fax +353 91 792445
Home Page: www.bb-europe.com
Sales e-mail: orders@bb-europe.com
Technical Support e-mail: support@bb-europe.com
B&B Electronics – November 2000
-- Fax (815) 433-5109
-- Fax (815) 433-5104
1939STB4600 Manual Cover Page
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Commercial Park – Oranmor e, Galway, Ireland – Ph +353 91-792444 – Fax +353 91-792445
Table of Contents
INTRODUCTION ...................................................................................... 1
SAE Publications.................................................................................. 1
WARNING!................................................................................ 2
DESCRIPTION............................................................................................. 3
Physical Description ............................................................................4
Electrical Specification ........................................................................4
Communication directed to the device .................................................5
Control Byte 3 ............................................................................................. 6
Control Byte 4 ............................................................................................. 7
Internal Functions ................................................................................ 8
Vendor String .............................................................................................. 8
RS-232 Baud Change .................................................................................. 9
External Commands ...........................................................................13
Message Header Setup............................................................................... 14
Message Information ................................................................................. 15
Byte 5 ........................................................................................................ 16
Byte 6 ........................................................................................................ 17
Byte 11 ...................................................................................................... 18
SAE-J1939 CONTROL HEADER.......................................................... 19
BYTE 7 .................................................................................................... 21
BYTE 8 .................................................................................................... 23
BYTES 9 AND 10 ...................................................................................... 25
BYTE 11 .................................................................................................. 26
Data Field .................................................................................................. 28
Reception of Data ...................................................................................... 29
SAE-J1939 BUS...................................................................................... 29
INTERNAL MESSAGES ........................................................................31
SOFTWARE .............................................................................................32
Installation................................................................................................. 32
Message Transmission............................................................................... 34
Message Reception .................................................................................... 34
Saving Message Information .................................................................... 35
File Logging ...............................................................................................35
APPENDIX A: EXTENDED CAN/SAE-J1939 MESSAGE FRAME A-1
APPENDIX B: EXAMPLE....................................................................B-1
1939STB4600 Manual Table of Contents i
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Commercial Park – Oranmor e, Galway, Ireland – Ph +353 91 792444 – Fax +353 91 792445
Introduction
SAE-J1939 is a communication protocol developed by SAE (Society of Automotive Engineers). The communication protocol is based on the CAN specification developed by Bosch 2.0 part B (September, 1991).
Before using the Model 1939STB the user should be familiar with the SAE publications listed below, and follow all the guidelines before attempting to connect to an active J1939 network.
The SAE-J1939 specifications are guidelines. Many manufacturers have proprietary data codes developed for their own use. The user must obtain these codes from the manufacturer of the vehicle. B&B Electronics does not have access to the SAE-J1939 codes, and cannot provide any assistance in obtaining these codes. It is the responsibility of the user to obtain and implement the specific J1939 codes for the vehicle(s) that the 1939STB is interfaced to.
SAE Publications
Surface Vehicle Recommended Practice
SAE-J1939/11 Physical Layer – 250k bits/s, Shielded Twisted Pair
SAE-J1939/21 Data Link Layer (issued JUL94)
SAE-J1939/31 Recommended Practice for Serial Control and Communications Vehicle Network – Part 31- Network Layer (issued DEC94)
SAE-J1939/71 Vehicle Application Layer (revised MAY96)
SAE-J1939/73 Application Layer –Diagnostics (issued FEB96)
SAE-J1939/81 Recommended Practice for Serial Control and Communications
You may order these documents from SAE at (412) 776-4970
CAN Specification 2.0 Robert Bosch GmbH Postfach 50 D-7000 Stuttgart 1, Germany
1939STB4600 Manual 1
(issued DEC94)
Vehicle Network – Park 81 – Network Management (issued JUL97)
FAX: (412) 776-0790
Or on the web at
http://www.sae.org
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Commercial Park – Oranmor e, Galway, Ireland – Ph +353 91 792444 – Fax +353 91 792445
WARNING!
This Model 1939STB Converter Module allows you to connect to active SAE J-1939 networks. It is possible that your transmissions through this converter module could cause malfunction of the network operation, damage to the software or equipment, or bodily harm.
Do Not Transmit Any Messages to The Network without a
complete understanding of the operation of the network.
B&B Electronics Mfg. Co. specifically disclaims any responsibility for damage or injury to software, hardware, equipment or persons as a result of using this product.
WARNING!
2 1939STB4600 Manual
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Commercial Park – Oranmor e, Galway, Ireland – Ph +353 91 792444 – Fax +353 91 792445
Description
The 1939STB is an interface device allowing the user to connect a PC to an SAE-1939 bus via a serial port. The 1939STB conforms to the Physical Layer specification as set forth in SAE-J1939/11. The 1939STB allows the reception and transmission of messages over an SAE-J1939 standard bus. This converter has 14 message “slots” that can be configured for either reception or transmission. A sample program is provided to aid in the setup of the interface. Source code is provided and can be found in a subdirectory under B&B Electronics/J1939/VB6. The Visual Basic program runs under Windows: however, setup and data transfers can be sent and received by any terminal capable of serial communications.
The power supply is a wide-range design and will accept a DC voltage between 10 and 42 volts. The 1939STB has reverse polarity protection. Power is connected to the 1939STB though a terminal block located under the snap cover. +DC is connected to the terminal marked “POWER”. -DC is connected to the terminal marked “GND”.
The serial port on the 1939STB is a 9-pin male connection, configured as DCE (pin 2 receive// pin 3 transmit). The serial baud rate is user selectable between 300 and 57600. The stop, parity, and word length can also be adjusted.
Two LED’s are provided on the 1939STB. One indicates that DC power is connected to the converter and the power supply is working properly. This LED will be lit constantly. The second LED is labeled “DATA”. This LED monitors the function of the converter. After the device is connected, the LED should flash approximately once every 2 seconds. The flashing LED confirms that the converter is operating properly and is ready to accept data.
Connection to the SAE-J1939 bus is made by a terminal connection. The terminal, located under the snap cover, is marked “CAN LOW and “CAN HIGH”. In some applications it may be necessary to add a terminating resistor across the CAN high/low terminals. Consult the SAE-J1939/11 publication for details concerning terminating resistors.
The terminals marked “ A” and “B” are not used.
1939STB4600 Manual 3
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Commercial Park – Oranmor e, Galway, Ireland – Ph +353 91 792444 – Fax +353 91 792445
Physical Description
Length: 5.25 in. (134mm) Width: 2.75 in. (70mm) Height: 1.00 in (25.4mm) Serial Connection: DB-9 female, DCE SAE-J1939 Connection: Terminal block, CAN HIGH/CAN LOW Power Connection: Terminal block, POWER/GND Temperature: 0 to +70 degrees Centigrade
Electrical Specification
Input Power Requirement: 10 to 42 volts DC, 1 Watt max. Meets Physical Layer SAE-J1939/11 Fully compatible with ISO 11898-24v standard RS-232 driver meets EIA-232-E and V.28 specification CAN transceiver meets ISO 11898-24 V standard
4 1939STB4600 Manual
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Commercial Park – Oranmor e, Galway, Ireland – Ph +353 91 792444 – Fax +353 91 792445
Communication directed to the device
Format:
Message header Message Information Data Payload
B1 B2 B3 B4 B5 B6 B7 B8 B9 B
8 1 21 1F 05 95 E7 0c 80 00 40 8c 41 42 43 44 45 46 47 4
Table 1. J1939STB Format
B
B
1
1
0
1
B
1
1
2
3
B
B
B
B
1
1
4
1
5
6
B
1
1
8
9
All communications to the device start with a message header (white area). This header is removed from any message sent to the J1939 bus. The header is four bytes long. Two bytes (B1& B2) are used to confirm start of frame. The next two bytes (B3 & B4) contain information controlling how the 1939STB functions. The remainder of the packet is the data payload and can contain from zero to sixteen bytes depending on function.
Byte 1 Byte 2 Byte 3 Byte 4 Message Information Data Payload
Check1 Check 2 Control 1 Control 2
Table 2. Transmit Data Format
The first two bytes (Check 1 and Check 2) are always set to 81hex and 21hex. These bytes must
precede all data sent to the device. If the Check bytes are not sent consecutively the message will be rejected. The entire message must be resent before data can be transmitted to the device. Control (byte 3 and byte 4) contain information that is used by the converter. This information is not passed to the J1939 bus. Both control bytes must contain data (cannot have a value of 00) or the transmission will be rejected.
B 2 0
8
1939STB4600 Manual 5
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Commercial Park – Oranmor e, Galway, Ireland – Ph +353 91 792444 – Fax +353 91 792445
Control Byte 3
Byte 3 directs the data packet to the proper destination. The setting of this byte will affect the rest of the message. That is to say changing this byte changes the meaning of the following data bytes.
Nibble 2 Nibble 1 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Table 3. Bits of Byte 3
Byte 3 has two parts, Nibble 1 and Nibble 2. Nibble 2 (bits 4 – 7) sets
the control code as follows:
Bit Number Value Function
1 Reserved not used Bit 7 0 Reserved not used 1 Reserved not used Bit 6 0 Reserved not used 1 Internal commands (Baud rate, Version number) Bit 5 0 No function 1 External commands (Messages to J1939 bus) Bit 4 0 No function
Table 4. Byte 3 Nibble 2
Nibble 1 (bits 0 – 3) of control byte 3 defines the number of bytes in the data payload of the message. The byte count does NOT include the message header (bytes 1 through 4). The message payload is limited to 16 bytes. This limit allows a complete J1939 packet to be sent or received from the bus.
Byte 1 Byte 2 Byte 3 Byte 4 Check 1 Check 2 Control 1 Control 2
<< Count Number of Bytes for byte 3 nibble 1 >>
Table 5. Transmit Data Format
Message Information Data Payload
Nibble 1 of control byte 3 can be set to any value between 0 and 16
(0 to F hex).
Bit Number Value Function
6 1939STB4600 Manual
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Commercial Park – Oranmor e, Galway, Ireland – Ph +353 91 792444 – Fax +353 91 792445
Table 6. Byte 3 Nibble 1
1 Number of bytes in data payload (MSB) Bit 3 0 1 Number of bytes in data payload Bit 2 0 1 Number of bytes in data payload Bit 1 0 1 Number of bytes in data payload (LSB) Bit 0 0
Control Byte 4
When control byte 3 is set to “external commands” (bit 4 set to 1), nibble 1 of control byte 4 is used to tell the J1939 in which message slot location (1 through 15) to place the message data. NOTE: Message location number 15 is receive only.
Nibble 2 Nibble 1 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
Table 7. Byte 4
When control byte 3 is set to “ internal commands” (bit 5 set to 1), nibble 1 of control byte 4 has the following functions:
Nibble 1 Value Function 0001 Display vender number & version 0010 Set baud rate, stop, start bits 0100 Not used 1000 Not used
Table 8. Nibble 1 Bit Values
Nibble 2 of control byte 4 is reserved for future use and is set to 0.
1939STB4600 Manual 7
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Commercial Park – Oranmor e, Galway, Ireland – Ph +353 91 792444 – Fax +353 91 792445
Internal Functions
While most of the information sent and received from the 1939STB will be transferred to the J1939 bus, the internal function codes allow the user to set up the serial port, and receive an identity string from the 1939STB. The identity string may be used to verify that the 1939STB is connected and working properly.
Vendor String
The vendor string function is sent to the 1939STB as shown in the table below. This function is strictly internal and can be sent to the 1939STB at any time whether or not the 1939STB is connected to an active J1939 bus. The shaded areas are to be set by the user.
Table 9. Vendor String Setup
Byte 3 Byte 4 Byte 1 Byte 2
81 21 0010 0000 0000 0001 81 21 20hex 01hex
Nibble 2 Nibble 1 Nibble 2 Nibble 1
After this is sent to the 1939STB the device will respond with:
Table 10. Message Received from the SAE-J1939 Bus
Function
I D 42 28 00 00 00 00 00 A
J1939 Address
MC Data
xx xx xx xx xx xx xx
A
See “Reception of Data” for an explanation of codes. The xx may change.
The included Visual Basic application has a script file, VENDN.CVS, that can be sent to the 1939STB to illustrate the vendor string function.
A A
8 1939STB4600 Manual
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Commercial Park – Oranmor e, Galway, Ireland – Ph +353 91 792444 – Fax +353 91 792445
RS-232 Baud Change
Setting byte-3/nibble-2 to 2 and byte-4/nibble-1 to 2 causes the 1939STB to change baud. This function also requires 3 bytes of additional information bytes 5, 6, and 7. It is important to note that after a baud change the PC must have its baud changed to match the baud of the 1939STB for communication to exist. If communication is lost after a baud change and cannot be recovered, disconnecting the 1939STB from its power source will restore the 1939STB to its default baud rate of 9600 baud, 1 stop bit, 8 data bits, no parity.
Table 11. Baud Rate Setup
Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Byte
Byte
1
2 81 21 0010 0011 0000 0010 81 21 23 hex 02 hex 03 hex 00 hex 06 hex
Nibble 2 Nibble 1 Nibble 2 Nibble 1 UB3 Baud 1 Baud 2
Table 11 shows how an internal command is used to set the 1939STB to a baud rate of 300, 1 stop bit, 8 data words, and no parity. Byte 3 nibble 2 sets the internal command function. A nibble value of 2 sets the J1939STB into the Internal Function mode. Nibble 1 of byte 3 tells the 1939STB 3 bytes will follow Byte 4. Byte 4, nibble 1 is set to 2 telling the 1939STB to perform a baud change using the information contained in bytes 5, 6, and 7.
Table 12. Baud Rate Setup
Baud Rate Decimal Divisor Hex Divisor MSB (Baud 2) Hex Divisor LSB (Baud 1) 300 1556 06 hex 00 hex 1200 384 01 hex 80 hex 2400 192 00 hex C0 hex 9600 48 00 hex * 30 hex * 19200 24 00 hex 18 hex 38,400 12 00 hex 0C hex 57,600 8 00 hex 08 hex * Setup default value.
1939STB4600 Manual 9
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Commercial Park – Oranmor e, Galway, Ireland – Ph +353 91 792444 – Fax +353 91 792445
RS-232 Baud Rate Change - cont’d.
All baud rates are entered as hex numbers. To determine the decimal divisor use the following formula. The decimal number must be converted to hexadecimal before entering the number into byte 6 and 7. Baud rates faster than 57,600 are not supported.
UART clock = 7,372,800 Hz
Decimal Divisor = Clock frequency (7,372,800
)
Baud output x 16
If you want a baud rate output of 300 baud:
Decimal Divisor = 7,372,800 300 x 16
Decimal Divisor = 1536 = 600 hex Baud 1= 00 Baud 2= 06
Programming a baud rate change to 300 baud, 1 stop bit, 8 bit data, no parity.
Table 13. Baud Rate Setup
Byte 3 Byte 4 Byte 5 Byte 6 Byte 7 Byte
Byte
1
2
81 21 0010 0011 0000 0010
Nibble 2 Nibble 1 Nibble 2 Nibble 1
81 21 23 hex 02 hex 03 hex 00 hex 06 hex
UB3 Baud 1 Baud 2
Table 13 is set to produce a baud rate of 300, 1stop bit, an 8 bit data word, and no parity.
10 1939STB4600 Manual
B&B Electronics Mfg C o Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104
B&B Electronics Ltd – Westlink Commercial Park – Oranmor e, Galway, Ireland – Ph +353 91 792444 – Fax +353 91 792445
Loading...
+ 28 hidden pages