DIBAL POS Scale Serial Settings & Communication Protocol
1 2 3 4 5 6 7 8 9 10 11 12 |
[Scale] decimalexists=0 hexcommands=$39$38$30$30$30$30$30$31$0D$0A scale_price_for=6 scale_price_from=3 parity=None stopbits=1 databits=8 BaudRate=9600 Port=COM3 Title=scale datafolder=C:\Temp\ |
The serial settings must be 9600, n, 8, 1.
We send to the scale a string with the fields: 98, a 5-digit price, and a checksum, followed by CRLF.
You can find the checksum as follows:
-
Add together all the digits of the price (P1–P5) → Sum1
-
XOR this sum (Sum1) with all elements (characters/bytes) of the string → Sum2
-
Finally, checkSum = Sum1 XOR Sum2
The simplest way to communicate with the scale is to keep sending 98000001CRLF
and the scale will return the weight.
The format of the response from the scale is: 9900031600000004CRLF
-
99
: response code -
0
: correct reception -
00316
: the weight (in this example, 316 grams—in 5 digits, with the last 3 considered as decimals) -
0
-
000000
-
4
: checksum, which is calculated as the sum of the digits in99000316