ISISComputingGroup / lewis-ess

Let's write intricate simulators!
GNU General Public License v3.0
21 stars 19 forks source link

Stream Protocols Without Terminators #261

Closed MikeHart85 closed 7 years ago

MikeHart85 commented 7 years ago

Issue raised by @samueljackson92.

Some devices, such as the Eurotherm 2000, use a TCP Stream protocol that does not rely on terminators, or uses different terminators for different commands. This is currently not supported by our StreamAdapter, which relies on terminators to separate commands.

A preliminary look at protocol file documentation seems to indicate that a timeout can be used to separate commands, instead of a terminator.

ReadTimeout = 100; Integer. Affects in commands. The device may send input in pieces (e.g. bytes). When it stops sending, how many milliseconds to wait for more input bytes before giving up? If InTerminator = "", a read timeout is not an error but a valid input termination.

The direction of data flow is reversed, since this is written from the IOC's perspective, but adding the same sort of timeout feature in the stream adapter should allow us to support these kinds of devices while leaving current behaviour largely intact.