B&B Electronics HVD100A3 User Manual

Model: HVD100A3
HDV100A3 Command
Response Protocol
Documentation Number: HDV100A3-4407CR
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
-- Fax (815) 433-5109
-- Fax (815) 433-5104
© B&B Electronics -- November 2005
HDV100A3 Command & Response Manual-1306cr Cover Page
B&B Electronics -- 707 Dayton Rd. -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Table of Contents
INTRODUCTION........................................................................................ 1
Intelligent Mode Command Protocol..................................................... 2
Formatting the Control Bytes ................................................................ 3
DETAILED DESCRIPTION OF GENERAL FUNCTION CODES...... 4
Command Acknowledgement................................................................. 4
RS-232 Baud Rate Setup........................................................................5
Setting Baud 1, Baud 2........................................................................... 7
Baud Rate Example................................................................................ 8
Time Stamp Information ........................................................................ 9
Master Reset Command.......................................................................11
Vendor Information.............................................................................. 11
J1708 COMMANDS.................................................................................. 12
Receiving Data from the J1708 Bus..................................................... 12
Transmitting Data to the J1708 Bus....................................................14
Set Filter Active.................................................................................... 16
Set Filter Off ........................................................................................ 16
Broadcast Message..............................................................................17
J1939 COMMANDS.................................................................................. 19
Start Receive on J1939 Bus.................................................................. 20
Stop Receive on J1939 Bus .................................................................. 20
Arbitration Field (Y1, Y2, Y3, Y4)........................................................ 21
Transmit Data to J1939 Bus ................................................................ 23
Set Mask............................................................................................... 23
Set Filter 1 to 4 .................................................................................... 24
J1939 Header Worksheet..................................................................... 26
ERROR CODES........................................................................................27
HDV100A3 Command & Response Manual-1306cr Table of Contents i
B&B Electronics -- 707 Dayton Rd. -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
WARNING!
This Model HDV100A3 Converter Module allows you to connect to active J1708 / J1939 networks. It is possible that your transmissions through this converter module could cause malfunction of the network operation, damage to 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!
ii HDV100A3 Command & Response Manual-1306cr
B&B Electronics -- 707 Dayton Rd. -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Introduction
The HDV100A3 adapter has two modes of operation: J1708 Intelligent and J1939 Intelligent mode In Intelligent mode the HDV100A3 works with a command protocol to control different operations of the HDV100A3.
The HDV100A3 performs several functions in the intelligent mode in order to reduce the overhead and timing requirements of the host application when communicating with the J1708 bus. The device handles collision detection and retries with no additional interaction from the host application. This greatly reduces the processor overhead required by the host in order to communicate efficiently with the J1708 bus.
Note that the HDV100A3 is powered from the vehicle side of the interface. If the device is to be used without a vehicle, it will be necessary to connect power to the device through the 15-pin connector. Positive voltage is connected on pin 8. Pin 7 is connected to ground.
Intelligent Mode Verification
To confirm that the HDV100A3 is in the Intelligent mode, set the host baud rate to 115.2 KB 8,1,N. The host application can request the vendor number from the HDV100A3 This is done by sending the following string in hex from the host to the HDV100A3:
(01, 01, 05, 00, 07)
It will respond as follows:
Hex (01, 0B, 85, MM, DD, MA, M1, M2, MO, 00, VV, VV, 00, DB, CS)
An example of this command can be found on page 12 of this document. The HDV100A3 does not need to be connected to a vehicle to respond, however power must be supplied the HDV100A3.
HDV100A3 Command & Response Manual-1306cr 1
B&B Electronics -- 707 Dayton Rd. -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Intelligent Mode Command Protocol
The HDV100A3 uses a simple protocol to communicate to vehicle bus. The protocol is divided into four parts:
Start Of Frame (SOF) Control Field (shown in light gray) Data Field (shown in dark gray) Checksum (CS)
Intelligent Mode Message Structure
SOF
Number of
Control Bytes
Control Bytes Number of
Data Bytes
Data Bytes CS
1 byte 1 byte 1 to 20 bytes 1 byte 1 to 100 bytes 1 byte
The Start of Frame byte is the first byte in a valid frame and is
always 01 hex.
The Control Field sets up the function and control of the
HDV100A3 hardware and is formatted as shown below.
Control Field Structure
Number of Control Bytes to Follow
ID Byte Function
Byte
Control Data Bytes
1 byte 1 byte 1 byte Up to 20 bytes
The first byte of the Control Field is the number of control bytes in the message. This value indicates the number of control bytes, excluding itself, to follow. If the message doesn’t contain any control bytes, the Number of Control Bytes value will be set to 00 hex as a placeholder.
The next part of the message frame is the data field. The data field is preceded by the number of data bytes, excluding itself, to follow and is set to 00 hex if no data is present in the message. The data field is reserved for data that is to be communicated to the vehicle bus.
Data Field Structure
Number of
Data Bytes
Data Bytes
1 byte Up to 100 bytes
The last element of a valid message is the checksum. The checksum is calculated by adding ALL bytes from the Start of Frame (inclusive) to the last data byte and using the last 8 bits as a checksum.
2 HDV100A3 Command & Response Manual-1306cr
B&B Electronics -- 707 Dayton Rd. -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Formatting the Control Bytes
The 2
nd
byte is “Number of Control Bytes” to follow and always precedes the control field. The third byte is the ID byte. This byte tells the hardware where to direct the message. Valid entries for functions are:
ID Codes
=01 Message for J1708 =02 Message for J1939 =08 General message (for control of the HDV100A3 device) =05 Device identification (reverse compatible)
The fourth byte is the function byte. The functions that are supported are listed below. Note that some of the function codes are followed by additional bytes of information. These bytes must be included in the control byte count.
Valid General Function Codes Function codes
=01 change PC baud rate, followed by 3 bytes (UB3, Baud1, Baud2) =02 send time stamp =04 hardware handshaking =08 reset converter, followed by 2 bytes (01,and 02) =10 time stamp off =20 time stamp on
Valid Entries for J1708 Functions Function codes = 07 set broadcast message
= X8 set filter X off = X9 set filter X on = 11 Sync with J1708 bus and start reception = 10 Stop reception = 12 Transmit to J1708 bus
Valid Entries for J1939 Functions Function codes =00 Receive off =01 Receive on =02 Transmit message =08 Set mask
=X8 set filter X off =X9 set filter X on
HDV100A3 Command & Response Manual-1306cr 3
B&B Electronics -- 707 Dayton Rd. -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Detailed Description of General Function Codes
Command Acknowledgement
All commands sent to the device will be acknowledged. If no error occurs an ACK will be sent with the ID byte that accompanied the command. If an error occurred, a NACK will be sent with the ID byte that accompanied the command as well as a Function code of $05 and the Error Code. The responses will not be shown for each command since it is the same for almost all commands. Below is the format of the ACK/NACK response. If an ACK/NACK response is different for a particular command, it will be specified.
ACK/NACK Format: Byte Number 1 01 Start of frame 2 01 or 03 Number of control bytes = 1 for ACK, 3 for NACK 3 aa ID byte 08 = internal command 4 bb Function code 02 = send time stamp 5 cc 6 00 Number data bytes 7 CS Checksum
aa – ID Byte $01 = J1708 Interface $02 = J1939 Interface $05 = Device Id $08 = RS-232 Interface $09 = Message Xmit OK Response bb – FC Byte None = Command Received and Valid $05 = A error was detected, NACK cc – CD Byte None = No Error Condition Error Code = See Section 5.10
Byte Value
Function
4 HDV100A3 Command & Response Manual-1306cr
B&B Electronics -- 707 Dayton Rd. -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
RS-232 Baud Rate Setup
To set the baud rate for the RS-232 port, set a general command code of 08. Set the function code to 01. Then set 3 control bytes as follows.
Function Start
Byte # 1 2 3 4 5 6 8 9 10 Value 01 05 08 01 00
of Frame
Control Bytes
Command Code
Function Code
UB3 Baud
1
Baud 2
Data Bytes
Check Sum
Setting UB3
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Divisor Latch
Set Break
Set Parity
Even Parity
Parity Enable
Stop Bits
Word Length 1
Word Length 0
Bit 7 = 1 allows baud rate divisor to be changed. 0 baud rate change is blocked. Bit 7 should not be set. The setting and resetting of this bit is handled internally.
Bit 6 = 1 forces the transmitter output to a logic 0 for alerting the remote receiver to a line break. 0 indicates no break condition.
Bit 5, 4 and 3 work together to set parity
Bit 5 Bit 4 Bit 3 Parity Selection * * 0 No parity (default) 0 0 1 Odd parity 0 1 1 Even parity 1 0 1 Force parity “1” 1 1 1 Force parity “0”
*Don’t care state.
Bit 2, stop bit, works in conjunction with bits 1 and bit 0
Bit 2 Word Length (bits) Stop Bit Length 0 5,6,7,8 1 (default) 1 5 1½ 1 6,7,8 2
HDV100A3 Command & Response Manual-1306cr 5
B&B Electronics -- 707 Dayton Rd. -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Bits 1 and 0 set the word length
Bit 0 Bit 1 Word Length 0 0 5 0 1 6 1 0 7 1 1 8 (default)
Default value. The HDV100A3 should always be set to 8-bit word length.
6 HDV100A3 Command & Response Manual-1306cr
B&B Electronics -- 707 Dayton Rd. -- PO Box 1040 -- Ottawa, IL 61350
PH (815) 433-5100 -- FAX (815) 433-5104
Loading...
+ 21 hidden pages