Asked by:
Getting weight from a scale via rs232

Question
-
Hi All,
I'm new to hardware interfacing and I'm developing an application that sends a command to a scale and retrieves the weight data from the scale and prints it in a textbox. The problem is with the data returned from the scale, its in the form below : -
‚‹ 00±6±3 0·-0·-09 0¸-5¸ -·¸¸¬5 ëç‹ !
How can I format the data to show sensible text. After having done some test. It appears the weight is shown in the fourth character set i.e "-·¸¸¬5 ëç‹"
I'm using VB .net 2005
Thanks in advance
LeeWednesday, July 8, 2009 12:58 PM
All replies
-
You're asking us to guess what the scale protocol is. We wouldn't be able to answer that.
For example, it could be sent back in Unicode or just pure ASCII, but even if we can get the proper character encoding unless we know the mapping of the fields (offsets and lengths) we can't parse the data correctly.
This is the reason XML is so popular, it renders Protocols to English so people can easily see, understand and parse responses.Thursday, July 9, 2009 5:24 PM -
First, you need to figure out the proper communications parameters (baud rate, data bits, parity, and stop bits). To do that, put some weight on the scale (so you will recognize the numbers when you see them), and start trying different combinations of communications parameters using hyperterminal or some other terminal program. The most common for scales are 9600 7 E 1, and 9600 8 N 1.
Once you have the correct parameters, you will see the weight digits, and typically some status information. Different scales have different formats, but many use an "M" to indicate motion, and "lb" or "kg" to indicate the unit of measure. Others, use bit encoding for their status information as it packs more into a few characters. And most use either a carriage return, or a carriage return/line feed pair to end a line.
Thursday, July 16, 2009 8:42 PM -
woops, Ray is right this is the old ASYNC mode which is pure ASCII and as he mentions is important to have the right data transfer rates to interpret the data. Sorry bout that.Thursday, July 16, 2009 10:11 PM
-
I spent the last 15 years writing scale software.
Tuesday, July 28, 2009 4:54 PM