HDV100A2 1306CommandResponse
HDV100A2 1306CommandResponse
HDV100A2 1306CommandResponse
Response Protocol
Documentation Number: HDV100A2-1306cr
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: [email protected] -- Fax (815) 433-5109
Technical Support e-mail: [email protected] -- Fax (815) 433-5104
WARNING!
Note that the HDV100A2 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.
For either method, the string must be sent within the first 30 bytes received
by the RS-232 port. After the device has received its first 30 bytes, it is
locked into Pass-through mode and can only be switched into Intelligent
mode by recycling power to the device.
If the string is accepted the device will stop receiving or transmitting data to
or from the bus. The HDV100A2 is now in Intelligent mode, and is ready to
receive messages using the command protocol.
The Start of Frame byte is the first byte in a valid frame and is
always 01 hex.
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.
ID Codes
=01 Message for J1708
=02 Message for J1939
=08 General message (for control of the HDV100A2 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.
ACK/NACK Format:
Byte Byte Function
Number Value
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
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 Control Command Function UB3 Baud Baud Data Check
of Bytes Code Code 1 2 Bytes Sum
Frame
Byte # 1 2 3 4 5 6 8 9 10
Value 01 05 08 01 00
Setting UB3
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.
Default value. The HDV100A2 should always be set to 8-bit word length.
All baud rates are entered as hex numbers. To calculate your own
decimal divisor use the following formula. The decimal number must be
converted to hexadecimal before entering the number. Baud rates below
9,600 are not recommended because of the difference in speed between the
vehicle bus and PC serial port. Additionally, baud rates faster than 115,200
baud are not supported.
Baud 1= 30
Baud 2= 00
To set the PC baud rate to 57,600 baud, N,8,1, format the message as
follows.
Byte Byte
Byte Function
Number Value
Hex
1 01 Start of frame
2 05 Number of control bytes
3 08 Command byte (08 = internal command)
4 01 Function Bbte (01 = change baud)
5 03 UB3
6 08 Baud 1
7 00 Baud 2
8 00 Number of data bytes
9 1A Checksum
The first byte is the start of frame and always 01. Next is the
number of control bytes (05). There are 5 bytes in the control section (in
gray). Byte number 3 sets the HDV100A2 to an internal operation (08).
Byte 4 is the internal function to be executed; (01) is the change baud
command. Bytes 5, 6, and 7 set the baud rate, parity, stop bits and word
length. Next is the number of data bytes, in this case there are no data bytes.
Last is the checksum, the value is the 8 bit addition of bytes 1 to 8.
The master reset command allows the HDV100A2 to be reset from the PC.
Sending this command resets the HDV100A2 to the default mode (dumb
mode). You will lose all setting sent in the smart mode.
Vendor Information
To receive the vendor information from the HDV100A2 send hex (01, 01,
05, 00, 07) to the device. It will respond as follows:
Hex (01, 0B, 85, MM, DD, MA, M1, M2, MO, 00, VV, VV, 00, DB, CS)
After sending this command to the device, the device will respond
with a confirmation message. The message confirms that the command was
received by the HDV100A2 and the checksum verified correctly. The reply
from the device is formatted as follows:
To stop receiving data from the J1708 bus send the following
command to the HDV100A2.
After sending this command to the device, the device will respond
with a confirmation message and data will cease. Note that there is the
possibility of an incomplete message being sent to the PC after sending this
command. Use the check-sum to verify all messages.
To restart reception, send the (01, 02, 01, 11, 00, 15) command to
the HDV.
Setting all filters off will stop all data from the J1708 bus. When all filters
are set off you must send the receive J1708 command to start receiving all
bus messages.
Byte 4 Values
Byte Time
Value Value
07 Stop broadcast
17 .5 sec.
27 1.0 sec
37 1.5 sec
47 2.0 sec
01 00000001 1
02 00000010 2
04 00000100 3
08 00001000 4
10 00010000 5
20 00100000 6
40 01000000 7
80 10000000 8
The message starts with Start of Frame byte 01. The number of
control bytes will be 06. The control code for J1939 is 02. The function
codes (XX) are as follows:
00=Sets receive function off
01=Sets receive on
02=Transmits a message with data
04=Set mask
19=filter 1 set on
18=filter 1 set off
29=filter 2 set on
28=filter 2 set off
39=filter 3 set on
38=filter 3 set off
49=filter 4 set on
48=filter 4 set off
Because of the difference in baud rates between the J1939 bus and
the RS-232 serial bus, the HDV100A2 may miss messages on the J1939 bus.
This depends on bus load, message length, and filter settings.
Sending any message with a control code of (02) to the J1939 bus
stops the operation on the J1708 bus. If you wish to restart operation on the
J1708 bus you must send the start J1708 reception message (01, 02, 01, 11,
00, 15). Sending this message stops operation on the J1939 bus.
The message starts with 01. The number of control bytes is 05. Next is the
control byte 02, followed by the time stamp, four bytes, with msb first. The
number of data bytes is the number of bytes to follow excluding itself and
the checksum byte. Next is a four byte that contains the arbitration field.
J1939 divides this field for different functions show in the chart below. The
number of data bytes sent by the bus is next. This will be a value between 0
and 8. Next is the bus data followed by the checksum byte.
Set Mask
Function code 04 set mask. The mask is applied to ALL filters. The mask is
32 bits long. The last 3 bits are not used and must be set to zero. This mask
covers the 29-bit arbitration field. To use the filter function, the mask must
be set. The mask determines what position(s) will be tested and matched to
the incoming message. If a 1 is set in a particular position, that position will
be tested. It will be “and” with any active filters to determine if the message
will be passed to the PC side. Any position marked with a 0 is a “don’t
care” position and will pass all data in that position. There is a form on page
33 that helps set up the mask for the arbitration field.
Set Filter 1 to 4
Function codes 18 and 19, 28 and 29, 38 and 39, 48 and 49 are filter pairs.
These filters are set by sending the desired arbitration code to each filter, 1
to 4. The filters work with the mask function. If the mask is set to zero in a
position (don’t care) the value of the filter in that position doesn’t matter.
The filter arbitration field is set to match the aberration code of the incoming
message. A match of the filter “and” the mask will pass the message to the
PC. The X9 sets the filter On; X8 sets the filter Off, where X=1 through 4.
Important: the receiver and each filter must have a different arbitration
code. If the receiver and a filter are given the same arbitration code the
controller may become erratic. It will need to be powered-off reset to
recover from this error.
To use the HDV100A2, the filter for a particular J1939 PGN the following
procedure must be followed.
2. Set the “Mask” to the desired pattern (01, 06, 02, 04, XX, XX, XX, XX,
00, CS).
3. Set a filter (1 to 4) to the match value (01, 06, 02, YY, XX, XX, XX, XX,
00, CS). Be sure that this is NOT the same as any other filter value or the
HDV100A2 may become erratic.
4. Sending this value to the HDV100A2 will continuously send this match to
the PC.
Note that sending the “ Start Receive” or the “Stop Receive” command
resets the mask rendering the filters useless.
This worksheet will aid in filling out/decoding the J1939 arbitration field.