OBC Serial Commands Protocol: Manual No: Revision
OBC Serial Commands Protocol: Manual No: Revision
OBC Serial Commands Protocol: Manual No: Revision
EMR4
OBC Serial Commands Protocol
Notice
Veeder-Root makes no warranty of any kind with regard to this publication, including, but not limited to, the implied warranties of
merchantability and fitness for a particular purpose.
Veeder-Root shall not be liable for errors contained herein or for incidental or consequential damages in
connection with the furnishing, performance, or use of this publication.
Veeder-Root reserves the right to change system options or features, or the information contained in this publication.
This publication contains proprietary information which is protected by copyright. All rights reserved. No part of this publication
may be photocopied, reproduced, or translated to another language without the prior written consent of Veeder-Root.
RETURN SHIPPING
For the parts return procedure, please follow the appropriate instructions in the EMR Products General Returned Goods Policy
pages in the EMR4 Products price list. Veeder-Root will not accept any return product without a Return Goods Authorization
(RGA) number clearly printed on the outside of the package.
Introduction
General .............................................................................................................................1
Packet Definition ...............................................................................................................1
Interface Definition
General Rules ...................................................................................................................2
Message Description ........................................................................................................2
Notes to Tables ........................................................................................................2
IEEE Floating Point Format ..............................................................................................3
IEEE Floating Point Format Examples ..............................................................................3
Figures
Figure 1. Print Device Control Flow Diagram .......................................................25
Figure A-1. OBC State Machine For Pass-Through Printing ................................. A-2
Tables
Table 1. OBC Packet Formats ................................................................................1
Table 2. IEEE 32-Bit Float .......................................................................................3
Table 3. IEEE 64-Bit Float* .....................................................................................4
Table 4. List of Command/Response Codes1 .........................................................5
Table 5. Get Meter Fields = ‘G’ and Set Meter Fields = ‘S’ .....................................6
Table 6. Set Delivery Status = ‘O’ ...........................................................................7
Table 7. All Set And Get Commands Use These Results .......................................8
Table 8. Get Meter Status = ‘T’ ...............................................................................9
Table 9. Transaction Request : ‘H’ w/o custom fields – ‘J’ with custom fields .......10
Table 10. Transaction response field code – ID ‘I’ w/o custom fields –
ID ‘K’ with custom fields .........................................................................11
Table 11. Transaction Record Table w/o Custom Fields (ID: ‘H’ –
Answer ID: ‘I’) ..........................................................................................11
Table 12. Transaction Record Table with Custom Fields (ID: ‘J’ –
Answer ID: ‘K’) .........................................................................................12
Table 13. Get Register Configuration: ‘E’ – Set Register Configuration: ‘D’ ...........15
Table 14. Tax Discount Types .................................................................................23
Table 15. Tax Mask Table .......................................................................................24
Table 16. Print Device Control = ‘p’ .........................................................................24
Table 17. Print Device Control Response = ID: ‘p’ – Answer ID: ‘p’ ........................25
Table 18. Delivery Report Line Codes ....................................................................26
Table 19. Shift Report Line Codes ..........................................................................27
Table 20. Product Type: Aux_Dev ..........................................................................29
Table 21. List Of String Numbers And Corresponding Internal String Name ..........29
Table A-1. Print Device Control Field Codes .......................................................... A-3
Table A-2. Status Bytes Used In The ‘p’ Reply ....................................................... A-4
iii
Introduction
General
The mobile On Board Computer (OBC) for Fuel Delivery Systems communicates with and operates the EMR4 Sys-
tem. The scope of OBC to EMR4 interface is limited to all activities required for a regular fuel delivery (no initial
meter setup or meter calibration).
The physical connection between the OBC and EMR4 uses the asynchronous serial communication protocol RS-
232 (with no h/w flow control; 9600 baud, none parity, 8 bit data, 1 bit stop).
Packet Definition
All information between the OBC and the EMR4 is formatted into packets containing the following fields:
[DelimiterFlag][DestinationAddress][SourceAddress][Body of Message][CS][DelimiterFlag]
Table 1 describes the OBC data packets.
Field Description
[DestinationAddress] 1 Byte representing a destination / source address: 0x01 - 0x20 - Single Meter address; 0x41 - 0x60 -
[SourceAddress] Printer Device address; 0x81 - 0x90 - Interface Box address; x00 - broadcast address (both meters
attached to an IB); 0xFF - OBC address
[CS] 1 Byte check sum defined as: 0x00 - {[DestinationAddress] + [SourceAddress] + [Body of Message]}
NOTE:
To eliminate forbidden characters (0x7E, 0x7D) inside the packet (defined as data between delimiter flags), the following "escape" needs
to be performed:
1. XOR operation between CONTROL_CHAR (0x20) and a forbidden char.
2. Inserting an ESCAPE_CHAR (0x7D) in front of the result of step (1).
Whenever the packet contains the ESCAPE_CHAR (0x7D) the reverse operation should be performed:
1. Remove ESCAPE_CHAR from the packet.
2. XOR the following character with the CONTROL_CHAR (0x20).
1
Interface Definition
General Rules
The communication between OBC and third party meter will be guided by following rules:
1. All information (i.e. command type, exchanged data) is located in <Body of the Message> portion of interface
packet;
2. The <Body of the Message> always starts with Command Code (1 BYTE) sometimes followed by Field Code
(1 BYTE) and proper parameters;
3. There is only a single command (represented by Command Code) inside of each interface packet;
4. Check sum ([CS] in Table 1) is calculated before the "escape" operation and validated on a destination side
after the "escape" operation is performed;
5. All message exchanges are solicited by the OBC - the EMR4 does not send any message without a request
from the OBC;
6. Incorrectly formatted packets (missing delimiter flags, incorrect CS) will be discarded;
7. Point to point communication with an EMR System is half-duplex. A half-duplex system provides
communication in both directions but not at the same time. The EMR IB can only receive and process one
message at a time. After receiving a message, the EMR transmits a response message to the OBC, prior to
the OBC transmitting a new message. It is the responsibility of the OBC software to ensure that a proper
response was received from the EMR before transmitting the next message.
8. The following time delays, related to half-duplex communication, must be followed to avoid significant
processing delays. After transmitting a message, the OBC must wait a minimum of 1 second prior to retrying
to send the same message if the proper response is not received by the OBC.
9. If the EMR IB repeatedly fails to communicate a response, the OBC must wait a minimum of 5 seconds prior to
sending a new command message.
Message Description
Table 4 identifies and defines the interface messages between the OBC and EMR4 required for fuel delivery pro-
cessing.
NOTES TO TABLES
Entries in the Binary Code column of tables 6, 7, 8, 9, 10, and 13 are in the form of a numeric (1 Byte) value.
Definitions:
CHAR - Signed byte (1 byte)
UCHAR - Unsigned byte (1 byte)
SHORT - Signed Short Integer (2 bytes)
USHORT - Unsigned Short Integer (2 bytes)
LONG - Signed Long Integer (4 bytes)
ULONG - Unsigned Long Integer (4 bytes)
FLOAT - signed 4-byte IEEE floating-point number that always contains a positive number
SFLOAT - signed 4-byte IEEE floating-point number
DOUBLE - signed 8-byte IEEE floating-point number
Data transmission structure is type little-endian in which the last significant byte is transmitted first.
2
Interface Definition IEEE Floating Point Format
Byte 1 2 3 4
Nibble 1 2 3 4 5 6 7 8
1. 3F800000 hex = 0011 1111 1000 0000 0000 0000 0000 0000 bin
S = 0 = +(positive)
E = 011 1111 1 bin = 7F hex = 127 dec
M = 000 0000 0000 0000 0000 0000 bin = 0 hex = 0 dec
2. B8D1B717 hex = 1011 1000 1101 0001 1011 0111 0001 0111 bin
S = 1 = -(negative)
E = 011 1000 1 bin = 71 hex = 113 dec
M = 101 0001 1011 0111 0001 0111 bin = 51 B7 17 hex = 5,355,287 dec
3
Interface Definition IEEE Floating Point Format Examples
3. C2C7FAE1 hex = 1100 0010 1100 0111 1111 1010 1110 0001 bin
S = 1 = -(negative)
E = 100 0010 1 bin = 85 hex = 133 dec
M = 100 0111 1111 1010 1110 0001 bin = 47 FA E1 hex = 4,717,281 dec
Exponent = 2(133-127) = 64
Mantissa = 1.0 + (4,717,281/8,388,608) = 1.56234
Decimal Value = -64 x 1.56234 = -99.99
4. 461C4000 hex = 0100 0110 0001 1100 0100 0000 0000 0000 bin
S = 0 = +(positive)
E = 100 0110 0 bin = 8C hex = 140 dec
M = 001 1100 0100 0000 0000 0000 bin = 1C 40 00 hex = 1,851,392 dec
Byte 1 2 3 4 5 6 7 8
S EEE EEEE EEEE FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF
Nibble 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
*1st bit is sign bit (S), next 11 bits are exponent bits (E), and final 52 bits are the fraction (F).
4
Interface Definition IEEE Floating Point Format Examples
COMMAND RESPONSE
Command Response
Code Field Code Code Field Code
From/To (ASCII) Description (R = read only) From/To (ASCII) (R = read only)
OBC/Meter T Get Meter Status See Table 8 (R) Meter/OBC M See Table 8
CHAR Main
Request version numbers of Number[15]
OBC/Meter V device addressed. Field None (R) Meter/OBC U
Code = 0 BootNumber[2]
(R)
5
Interface Definition IEEE Floating Point Format Examples
Table 5. Get Meter Fields = ‘G’ and Set Meter Fields = ‘S’
ASCII
Code Description Parameters (R = read only)
a Net total quantity of current shift (for current product, counted from last DOUBLE - volume (R)
reset)
b Gross total quantity of current shift (for current product, counted from DOUBLE - volume (R)
last reset)
e Meter net totalizer reading for current product DOUBLE - volume (R)
f Meter gross totalizer reading for current product DOUBLE - volume (R)
h Number of decimal digits for all volume values BYTE - [0,1,2] (R)
l Get Totalizer display field current value Null terminated string of the value cur-
rently displayed in the Totalizer display
field.
m Timeout for no flow delivery - it will terminate delivery when paused USHORT - time in seconds.
5 sec< timeout<20 min
6
Interface Definition IEEE Floating Point Format Examples
Table 5. Get Meter Fields = ‘G’ and Set Meter Fields = ‘S’ (Continued)
ASCII
Code Description Parameters (R = read only)
o Get Preset display field current value Null terminated string of the value cur-
rently displayed in the Preset display
field.
q Print pause. When On, the meter will not attempt to print at the printer. 1 Byte [0=Off, 1=On]
New transactions can not be started until print pause is set Off and
queued transaction is printed.
u Enters key stroke into EMR4 head. Write only. 1 byte, key to enter
0 = Start, 1=Finish, 2=Mode, 3=Pre-
set, 4=Next, 5=Plus, 6=Minus, 7=Clr,
8=Enter, 9=keypad 0, 10=K1, 11=K2,
12=K3, 13=K4, 14=K5, 15=K6,
16=K7, 17=K8, 18=K9
K Real-time volume displayed during delivery. Unformatted, no rounding DOUBLE - volume (R)
applied
O Preset countdown value displayed. Only valid when preset is active. SFLOAT - preset (R)
Unformatted, no rounding applied
R Delivery rate as seen on the display. Only valid during delivery. Unfor- DOUBLE - volume (R)
matted, no rounding applied
7
Interface Definition IEEE Floating Point Format Examples
9 Enter Custom Field 1 byte CHAR Current Custom Field ID awaiting entry (1-7) No
n bytes CHAR Custom Field with 0 terminator. n is based
on the Custom Field awaiting entry. The values on n are:
Custom Field 1: n=14
Custom Field 2: n=14
Custom Field 3: n=9
Custom Field 4: n=7
Custom Field 5: n=7
Custom Field 6: n=7
Custom Field 7: n=7
Note that the fields are 0 terminated, and fewer bytes can
be sent than the maximum length given. For example, if
Custom Field 1 is being sent, and it is the following 4
bytes: ‘A’ ‘B’ ‘C’ 0, these can be sent without padding the
length to 14.
If a single 0 byte is sent, the field will be set to empty.
If no bytes are sent for the field text, then the default value
is used for this Custom Field.
8
Interface Definition IEEE Floating Point Format Examples
Binary
Code Description Parameters
5 Authorization 1 BYTE - 0 = authorization not required for all deliveries, 1 = authorization required
Required State for all deliveries
6 Get Current 4 BYTE - Float IEEE with the current delivery unit price
Price Value
9
Interface Definition IEEE Floating Point Format Examples
Binary
Code Description Parameters
7 Get Current 4 BYTE - Float IEEE with the unit price for the current product price code
Product Price
Code Value
Table 9. Transaction Request : ‘H’ w/o custom fields – ‘J’ with custom fields
Binary
Code Description Parameters (R = read only)
1 Transaction with the matching index for device addressed 2 byte index number [0...199] (R)
2 Transaction with the matching ticket number in device 4 byte ticket number (R)
addressed
3 Number of transaction records in device address that 1 byte head address of meter [1...32] (R)
match parameter address. When polling the head, the
head address parameter is ignored if it is included. It is
required when polling the IB.
4 Transaction in device addressed that matches head & 2 byte index number [0...199]
index parameters. When polling the head, the head 1 byte head address of meter [1...32] (R)
address parameter is ignored if it is included. It is required
when polling the IB.
10
Interface Definition IEEE Floating Point Format Examples
Table 10. Transaction response field code – ID ‘I’ w/o custom fields – ID ‘K’ with custom fields
Binary
Code Description Parameter
3 Transaction record See Table 11 or Table 12, as req’d., for record description.
Table 11. Transaction Record Table w/o Custom Fields (ID: ‘H’ – Answer ID: ‘I’)
Size
Field Description (Bytes) Type
Ticket # 4 LONG
Subtotal 4 FLOAT
TotalizerStart 8 DOUBLE
TotalizerEnd 8 DOUBLE
11
Interface Definition IEEE Floating Point Format Examples
Table 11. Transaction Record Table w/o Custom Fields (ID: ‘H’ – Answer ID: ‘I’) (Continued)
Size
Field Description (Bytes) Type
Six individual tax/discount fields, each 6 bytes (if Transaction type is 3 = unused) 36
Tax discount type (percent, money/volume, surcharge) - 1 byte CHAR
Assigned lines mask - 1 byte CHAR
Tax/discount value - 4 bytes FLOAT
Number non-zero flow - counts the number of 0.1 second periods with flow >0 for 2 USHORT
use in estimating average flow rate
Table 12. Transaction Record Table with Custom Fields (ID: ‘J’ – Answer ID: ‘K’)
Size
Field Description (Bytes) Type
Ticket # 4 LONG
12
Interface Definition IEEE Floating Point Format Examples
Table 12. Transaction Record Table with Custom Fields (ID: ‘J’ – Answer ID: ‘K’) (Continued)
Size
Field Description (Bytes) Type
Subtotal 4 FLOAT
TotalizerStart 8 DOUBLE
TotalizerEnd 8 DOUBLE
Six individual tax/discount fields, each 6 bytes (if Transaction type is 3 = unused) 36
Tax discount type (percent, money/volume, surcharge) - 1 byte CHAR
Assigned lines mask - 1 byte CHAR
Tax/discount value - 4 bytes FLOAT
Number non-zero flow - counts the number of 0.1 second periods with flow >0 for 2 USHORT
use in estimating average flow rate
13
Interface Definition IEEE Floating Point Format Examples
Table 12. Transaction Record Table with Custom Fields (ID: ‘J’ – Answer ID: ‘K’) (Continued)
Size
Field Description (Bytes) Type
Custom Field 1: Customers use these Custom Fields (1 to 7) for different pur- 13+1 CHAR
poses, the names of these data fields should be customizable (Plus Null).
14
Interface Definition IEEE Floating Point Format Examples
Table 13. Get Register Configuration: ‘E’ – Set Register Configuration: ‘D’
0 Price configuration 1 byte CHAR Price code index (1-15) of price code of interest No
1 byte CHAR Tax code index (1-15) assigned to this price code
4 bytes FLOAT raw price value
1 Tax code configuration 1 byte CHAR tax code index (1-15) of tax code of interest No
2 Delivery report format Null terminated string of report codes (see Table 18 for report code defini- Yes
tion) UCHAR formatCode[N] where n<50.
3 Shift Report format Null terminated string of report codes (see Table 19 for report code defini- Yes
tion) UCHAR formatCode[N] where N<50.
4 Reserved N/A
5 Tank ID default Null terminated ASCII string. UCHAR TankID[N] where N<=10. Yes
15
Interface Definition IEEE Floating Point Format Examples
Table 13. Get Register Configuration: ‘E’ – Set Register Configuration: ‘D’ (Continued)
16
Interface Definition IEEE Floating Point Format Examples
Table 13. Get Register Configuration: ‘E’ – Set Register Configuration: ‘D’ (Continued)
17
Interface Definition IEEE Floating Point Format Examples
Table 13. Get Register Configuration: ‘E’ – Set Register Configuration: ‘D’ (Continued)
12 Shift Report (for Printing) 1 byte UCHAR Shift (1-4, 0 if shift not used) No
1 byte UCHAR Product (1-8, 0 if no delivery on product)
1 byte UCHAR Begin Time Century
1 byte UCHAR Begin Time Second
1 byte UCHAR Begin Time Minute
1 byte UCHAR Begin Time Hour
1 byte UCHAR Begin Time DayOfWeek
1 byte UCHAR Begin Time DayOfMonth
1 byte UCHAR Begin Time Month
1 byte UCHAR Begin Time Year
1 byte UCHAR End Time Century
1 byte UCHAR End Time Second
1 byte UCHAR End Time Minute
1 byte UCHAR End Time Hour
1 byte UCHAR End Time DayOfWeek
1 byte UCHAR End Time DayOfMonth
1 byte UCHAR End Time Month
1 byte UCHAR End Time Year
8 bytes DOUBLE Begin Volume
4 bytes FLOAT load
8 bytes DOUBLE End Volume
8 bytes DOUBLE Total Gross Volume
2 bytes SHORT Number of Single Deliveries
2 bytes USHORT Number of Multiple Deliveries
2 bytes USHORT Number of Itemized Deliveries
8 bytes DOUBLE Total Volume
8 bytes DOUBLE Total Volume Priced
8 bytes DOUBLE Total No Tax Discount
8 bytes DOUBLE Total Tax Discount Line 1
8 bytes DOUBLE Total Tax Discount Line 2
8 bytes DOUBLE Total Tax Discount Line 3
8 bytes DOUBLE Total Tax Discount Line 4
8 bytes DOUBLE Total Tax Discount Line 5
8 bytes DOUBLE Total Tax Discount Line 6
8 bytes DOUBLE Total Sales
2 bytes USHORT Number of Transfer Deliveries
18
Interface Definition IEEE Floating Point Format Examples
Table 13. Get Register Configuration: ‘E’ – Set Register Configuration: ‘D’ (Continued)
14 Time Delays 1 byte UCHAR which fields being returned are valid: No
0x01: backlight delay
0x02: display delay
0x04: volume return delay
2 bytes USHORT backlight turn off delay in seconds
2 bytes USHORT display delay in seconds
2 bytes USHORT volume return delay in seconds
16 Display Syntax Setup 1 byte UCHAR Decimal Symbol (0=’.’ 1=’,’) Yes
1 byte UCHAR Thousand Symbol (0=’.’ 1=’,’ 2=’ ‘)
1 byte UCHAR Preset Volume Precision (0-3)
1 byte UCHAR Preset Currency Precision (0-3)
1 byte UCHAR Preset Price Precision (0-3)
1 byte UCHAR Register Volume Precision (0-3)
1 byte UCHAR Register Rate Precision (0-3)
1 byte UCHAR Register Currency Precision (0-3)
1 byte UCHAR Register Price Precision (0-3)
1 byte UCHAR Totalizer Volume Precision (0-3)
19
Interface Definition IEEE Floating Point Format Examples
Table 13. Get Register Configuration: ‘E’ – Set Register Configuration: ‘D’ (Continued)
20 Reserved N/A
22 OEM Message 1 byte UCHAR Is OEM Messsage Enabled? (0=no, 1=yes) Yes
24 bytes CHAR OEM Message // null at end not guaranteed
20
Interface Definition IEEE Floating Point Format Examples
Table 13. Get Register Configuration: ‘E’ – Set Register Configuration: ‘D’ (Continued)
21
Interface Definition IEEE Floating Point Format Examples
Table 13. Get Register Configuration: ‘E’ – Set Register Configuration: ‘D’ (Continued)
25 Printer Label 1 byte UCHAR Printer Label ID (see Table LID) Yes
24 bytes CHAR Label (may not be 0 terminated)
22
Interface Definition IEEE Floating Point Format Examples
Table 13. Get Register Configuration: ‘E’ – Set Register Configuration: ‘D’ (Continued)
Type Value
Tax percent 0
Tax surcharge 2
Discount percent 3
Discount surcharge 5
Table 15 shows the meaning of each bit in the mask (left of the thick line). It also shows the set of bits each tax line
can use (right of thick line). Tax line 2 can only be applied to Line 1 and Unit price (bit 0 and 1) resulting in a YES in
the first two rows. Tax line 2 can not be applied to Tax lines 3 - 6 that follow. Note: none of the Tax lines can be
applied to Tax line 6, which is why the mask does not include a bit for line 6. However, line 6 can be applied to the
Unit price and all lines that precede it.
23
Interface Definition IEEE Floating Point Format Examples
5 Line 5 No No No No No Yes
Binary
Code Description Parameters Field Code
0 Printer Request - ready to print (see Figure 1). None Table 17: 0,1,2
2 Print Data, format and send a data buffer to n data byes n<= 150 bytes Table 7
printer. Repeat for additional data buffers (num-
ber constrained by printer’s memory).
3 Print End, print set of data buffers sent - no 1 Byte. Number buffers sent. Table 17: 03 No error,
more data buffers to follow, release printer. Table 17: 04 - 08 Error
4 Flush Buffer. Same as P_END, printer not Number of packets sent since Table 17: 04-08 Error
released, new P_START, P_DATA sequence to Print Start was sent.
follow. Print buffer limited to 4096 bytes. To
exceed this limit flush the buffers sent with
P_DATA and then continue. Print does not
occur until this command or P_END is sent.
5 Removal of paper (slip printer) and cut of paper 1 byte - Table 17: 09
(roll printer) controlled by OBC, not automatic 0=Off (normal operation)
by printer driver. Sent after Print Request
before Print Start. Power up default is Off. Only 1=On (remote operation)
needs to be turned On once after power up.
Allowable sequence to set remote operation:
Print Request, Print Remote, Print End.
24
Interface Definition IEEE Floating Point Format Examples
Mark start of
data buffer(s)
Print data buffer(s)
Request 1 3 and release printer -
printer no more data to
0 follow
2
Send data buffer.
Repeat for each
data buffer (number
limited by printer
memory)
4
Print data buffer(s)
and hold printer -
more buffers to follow emr3/printcontrol.eps
Table 17. Print Device Control Response = ID: ‘p’ – Answer ID: ‘p’
Binary
Code Description Parameters
25
Interface Definition IEEE Floating Point Format Examples
Binary
Report Line Description Code
Blank line 3
Start time 17
End time 18
Start volume 19
Ticket number 25
Meter identification 27
Unused 28
Product name 29
26
Interface Definition IEEE Floating Point Format Examples
Binary
Report Line Description Code
Taxes/discounts 35
Grand total 41
Reserved 42
Binary
Report Line Description Code
Blank line 11
27
Interface Definition IEEE Floating Point Format Examples
Binary
Report Line Description Code
15
16
Product name 17
Meter identification 18
Loaded volume 20
Grand total 36
28
Interface Definition IEEE Floating Point Format Examples
0 GASOLINE
1 DIESEL
2 LPG
3 JET A
4 AV_GAS
5 FUEL_OIL
6 CRUDE_OILS
7 LUBRICATING_OILS
8 USER_DEFINED
9 NO_PRODUCT_DEFINED
Table 21. List Of String Numbers And Corresponding Internal String Name
00 STR_UNUSED
01 STR_RPT_START_TIME
02 STR_RPT_START_TIME
03 STR_RPT_VOLUME_START
06 STR_RPT_AVERAGE_TEMP
07 STR_RPT_REFERENCE_TEMP
08 STR_RPT_COEF_TEMP
09 STR_RPT_DENSITY
10 STR_RPT_TICKET_NUMBER
11 STR_RPT_CALIB_TICKET
12 STR_RPT_SUMMARY_TICKET
13 STR_RPT_SUMMARY_TICKET_OF
14 STR_RPT_TRANSFER_TICKET
15 STR_RPT_METER_ID
29
Interface Definition IEEE Floating Point Format Examples
Table 21. List Of String Numbers And Corresponding Internal String Name (Continued)
16 STR_RPT_MULT_DEL_TICKET
17 STR_TANK_ID
18 STR_TAX_PERCENT
19 STR_TAX_PER_VOLUME
20 STR_TAX_SURCHARGE
21 STR_DIS_PERCENT
22 STR_DIS_PER_VOLUME
23 STR_DIS_SURCHARGE
24 STR_ASSIGN_TO_LINE
25 STR_ENTER_NEW_TAX
26 STR_ENTER_NEW_DIS
27 STR_UNUSED
28 STR_RPT_START_TIME
29 STR_RPT_FINISH_TIME
30 STR_RPT_VOLUME_START
31 STR_RPT_GROSS_VOLUME_FINISH
32 STR_RPT_NET_VOLUME_FINISH
33 STR_RPT_AVERAGE_TEMP
34 STR_RPT_REFERENCE_TEMP
35 STR_RPT_COEF_TEMP
36 STR_RPT_DENSITY
37 STR_RPT_TICKET_NUMBER
38 STR_RPT_CALIB_TICKET
39 STR_RPT_SUMMARY_TICKET
40 STR_RPT_SUMMARY_TICKET_OF
41 STR_RPT_TRANSFER_TICKET
42 STR_RPT_METER_ID
43 STR_RPT_MULT_DEL_TICKET
44 STR_RPT_PROD_DSCRPT
45 STR_RPT_SHIFT_BEGIN
30
Interface Definition IEEE Floating Point Format Examples
Table 21. List Of String Numbers And Corresponding Internal String Name (Continued)
46 STR_RPT_SHIFT_END
47 STR_RPT_ODOMETER_START
48 STR_RPT_ODOMETER_END
49 STR_RPT_MILES_DRIVEN
50 STR_RPT_BEGINNING_VOLUME
51 STR_RPT_LOADED_VOLUME
52 STR_RPT_ENDING_VOLUME
53 STR_RPT_TOTAL_GROSS_VOLUME
54 STR_RPT_SINGLE_DELIVERIES
55 STR_RPT_MULTIPLE_DELIVERIES
58 STR_RPT_TOTAL_TC_VOLUME
59 STR_RPT_TOTAL_VOLUME
60 STR_RPT_TOTAL_TC_VOL_NO_PRICE
61 STR_RPT_TOTAL_VOL_NO_PRICE
62 STR_RPT_TOTAL_TC_VOL_PRICED
63 STR_RPT_TOTAL_VOL_PRICED
64 STR_RPT_TOTAL_NO_TD_SALES
65 STR_RPT_TOTAL_TAX_DISCOUNT1
66 STR_RPT_TOTAL_TAX_DISCOUNT2
67 STR_RPT_TOTAL_TAX_DISCOUNT3
68 STR_RPT_TOTAL_TAX_DISCOUNT4
69 STR_RPT_TOTAL_TAX_DISCOUNT5
70 STR_RPT_TOTAL_TAX_DISCOUNT6
71 STR_RPT_TOTALIZER_START
72 STR_RPT_TOTALIZER_END
73 STR_RPT_AVG_FLOW_RATE
74 STR_RPT_UNIT_PRICE
75 STR_RPT_FINAL_PRICE
31
Interface Definition IEEE Floating Point Format Examples
Table 21. List Of String Numbers And Corresponding Internal String Name (Continued)
76 STR_RPT_SUBTOTAL
77 STR_RPT_PRICE_WITH_TAX
78 STR_RPT_PRICE_WITH_NON_TAX
79 STR_RPT_GRAND_TOTAL
80 STR_RPT_MULT_DELIVERY_NOTE
81 STR_ON_ONE_SITE
82 STR_RPT_DUPLICATE_TICKET
83 STR_RPT_TRANSFER_TICKET
91 STR_RPT_CF1_ID
92 STR_RPT_CF2_ID
93 STR_RPT_CF3_ID
94 STR_RPT_CF4_ID
95 STR_RPT_CF5_ID
96 STR_RPT_CF6_ID
97 STR_RPT_CF7_ID
98 STR_RPT_T_D_SUBTOTAL
99 STR_RPT_TANK_LOAD
32
Sample Commands
1. Set a product (index 0) as a current product for meter address 01:
7E 01 FF 53 70 00 3D 7E
where:
7E - delimiter flag
01 - destination address (meter 1);
FF - source address (OBC);
53 - 'S' - set the meter field command (from Table 4 on page 5)
70 - 'p' current (active product) (from Table 5 on page 6)
00 - product index
3D - check sum calculated as: (BYTE)(0 - (01+FF+53+70+00)
33
Appendix A: OBC Serial Pass-Through Printing Commands
The pass-through printing feature allows another party to add lines of text both before and after the normal EMR
printout. This feature will work on both the Roll and Slip printers that the EMR supports.
The pass-through printing feature works as follows:
1. The OBC requests control of the printer
2. The OBC sends data to the EMR printer buffer
3. The EMR prints the data
4. The OBC closes the connection
There are a two important size limits that must be taken into account.
1. The OBC commands used to send data to the EMR print buffer can only have 150 bytes of data. Multiple
commands must be used to send more data.
2. The print buffer is only 4KB in length. To print more data, the buffer must be flushed, and then more data sent.
In order to work within these size limits, the protocol has the commands defined in Table 1. Using the example
above, the commands are used as follows:
1. The OBC requests control of the printer
a. Printer Request
2. The OBC sends data to the EMR printer buffer
3. The EMR prints the data
a. Print Start
b. One or more Print Data
c. Either Print Flush, go to 2.a,
d. OR Print End
4. The OBC closes the connection
Note that the destination address of the print commands is the printer, not the EMR or IB.
The state machine that the OBC should follow is shown in Figure A-1.
A-1
Appendix A Overview of Pass-Through Printing
Send
PRINTER_REQUEST
Received
PRINTER_BUSY,
PRINTER_NEEDS_SERVICE or
Print Job Available PRINTER_PAPER_OUT
Delay Time
Elapsed
Received
PRINTER_GRA
Send
Received NTED Max Retries PRINTER_REQUEST
PRINT_ or Timeout
DATA_
Spool Data ERROR
Send PRINT START,
Send PRINT_DATA
commands until done,
If needed, send PRINT Spool
FLUSH and a new Data
ERROR
PRINT START to avoid
overflowing the 4K print Received
buffer. PRINT_COMM_ABORT
or
Send PRINT END PRINT_ERROR_ABORT
Received PRINT
REMOVE SLIP
(Only for SLIP
PRINTER)
Received
PRINT_COMPLETE
Wait For
Print
Complete
Important notes on the communications shown in Figure A-1 are discussed in the steps below.
1. There are 2 possible paths to take once the Print End is sent, depending on whether the printer is a Slip
Printer or a Roll Printer (or a Slip Printer with printer paper control set to “remote”). Please pay attention to
this, because the print complete message may not come when expected.
A-2
Appendix A Pass-Through Printing Command Tables
2. Once the printer is granted to the OBC, all subsequent print commands must be sent with less than 2
seconds between them (less than 5 seconds in version F08 or more recent version). Taking longer than this
between messages is a protocol error.
3. If 2 seconds or more (5 seconds in version F08 or more recent version) pass between print commands, the
EMR4 will send an unsolicited DATA ERROR reply. It will do this twice, once every 2 seconds, then the
EMR4 will rescind the grant, send a COMM ABORT, and flush the print buffer.
4. The rationale for the DATA ERROR message is that the EMR4 assumes that the OBC message it was waiting
for was lost, and it wants the OBC to resend it. Please pay attention to this, because slow OBC timing can
result in apparent command failures (DATA ERROR replies). [NOTE: In future versions of the protocol, an
explicit “TIMEOUT” message (6) will be added to the protocol for this condition.]
5. Once the error state is entered, normal operation is not possible without external intervention. Entering the
error state means that a serious problem has occurred, and this can only be resolved by external intervention.
To clear the error state, it is necessary to disable printing, and then re-enable it. This will re-initialize the print
engine.
A-3
Appendix A Examples of Pass-Through Printing
Status bytes used in the ‘p’ reply are shown in Table A-2.
A-4
Appendix A Examples of Pass-Through Printing
Print Data-->
<-- ACK
Print Data-->
<-- ACK
Print Data-->
<-- ACK
Print End-->
<-- Print Complete
Example showing the full packets with packet start & end bytes, addressing bytes, checksums, and
the command & reply bytes.
A-5
Appendix A Examples of Pass-Through Printing
<Print Data>
$7E,$41,$FF,$70,$02,$2A,$2A,$2A,$20,$44,$49,$52,$45,$43, <CMD ACK>
$54,$20,$50,$52,$49,$4E,$54,$20,$54,$45,$53,$54,$20,$2A, $FF,$C1,$41,$00,$FF
$2A,$2A,$0D,$0A,$0D,$0A,$1C,$7E
<Print Data>
$7E,$41,$FF,$70,$02,$2A,$2A,$20,$50,$52,$49,$4E,$54,$20, <CMD ACK>
$54,$45,$53,$54,$20,$4C,$49,$4E,$45,$20,$31,$20,$2A,$2A, $FF,$C1,$41,$00,$FF
$0D,$0A,$C9,$7E
<Print Data>
$7E,$41,$FF,$70,$02,$2A,$2A,$20,$50,$52,$49,$4E,$54,$20, <CMD ACK>
$54,$45,$53,$54,$20,$4C,$49,$4E,$45,$20,$32,$20,$2A,$2A, $FF,$C1,$41,$00,$FF
$0D,$0A,$C8,$7E
<Print Data>
$7E,$41,$FF,$70,$02,$2A,$2A,$2A,$20,$44,$49,$52,$45,$43,
<CMD ACK>
$54,$20,$50,$52,$49,$4E,$54,$20,$54,$45,$53,$54,$20,$45,
$FF,$C1,$41,$00,$FF
$4E,$44,$20,$2A,$2A,$2A,$0D,$0A,$0D,$0A,$0D,$0A,$0D,$0A,
$F7,$7E
<Print End> <Print complete>
$7E,$41,$FF,$70,$03,$04,$49,$7E $FF,$41,$70,$03,$4D
A-6
Appendix A Examples of Pass-Through Printing
Example showing the full packets with packet start & end bytes, addressing bytes, checksums, and
the command & reply bytes.
A-7
Appendix A Examples of Pass-Through Printing
<Print Data>
$7E,$41,$FF,$70,$02,$2A,$2A,$20,$50,$52,$49,$4E,$54,$20, <CMD ACK>
$54,$45,$53,$54,$20,$4C,$49,$4E,$45,$20,$31,$20,$2A,$2A, $FF,$C1,$41,$00,$FF
$0D,$0A,$C9,$7E
<Print Flush> <Print flush done>
$7E,$41,$FF,$70,$03,$02,$47,$7E $FF,$41,$70,$0A,$4D
<Print Start> <CMD ACK>
$7E,$41,$FF,$70,$01,$4F,$7E $FF,$C1,$41,$00,$FF
<Print Data>
$7E,$41,$FF,$70,$02,$2A,$2A,$20,$50,$52,$49,$4E,$54,$20, <CMD ACK>
$54,$45,$53,$54,$20,$4C,$49,$4E,$45,$20,$32,$20,$2A,$2A, $FF,$C1,$41,$00,$FF
$0D,$0A,$C8,$7E
<Print Data>
$7E,$41,$FF,$70,$02,$2A,$2A,$2A,$20,$44,$49,$52,$45,$43,
<CMD ACK>
$54,$20,$50,$52,$49,$4E,$54,$20,$54,$45,$53,$54,$20,$45,
$FF,$C1,$41,$00,$FF
$4E,$44,$20,$2A,$2A,$2A,$0D,$0A,$0D,$0A,$0D,$0A,$0D,$0A,
$F7,$7E
<Print End> <Print Complete>
$7E,$41,$FF,$70,$03,$02,$47,$7E $FF,$41,$70,$03,$4D
Printer Request-->
<-- Printer Granted
Print Start-->
<-- ACK
Print Data-->
<-- ACK
Print End-->
<-- Print Remove Slip
(user removes slip and inserts new slip)
<-- Print Complete
A-8
Appendix A Examples of Pass-Through Printing
Example showing the full packets with packet start & end bytes, addressing bytes, checksums, and
the command & reply bytes.
A-9
Appendix B: Serial Data Flow Diagram
B-1
For technical support, sales or
other assistance, please visit:
www.veeder.com