Tuesday, 17 April 2007

Eureka!

Solved the 'Failed to send Command - Write pending' error. Caused by running the Disconnect sub directly from the disconnect menu option instead of setting the 'disconnect request' flag.

Also solved the problem of getting invalid start characters when a connection is attempted after the comms lead has been removed in mid-sequence. Solved this by setting a timeout value in the PLC comms card when transmitting data. If a timeout occurs (i.e. when the lead has become disconnected and transmition is not possible) then the communications sequence is aborted and the buffers are flushed.

0 comments: