auscom
asked on
Serial port data from weigh scales to decode
I have hooked a PC up to a desktop weigh scale that communicates over serial port (via a usb adapter and virtual com port driver). We get data back when the Print button is pressed.
\xf8\x80x\x00x\x00x\xf8x\x 80\x00\x80 \x00\x80\x 00\x80\x00 \x80\x80\x 80\xf8\x80 xx\xf8x\x8 0\x00\xf8\ xf8x\xf8\x 80x\x00\x8 0x
It looks like hex or something encoded in a strange way (like UTF-16) but cannot make heads or tails of it. Anyone recognise this and know how to decode?
My assumption is that the first to letters will be ST then there will be a weight shown (based on other research). We have played around with various baud rates to no success.
Example solution can be in any dev language (C#, VB, PHP, Python, Javascript preferably).
Thanks!
\xf8\x80x\x00x\x00x\xf8x\x
It looks like hex or something encoded in a strange way (like UTF-16) but cannot make heads or tails of it. Anyone recognise this and know how to decode?
My assumption is that the first to letters will be ST then there will be a weight shown (based on other research). We have played around with various baud rates to no success.
Example solution can be in any dev language (C#, VB, PHP, Python, Javascript preferably).
Thanks!
What Make/Model are the scales?
ASKER
FG-150KBM
digital platform scale
A&D company
digital platform scale
A&D company
Have a look here:
http://www.aandd.jp/products/manual/balances/newfg.pdf
Page 16 refers to the RS-232 interface.
Looks like BAUD rate will be 2400, 4800 or 9600.
7 data bits
even parity
Once set correctly the data looks quite readable.
http://www.aandd.jp/products/manual/balances/newfg.pdf
Page 16 refers to the RS-232 interface.
Looks like BAUD rate will be 2400, 4800 or 9600.
7 data bits
even parity
Once set correctly the data looks quite readable.
ASKER
Thanks we have the manual. Can you tell from the hex string if the data is encoding specifically? Or should we just have text as a result?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Dropping down to these settings we get close to readable ...
port is : /dev/cu.usbserial
flowcontrol : none
baudrate is : 2400
parity is : even
databits are : 7
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv
imap is :
omap is :
emap is : crcrlf,delbs,
Terminal ready
SԬ+0000�.�9���
The above line is getting closer to numeric.
port is : /dev/cu.usbserial
flowcontrol : none
baudrate is : 2400
parity is : even
databits are : 7
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv
imap is :
omap is :
emap is : crcrlf,delbs,
Terminal ready
SԬ+0000�.�9���
The above line is getting closer to numeric.
I'd say the BAUD rate is right as half the text looks OK. Maybe try experimenting with parity: try odd and none.
ASKER
Figured it out - but you were close! We had to drop the first bit (in python);
.join([chr(ord(char) & 0x7F) for char in text]
Gold now. Thanks!
.join([chr(ord(char) & 0x7F) for char in text]
Gold now. Thanks!
ASKER
I've requested that this question be closed as follows:
Accepted answer: 500 points for akb's comment #a40632409
Assisted answer: 0 points for auscom's comment #a40634718
for the following reason:
The final operation was removing the first bit, that completes the solution
Accepted answer: 500 points for akb's comment #a40632409
Assisted answer: 0 points for auscom's comment #a40634718
for the following reason:
The final operation was removing the first bit, that completes the solution
Good to see you got it figured.
You really don't think my help was worth any points? :(
You really don't think my help was worth any points? :(
ASKER
ah sorry - it was I am a n00b to this. lemme see ...
Thanks auscom