However, the problem I see watching Windows applications use the serial API (via the PortMon utility) is that they ASSUME a small delay or gap between the (DLE)(ACK) bytes and the response from the slave.
So the application uses the incorrect algorithm:
- Read 2 Bytes
- Ask Windows to notify application when more data comes
- Loop, reading buffered data and waiting until full response seen
The correct algorithm would be:
- Read 2 Bytes
- Loop, reading buffered data and waiting until full response seen
See Also:
- Download the Rockwell Allen-Bradley DF1 specification: this used to be open to download as a PDF ... it is still free but now you need to log into http://www.ab.com/ and find "DF1 Protocol and Command Set Reference Manual - Publication 1770-6.5.16"
- Download PortMon http://www.microsoft.com/technet/sysinternals/utilities/PortMon.mspx
No comments:
Post a Comment