I am reading data from a scale Mettler toledo using USB to RS232 I am successfully getting data with the following setting using C#.NET
Port.BaudRate = (int)baudRate;
Port.Handshake = Handshake.XOnXOff;Port.Parity = Parity.Even; //Even,None,Odd supported
Port.DataBits = 7;
Port.StopBits = StopBits.One;
Port.ReadTimeout = 2000;
Port.WriteTimeout = 500;
Port.ReadBufferSize = 2048;
Port.ReceivedBytesThreshold = 1;
Port.WriteBufferSize = 1024;
Port.DtrEnable = true; //enable Data Terminal Ready
Port.RtsEnable = false; //enable Request to send
the setting on my display toledo is set to continuous output
I am able to get the weight in real-time, but it comes with a bunch of data as follows
A*0 15 00
or
A*0 15 0
or
The first set may vary but the middle one which is the weight changes according to what is on the scale
I did try to remove special characters using regex, reducing the white spaces and splitting the data, to get only the middle one but it wasn't successful
What I want to achieve is only to get the weight [middle value]