Posted on 2014-01-07
I have an application that needs to read from a scale connected via serial port to a PC multiple times per second. As of now, I'm not controlling the frequency, but executing:
//parse string as needed
This code executes perhaps more than 100 times per second. I can limit the rate programatically to once every 100 milliseconds, but not less often than that.
Anyway, the behavior that I'm witnessing is an extreme lag in reading from the scale, on the order of 60 seconds. When the scale does start reading, it seems OK, but it doesn't respond quickly to the initial change (the 60 second lag).
If needed, I can issue a command to the scale to get an output from it, but right now I have the scale streaming data and am trying to read the most current line from the scale using the code above.
Any suggestions would be appreciated.