Date: 2010-02-01 12:43 pm (UTC)
> Now I just need (a) a very long serial cable,

That reminds me of one of my very first paid programming gigs. The client had an ancient piece of legacy machinery that communicated via a serial port to a DOS-based user interface. The trouble was that the machine was somewhere in mainland Europe and they wanted to move the user interface over to their head office here in the UK. Nowadays I might just run the UI in VMWare or something on a small embedded PC next to the machine and access it via VNC, but back then bandwidth limitations ruled that out.

The solution I came up with involved the UI running under DosEMU on a Linux PC in their office, the machine plugged into a second Linux box in Europe, and a couple of custom programs I wrote that transferred the serial data and control signals via a TCP/IP connection.

It seemed to work OK in testing but the client kept complaining of terrible latency problems. After much time spent monitoring the network traffic between the two sites, I eventually traced the problem to a bug in my own code: for efficiency reasons it was buffering the serial data into 1KB chunks before writing it across the network. Where this failed is when the UI sent a short query and then sat around waiting for the machine's response. The query wasn't long enough to fill the buffer, so it didn't get sent out until the UI had timed out and resent the query several times. The solution was to set up a timer that automatically flushed the buffer if it wasn't full after 100ms or so.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

January 2023

S M T W T F S
1234567
891011 121314
15 161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 18th, 2025 03:38 am
Powered by Dreamwidth Studios