Unhandled Exception when processing SideOfPier after tracking off

Issue #11 closed
Tim Long created an issue

Problem reported by Martin Crane which appears to be triggered particularly by SGP due to its aggressive polling strategy. The sequence of events seems to be:

  1. Driver was connected to the IH and started going through its initialization routine. Amongst other things, it correctly reads the firmware version 1.732.
  2. The last thing in that routine is to turn tracking off (:EX0# sent 17:38:13.5667)
  3. SGP requested the Side of Pier (:GSP# sent 17:38:13.6137)
  4. The IH emits some “axis state change” event messages - :X00# received twice at 17:38:13.6977 and 17:38:13.7637
  5. The IH emits a single # character that doesn’t seem to belong to any other response (received at 17:38:13.7697)

Times in the description relate to the attached log file.

The exception thrown is IndexOutOfRangeException which is likely due to the code attempting to index into an empty string.

Comments (4)

  1. Tim Long reporter

    Possible fix is to use the DelimitedMessageStrings() extension method instead of the TerminatedStrings() method. The former matches start and end delimiters while the latter only matches end delimiters. This would ensure that only well-formed responses with both a header and footer are accepted.

  2. Martin Crane

    Thanks Tim but the link doesn't allow me access to the driver file.

    Could you email me the file or pop into the OneDrive folder I shared with you.

    Many thanks & regards Martin

  3. Log in to comment